Exemplo n.º 1
0
        public ActionResult DeleteLeague(int id)
        {
            var manager = new LeagueManager();
            var league  = manager.GetLeagueById(id);

            return(View(league));
        }
Exemplo n.º 2
0
        public ActionResult RemoveTeamToLeagueless(int id)
        {
            var teamManager   = new TeamManager();
            var leagueManager = new LeagueManager();
            var vm            = new RemoveTeamToNoLeagueVM();

            vm.Leagueless         = leagueManager.GetLeagueById(0);
            vm.LeagueToRemoveTeam = leagueManager.GetLeagueById(id);
            var teams1 = teamManager.GetAllTeams().FindAll(t => t.LeagueId == 0);

            teams1.RemoveAll(t => t.Id == 0);
            var teams2 = teamManager.GetAllTeams().FindAll(t => t.LeagueId == id);

            vm.SetLeaguelessTeams(teams1);
            vm.SetTeamsInLeague(teams2);
            return(View(vm));
        }
Exemplo n.º 3
0
        public ActionResult EditLeague(int id)
        {
            var    manager = new LeagueManager();
            League league  = new League();

            league.Id = id;
            var editLeague = manager.GetLeagueById(league.Id);

            return(View(editLeague));
        }
Exemplo n.º 4
0
        public ActionResult ViewLeague(int id)
        {
            var leagueManager = new LeagueManager();
            var manager       = new TeamManager();
            var league        = leagueManager.GetLeagueById(id);
            var leagueVM      = new LeagueVM();

            leagueVM.League        = league;
            leagueVM.TeamsInLeague = manager.GetAllTeams().FindAll(t => t.LeagueId == leagueVM.League.Id);
            return(View(leagueVM));
        }
Exemplo n.º 5
0
        public ActionResult ViewRoster(int id)
        {
            var leagueManager = new LeagueManager();
            var manager       = new TeamManager();
            var roster        = manager.GetTeamById(id);

            var teamVM = new TeamVM();

            teamVM.Team         = roster;
            teamVM.TeamLeague   = leagueManager.GetLeagueById(teamVM.Team.LeagueId);
            teamVM.FreeAgents   = manager.GetTeamById(0);
            teamVM.Team.Players = roster.Players.OrderBy(t => t.LastName).ToList();


            return(View(teamVM));
        }