public ActionResult AddMatch(AddNewMatchChoices model, int leagueId) { Match match = model.Match; int matchId = MatchService.AddNewMatch(match, leagueId, match.HomeTeam.Id, match.AwayTeam.Id); return(RedirectToAction("AddDetailsForMatch", new { id = matchId })); }
public ActionResult AddNewMatch(int leagueId) { ViewBag.LeagueId = leagueId; var teams = MatchService.GetTeamsForChoices(leagueId); AddNewMatchChoices model = new AddNewMatchChoices { Teams = teams }; return(View(model)); }
public ActionResult AddDetailsForMatch(int id) { ViewBag.MatchId = id; var players = MatchService.GetPlayersForChoices(id); AddNewMatchChoices model = new AddNewMatchChoices { Players = players }; return(View(model)); }
public ActionResult AddMatchDetails(AddNewMatchChoices model, int matchId) { MatchService.AddScorersAndAssistants(matchId, model.Scorers, model.Assistants); return(RedirectToAction("Index", "Home")); }