コード例 #1
0
        public override void Sil()
        {
            DialogResult sonuc = new DialogResult();

            sonuc = XtraMessageBox.Show("Verileri silmek istediğinize emin misiniz?", "Uyarı", MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Question);
            if (sonuc == DialogResult.No)
            {
                return;
            }
            else if (sonuc == DialogResult.Yes)
            {
                if (vpDogrulama.Validate())
                {
                    try
                    {
                        Kullanici.DeleteKullanici(_kullaniciId);

                        XtraMessageBox.Show("Veritabanından silme işlemi başarılı!  ", "Uyarı", MessageBoxButtons.OK,
                                            MessageBoxIcon.Information);
                        FormuTemizle(false);
                        _sonKullaniciAdi = "";
                        _guncelle        = false;
                    }

                    catch (Exception ex)
                    {
                        CommonHelper.WriteLog("Kullanici Kartı Veri Silme", ex.Message);
                        XtraMessageBox.Show("Silme işlemi sırasında hata meydana geldi! " + ex.Message, "Uyarı", MessageBoxButtons.OK,
                                            MessageBoxIcon.Error);
                    }
                }
                else
                {
                    XtraMessageBox.Show("Boş bırakılamaz! Alanları kontrol ediniz! ", "Uyarı", MessageBoxButtons.OK,
                                        MessageBoxIcon.Error);
                }
            }
        }