GetCategoriesByParentId() public method

public GetCategoriesByParentId ( int parentCategroyId ) : CategoriesDataComponent.CategoriesDataTable
parentCategroyId int
return CategoriesDataComponent.CategoriesDataTable
Example #1
0
        private static void FetchCategoriesRecursively(bool recursing, List<CachedCategory> list, CategoriesDB db, int categoryId, string levelPrefix)
        {
            CategoriesDataComponent.CategoriesDataTable subCategories = db.GetCategoriesByParentId(categoryId);

            if (subCategories != null)
            {
                string categoryIdString = categoryId.ToString();
                foreach (CategoriesDataComponent.CategoriesRow category in subCategories)
                {
                    list.Add(new CachedCategory(category.Name, category.Id, categoryId, category.NumActiveAds, levelPrefix));

                    if (recursing)
                        FetchCategoriesRecursively(recursing, list, db, category.Id, levelPrefix + "--");
                }
            }
        }