private void kaydetbuton_Click(object sender, EventArgs e) { if (isimbox.Text == "" || soyisimbox.Text == "" || ogrsifrebox.Text == "" || nobox.Text == "") { MessageBox.Show("Lütfen eksik kutu bırakmayınız. Alanları doldurunuz. Eğer öğrenci silme işlemi yapmak istiyorsanız butona tıklamayı unutmayınız."); } else { islem2 = new SinifOgrenciGiris(); user2 = new SinifOgrenci(); user2.İsim = isimbox.Text; user2.Soyisim = soyisimbox.Text; user2.OgrenciNo = Convert.ToInt64(nobox.Text); user2.Sifre = ogrsifrebox.Text; if (islem2.InsertUser(user2)) { MessageBox.Show("Öğrenci Ekleme işleminiz başarıyla gerçekleşti."); } else { MessageBox.Show("Bu okul numarası ile kayıtlı öğrenci sistemde zaten mevcuttur. Lütfen tekrar deneyiniz."); } } KayitSonrasiTemizleme(this); }
private void button2_Click(object sender, EventArgs e) { if (boxİsim.Text == "" || boxSoyisim.Text == "" || boxSifre.Text == "" || boxNO.Text == "" || boxBolumID.Text == "") { MessageBox.Show("Lütfen eksik kutu bırakmayınız. Alanları doldurunuz. Bölümünüzü seçmeyi unutmayınız."); } else { SinifOgrenciGiris islem2 = new SinifOgrenciGiris(); SinifOgrenci user2 = new SinifOgrenci(); //islem2 = new SinifOgrenciGiris(); //user2 = new SinifOgrenci(); user2.İsim = boxİsim.Text; user2.Soyisim = boxSoyisim.Text; user2.OgrenciNo = Convert.ToInt64(boxNO.Text); user2.Sifre = boxSifre.Text; user2.BolumID = Convert.ToInt32(boxBolumID.Text); if (islem2.InsertUser(user2)) { MessageBox.Show("Öğrenci Ekleme işleminiz başarıyla gerçekleşti."); } else { MessageBox.Show("Bu okul numarası ile kayıtlı öğrenci sistemde zaten mevcuttur. Lütfen tekrar deneyiniz."); } } }
private void girisyapbuton_Click(object sender, EventArgs e) { try { islem2 = new SinifOgrenciGiris(); user2 = islem2.getUser(Convert.ToInt64(ogrencino.Text), ogrencisifre.Text); if (user2 != null) { OgrenciAnaMenu a = new OgrenciAnaMenu(); //a.label2.Text = user.İsim.ToString(); a.Show(); this.Hide(); } else { MessageBox.Show("Öğrenci no veya şifreniz yanlıştır. Lütfen tekrar deneyiniz."); } } catch (Exception hata) { MessageBox.Show("Bir hata oluştu. \n"); MessageBox.Show(hata.Message); } }