public ActionResult Create(LeagueWinner @leagueWinner) { if (ModelState.IsValid) { leagueWinnerService.Insert(@leagueWinner); leagueWinnerService.Commit(); SuccessMessage(FormMessages.SaveSuccess); return(RedirectToAction("Index")); } return(View(@leagueWinner)); }
public ActionResult Create(LeagueWinnerViewModel model) { if (ModelState.IsValid) { LeagueWinner leagueWinner = new LeagueWinner(leagueService.Get(model.LeagueId), teamService.Get(model.TeamId)); leagueWinnerService.Insert(leagueWinner); leagueWinnerService.Commit(); SuccessMessage(FormMessages.SaveSuccess); return(RedirectToAction("Index")); } PopulateStaticData(model); return(View(model)); }