Пример #1
0
 private Categories(BL.Category category, Categories parent)
 {
     this.Parent = parent;
     this.Root = parent.Root;
     this.Name = category.Name;
     this.ID = category.CategoryID;
     this.sort = category.Sort;
     this.level = parent.level + 1;
     AllCategories = Root.AllCategories;
 }
Пример #2
0
        List<Categories> GetCategoriesTree(Categories node)
        {
            List<Categories> result = new List<Categories>();
            var childs = node.ChildCategories;

            foreach (var item in childs)
            {
                result.Add(item);
                result.AddRange(GetCategoriesTree(item));
            }

            return result;
        }