private void DeleteFilm_Click(object sender, EventArgs e) { try { if (_valid.ValidDeleteFilmsTable(_f1.idfilm)) { bool res = _filmsService.DeleteFilms(new FilmsMember { FilmId = _f1.idfilm }); if (res == false) { MessageBox.Show("Не удалось выполнить запрос!"); } else { outputFilms(_dataGridFilms); if (_dataGridFilms.CurrentRow != null) { _dataGridFilms.Rows[_dataGridFilms.CurrentRow.Index].Selected = false; } } } else { foreach (var v in _valid.ErrorStrings) { MessageBox.Show(v); } _valid.ErrorStrings.Clear(); } } catch (Exception exp) { MessageBox.Show(errorController); } }