private void giris_btn_Click(object sender, EventArgs e) { label1.Visible = true; sesCalmaClassBLL.PlayClickSound(); ogretmenBLL = new OgretmenBLL() { KullaniciAdi = kullaniciAdi_txt.Text, Sifre = sifre_txt.Text }; if (ogretmenBLL.CanLogIn()) { AnaFrm anaFrm = new AnaFrm(); anaFrm.girisYapanKisiId = ogretmenBLL.GirisYapanOgretmenId; this.Hide(); anaFrm.Show(); } else { kullaniciAdi_txt.LineIdleColor = Color.Red; kullaniciAdi_txt.LineFocusedColor = Color.Red; kullaniciAdi_txt.LineMouseHoverColor = Color.Red; sifre_txt.LineIdleColor = Color.Red; sifre_txt.LineFocusedColor = Color.Red; sifre_txt.LineMouseHoverColor = Color.Red; } label1.Visible = false; }
private void btn_GirisYap_Click(object sender, EventArgs e) { try { if (btn_Ogrenci.Checked) { OgrenciBLL ogrenciBll = new OgrenciBLL(); int ogrenciID = ogrenciBll.GirisKontrolu(txt_KullaniciAd.Text, txt_Parola.Text); if (ogrenciID == -1) { MessageBox.Show("Kullanıcı Adı/Şifre Hatalıdır..!", "Öğrenci Bilgileri Hatalıdır", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { frmOgrenci ogrenciForm = new frmOgrenci(); ogrenciForm.ogrenciID = ogrenciID; ogrenciForm.Show(); this.Hide(); } } if (btn_Ogretmen.Checked) { OgretmenBLL ogretmenBll = new OgretmenBLL(); if (ogretmenBll.GirisKontrolu(txt_KullaniciAd.Text, txt_Parola.Text)) { frmOgretmen ogretmen = new frmOgretmen(); ogretmen.Show(); this.Hide(); } else { MessageBox.Show("Kullanıcı Adı/Şifre Hatalıdır..!", "Öğretmen Bilgileri Hatalıdır", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } catch (Exception) { MessageBox.Show("Eksik veya Hatalı Giriş Yaptınız.!"); } }