Exemplo n.º 1
0
 public ActionResult Create(LeagueWinner @leagueWinner)
 {
     if (ModelState.IsValid)
     {
         leagueWinnerService.Insert(@leagueWinner);
         leagueWinnerService.Commit();
         SuccessMessage(FormMessages.SaveSuccess);
         return(RedirectToAction("Index"));
     }
     return(View(@leagueWinner));
 }
Exemplo n.º 2
0
        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));
        }