Kutubxonani avtomatlashtirish tarixi 9




Download 2,44 Mb.
bet5/12
Sana14.05.2024
Hajmi2,44 Mb.
#232837
1   2   3   4   5   6   7   8   9   ...   12
Bog'liq
Abdulloyeva Sitora

using 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)
{


Download 2,44 Mb.
1   2   3   4   5   6   7   8   9   ...   12




Download 2,44 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Kutubxonani avtomatlashtirish tarixi 9

Download 2,44 Mb.