private void btnXoaTN_Click(object sender, EventArgs e) { if (!isAdmin) { return; } DataGridViewRow row = dataGridView2.CurrentRow; if (row != null) { if (MessageBox.Show("Bạn có chắc muốn xóa thân nhân " + row.Cells["HOTEN"].Value.ToString() + "?", "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { switch (tab.action) { case ActionForm.THEM: dataGridView2.Rows.Remove(row); break; case ActionForm.KHONG: case ActionForm.SUA: if (model.XoaTN(row.Cells["MAQHGD"].Value.ToString()) > 0) { dataGridView2.Rows.Remove(row); } break; } } } }