Exemplo n.º 1
0
        private void MakeNodel(IList <RoleDTO.Node> root, SysFunctionInfo currentSource
                               , IList <SysFunctionInfo> allSource)
        {
            var node = new RoleDTO.Node()
            {
                id   = currentSource.Id,
                text = currentSource.Name
            };

            root.Add(node);
            var childList = allSource.Where(c => c.Parent == currentSource.Id);

            if (childList.Count() > 0)
            {
                IList <RoleDTO.Node> child = new List <RoleDTO.Node>();
                node.children = child;
                foreach (var item in childList)
                {
                    MakeNodel(child, item, allSource);
                }
            }
        }
Exemplo n.º 2
0
 private void MakeNodel(IList<RoleDTO.Node> root, SysFunctionInfo currentSource
    , IList<SysFunctionInfo> allSource)
 {
     var node = new RoleDTO.Node()
     {
         id = currentSource.Id,
         text = currentSource.Name
     };
     root.Add(node);
     var childList = allSource.Where(c => c.Parent == currentSource.Id);
     if (childList.Count() > 0)
     {
         IList<RoleDTO.Node> child = new List<RoleDTO.Node>();
         node.children = child;
         foreach (var item in childList)
         {
             MakeNodel(child, item, allSource);
         }
     }
 }