public ActionResult _AddPlayerModal() { var ops = new BaseballBLL(); var vm = new AddPlayerModalVM(ops.GetTeamDropDown(), ops.GetPositionDropDown()); return PartialView(vm); }
// 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<Team> GetTeamsDropDown() { var ops = new BaseballBLL(); return ops.GetTeamDropDown(); }