Пример #1
0
        public List <ASECTION> loadSectionsBySegmentID(CommObjCacheManager cache, string segment_num)
        {
            var query = from section in cache.getSections()
                        where section.SEG_NUM == segment_num.Trim()
                        select section;

            return(query.ToList());
        }
Пример #2
0
        public List <ASECTION> loadByFromAdr(CommObjCacheManager cache, string from_adr)
        {
            var query = from section in cache.getSections()
                        where section.FROM_ADR_ID.Trim() == from_adr.Trim()
                        select section;

            return(query.ToList());
        }
Пример #3
0
        public ASECTION getFirstSecBySegmentID(CommObjCacheManager cache, string seg_id)
        {
            var query = from section in cache.getSections()
                        where section.SEG_NUM == seg_id.Trim()
                        orderby section.SEG_ORDER_NUM
                        select section;

            return(query.FirstOrDefault());
        }
Пример #4
0
        public List <ASECTION> loadSecBySecIds(CommObjCacheManager cache, List <string> sec_ids)
        {
            var query = from sec in cache.getSections()
                        //where sec_ids.Any(s => sec.SEC_ID.Contains(s.Trim()))
                        where sec_ids.Contains(sec.SEC_ID.Trim())
                        select sec;

            return(query.ToList());
        }
Пример #5
0
        public ASECTION getByID(CommObjCacheManager cache, String section_id)
        {
            var query = from s in cache.getSections()
                        where s.SEC_ID.Trim() == section_id.Trim()
                        orderby s.SEC_ID
                        select s;

            return(query.FirstOrDefault());
        }
 public List <ASECTION> loadSectionsBySegmentID(string id)
 {
     return(CommObjCacheManager.getSections().
            Where(sec => sec.SEG_NUM.Trim() == id.Trim()).
            OrderBy(sec => sec.SEG_ORDER_NUM).
            ToList());
 }
Пример #7
0
        public List <ASECTION> loadByFromAdrs(CommObjCacheManager cache, List <string> from_adrs)
        {
            if (from_adrs == null || from_adrs.Count == 0)
            {
                return(null);
            }
            var query = from section in cache.getSections()
                        //where to_adrs.Contains(section.TO_ADR_ID.Trim())
                        where from_adrs.Any(from_adr => from_adr.Trim() == section.FROM_ADR_ID.Trim())
                        select section;

            return(query.ToList());
        }
Пример #8
0
        public List <ASECTION> loadByFromOrToAdr(CommObjCacheManager cache, string adr)
        {
            if (string.IsNullOrWhiteSpace(adr))
            {
                return(null);
            }
            var query = from s in cache.getSections()
                        where s.FROM_ADR_ID.Trim() == adr.Trim() ||
                        s.TO_ADR_ID.Trim() == adr.Trim()
                        orderby s.SEC_ID
                        select s;

            return(query.ToList());
        }
Пример #9
0
        public ASECTION getByFromToAdr(CommObjCacheManager cache, string from_adr, string to_adr)
        {
            if (string.IsNullOrWhiteSpace(from_adr) ||
                string.IsNullOrWhiteSpace(to_adr))
            {
                return(null);
            }
            var query = from s in cache.getSections()
                        where s.FROM_ADR_ID.Trim() == from_adr.Trim() &&
                        s.TO_ADR_ID.Trim() == to_adr.Trim()
                        orderby s.SEC_ID
                        select s;

            return(query.FirstOrDefault());
        }
Пример #10
0
 public List <ASECTION> loadAllSection(CommObjCacheManager cache)
 {
     return(cache.getSections());
 }
 public List <ASECTION> GetSectionBySegmentID(string id)
 {
     return(CommObjCacheManager.getSections().
            Where(sec => sec.SEG_NUM.Trim() == id.Trim()).
            ToList());
 }