public static IList <CategoryInfo> GetSubCategories(int parentCategoryId) { IList <CategoryInfo> list = new List <CategoryInfo>(); System.Data.DataTable categories = SubsiteCatalogHelper.GetCategories(); System.Data.DataRow[] array = categories.Select("ParentCategoryId = " + parentCategoryId.ToString()); for (int i = 0; i < array.Length; i++) { list.Add(DataMapper.ConvertDataRowToProductCategory(array[i])); } return(list); }
public static IList <CategoryInfo> GetMainCategories() { IList <CategoryInfo> list = new List <CategoryInfo>(); System.Data.DataTable categories = SubsiteCatalogHelper.GetCategories(); System.Data.DataRow[] array = categories.Select("Depth = 1"); for (int i = 0; i < array.Length; i++) { list.Add(DataMapper.ConvertDataRowToProductCategory(array[i])); } return(list); }