Ilova
Dasturning kirish qismidagi asosiy oyna.Bu yerda foydalanuvchi login parollarni kiritish qismi namoyon bo‘ladi.
namespace kurs_ishim
{
public partial class Form1_KIRISH : Form
{
public Form1_KIRISH()
{
InitializeComponent();
}
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\HP\Documents\LOGIN.mdf;Integrated Security=True;Connect Timeout=30");
private void button_CHIQISH_Click(object sender, EventArgs e)
{
this.Close();
}
private void button_KIRISH_Click(object sender, EventArgs e)
{
SqlDataAdapter yangi = new SqlDataAdapter("select count (*) From LOGIN where LOGIN='" + textBox_LOGIN.Text + "'and PAROL='" + textBox_PAROL.Text + "'", con);
DataTable data = new DataTable();
yangi.Fill(data);
if (data.Rows[0][0].ToString() == "1")
{
this.Hide();
REGISTER oyna = new REGISTER();
oyna.Show();
}
else if (data.Rows[0][0].ToString() == "1")
{
this.Hide();
REGISTER oyna = new REGISTER();
oyna.Show();
}
else
MessageBox.Show("LOGIN YOKI PAROLNI NOTO`G`RI KIRITDINGIZ!!!");
}
private void Form1_KIRISH_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
SqlDataAdapter yangi = new SqlDataAdapter("select count (*) From LOGIN where LOGIN='" + textBox_LOGIN.Text + "'and PAROL='" + textBox_PAROL.Text + "'", con);
DataTable data = new DataTable();
yangi.Fill(data);
if (data.Rows[0][0].ToString() == "1")
{
this.Hide();
OQITUVCHI_OYNASI oyna = new OQITUVCHI_OYNASI();
oyna.Show();
}
else if (data.Rows[0][0].ToString() == "1")
{
this.Hide();
OQITUVCHI_OYNASI oyna = new OQITUVCHI_OYNASI();
oyna.Show();
}
else
MessageBox.Show("LOGIN YOKI PAROLNI NOTO`G`RI KIRITDINGIZ!!!");
}
Do'stlaringiz bilan baham: |