private void PopulateStaticData(FixtureViewModel model) { // TODO Perhaps get only the teams involved in the cup? if (model.Fixture.IsCupFixture) { model.Teams = teamService.GetTeamsForCurrentSeason().ToSelectList(x => x.ToString(), x => x.Id.ToString(), null); } else { model.Teams = teamService.GetTeamsForLeague(model.LeagueOrCupId).ToSelectList(x => x.ToString(), x => x.Id.ToString(), null); } if (model.Fixture.IsCupFixture) { model.LeagueOrCupName = cupService.Get(model.LeagueOrCupId).ToString(); } else { model.LeagueOrCupName = competitionService.GetLeague(model.LeagueOrCupId).ToString(); } model.Referees1 = refereeService.Get(orderBy: q => q.OrderBy(x => x.Forename)).ToSelectListWithHeader(x => x.ToString(), x => x.Id.ToString(), null, "None"); model.Referees2 = refereeService.Get(orderBy: q => q.OrderBy(x => x.Forename)).ToSelectListWithHeader(x => x.ToString(), x => x.Id.ToString(), null, "None"); model.OneOffVenues = oneOffVenueService.Get(orderBy: q => q.OrderBy(x => x.Venue)).ToSelectListWithHeader(x => x.ToString(), x => x.Id.ToString(), null, "None"); }
public IActionResult Edit(int id) { var referee = refereeService.Get(id); var refereeViewModel = new RefereeViewModel { Id = id, Name = referee.Name, BirthDate = referee.BirthDate, CountryId = referee.Country.Id, CountryName = referee.Country.Name, CountriesItems = countryService.GetAllAsKeyValuePairs() }; return(View(refereeViewModel)); }
public ActionResult Edit(int id) { return(View(refereeService.Get(id))); }