private void btnXoa_Click(object sender, EventArgs e) { foreach (int j in lvwHV.SelectedIndices) { if (xl.xoa(lvwHV.Items[j].Text)) { hienthi(); } else { MessageBox.Show("Xóa bị lỗi."); } break; } }
public bool xoaHV(string malop, string mahv) { try { CHocvien hv = timHV(malop, mahv); if (hv != null) { CdmHocVien xl = new CdmHocVien(); xl.xoa(mahv); return(true); } return(false); } catch (Exception) { throw; } }