Пример #1
0
        internal static List <BranchHolder> GetAllBranches()
        {
            var cacheKey  = MarsV2Cache.MarsBranchList;
            var cacheItem = MarsV2Cache.GetCacheObject(cacheKey);

            if ((ConfigAccess.ByPassCache()) || (cacheItem == null))
            {
                cacheItem = ParameterDataAccess.GetAllBranches();
                MarsV2Cache.AddObjectToCache(cacheKey, cacheItem);
            }

            return((List <BranchHolder>)cacheItem);
        }
Пример #2
0
        public List <string> GetBranchList(string prefixText, int count)
        {
            if (_branchData == null)
            {
                _branchData = ParameterDataAccess.GetAllBranches();
            }

            //Only return those that begin with the prefixText passed in
            var res = (from lg in _branchData
                       where lg.BranchCode.ToLower().StartsWith(prefixText.ToLower())
                       select lg.BranchCode);

            return(res.Take(count).ToList());
        }