//Lara created --- goes to list of Teams page
        public ActionResult Index()
        {
            var ops = new BaseballOperations();
            AddPlayerViewModel teams = new AddPlayerViewModel();

            var response = ops.GetAllTeams();

            return View("Index",response.Teams);
        }
        // GET: Player
        public ActionResult AddPlayer()
        {
            BaseballOperations ops = new BaseballOperations();

            AddPlayerViewModel addP = new AddPlayerViewModel();

            var teamResponse = ops.GetAllTeams();
            var positionResponse = ops.GetAllPositions();

            addP.CreatePositionList(positionResponse.Positions);
            addP.CreateTeamList(teamResponse.Teams);

            return View(addP);
        }
        public ActionResult AddPlayer(AddPlayerViewModel addP)
        {
            var ops = new BaseballOperations();

            var teamResponse = ops.GetAllTeams();
            var positionResponse = ops.GetAllPositions();

            addP.CreateTeamList(teamResponse.Teams);
            addP.CreatePositionList(positionResponse.Positions);

            if (ModelState.IsValid)
            {
                var playerResponse = ops.CreatePlayer(addP.player);
                playerResponse.Player.Position =
                    ops.GetAllPositions().Positions.FirstOrDefault(p => p.PositionID == addP.player.Position.PositionID);

                return View("PlayerDetails", playerResponse.Player);
            }
            else
            {
                return View(addP);
            }
        }
        //Lara added -- goes to list of players page
        public ActionResult Index(int teamID)
        {
            TeamPlayersVM vm = new TeamPlayersVM();
            BaseballOperations ops = new BaseballOperations();
            AddPlayerViewModel teams = new AddPlayerViewModel();

            var response = ops.GetPlayersByTeamName(teamID);
            vm.TeamName = ops.GetTeamByID(teamID).Team.TeamName;
            vm.Players = response.Players;

            return View(vm);
        }