コード例 #1
0
        public ActionResult Index()
        {
            var repo = new TeamRepo();
            var teams = repo.GetTeams(1);

            return View(teams);
        }
コード例 #2
0
        public ActionResult AddTeam()
        {
            var repo = new TeamRepo();
            var VM = new AddTeamVM();
            VM.TeamList = repo.GetTeams(1);

            return View(VM);
        }
コード例 #3
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);
        }