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"); } } } }
private void btnMeydancaElaveEt_Click(object sender, EventArgs e) { string MeydancaAdi = txtMeydancaAdi.Text; string MeydacaNomresi = txtMeydancaNomresi.Text; if (Extension.isNotEmpty(new string[] { MeydancaAdi }, string.Empty)) { tbl_Meydan mydn = null; mydn = new tbl_Meydan { Meydan_Adi = MeydancaAdi, Meydan_nomresi = MeydacaNomresi }; db.tbl_Meydan.Add(mydn); db.SaveChanges(); FillDataGrid(); MessageBox.Show("Elave Edildi", "MEYDAN", MessageBoxButtons.OK, MessageBoxIcon.Information); } }