Exemplo n.º 1
0
 public HallsManagement()
 {
     InitializeComponent();
     HallsSource.DataSource = _core.Halls;
     _core.Halls.Add(new Hall("тест"));
     _core.Halls.Add(new Hall("qdw"));
     _core.Halls.Add(new Hall("ad"));
     HallsSource.ResetBindings(true);
 }
Exemplo n.º 2
0
 private void RemoveHall_Click(object sender, EventArgs e)
 {
     if (_core.Halls.Count != 0)
     {
         _core.Halls.Remove(_core.Halls[Halls.SelectedIndex]);
         Halls.SelectedIndex = 0;
         HallsSource.ResetBindings(true);
     }
     else
     {
         MessageBox.Show("Нечего удалять");
     }
 }
Exemplo n.º 3
0
 private void AddHall_Click(object sender, EventArgs e)
 {
     if (isActiveButton)
     {
         CheckNameHall();
         Hall hall = new Hall(NameNewHall.Text);
         NameNewHall.Text = "";
         _core.Halls.Add(hall);
         HallsSource.ResetBindings(true);
         Halls.SelectedIndex = HallsSource.Count - 1;
     }
     else
     {
         MessageBox.Show("Введите название зала");
     }
 }