Ejemplo n.º 1
0
        public static IList <CategoryInfo> GetAllCategorieList()
        {
            IList <CategoryInfo> list = new List <CategoryInfo>();

            System.Data.DataTable categories = CatalogHelper.GetCategories();
            System.Data.DataRow[] array      = categories.Select("");
            for (int i = 0; i < array.Length; i++)
            {
                list.Add(DataMapper.ConvertDataRowToProductCategory(array[i]));
            }
            return(list);
        }
Ejemplo n.º 2
0
        public static IList <CategoryInfo> GetSubCategories(int parentCategoryId)
        {
            IList <CategoryInfo> list = new List <CategoryInfo>();
            string filterExpression   = "ParentCategoryId = " + parentCategoryId.ToString(CultureInfo.InvariantCulture);

            System.Data.DataTable categories = CatalogHelper.GetCategories();
            System.Data.DataRow[] array      = categories.Select(filterExpression);
            for (int i = 0; i < array.Length; i++)
            {
                list.Add(DataMapper.ConvertDataRowToProductCategory(array[i]));
            }
            return(list);
        }
Ejemplo n.º 3
0
 public static System.Data.DataTable GetCategoryisChirldren(int categoryId)
 {
     System.Data.DataTable categories = CatalogHelper.GetCategories();
     System.Data.DataTable dataTable  = categories.Clone();
     if (categoryId > 0)
     {
         CategoryInfo          category = CatalogHelper.GetCategory(categoryId);
         System.Data.DataRow[] array    = categories.Select(string.Concat(new object[]
         {
             "CategoryId=",
             categoryId,
             " OR [Path] like '",
             category.Path,
             "|%'"
         }));
         dataTable.Rows.Clear();
         for (int i = 0; i < array.Length; i++)
         {
             dataTable.Rows.Add(array[i].ItemArray);
         }
     }
     return(dataTable);
 }