private void button2_Click(object sender, EventArgs e) { MusteriKayit frm = new MusteriKayit(); frm.label12.Text = admin.ToString(); frm.Show(); }
private void girisBtn_Click(object sender, EventArgs e) { using (var db = new OtelBilgiEntities()) { string eposta = girisEpostaTbox.Text, sifre = girisSifreTbox.Text; if (string.IsNullOrWhiteSpace(girisEpostaTbox.Text) || string.IsNullOrWhiteSpace(girisSifreTbox.Text)) { MessageBox.Show("You must fill in the all empty fields"); } else { MusteriKayit kd = new MusteriKayit(); var sorgu2 = from a in db.MusteriKayits where a.musteriEPosta == eposta select a.musteriEPosta; var sorgu3 = from a in db.MusteriKayits where a.musteriSifre == sifre select a.musteriSifre; var sorgu = from a in db.MusteriKayits where a.musteriEPosta == eposta && a.musteriSifre == sifre select a.isTrue; string sorgu4 = "", sorgu5 = ""; foreach (string item in sorgu2) { sorgu4 = item; } foreach (string item in sorgu3) { sorgu5 = item; } if (sorgu4 == eposta && sorgu5 == sifre) { foreach (int item in sorgu) { if (item == 1) { yon.Show(); this.Hide(); kul.Hide(); } else if (item == 0) { kul.Show(); this.Hide(); yon.Hide(); } else { MessageBox.Show("Hatalı Giriş"); } } } else { MessageBox.Show("Hatalı Giriş"); } } } }
private void Kayitbtn_Click(object sender, EventArgs e) { using (var db = new OtelDbcontext()) { if (string.IsNullOrWhiteSpace(TcNotbox.Text) || string.IsNullOrWhiteSpace(Adtbox.Text) || string.IsNullOrWhiteSpace(soyadtbox.Text) || string.IsNullOrWhiteSpace(epostotbox.Text) || string.IsNullOrWhiteSpace(sifreTbox.Text) || string.IsNullOrWhiteSpace(teltbox.Text)) { MessageBox.Show("You must fill in the all empty fields"); } else { string ad, soyad, telefon, eposta, sifre; int TcNo; TcNo = Convert.ToInt32(TcNotbox.Text); ad = Adtbox.Text; soyad = soyadtbox.Text; telefon = teltbox.Text; eposta = epostotbox.Text; sifre = sifreTbox.Text; var query = new MusteriKayit() { Ad = ad, Eposta = eposta, Sifre = sifre, Soyad = soyad, TCKimlik = TcNo, IsTrue = false, telefon = Convert.ToInt32(telefon) }; db.musteriKayits.Add(query); db.SaveChanges(); MessageBox.Show("Başarılı Kayıt"); Giris frm = new Giris(); frm.Show(); this.Hide(); } } }
private void Kayitbtn_Click(object sender, EventArgs e) { using (var db = new OtelBilgiEntities()) { if (string.IsNullOrWhiteSpace(TcNotbox.Text) || string.IsNullOrWhiteSpace(Adtbox.Text) || string.IsNullOrWhiteSpace(soyadtbox.Text) || string.IsNullOrWhiteSpace(epostotbox.Text) || string.IsNullOrWhiteSpace(sifreTbox.Text) || string.IsNullOrWhiteSpace(teltbox.Text)) { MessageBox.Show("You must fill in the all empty fields"); } else { string ad, soyad, telefon, eposta, sifre; string TcNo; TcNo = TcNotbox.Text; ad = Adtbox.Text; soyad = soyadtbox.Text; telefon = teltbox.Text; eposta = epostotbox.Text; sifre = sifreTbox.Text; var query = new MusteriKayit { musteriAd = ad, musteriTel = telefon, musteriEPosta = eposta, musteriSifre = sifre, musteriSoyad = soyad, musteriTC = TcNo, isTrue = 0 }; db.MusteriKayits.Add(query); db.SaveChanges(); MessageBox.Show("Başarılı Kayıt"); Giris frm = new Giris(); frm.Show(); this.Hide(); } } }