Example #1
0
 public Node GetCameraNodes(UserInfo user)
 {
     var node = new Node();
     if (m_LogicCameraNodes.ContainsKey(user.LoginName))
     {
         m_LogicCameraNodes.TryGetValue(user.LoginName, out node);
     }
     else
     {
         var rights = RightMaintenance.Instance.FilterUserNodeRight(user);
         rights = rights.Where(r => r.SysFlag != UNSYSFLAG).ToList();
         node = CreateTree(rights, MultilingualUtility.GetString("Camera"), SYSFLAG);
     }
     return node;
 }
Example #2
0
 private void RurCreateNode(Node parent, IList<UserNodeRight> rights)
 {
     var childs = rights.Where(r => r.ParentIdx.ToString() == parent.NodeId)
         .OrderBy(r => r.ShowOrder)
         .ThenBy(r => r.Name)
         .ToList();
     foreach (var child in childs)
     {
         var childNode = CreateNode(child);
         parent.Children.Add(childNode);
         RurCreateNode(childNode, rights);
     }
 }
Example #3
0
 private Node CreateNode(UserNodeRight right)
 {
     var node = new Node();
     node.Id = right.Id;
     node.NodeId = right.Idx.ToString();
     node.Name = right.Name;
     node.Type = right.Type.ToString();
     node.DBHostIdx = right.DBHostIdx;
     return node;
 }
Example #4
0
 private Node CreateRoot(String rootName)
 {
     var node = new Node();
     node.Id = ROOT;
     node.Key = ROOT;
     node.NodeId = ROOT;
     node.DBHostIdx = -1;
     node.Name = rootName;
     node.Type = DataTypeEnum.Host.ToString();
     return node;
 }