private void btnXoaCTXK_Click(object sender, EventArgs e) { DialogResult dlr = MessageBox.Show("Bạn có chắc muốn xóa dữ liệu cho chi tiết xuất kho này?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dlr == DialogResult.Yes) { String sql = "delete from ct_phieuxuat where mapx = '" + cbboxMaXK.SelectedItem.ToString().Trim() + "' and masp = '" + SANPHAMDAO.MaSPTheoTenSP(QuanLyHangHoa.dsSP, cbboxTenSP.SelectedItem.ToString().Trim()) + "'"; cn.themxoasua(sql); CHITIETXUATKHODAO.XoaCTXK(dsCTXK, cbboxMaXK.SelectedItem.ToString().Trim(), SANPHAMDAO.MaSPTheoTenSP(QuanLyHangHoa.dsSP, cbboxTenSP.SelectedItem.ToString().Trim())); dgvCTXK.Rows.RemoveAt(indexCTNK); MessageBox.Show("Xóa thành công"); } }