Ejemplo n.º 1
0
 private void UpdateHall_Click(object sender, EventArgs e)
 {
     try
     {
         if (_valid.ValidAddHallTable(_f1.rowshall, _f1.seatshall))
         {
             bool res = _hallService.UpdateHalls(new HallMember
             {
                 Numbers_of_rows = _f1.rowshall,
                 Number_of_seats = _f1.seatshall,
                 HallId          = _f1.idhall
             });
             if (res == false)
             {
                 MessageBox.Show("Не удалось выполнить запрос!");
             }
             else
             {
                 MessageBox.Show("Данные обновлены!");
                 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);
     }
 }