Пример #1
0
 public void AddChild(TreeNode node)
 {
     this.ChildNodes.Add(node);
     node.Tree = this.Tree;
     node.Parent = this;
 }
Пример #2
0
        public static TreeNode GetNode(Employee item, IEnumerable<Employee> items)
        {
            TreeNode node = new TreeNode()
            {
                ThumbImageUrl = "/public/userfiles/employees/1.jpg",
                Title = item.FullName,
                Caption = item.JobTitleName,
                Action = "Card",
                Controller = "Employees",
                Id = item.Id
            };


            IEnumerable<Employee> employees = items
                .Where(x => x.Manager != null && x.Manager.Id == item.Id).ToArray();

            foreach (Employee employee in employees)
            {
                node.AddChild(GetNode(employee, items));
            }

            return node;
        }
Пример #3
0
 public void AddNode(TreeNode node)
 {
     this.Nodes.Add(node);
     node.Tree = this;
 }