private void btnsil_Click(object sender, EventArgs e) { DialogResult cvp = MessageBox.Show("Emin misiniz?", "Silme Onayı", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cvp == DialogResult.No) { return; } MusteriBL mbl = new MusteriBL(); try { if (mbl.MusteriSil(musteriid)) { MessageBox.Show("Silme Başarılı'"); } else { MessageBox.Show("Silme Hatalı!!"); } Temizle(); } catch (Exception) { throw; } finally { mbl.Dispose(); } }
private void btnkaydet_Click(object sender, EventArgs e) { MusteriBL mbl = new MusteriBL(); foreach (DataRow item in dt.Rows) { MODEL.Musteri m = new MODEL.Musteri(); if (item.RowState != DataRowState.Deleted) { m.Musteriad = item["Musteriad"].ToString(); m.Musterisoyad = item["Musterisoyad"].ToString(); m.Mustericep = item["Mustericep"].ToString(); m.Musterimail = item["Musterimail"].ToString(); m.Musteriadres = item["Musteriadres"].ToString(); } switch (item.RowState) { case DataRowState.Added: mbl.MusteriEkle(m); break; case DataRowState.Deleted: mbl.MusteriSil((int)item["MusteriId", DataRowVersion.Original]); break; case DataRowState.Modified: m.Musteriid = (int)item["MusteriId"]; mbl.MusteriGuncelle(m); break; default: break; } } }
private void Msuteri_Sil_Button_Click(object sender, EventArgs e) { Musteri mstr = new Musteri(); MusteriBL mb = new MusteriBL(); mstr.Musteri_kod = musterSiltextbox.Text; mb.MusteriSil(mstr); mb.SaveChanges(); }
private void BtnSil_Click(object sender, EventArgs e) { DialogResult cvp = MessageBox.Show("Kayıt Silinecek. Emin misiniz?", "Silme Onayı", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cvp == DialogResult.Yes) { MusteriBL mbl = new MusteriBL(); if (mbl.MusteriSil(MusteriID)) { Temizle(); MessageBox.Show("Silme Başarılı!"); } else { MessageBox.Show("Silme hatalı!"); } mbl.Dispose(); } }
private void btnKaydet_Click(object sender, EventArgs e) { MusteriBL mbl = new MusteriBL(); foreach (DataRow item in dt.Rows) { Musteri m = new Musteri(); if (item.RowState != DataRowState.Deleted) { m.Ad = item[1].ToString(); m.Soyad = item[2].ToString(); m.Telefon = item[3].ToString(); m.Sifre = item[4].ToString(); m.EPosta = item[5].ToString(); m.Adres = item[6].ToString(); m.TCKNo = item[7].ToString(); } switch (item.RowState) { case DataRowState.Added: mbl.Kaydet(m); break; case DataRowState.Deleted: mbl.MusteriSil(Convert.ToInt32(item[0, DataRowVersion.Original])); break; case DataRowState.Modified: m.Musteriid = Convert.ToInt32(item[0]); mbl.Guncelle(m); break; default: break; } } }
private void btnKaydet_Click(object sender, EventArgs e) { MusteriBL mbl = new MusteriBL(); foreach (DataRow item in dt.Rows) { Musteri m = new Musteri(); if (item.RowState != DataRowState.Deleted) { m.TcKNo = item[1].ToString(); m.Ad = item[2].ToString(); m.Soyad = item[3].ToString(); m.GirTar = Convert.ToDateTime(item[4]); m.CikTar = Convert.ToDateTime(item[5]); m.OdaNo = Convert.ToInt32(item[6]); } switch (item.RowState) { case DataRowState.Added: mbl.MusteriEkle(m); break; case DataRowState.Deleted: mbl.MusteriSil(Convert.ToInt32(item[0, DataRowVersion.Original])); break; case DataRowState.Modified: m.MusteriKayitID = Convert.ToInt32(item[0]); mbl.MusteriGuncelle(m); break; default: break; } } }