示例#1
0
        private IEnumerable <Team> GetTeamsByRoundPrivate(int roundId)
        {
            Round round = DalRound.GetRound(roundId);

            if (round == null)
            {
                return(new Team[0]);
            }

            if (string.IsNullOrWhiteSpace(round.TeamList))
            {
                return(DalTeam.GetTeams());
            }

            var teamIds = JsonConvert.DeserializeObject <int[]>(round.TeamList);

            if (teamIds == null)
            {
                return(new Team[0]);
            }

            if (teamIds.Length == 0)
            {
                return(DalTeam.GetTeams());
            }

            return(DalTeam.GetTeams(teamIds));
        }
示例#2
0
        public IEnumerable <Team> SearchByDefault(string text, int roundId)
        {
            Round round = DalRound.GetRound(roundId);

            if (round == null)
            {
                return(new Team[0]);
            }

            if (string.IsNullOrWhiteSpace(round.TeamList))
            {
                return(SearchByDefault(text));
            }

            var teamIds = JsonConvert.DeserializeObject <int[]>(round.TeamList);

            if (teamIds == null)
            {
                return(new Team[0]);
            }

            if (teamIds.Length == 0)
            {
                return(SearchByDefault(text));
            }

            return(DalTeam.SearchByDefault(text, teamIds));
        }
示例#3
0
        public IEnumerable <Team> GetTeams(IEnumerable <int> ids)
        {
            string cacheKey = GetStringKey("GetTeams", ids);

            IEnumerable <Team> result = Cache.GetOrCreate(cacheKey, () => { return(DalTeam.GetTeams(ids)); });

            return(result);
        }
示例#4
0
        public IEnumerable <Team> SearchByTypeDefault(string text, int typeId)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                return(new Team[0]);
            }

            return(DalTeam.SearchByTypeDefault(text, typeId));
        }
示例#5
0
        //public long DeleteData()
        //{
        //    DalTeam dalTeam = new DalTeam();
        //    long status;
        //    status = 0;
        //    try
        //    {
        //        status = dalTeam.DeleteTeam(this);
        //        dalTeam = null;
        //    }
        //    catch (Exception ex)
        //    {
        //    }
        //    return status;
        //}
        //public void SelectData()
        //{
        //    DalTeam dalTeam = new DalTeam();
        //    ITeam iTeam;
        //    iTeam = (ITeam)dalTeam.SelectTeam(this);
        //    //_ShortName = iTeam.ShortName;
        //    //_Name = iTeam.Name;
        //    //_Address1 = iTeam.Address1;
        //    //_Address2 = iTeam.Address2;
        //    //_Address3 = iTeam.Address3;
        //    //_Active = iTeam.Active;
        //    dalTeam = null;
        //}
        public DataTable SelectAllData()
        {
            DataTable dtbl    = new DataTable();
            DalTeam   dalTeam = new DalTeam();

            dtbl    = dalTeam.SelectAllTeam(this);
            dalTeam = null;
            return(dtbl);
        }
示例#6
0
        public long DeleteData()
        {
            _UserAction = 3;
            DalTeam dalTeam = new DalTeam();
            long    status;

            status = 0;
            try
            {
                status  = dalTeam.DeleteTeam(this);
                dalTeam = null;
            }
            catch (Exception ex)
            {
            }
            return(status);
        }
示例#7
0
        public long UpdateData()
        {
            DalTeam dalTeam = new DalTeam();
            long    status;

            status = 0;
            try
            {
                _UserAction = 2;
                status      = dalTeam.UpdateTeam(this);
                dalTeam     = null;
            }
            catch (Exception ex)
            {
            }
            return(status);
        }
示例#8
0
 public Team GetTeam(int id)
 {
     return(DalTeam.GetTeam(id));
 }
示例#9
0
 public int SaveTeam(Team entity)
 {
     return(DalTeam.SaveTeam(entity));
 }
示例#10
0
 public IEnumerable <Team> GetTeams()
 {
     return(DalTeam.GetTeams());
 }
示例#11
0
 public IEnumerable <Team> GetTeamsByTypeAndParent(int teamTypeId, int parentTeamId)
 {
     return(DalTeam.GetTeamsByTypeAndParent(teamTypeId, parentTeamId));
 }
示例#12
0
 public IEnumerable <Team> GetTeamsByType(int teamTypeId)
 {
     return(DalTeam.GetTeamsByType(teamTypeId));
 }