Esempio n. 1
0
        public ActionResult AddTeam()
        {
            var repo = new TeamRepo();
            var VM = new AddTeamVM();
            VM.TeamList = repo.GetTeams(1);

            return View(VM);
        }
Esempio n. 2
0
        public ActionResult AddTeam(AddTeamVM VM)
        {
            var repo = new TeamRepo();

            if (ModelState.IsValid)
            {
                int teamID = repo.AddTeam(VM.NewTeam);
                repo.AddLeagueTeamDetails(teamID, 1);

                return View("SuccessPage");
            }

            return View(VM);
        }