Beispiel #1
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            if (MessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                int flat_dk   = dk.delete(AccountHelper.getAccountId(), AccountHelper.getAccoutPassword(), txtMaHV.Text, cbxLopHoc.Text);
                int flat_tthp = tthp.delete(AccountHelper.getAccountId(), AccountHelper.getAccoutPassword(), txtMaHV.Text);
                int flat_thi  = thi.deleteMaHV(AccountHelper.getAccountId(), AccountHelper.getAccoutPassword(), txtMaHV.Text);
                int flat_hv   = hv.delete(AccountHelper.getAccountId(), AccountHelper.getAccoutPassword(), txtMaHV.Text);


                if (flat_hv == 1 && flat_dk == 1)
                {
                    DialogHelper.ExtendedShowErrorDialog("Xóa thành công", "", 1, 2);
                }
                else
                {
                    DialogHelper.ExtendedShowErrorDialog("Xóa không thành công", "", 1, 1);
                }
            }
            Load_HV();
            XoaText();
            EditButton(true, false, false, false);
            this.Cursor = Cursors.Arrow;
        }