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