예제 #1
0
 public PartialViewResult SaveLeague(ViewLeague viewLeague)
 {
     League league = new League();
     if (ModelState.IsValid)
     {
         try
         {
             league.LeagueID = viewLeague.LeagueID;
             league.LeagueName = viewLeague.LeagueName;
             league.Description = viewLeague.LeagueDescription;
             league.RegionID = viewLeague.RegionID;
             viewLeague.LeagueID = BizMgr.SaveLeague(league);
             BizMgr.SaveUserLeague(viewLeague.LeagueID, this.CurrentUser.SystemUserID);
         }
         catch (Exception ex)
         {
             LogController.LogError(ex, LogEntryType.NormalError, "", "", "", "League=" + viewLeague.LeagueID.ToString());
             return PartialView("_League", viewLeague);
         }
     }
     else
     {
         viewLeague.Regions = GetRegions(viewLeague.RegionID);
         return PartialView("_League", viewLeague);
     }
     return PartialView("_League", GetLeague(viewLeague.LeagueID));
 }
예제 #2
0
 public ActionResult LeagueSearch(int UserTeamID)
 {
     ViewLeague vl = new ViewLeague();
     vl.Regions = GetRegions(0);
     vl.UserTeamID = UserTeamID;
     return PartialView("_LeagueSearch", vl);
 }
예제 #3
0
 private List<ViewLeague> GetViewLeaguesFromLeagues(LeagueCollection leagues)
 {
     List<ViewLeague> vls = new List<ViewLeague>();
     ViewLeague vl;
     foreach (League l in leagues)
     {
         vl = new ViewLeague();
         vl.LeagueDescription = l.Description;
         vl.LeagueName = l.LeagueName;
         vl.LeagueID = l.LeagueID;
         vl.RegionAbbrev = l.RegionAbbrev;
         vls.Add(vl);
     }
     return vls;
 }
예제 #4
0
 private List<ViewLeague> GetLeagues()
 {
     LeagueCollection leagues = BizMgr.GetLeaguesBySystemUserID(this.CurrentUser.SystemUserID);
     List<ViewLeague> vls = new List<ViewLeague>();
     ViewLeague vl;
     foreach (League league in leagues)
     {
         vl = new ViewLeague();
         vl.LeagueName = league.LeagueName;
         vl.RegionID = league.RegionID;
         vl.LeagueDescription = league.Description;
         vl.LeagueID = league.LeagueID;
         vl.RegionAbbrev = league.RegionAbbrev;
         vl.IsAdmin = league.IsAdmin;
         vls.Add(vl);
     }
     return vls;
 }
예제 #5
0
 private ViewLeague GetLeague(int LeagueID)
 {
     League league = BizMgr.GetLeague(LeagueID);
     ViewLeague vl = new ViewLeague();
     vl.LeagueName = league.LeagueName;
     vl.RegionID = league.RegionID;
     vl.Regions = GetRegions(league.RegionID);
     vl.LeagueDescription = league.Description;
     vl.LeagueID = league.LeagueID;
     vl.RegionAbbrev = league.RegionAbbrev;
     return vl;
 }
예제 #6
0
 private List<ViewLeague> GetLeagues(ViewLeague viewLeague)
 {
     SeasonCollection seasons = BizMgr.GetSeasonsBySearch(viewLeague.LeagueName, viewLeague.RegionID);
     ViewLeague vl = null;
     List<ViewLeague> vls = new List<ViewLeague>();
     foreach (Season season in seasons)
     {
         vl = new ViewLeague();
         vl.EndDate = season.EndDate;
         vl.LeagueName = season.LeagueName;
         vl.LeagueDescription = season.LeagueDescription;
         vl.SeasonDescription = season.Description;
         vl.StartDate = season.StartDate;
         vl.SeasonID = season.SeasonID;
         vls.Add(vl);
     }
     return vls;
 }
예제 #7
0
 public ActionResult TeamLeagueRequest(ViewLeague vl)
 {
     ViewTeamLeagueRequest vtlr = new ViewTeamLeagueRequest();
     vtlr.ViewLeagues = GetLeagues(vl);
     vtlr.UserTeamID = vl.UserTeamID;
     return PartialView("_TeamLeagueRequest", vtlr);
 }