示例#1
0
        private void btnHapus_Click(object sender, EventArgs e)
        {
            var msgResult = MessageBox.Show("Data  Akan Dihapus!!!", "Confirm Delete!!", MessageBoxButtons.YesNo);

            if (msgResult == DialogResult.Yes)
            {
                int    result = DbQuery.DeleteSPD(id);
                string msg    = "Terjadi Kesalahan Pada Saat Menghapus Data";
                if (result > 0)
                {
                    msg = "Berhasil! Data Telah Dihapus";
                }
                MessageBox.Show(msg);
                if (Application.OpenForms["Form1"] != null)
                {
                    (Application.OpenForms["Form1"] as Form1).RefSpd();
                }
                this.Close();
            }
        }