public ActionResult DeleteLeague(int id) { var manager = new LeagueManager(); var league = manager.GetLeagueById(id); return(View(league)); }
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)); }
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)); }
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)); }
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)); }