Ejemplo n.º 1
0
 public ActionResult Create(CupLeague @cupLeague)
 {
     if (ModelState.IsValid)
     {
         cupLeagueService.Insert(@cupLeague);
         cupLeagueService.Commit();
         SuccessMessage(FormMessages.SaveSuccess);
         return(RedirectToAction("Index"));
     }
     return(View(@cupLeague));
 }
        public ActionResult Create(CupLeagueViewModel model)
        {
            if (ModelState.IsValid)
            {
                var cupLeague = new CupLeague(cupService.Get(model.CupId), competitionService.GetLeague(model.LeagueId));

                cupLeagueService.Insert(cupLeague);
                cupLeagueService.Commit();
                SuccessMessage(FormMessages.SaveSuccess);
                return(RedirectToAction("Index"));
            }

            this.PopulateStaticData(model);

            return(View(model));
        }