Beispiel #1
0
 private void AddHall_Click(object sender, EventArgs e)
 {
     try
     {
         if (_valid.ValidAddHallTable(_f1.rowshall, _f1.seatshall))
         {
             bool res = _hallService.InsertHalls(new HallMember
             {
                 Numbers_of_rows = _f1.rowshall,
                 Number_of_seats = _f1.seatshall
             });
             if (res == false)
             {
                 MessageBox.Show("Не удалось выполнить запрос!");
             }
             else
             {
                 outputHall(_dataGridHall);
                 if (_dataGridHall.CurrentRow != null)
                 {
                     _dataGridHall.Rows[_dataGridHall.CurrentRow.Index].Selected = false;
                 }
             }
         }
         else
         {
             foreach (var v in _valid.ErrorStrings)
             {
                 MessageBox.Show(v);
             }
             _valid.ErrorStrings.Clear();
         }
     }
     catch (Exception exp)
     {
         MessageBox.Show(errorController);
     }
 }