public async Task <ActionResult> Index(string clubInitials) { ViewData["ClubInitials"] = clubInitials; var regattas = await _regattaService.GetAllRegattaSummaryAsync(clubInitials); var clubName = await _clubService.GetClubName(clubInitials); return(View(new ClubCollectionViewModel <RegattaSummaryViewModel> { List = regattas, ClubInitials = clubInitials, ClubName = clubName, CanEdit = await _authService.CanUserEdit(User, clubInitials) })); }
public async Task <ActionResult> Index(string clubInitials) { ViewData["ClubInitials"] = clubInitials.ToUpperInvariant(); var series = await _seriesService.GetNonRegattaSeriesSummariesAsync(clubInitials); var clubName = await _clubService.GetClubName(clubInitials); return(View(new ClubCollectionViewModel <SeriesSummary> { List = series, ClubInitials = clubInitials, ClubName = clubName, CanEdit = await _authService.CanUserEdit(User, clubInitials) })); }
public async Task <ActionResult> Index( string clubInitials, string seasonName, bool showScheduled = true, bool showAbandoned = true) { var capInitials = clubInitials.ToUpperInvariant(); if (String.IsNullOrWhiteSpace(seasonName)) { var currentSeason = await _raceService.GetCurrentSeasonAsync(capInitials); if (currentSeason != null) { return(RedirectToRoute("Race", new { clubInitials = capInitials, seasonName = currentSeason.UrlName })); } } var clubName = await _clubService.GetClubName(capInitials); var races = await _raceService.GetAllRaceSummariesAsync( capInitials, seasonName, showScheduled, showAbandoned); return(View(new ClubItemViewModel <RaceSummaryListViewModel> { Item = races, ClubInitials = capInitials, ClubName = clubName, CanEdit = await _authService.CanUserEdit(User, capInitials) })); }