// GET: Fixtures/SaveFixture/5 public IActionResult CreateNewFixture(int sectionId) { FixtureVm viewModel = new FixtureVm(); viewModel.SectionId = sectionId; viewModel.Section = _sectionManagement.GetSectionById(sectionId); viewModel.AvailableTeams = _teamManagement.GetTeamsForSection(sectionId); viewModel.AvailableVenues = _tournamentSquashVenueManagement.GetAvailableTournamentSquashVenues(viewModel.Section.TournamentId); return(View("FixtureAdminForm", viewModel)); }
public IActionResult SectionsDashboard(int id) { SectionUserViewVm viewModel = new SectionUserViewVm(_tournamentManagement.GetTournamentById(id)); viewModel.MensSections = _sectionManagement.GetMenSectionsForTournament(id); foreach (var mensSection in viewModel.MensSections) { mensSection.Teams = _teamManagement.GetTeamsForSection(mensSection.SectionId); mensSection.Fixtures = _fixtureManagement.GetFixturesForSection(mensSection.SectionId); } viewModel.WomensSections = _sectionManagement.GetWomenSectionsForTournament(id); foreach (var womensSection in viewModel.WomensSections) { womensSection.Teams = _teamManagement.GetTeamsForSection(womensSection.SectionId); womensSection.Fixtures = _fixtureManagement.GetFixturesForSection(womensSection.SectionId); } viewModel.MixedSections = _sectionManagement.GetMixedSectionsForTournament(id); foreach (var mixedSection in viewModel.MixedSections) { mixedSection.Teams = _teamManagement.GetTeamsForSection(mixedSection.SectionId); mixedSection.Fixtures = _fixtureManagement.GetFixturesForSection(mixedSection.SectionId); } return(View("SectionUserView", viewModel)); }