private void button4_Click(object sender, EventArgs e) { satisler SS = new satisler(); SS.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { try { if (comboBox1.Text == "Admin") { baglan.Open(); using (var cmd = new MySqlCommand("SELECT COUNT(*) FROM admin where username='******' and password='******'", baglan)) { int count = Convert.ToInt32(cmd.ExecuteScalar()); if (count == 1) { islem formac = new islem(); formac.Text = textBox1.Text; formac.Show(); this.Hide(); } else { MessageBox.Show("YANLIŞ KULLANICI GİRİŞİ!!!!!!"); } } baglan.Close(); } else if (comboBox1.Text == "Personel") { baglan.Open(); using (var cmd = new MySqlCommand("SELECT COUNT(*) FROM personel where username='******' and password='******'", baglan)) { int count = Convert.ToInt32(cmd.ExecuteScalar()); if (count == 1) { satisler formac = new satisler(); formac.LBLPERSONEL.Text = textBox1.Text; formac.Show(); this.Hide(); } else { MessageBox.Show("YANLIŞ KULLANICI GİRİŞİ!!!!!!"); } } baglan.Close(); } else { MessageBox.Show("lutfen yetkiyi seciniz"); } } catch (Exception) { MessageBox.Show("BAĞLANTI HATASI"); } }