コード例 #1
0
 public CategoryCollection GetCategoryTreeByProjectId(int projectId)
 {
     _SortedCats   = new CategoryCollection();
     _UnSortedCats = Category.GetCategoryByProjectId(projectId);
     foreach (Category parentCat in GetTopLevelCategories())
     {
         _SortedCats.Add(parentCat);
         BindSubCategories(parentCat.Id);
     }
     return(_SortedCats);
 }
コード例 #2
0
        CategoryCollection GetChildCategories(int parentId)
        {
            CategoryCollection colCats = new CategoryCollection();

            foreach (Category cat in _UnSortedCats)
            {
                if (cat.ParentCategoryId == parentId)
                {
                    colCats.Add(cat);
                }
            }
            return(colCats);
        }
コード例 #3
0
        CategoryCollection GetTopLevelCategories()
        {
            CategoryCollection colCats = new CategoryCollection();

            foreach (Category cat in _UnSortedCats)
            {
                if (cat.ParentCategoryId == 0)
                {
                    colCats.Add(cat);
                }
            }
            return(colCats);
        }