private void btnXoa_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow == null) { return; } using (HangHoaBUS bus = new HangHoaBUS()) { if (new XacNhan { Text = @"Bạn có chắc chắn muốn xóa hàng hóa " + dataGridView1.CurrentRow.Cells[0].Value }.ShowDialog() == DialogResult.Yes) { string tenhanghoa = dataGridView1.CurrentRow.Cells[0].Value.ToString(); bus.DeleteHangHoa(tenhanghoa); } } RefreshHangHoa(); }