public virtual ActionResult Create(long seasonId, long leagueId) { var model = new MatchDayViewModel(); model.SeasonId = seasonId; model.LeagueId = leagueId; return(View(model)); }
public virtual ActionResult Edit(MatchDayViewModel model) { if (ModelState.IsValid) { var matchDay = _matchDayService.GetById(model.MatchDayId); matchDay.Number = model.Number; matchDay.Round = model.Round; _matchDayService.Update(matchDay); return(RedirectToAction(MVC.Admin.MatchDays.List(model.SeasonId, model.LeagueId))); } return(View(model)); }
public virtual ActionResult Create(MatchDayViewModel model) { if (ModelState.IsValid) { var matchDay = new MatchDay() { LeagueId = model.LeagueId, SeasonId = model.SeasonId, Number = model.Number, Round = model.Round }; _matchDayService.Create(matchDay); return(RedirectToAction(MVC.Admin.MatchDays.List(model.SeasonId, model.LeagueId))); } return(View(model)); }
public async Task <IActionResult> List(MatchDayViewModel matchDayViewModel) { var matches = await this._matchService .GetMatchesAsync(matchDayViewModel.MatchDay); ICollection <MatchViewModel> matchesViewModel = new List <MatchViewModel>(); foreach (var match in matches) { matchesViewModel.Add(new MatchViewModel { Id = match.Id, HomeTeam = match.HomeTeam, AwayTeam = match.AwayTeam, HomeGoals = match.HomeGoals, AwayGoals = match.AwayGoals, MatchDay = match.MatchDay }); } return(View(matchesViewModel)); }
public virtual ActionResult DeleteConfirmed(MatchDayViewModel model) { _matchDayService.Delete(model.MatchDayId); return(RedirectToAction(MVC.Admin.MatchDays.List(model.SeasonId, model.LeagueId))); }