private void btnDeleteStudent_Click(object sender, EventArgs e) { if (lstStudents.SelectedItems.Count == 0) { return; } var selectedItem = lstStudents.SelectedItems[0]; StudentManager.Delete((selectedItem.Tag as Student).Id); lstStudents.Items.Remove(selectedItem); ReloadCourses(); }
private void btnDeleteStudent_Click(object sender, EventArgs e) { StudentManager.Delete(_student.Id); Close(); }