Esempio n. 1
0
        public async Task <IEnumerable <SeriesDto> > Get(
            Guid clubId,
            DateTime?date
            )
        {
            var series = await _service.GetAllSeriesAsync(clubId, date, true);

            return(_mapper.Map <List <SeriesDto> >(series));
        }
Esempio n. 2
0
    private async Task <RaceWithOptionsViewModel> CreateClubRaceAsync(string clubInitials)
    {
        var club = await _coreClubService.GetMinimalClub(clubInitials);

        var model = new RaceWithOptionsViewModel
        {
            ClubId           = club.Id,
            FleetOptions     = await _coreClubService.GetActiveFleets(club.Id),
            SeriesOptions    = await _coreSeriesService.GetAllSeriesAsync(club.Id, DateTime.Today, false),
            ScoreCodeOptions = (await _coreScoringService.GetScoreCodesAsync(club.Id))
                               .OrderBy(s => s.Name).ToList(),
            CompetitorOptions          = new List <Competitor>(),
            CompetitorBoatClassOptions = (await _coreClubService.GetAllBoatClasses(club.Id)).OrderBy(c => c.Name),
            Date                = DateTime.Today,
            Weather             = await _weatherService.GetCurrentWeatherForClubAsync(club),
            WeatherIconOptions  = GetWeatherIconOptions(),
            ClubHasCompetitors  = await _coreClubService.DoesClubHaveCompetitors(club.Id),
            NeedsLocalDate      = true,
            UseAdvancedFeatures = club.UseAdvancedFeatures ?? false
        };

        return(model);
    }
Esempio n. 3
0
    public async Task <Club> GetClubForClubHome(string clubInitials)
    {
        var clubId = await _coreClubService.GetClubId(clubInitials);

        var club = await _coreClubService.GetMinimalClub(clubId);

        // 10 days back, but view filters down to 8 days back.
        club.Races = await _coreRaceService.GetRecentRacesAsync(clubId, 10);

        club.Series = await _coreSeriesService.GetAllSeriesAsync(clubId, null, false);

        club.Regattas = await _coreRegattaService.GetAllRegattasAsync(clubId);

        return(club);
    }