private void kaydetBtn_Click(object sender, EventArgs e) { var entity = _musteriServis.Add(new Musteri { AD = adTxt.Text.ToString(), SOYAD = soyadTxt.Text.ToString(), TELEFON1 = telefon1Masked.Text.ToString(), TELEFON2 = telefon2Masked.Text.ToString(), TC = tcTxt.Text.ToString(), MAIL = mailTxt.Text.ToString(), IL = ilCbx.SelectedText.ToString(), ILCE = ilceCbx.SelectedText.ToString(), ADRES = adresTxt.Text.ToString(), VERGIDAIRE = vergiDairesiTxt.Text.ToString() }); if (entity != null) { BindData(); MessageBox.Show("Kaydetme işlemi başarılı oldu.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); Temizle(); } else { MessageBox.Show("Kaydetme işlemi başarısız oldu.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void barbtnkaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MessageBox.Show("Müşteriyi Kayıt Etmek İstiyor musunuz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { _musteriService.Add(new Musteri { Ad = textAd.Text, Soyad = textSoyad.Text, Tc = maskTCKimlik.Text, Telefon1 = maskTelefon1.Text, Telefon2 = maskTelefon2.Text, Mail = txtMail.Text, Il = comIl.Text, Ilce = comIlce.Text, VergiDaire = textvergiDairesi.Text, Adres = richAdres.Text }); MessageBox.Show("Kayıt İşlemi Başarılı. Değişiklikleri Görmek için YENİLE Butonuna Basınız", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exception) { MessageBox.Show(exception.Message); } } else { MessageBox.Show("Müşteri Kayıt Edilmedi", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Kaydet() { try { musteriServis.Add(new Entities.Concrete.Musteri { MusteriAd = adTxt.Text.ToString(), MusteriSoyad = soyadTxt.Text.ToString(), MusteriTelefon = telefonTxt.Text.ToString(), MusteriMail = mailTxt.Text.ToString(), MusteriBanka = bankaTxt.Text.ToString(), MusteriVergiDaire = vergiDairesiTxt.Text.ToString(), MusteriVergiNo = vergiNumarasiTxt.Text.ToString(), MusteriStatu = statuTxt.Text.ToString(), MusteriIl = ilTxt.Text.ToString(), MusteriIlce = ilceTxt.Text.ToString(), MusteriAcikAdres = acikAdresTxt.Text.ToString() }); MessageBox.Show("Müşteri ekleme işlemi başarılı oldu.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exception) { MessageBox.Show(exception.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public IActionResult Kayit(MusteriAddModel musteriAddModel) { if (ModelState.IsValid) // Gerekli Alanlar Dolduruldu ise { try { // Veri tabanına kayıt işlemleri musteriAddModel.musteri.Parola = "1234"; _musteriService.Add(musteriAddModel.musteri); foreach (var arakisi in musteriAddModel.Aranacaklars) { arakisi.aboneNo = musteriAddModel.musteri.AboneNo; _aranacakService.Add(arakisi); } TempData["sonuc"] = "0"; } catch (Exception e) { Console.WriteLine(e); TempData["sonuc"] = "1"; } } return(View()); }