private void ReloadStarterCompetitionList() { if (_competitionTabOneComboBox.SelectedValue is int) { _starterCompetitionDataGridView.StoreRowSelection(); _starterCompetitionDataGridView.DataSource = PonyCompetition.SelectForCompetition( (int)_competitionTabOneComboBox.SelectedValue, false); _starterCompetitionDataGridView.RestoreRowSelection(); } }
public EditResultForm(PonyCompetition result, string competitionCaption) : this() { _isLoading = true; _result = result; _titleLable.Text = string.Format(_titleLable.Text, competitionCaption); _starterInfo.Text = string.Format("{0} {1}", result.FirstName, result.LastName); _ponyInfo.Text = result.Pony; _assessment.Text = result.Assessment.ToString(); _comment.Text = result.Comment; _isLoading = false; }
private void CompetitionDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e) { if (e.Row != null && e.Row.DataBoundItem is Competition) { Competition c = (Competition)e.Row.DataBoundItem; int count = PonyCompetition.SelectInUseCount(c.Id); if (count > 0) { MessageBox.Show(this, string.Format("Der Bewerb kann nicht gelöscht werden, da er bereits {0} Starter zugeordnet wurde.", count), "Bewerb löschen", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); e.Cancel = true; } } }
private void EditResult(PonyCompetition result) { try { using (EditResultForm frm = new EditResultForm(result, _competitionTabTwoComboBox.Text)) { frm.ShowDialog(); ReloadResultList(); } } catch (Exception ex) { _log.Error("Failed to open starter-editing form!", ex); MessageBox.Show(this, "Beim Bearbeiten eines Starters ist ein Fehler aufgetreten.", "Starter bearbeiten", MessageBoxButtons.OK, MessageBoxIcon.Error); } }