private void BtFinish_Click(object sender, RoutedEventArgs e) { if (CompetitionsToSelect.SelectedItem == null) { MessageBox.Show(Properties.Resources.NothingSelected); return; } /*try {*/ _competition = _competitionService.ListCompetitionsToInscribeObject(_athlete) .ElementAt(CompetitionsToSelect.SelectedIndex); if (_enrollService.IsAthleteInComp(_competition, _athlete)) { MessageBox.Show(Properties.Resources.PreviouslyEnrolled); return; } new DialogPayment(_athlete, _competition).ShowDialog(); LoadData(TxDni.Text); /*} catch (ApplicationException) { * MessageBox.Show(Properties.Resources.PreviouslyEnrolled); * }*/ }
private void BtFinish_Click(object sender, RoutedEventArgs e) { if (CompetitionsToSelect.SelectedItem == null) { MessageBox.Show(Properties.Resources.NothingSelected); return; } _competition = _competitionService.ListCompetitionsToPreinscribeObject(_athlete) .ElementAt(CompetitionsToSelect.SelectedIndex); if (_enrollService.IsAthleteInComp(_competition, _athlete)) { MessageBox.Show(Properties.Resources.PreviouslyEnrolled); return; } new DialogPreinscripted(_athlete, _competition).ShowDialog(); var competitionService = new CompetitionService(); var enrollService = new EnrollService(_competition); var category = _enrollService.GetCategory(_athlete, _competition); _enrollService.InsertAthleteInCompetition(_athlete, _competition, TypesStatus.PreRegistered); LoadData(TxDni.Text); }
private void BtFinish_Click(object sender, RoutedEventArgs e) { if (CompetitionsToSelect.SelectedItem == null) { MessageBox.Show(Properties.Resources.NothingSelected); return; } var dto = new CompetitionDto { ID = _columnIds[CompetitionsToSelect.SelectedIndex] }; _competition = _competitionService.SearchCompetitionById(dto); var stringBuilder = new StringBuilder(); foreach (var a in _athletes) { if (_enrollService.IsAthleteInComp(_competition, a)) { stringBuilder.Append(a.Dni + " inscrito anteriormente en la competición.\n"); } else { _enrollService.InsertAthleteInCompetition(a, _competition, TypesStatus.Registered); _count++; stringBuilder.Append(a.Dni + " inscrito correctamente.\n"); } } var dialog = new DialogPayment(null, null); dialog.Content = new InscriptionProofClubs(_competition, stringBuilder.ToString(), _count); dialog.Show(); _count = 0; GetListCompetition(); }