private void btnXoa_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Bạn chắc chắn xóa?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { //Xóa if (khctr.delData(txtma.Text.Trim())) { MessageBox.Show("Xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Xòa thất bại", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } frmKhachHang_Load(sender, e); }
private void btnxoa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DialogResult dr = MessageBox.Show("Bạn chắc chắn muốn xóa thông tin khách hàng này?", "Xác nhận xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { if (khCtrl.delData(txtmakh.Text.Trim())) { MessageBox.Show("Xóa thành công thông tin khách hàng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); clearData1(); } else { MessageBox.Show("Không xóa được thông tin khách hàng!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } ucKhachHang_Load(sender, e); DisEnl(false); }