private void btnXoa_Click(object sender, EventArgs e) { if (checkDuplicate() == 2) { { MessageBox.Show("Không Có Ca Làm Đó Để Xóa", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); txtMaCa.Text = ""; return; } } else { if (MessageBox.Show("Bạn Muốn Xóa Không ?", "Cảnh Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { { B_CaLam.DeleteCaLam(txtMaCa.Text); MessageBox.Show("Xóa Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); dgvCaLam.DataSource = B_CaLam.GetAllCaLam(); dt = B_CaLam.GetAllCaLam(); clearTxt(); } } } }