|
Kutubxonani avtomatlashtirish tarixi 9
|
bet | 5/12 | Sana | 14.05.2024 | Hajmi | 2,44 Mb. | | #232837 |
Bog'liq Abdulloyeva Sitorausing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApp4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\user\Documents\Kutubxonadb.mdf;Integrated Security=True;Connect Timeout=30");
private void Form1_Load(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string query = "select Count(*) from Librarian where LibName='" + user.Text + "' and LibPass='" + login.Text + "'";
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(query,con);
DataTable dt = new DataTable();
sda.Fill(dt);
if(dt.Rows[0][0].ToString()=="1")
{
this.Hide();
MAINFORM main = new MAINFORM();
main.Show();
}
else
{
MessageBox.Show(" Xatolik! Iltimos qaytadan urunib ko'ring");
}
con.Close();
}
private void label3_Click(object sender, EventArgs e)
{
user.Text= "";
login.Text = "";
}
private void label4_Click(object sender, EventArgs e)
{
|
| |