private void btnClientAdd_Click(object sender, EventArgs e) { string ClientName = txtClientAd.Text; string ClientLastname = txtClientSoyad.Text; string ClientPhone = txtClientNomre.Text; tbl_Musteri musteri = null; musteri = new tbl_Musteri { Ad = ClientName, Soyad = ClientLastname, Telefon = ClientPhone }; db.tbl_Musteri.Add(musteri); db.SaveChanges(); MessageBox.Show("Musteri Elave Edildi"); }
private void btnRez_Click(object sender, EventArgs e) { string RezAd = txtRezAd.Text; string RezSoyad = txtRezSoyad.Text; string RezNomre = txtRezNomre.Text; string MeydanAd = CmbMeydan.Text; string MeydanNomr = cmbRezMeydanNomr.Text; string OtaqNomre = cmbRezOtaqNomre.Text; DateTime DateFrom = dateFrom.Value; DateTime DateTo = dateToo.Value; int phoneNumber; if (Extension.isNotEmpty(new string[] { RezAd, RezSoyad, RezNomre, MeydanAd, MeydanNomr, OtaqNomre }, string.Empty)) { ; } { if (db.tbl_Otag.Any(otg => otg.Musteri_sayi <= 12)) { if (int.TryParse(RezNomre, out phoneNumber)) { tbl_Otag selectedOtaq = db.tbl_Otag.First(ot => ot.OtagNomre == OtaqNomre); tbl_Meydan selectedMeydn = db.tbl_Meydan.First(myd => myd.Meydan_nomresi == MeydanNomr); tbl_Musteri selectClient = null; int ClientId = 0; selectClient = db.tbl_Musteri.Add(new tbl_Musteri { Ad = RezAd, Soyad = RezSoyad, Telefon = RezNomre }); db.SaveChanges(); MessageBox.Show("ELAVE OLDU"); } } } }
public ActionResult MusteriEkle(tbl_Musteri m1) { db.tbl_Musteri.Add(m1); db.SaveChanges(); return(View()); }