예제 #1
0
 public ActionResult Edit(LeagueWinner @leagueWinner)
 {
     if (ModelState.IsValid)
     {
         leagueWinnerService.Update(@leagueWinner);
         leagueWinnerService.Commit();
         SuccessMessage(FormMessages.SaveSuccess);
         return(RedirectToAction("Index"));
     }
     return(View(@leagueWinner));
 }
예제 #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));
        }