Exemplo n.º 1
0
        public ActionResult SaveTeamLeagueRequest(int SeasonID, int UserTeamID)
        {
            BizMgr.SaveTeamLeagueRequest(SeasonID, UserTeamID);
            ViewTeam vt = new ViewTeam();
            Season s = BizMgr.GetSeason(SeasonID);
            Team t = BizMgr.GetTeamByUserTeamID(UserTeamID);

            vt.LeagueName = s.LeagueName;
            vt.TeamName = t.TeamName;
            vt.SeasonDescription = s.Description + "(" + s.StartDate.ToShortDateString() + " - " + s.EndDate.ToShortDateString() + ")";
            return PartialView("_RequestConfirmation", vt);
        }
Exemplo n.º 2
0
        public ActionResult SaveTeam(ViewTeam model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Team team = new Team();
                    team.TeamID = model.TeamID;
                    team.TeamName = model.TeamName;
                    team.Abbrev = model.Abbrev;
                    team.HomePoolConfigID = model.HomePoolConfigID;
                    model.TeamID = BizMgr.SaveTeam(team);

                    BizMgr.SaveUserTeam(model.TeamID, this.CurrentUser.SystemUserID);
                }
            }
            catch (Exception ex)
            {
                LogController.LogError(ex, LogEntryType.NormalError, "", "", "", "Team=" + model.TeamID.ToString());
            }
            return PartialView("_Teams", GetTeams());
        }
Exemplo n.º 3
0
        private ViewTeams GetHeatSheetTeams(int PoolConfigID, int SwimMeetID)
        {
            ViewTeams vts = new ViewTeams();
            PoolConfig ppc = BizMgr.GetPoolConfig(PoolConfigID);
            vts.LaneCount = ppc.LaneCount;
            vts.SwimMeetID = SwimMeetID;

            ViewTeam vt = null;
            TeamCollection teams = BizMgr.GetTeamsBySwimMeetID(SwimMeetID);
            foreach (Team team in teams)
            {
                vt = new ViewTeam();
                vt.Abbrev = team.Abbrev;
                vt.TeamID = team.TeamID;
                vt.TeamSeasonID = team.TeamSeasonID;
                vt.TeamName = team.TeamName;
                vt.TeamNameAbbrev = team.TeamNameAbbrev;
                vts.ViewTeamList.Add(vt);
            }
            return vts;
        }
Exemplo n.º 4
0
 public ActionResult SwimmerTeamRequest(ViewTeam vt)
 {
     ViewBag.Teams = GetTeams(vt);
     return PartialView("_SwimmerTeamRequest");
 }
Exemplo n.º 5
0
 private ViewTeam GetTeamSeason(int TeamSeasonID)
 {
     ViewTeam vt = new ViewTeam();
     Team team = BizMgr.GetTeamByTeamSeasonID(TeamSeasonID);
     vt.TeamName = team.TeamName;
     vt.SeasonDescription = team.SeasonDescription;
     return vt;
 }
Exemplo n.º 6
0
 private ViewTeams GetTeams(ViewTeam viewTeam)
 {
     TeamCollection teams = BizMgr.GetTeamBySearch(viewTeam.Address, viewTeam.City, viewTeam.PostalCode, viewTeam.RegionID, viewTeam.TeamName);
     ViewTeams vts = new ViewTeams();
     vts.UserSwimmerID = viewTeam.UserSwimmerID;
     ViewTeam vt = null;
     foreach (Team team in teams)
     {
         vt = new ViewTeam();
         vt.Address = team.Address;
         vt.City = team.City;
         vt.EndDate = team.EndDate;
         vt.LeagueName = team.LeagueName;
         vt.LocationName = team.LocationName;
         vt.PostalCode = team.PostalCode;
         vt.SeasonDescription = team.SeasonDescription;
         vt.StartDate = team.StartDate;
         vt.TeamNameAbbrev = team.TeamNameAbbrev;
         vt.TeamSeasonID = team.TeamSeasonID;
         vts.ViewTeamList.Add(vt);
     }
     return vts;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Returns all the teams with a current or future TeamSeason record containing the given LeagueID
 /// </summary>
 /// <param name="SeasonID"></param>
 /// <returns></returns>
 private List<ViewTeam> GetViewTeamList(int SeasonID)
 {
     List<ViewTeam> vts = new List<ViewTeam>();
     ViewTeam vt;
     TeamCollection teams = BizMgr.GetTeamsBySeasonID(SeasonID);
     foreach (Team t in teams)
     {
         vt = new ViewTeam();
         vt.Abbrev = t.Abbrev;
         vt.TeamID = t.TeamID;
         vt.TeamSeasonID = t.TeamSeasonID;
         vt.TeamName = t.TeamName;
         vts.Add(vt);
     }
     return vts;
 }
Exemplo n.º 8
0
        private List<ViewTeam> GetTeamSeasons(int SeasonID)
        {
            TeamCollection teams = BizMgr.GetTeamsBySeasonID(SeasonID);
            List<ViewTeam> vts = new List<ViewTeam>();
            ViewTeam vt = null;
            PoolConfig homePoolConfig = null;
            foreach (Team team in teams)
            {
                vt = new ViewTeam();
                vt.TeamName = team.TeamName;
                vt.Abbrev = team.Abbrev;
                vt.TeamNameAbbrev = team.TeamNameAbbrev;
                vt.LocationName = team.LocationName;
                vt.PostalCode = team.PostalCode;

                homePoolConfig = BizMgr.GetPoolConfig(team.HomePoolConfigID);
                vt.HomePoolConfig.LengthDescription = homePoolConfig.LengthDescription;
                vt.HomePoolConfig.LaneCount = homePoolConfig.LaneCount;
                vt.Address = homePoolConfig.Address;
                vt.CityStateZip = homePoolConfig.CityStateZip;
                vts.Add(vt);
            }
            return vts;
        }
Exemplo n.º 9
0
 /// <summary>
 /// Returns TeamLeagueRequests for the CurentUser's SystemUserID
 /// </summary>
 /// <param name="SeasonID"></param>
 /// <returns></returns>
 private List<ViewTeam> GetTeamLeagueRequests(int SeasonID)
 {
     List<ViewTeam> vts = new List<ViewTeam>();
     ViewTeam vt = null;
     TeamCollection teams = BizMgr.GetTeamLeagueRequestsBySeasonIDSystemUserID(SeasonID, this.CurrentUser.SystemUserID);
     foreach (Team team in teams)
     {
         vt = new ViewTeam();
         vt.TeamNameAbbrev = team.TeamNameAbbrev;
         vt.LocationName = team.LocationName;
         vt.UserTeamID = team.UserTeamID;
         vt.TeamLeagueRequestID = team.TeamLeagueRequestID;
         vt.SeasonID = SeasonID;
         vts.Add(vt);
     }
     return vts;
 }
Exemplo n.º 10
0
        private ViewTeams GetTeams()
        {
            TeamCollection Teams = BizMgr.GetTeamsBySystemUserID(this.CurrentUser.SystemUserID);
            ViewTeams vts = new ViewTeams();
            ViewTeam vt;
            PoolConfig homePoolConfig = null;
            foreach (Team Team in Teams)
            {
                vt = new ViewTeam();
                vt.TeamName = Team.TeamName;
                vt.Abbrev = Team.Abbrev;
                vt.TeamID = Team.TeamID;
                vt.LocationName = Team.LocationName;
                vt.UserTeamID = Team.UserTeamID;
                vt.IsAdmin = Team.IsAdmin;

                homePoolConfig = BizMgr.GetPoolConfig(Team.HomePoolConfigID);
                vt.HomePoolConfig.LengthDescription = homePoolConfig.LengthDescription;
                vt.HomePoolConfig.LaneCount = homePoolConfig.LaneCount;
                vt.Address = homePoolConfig.Address;
                vt.CityStateZip = homePoolConfig.CityStateZip;
                vts.ViewTeamList.Add(vt);
            }

            return vts;
        }
Exemplo n.º 11
0
 private ViewTeam GetTeam(int UserTeamID)
 {
     Team Team = BizMgr.GetTeamByUserTeamID(UserTeamID);
     ViewTeam vt = new ViewTeam();
     vt.TeamName = Team.TeamName;
     vt.Abbrev = Team.Abbrev;
     vt.TeamID = Team.TeamID;
     vt.UserTeamID = Team.UserTeamID;
     return vt;
 }