Ejemplo n.º 1
0
 public ActionResult Edit(LeagueWinner @leagueWinner)
 {
     if (ModelState.IsValid)
     {
         leagueWinnerService.Update(@leagueWinner);
         leagueWinnerService.Commit();
         SuccessMessage(FormMessages.SaveSuccess);
         return(RedirectToAction("Index"));
     }
     return(View(@leagueWinner));
 }
Ejemplo n.º 2
0
        public ActionResult Edit(LeagueWinnerViewModel model)
        {
            if (ModelState.IsValid)
            {
                LeagueWinner leagueWinnerToUpdate = leagueWinnerService.Get(model.LeagueWinnerId);

                leagueWinnerToUpdate.League = leagueService.Get(model.LeagueId);
                leagueWinnerToUpdate.Team   = teamService.Get(model.TeamId);

                leagueWinnerService.Update(leagueWinnerToUpdate);
                leagueWinnerService.Commit();

                SuccessMessage(FormMessages.SaveSuccess);
                return(RedirectToAction("Index"));
            }

            PopulateStaticData(model);

            return(View(model));
        }