public PartialTimesDto SelectPartialTimesByAthlete(CompetitionDto competition, AthleteDto athlete) { var partial = new SelectPartialTimes(ref _conn, athlete, competition); partial.Execute(); return(partial.PartialTimes); }
public IsAthleteInCompetition(ref DBConnection conn, CompetitionDto competitionP, AthleteDto athlete) { _conn = conn; _competition = competitionP; _athlete = athlete; IsEnroll = false; }
public Task <bool> ExistsAsync(Competition competition) { var dto = new CompetitionDto(competition); long count = competitions.CountDocuments(filter => filter.Id.Equals(dto.Id)); return(Task.FromResult(count > 0)); }
public async Task <IActionResult> AddNext([FromRoute] string type, [FromForm] CompetitionDto source) { bool t; if (type.ToLower().Equals("daily")) { t = false; } else if (type.ToLower().Equals("monthly")) { t = true; } else { return(BadRequest($"there is not Competition Type named {type} ")); } var state = await _service.AddNextCompetition(new Competition { Roles = source.Roles, Type = t, MinUniqueUsers = source.MinUniqueUsers, MinUniqueVisits = source.MinUniqueVisits, }); if (!state.Success) { return(BadRequest(state.Error)); } return(Ok(_mapper.Map <Competition, CompetitionDto>(state.Source))); }
public SelectCategoryByAthleteAndCompetition(ref DBConnection conn, CompetitionDto competition, AthleteDto athlete) { _conn = conn; _competition = competition; _athlete = athlete; }
public CompetitionDto SelectCompetitionDtoFromName(CompetitionDto competition) { var select = new SelectCompetitionLogic(ref _conn); select.Execute(); return(select.List.First(s => s.Name.Equals(competition.Name))); }
private void CompetitionList_SelectionChanged(object sender, SelectionChangedEventArgs e) { Competition = new CompetitionDto { ID = _ids[CompetitionList.SelectedIndex] }; Competition = _competitionService.SearchCompetitionById(Competition); var lista = _service.SelectPartialTimes(Competition); GenerateTable(lista); //if (Athlete == null) { // Athlete = new AthletesService().SelectAthleteByDniObject(_table.Rows[0][0] as string); //} if (Athlete != null) { LbNameSurname.Content = $"{Athlete.Name} {Athlete.Surname}"; var category = _competitionService.SelectCompetitionByAthleteAndCompetition(Competition, Athlete); LbCategory.Content = $"{category.Name.Replace('_', ' ')} ({category.MinAge} - {category.MaxAge})"; var p = _service.SelectCompetitionHasParticipated(Competition, Athlete); var time = PartialTimeString(p.FinishTime == 0 ? 0 : p.FinishTime - p.InitialTime); LbTiempoTotal.Content = $"T. Final: {time}"; } }
public bool IsCategoryInCompetition(CompetitionDto competition, AthleteDto athlete) { var isCategory = new IsCategoryInCompetitionLogic(ref _conn, _competition, athlete); isCategory.Execute(); return(isCategory.IsCorrect); }
public void InsertAthleteInCompetition(AthleteDto athlete, CompetitionDto competition, TypesStatus status) { var insertAthletesInCompetition = new InsertAthletesInCompetitionLogic(ref _conn, athlete, competition, status); insertAthletesInCompetition.Execute(); }
public SelectHasParticipatedTimeObject(ref DBConnection conn, CompetitionDto competition, AthleteDto athlete) { _conn = conn; HasParticipated = new HasParticipatedDto(); _competition = competition; _athlete = athlete; }
public bool IsAthleteInComp(CompetitionDto competition, AthleteDto athlete) { var isAthlete = new IsAthleteInCompetition(ref _conn, competition, athlete); isAthlete.Execute(); return(isAthlete.IsEnroll); }
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); }
public PaymentMethodSelectionWindow(AthleteDto athlete, CompetitionDto competition) { InitializeComponent(); _athlete = athlete; _competition = competition; }
public DataTable SelectCompetitionTimes(CompetitionDto competition) { var selectCompetition = new SelectHasParticipatedTimeLogic(ref _conn, competition); selectCompetition.Execute(); return(selectCompetition.Table); }
public int GetIdCompetition(CompetitionDto c) { var search = new GetIdCompetition(ref _conn, c); search.Execute(); return(search.id); }
public string GetCategory(AthleteDto athlete, CompetitionDto competition) { var getCategory = new GetCategoryLogic(ref _conn, competition, athlete); getCategory.Execute(); return(getCategory.Category); }
//public void InsertAthletesTable(AthleteDto athleteP) { // AddAthleteLogic add = new AddAthleteLogic(ref _conn, athleteP); // add.Execute(); //} //public List<CompetitionDto> SelectAthleteTable() { // SelectCompetitionLogic select = new SelectCompetitionLogic(ref _conn, c => c.Km > 50); // select.Execute(); // return select.List; //} //public void DeleteAthleteTable(AthleteDto athleteP) { // DeleteAthleteLogic delete = new DeleteAthleteLogic(ref _conn, athleteP); // delete.Execute(); //} //public static void PrintAthletes(IEnumerable<AthleteDto> list) { // Console.WriteLine(string.Join("\n", list)); //} //public static void PrintAthletes(IEnumerable<Athlete> list) { // Console.WriteLine(string.Join("\n", list)); //} public IEnumerable <AbsoluteCategory> SelectAllCategoriesByCompetitionId(CompetitionDto competition) { var categories = new SelectAllCategoriesByCompetitionId(ref _conn, competition); categories.Execute(); return(categories.Categories); }
public bool IsDorsalsInCompetition(CompetitionDto competition) { var dorsals = new IsDorsalsByCompetition(ref _conn, competition); dorsals.Execute(); return(dorsals.IsDorsals); }
/// <inheritdoc/> public async Task UpdateAsync( IWho who, IAuditHeaderWithAuditDetails auditHeader, ICompetition competition) { this.logger.LogTrace( "ENTRY {Method}(who, host) {@Who} {@Competition}", nameof(this.UpdateAsync), who, competition); CompetitionDto dto = CompetitionDto.ToDto(competition); CompetitionDto original = await this.context.FindAsync <CompetitionDto>(competition.Id) .ConfigureAwait(false); Audit.AuditUpdate(auditHeader, dto.Id, original, dto); this.context.Entry(original).CurrentValues.SetValues(dto); await this.context.SaveChangesAsync().ConfigureAwait(false); this.logger.LogTrace( "EXIT {Method}(who) {@Who}", nameof(this.UpdateAsync), who); }
public CreditCardWindow(AthleteDto athlete, CompetitionDto competition) { InitializeComponent(); _athlete = athlete; _competition = competition; }
public async Task <IActionResult> Modify_Test([FromRoute] string type, [FromForm] CompetitionDto source) { bool t; if (type.ToLower().Equals("daily")) { t = false; } else if (type.ToLower().Equals("monthly")) { t = true; } else { return(BadRequest($"there is not Competition Type named {type} ")); } var compel = _mapper.Map <CompetitionDto, Competition>(source); compel.Type = t; var state = await _service.ModifyNextCompetition_Test(compel, new DateTime(2020, 8, 23, 2, 3, 14)); if (!state.Success) { return(BadRequest(state.Error)); } return(Ok(_mapper.Map <Competition, CompetitionDto>(state.Source))); }
private void clearAll() { InitializeComponent(); GridMountain.Visibility = Visibility.Collapsed; GridInscription.Visibility = Visibility.Visible; InicioPlazo.IsEnabled = false; FinPlazo.IsEnabled = false; FechaCompeticion.SelectedDate = null; FechaCompeticion.DisplayDateStart = DateTime.Now; Categories.Items.Clear(); list = _serviceCompCat.SelectAllCategories(); _competition = new CompetitionDto(); Plazos_list.Items.Clear(); Km.Text = ""; Hitos.Text = ""; NumeroPlazas.Text = ""; Nombre.Text = ""; DPos.Text = ""; DNeg.Text = ""; DTotal.Text = ""; PrecioInscripcion.Text = ""; Reglamento.Text = ""; BtReset_Click(null, null); }
public IsCategoryInCompetitionLogic(ref DBConnection conn, CompetitionDto competitionP, AthleteDto athlete) { _conn = conn; _competition = competitionP; _athlete = athlete; IsCorrect = false; }
public void Execute() { try { using (var command = new SQLiteCommand(Resources.SQL_SELECT_COMPETITION, _conn.DbConnection)) { using (var reader = command.ExecuteReader()) { while (reader.Read()) { var competition = new CompetitionDto { ID = reader.GetInt32(0), Name = reader.GetString(1), Km = reader.GetInt32(3), Price = reader.GetDouble(4), Date = reader.GetDateTime(5), NumberPlaces = reader.GetInt32(6), Status = reader.GetString(7) }; Enum.TryParse(reader.GetString(2), out competition.Type); List.Add(competition); } } } } catch (SQLiteException) { _conn.DbConnection?.Close(); throw; } }
public SelectPartialTimes(ref DBConnection conn, AthleteDto athlete, CompetitionDto competition) { _conn = conn; PartialTimes = new PartialTimesDto(); _athlete = athlete; _competition = competition; }
public CompetitionDto SearchCompetitionById(CompetitionDto competition) { var searchCompetition = new SearchCompetitionByIdLogic(ref _conn, competition); searchCompetition.Execute(); return(searchCompetition.Competition); }
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); * }*/ }
public CategoryDto SelectCompetitionByAthleteAndCompetition(CompetitionDto competition, AthleteDto athlete) { var category = new SelectCategoryByAthleteAndCompetition(ref _conn, competition, athlete); category.Execute(); return(category.Category); }
public void Execute() { try { using (var command = new SQLiteCommand(Resources.SQL_SELECT_COMPETITIONS_TO_INSCRIBE_CLUBS, _conn.DbConnection)) { command.Parameters.AddWithValue("@COUNT", _count); var da = new SQLiteDataAdapter(command); da.Fill(Table); using (var reader = command.ExecuteReader()) { while (reader.Read()) { var competitionDto = new CompetitionDto { ID = reader.GetInt64(0), Name = reader.GetString(1), Km = reader.GetDouble(3), Price = reader.GetDouble(4) }; Competitions.Add(competitionDto); } } } } catch (SQLiteException) { _conn.DbConnection?.Close(); throw; } }
public IEnumerable <PartialTimesDto> SelectPartialTimes(CompetitionDto competition) { var partial = new SelectAllPartialTimes(ref _conn, competition); partial.Execute(); return(partial.List); }