예제 #1
0
 public WHSection GetSection(string areaCode, string sectionCode)
 {
     if (string.IsNullOrEmpty(sectionCode) || sectionCode.Trim().Length <= 0 || string.IsNullOrEmpty(areaCode) || areaCode.Trim().Length <= 0)
     {
         return(null);
     }
     DataRow[] rows = _ds.Tables["s"].Select("AreaCode='" + areaCode.Trim() + "' and SectionCode='" + sectionCode.Trim() + "'");
     if (rows != null && rows.Length > 0)
     {
         return(WHSection.Row2Entity(rows[0]));
     }
     else
     {
         return(null);
     }
 }
예제 #2
0
        public IList <WHSection> GetSections(string areaCode)
        {
            IList <WHSection> lists = new List <WHSection>();

            if (string.IsNullOrEmpty(areaCode) || areaCode.Trim().Length <= 0)
            {
                return(lists);
            }
            DataRow[] rows = _ds.Tables["s"].Select("AreaCode='" + areaCode.Trim() + "'", "SectionCode ASC");
            if (rows == null || rows.Length <= 0)
            {
                return(lists);
            }
            foreach (DataRow row in rows)
            {
                lists.Add(WHSection.Row2Entity(row));
            }
            return(lists);
        }