private void btnEkle_Click(object sender, EventArgs e) { ikMenu ikislem = new ikMenu(); this.Hide(); ikislem.Show(); }
private void btnGeri_Click(object sender, EventArgs e) { this.Hide(); ikMenu geri = new ikMenu(); geri.Show(); }
private void label8_Click(object sender, EventArgs e) { ikMenu ikMenu = new ikMenu(); ikMenu.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { int sayac = 0; SqlConnection baglanti = new SqlConnection(); baglanti.ConnectionString = "Data Source=USER11\\SQLEXPRESS;Initial Catalog=fabrikavt;Integrated Security=SSPI;MultipleActiveResultSets=True"; if (baglanti.State == ConnectionState.Open) { baglanti.Close(); } if (string.IsNullOrEmpty(kullaniciAd.Text) == true || string.IsNullOrEmpty(kullaniciSifre.Text) == true) { MessageBox.Show("Bu Alanlar Boş Bırakılamaz", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { baglanti.Open(); SqlCommand al = new SqlCommand("Select kullanici_ad,kullanici_sifre from kullanicilar where yetki_id=(select yetki_id from yetki where yetki_ad='Personel') and kullanici_id in (select personel_id from personel where departman_id=(select departman_id from departman where departman_ad='İnsan Kaynakları'))", baglanti); SqlDataReader oku = al.ExecuteReader(); if (!oku.HasRows) { oku.Close(); baglanti.Close(); } else { while (oku.Read()) { string a = (oku["kullanici_ad"].ToString()).ToString(); string b = (oku["kullanici_sifre"].ToString()).ToString(); if (kullaniciAd.Text == a && kullaniciSifre.Text == b) { sayac = sayac + 1; ikMenu menu = new ikMenu(); this.Hide(); menu.Show(); } } if (sayac == 0) { MessageBox.Show("Giriş başarısız"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }