//add faculti private void Button_Click_2(object sender, RoutedEventArgs e) { Window1 win1 = new Window1(); win1.Title = "add new faculty"; win1.ShowDialog(); Faculty faculty = new Faculty(); faculty.name = win1.textbox.Text; faclist.addObject(faculty); MyList<Faculty> clear = new MyList<Faculty>(); foreach (Faculty ff in faclist) clear.addObject(ff); listbox.ItemsSource = clear; }
//add group private void Button_Click(object sender, RoutedEventArgs e) { Window1 win1 = new Window1(); win1.Title = "Добавление новой группы"; win1.ShowDialog(); if (win1.flag) { MyList<Group> clear = new MyList<Group>(); Group g = new Group(); g.number = Convert.ToInt32(win1.textbox.Text); faclist.getElement(listbox.SelectedIndex).groups.addObject(g); foreach (Group gg in faclist.getElement(listbox.SelectedIndex).groups) clear.addObject(gg); grouplist.ItemsSource = clear; } }
private void button_Click(object sender, RoutedEventArgs e) { Window1 okno2 = new Window1(); okno2.Show(); }