Пример #1
0
        public List<Model.Info> GetAllInfoByCategoryID(int categoryID, List<Model.Info> infoList)
        {
            List<Model.Info> modelListBlank = new List<Model.Info>();
            try
            {
                List<Model.Info> il = this.GetModelList("categoryID=" + categoryID.ToString());
                foreach (Model.Info m_temp in il)
                {
                    infoList.Add(m_temp);
                }

                CategoryExt bllCategory = new CategoryExt();
                List<Model.Category> subCategoryList = bllCategory.GetSubCategory(categoryID);
                foreach (Model.Category subCategory in subCategoryList)
                {
                    GetAllInfoByCategoryID(subCategory.CategoryID, infoList);
                }

                if (infoList != null && infoList.Count > 0)
                {
                    infoList.Sort(delegate(Model.Info m1, Model.Info m2) { return m2.InfoID.CompareTo(m1.InfoID); });
                    return infoList;
                }
                else
                {
                    return modelListBlank;
                }
            }
            catch
            {
                return modelListBlank;
            }
            finally
            {
                infoList = null;
            }
        }