private void MassDelToolStripMenuItem2_Click(object sender, EventArgs e) { foreach (TreeNode treeNode in CheckedNodes(StudentCardsTreeView.Nodes)) { var currentStudent = SearchStudentInStudentList(treeNode); _manager.DeleteData(currentStudent); } DeleteTextBoxInfo(); RefreshInfo(); MessageBox.Show($"Данные удалены"); }
private void DeleteButton_Click(object sender, EventArgs e) { if (StudentCardsTreeView.SelectedNode != null && StudentCardsTreeView.SelectedNode.Name != "") { var currentStudent = SearchStudentInStudentList(); _manager.DeleteData(currentStudent); MessageBox.Show($"Данные {currentStudent.Surname} удалены"); DeleteTextBoxInfo(); RefreshInfo(); } }