예제 #1
0
        //******************************************************************
        public ActionResult AddTeam()
        {
            BaseballOperations ops = new BaseballOperations();

            TeamVM tvm = new TeamVM();

            var response = ops.GetAllLeagues();
            tvm.CreateLeagueList(response.Leagues);

            return View(tvm);
        }
예제 #2
0
        public ActionResult AddTeam(TeamVM vm)
        {
            var ops = new BaseballOperations();

            var response = ops.GetAllLeagues();
            vm.CreateLeagueList(response.Leagues);

            if (ModelState.IsValid)
            {
                var opsResponse = ops.AddTeam(vm.Team);
                opsResponse.Team.League = ops.GetLeagueByID(vm.Team.League.LeagueID).League;
                return View("TeamDetails", opsResponse.Team);
            }
            else
            {
                return View("AddTeam");
            }
        }