Beispiel #1
0
 public ActionResult Create(TeamLeague @teamLeague)
 {
     if (ModelState.IsValid)
     {
         teamLeagueService.Insert(@teamLeague);
         teamLeagueService.Commit();
         SuccessMessage(FormMessages.SaveSuccess);
         return(RedirectToAction("Index"));
     }
     return(View(@teamLeague));
 }
        public ActionResult Create(TeamLeagueViewModel model)
        {
            if (ModelState.IsValid)
            {
                Team       team       = teamService.Get(model.TeamId);
                TeamLeague teamLeague = new TeamLeague(competitionService.GetLeague(model.LeagueId), team, team.TeamName, team.TeamNameLong);

                teamLeagueService.Insert(teamLeague);
                teamLeagueService.Commit();

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

            PopulateStaticData(model);

            return(View(model));
        }