private void btn_DeleteAward_Click(object sender, EventArgs e) { var award = dataGridView2.CurrentRow?.DataBoundItem as Award; var form = new DeleteAward(); if (form.ShowDialog() == DialogResult.OK && (award != null)) { awardList.Remove(award); foreach (var user in userList) { user.DeleteAward(award.Title); } } }
private void btn_DeleteAward_Click(object sender, EventArgs e) { var award = dgv_Awards.CurrentRow?.DataBoundItem as Award; var form = new DeleteAward(); if (form.ShowDialog() == DialogResult.OK && (award != null)) { awardBL.Delete(award); foreach (var user in userBL.GetList()) { user.DeleteAward(award); } DisplayUsers(); DisplayAwards(); } }