//delete group private void Button_Click_1(object sender, RoutedEventArgs e) { if (grouplist.SelectedIndex != -1) { Window3 win3 = new Window3(); win3.Karl.Text += " " + faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex).number.ToString() + "?"; win3.ShowDialog(); if (win3.flag) { MyList<Group> clear = new MyList<Group>(); Group g = new Group(); g = faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex); faclist.getElement(listbox.SelectedIndex).groups.Remove(grouplist.SelectedIndex); foreach (Group gg in faclist.getElement(listbox.SelectedIndex).groups) clear.addObject(gg); grouplist.ItemsSource = clear; } } }
//delete faculty private void Button_Click_3(object sender, RoutedEventArgs e) { if (listbox.SelectedIndex != -1) { Window3 win3 = new Window3(); win3.Karl.Text += " " + faclist.getElement(listbox.SelectedIndex).name + "?"; win3.ShowDialog(); if (win3.flag) { MyList<Faculty> clear = new MyList<Faculty>(); Faculty f = new Faculty(); faclist.Remove(listbox.SelectedIndex); foreach (Faculty ff in faclist) clear.addObject(ff); listbox.ItemsSource = clear; } } }
//delete student private void Button_Click_5(object sender, RoutedEventArgs e) { if (studentlist.SelectedIndex != -1) { Window3 win3 = new Window3(); String name = faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex).students.getElement(studentlist.SelectedIndex).name; String surname = faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex).students.getElement(studentlist.SelectedIndex).surname; win3.Karl.Text += " " + surname+" "+name + "?"; win3.ShowDialog(); if (win3.flag) { MyList<Student> clear = new MyList<Student>(); Student s = new Student(); s = faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex).students.getElement(studentlist.SelectedIndex); faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex).students.Remove(studentlist.SelectedIndex); foreach (Student ss in faclist.getElement(listbox.SelectedIndex).groups.getElement(grouplist.SelectedIndex).students) clear.addObject(ss); studentlist.ItemsSource = clear; } } }