Ejemplo n.º 1
0
        // GET: Player
        public ActionResult Index()
        {
            var ops = new BaseballBLL();
            var playerList = new List<Player>();
            playerList.AddRange(ops.GetAllPlayers());
            playerList.AddRange(ops.GetFreeAgents());
            var result = playerList.OrderBy(player => player.TeamName).ThenBy(player => player.JerseyNumber).ToList();
            foreach (var player in result.Where(player => player.TeamID == 0))
            {
                player.TeamID = 1;
            }

            var teams = ops.GetTeamDropDown();

            var vm = new PlayersVM(result, teams);

            return View(vm);
        }
        public List<Player> GetFreeAgents()
        {
            var ops = new BaseballBLL();

            return ops.GetFreeAgents();
        }