コード例 #1
0
 private void GetSelectedChildren(TreeListNode _fnode, List <UserRightInfo> _ret)
 {
     foreach (TreeListNode _node in _fnode.Nodes)
     {
         TObj_RightItem _ritem = treeList2.GetDataRecordByNode(_node) as TObj_RightItem;
         if (_ritem.HaveRight)
         {
             _ret.Add(_ritem.Data);
         }
         GetSelectedChildren(_node, _ret);
     }
 }
コード例 #2
0
        private void AddChildrenRightItem(TObj_RightItem _fitem, List <UserRightInfo> _rightList)
        {
            UserRightFinder      _finder         = new UserRightFinder(_fitem.ID);
            List <UserRightInfo> _ChildRightList = _rightList.FindAll(new Predicate <UserRightInfo>(_finder.FindByFatherID));

            _ChildRightList.Sort(new UserRightInfoComparer());
            foreach (UserRightInfo _ri in _ChildRightList)
            {
                TObj_RightItem _ritem = new TObj_RightItem(_ri);
                _fitem.Children.Add(_ritem);
                AddChildrenRightItem(_ritem, _rightList);
            }
        }
コード例 #3
0
        /// <summary>
        /// 取用户选择的所有功能权限
        /// </summary>
        /// <returns></returns>
        private List <UserRightInfo> GetSelectedFunctionRights()
        {
            List <UserRightInfo> _ret = new List <UserRightInfo>();

            foreach (TreeListNode _node in this.treeList2.Nodes)
            {
                TObj_RightItem _ritem = treeList2.GetDataRecordByNode(_node) as TObj_RightItem;
                if (_ritem.HaveRight)
                {
                    _ret.Add(_ritem.Data);
                }
                GetSelectedChildren(_node, _ret);
            }
            return(_ret);
        }
コード例 #4
0
 private void InitRigtTree()
 {
     if (CurrentPost != null)
     {
         using (SinoSZClientBase.UserManagerService.UserManagerServiceClient _umsc = new SinoSZClientBase.UserManagerService.UserManagerServiceClient())
         {
             List <UserRightInfo> _rightList    = _umsc.GetRightListByPostID(CurrentPost.PostID).ToList <UserRightInfo>();
             UserRightFinder      _finder       = new UserRightFinder("-1");
             List <UserRightInfo> _TopRightList = _rightList.FindAll(new Predicate <UserRightInfo>(_finder.FindByFatherID));
             _TopRightList.Sort(new UserRightInfoComparer());
             TObj_RightItemList RightList = new TObj_RightItemList();
             foreach (UserRightInfo _ri in _TopRightList)
             {
                 TObj_RightItem _ritem = new TObj_RightItem(_ri);
                 RightList.Add(_ritem);
                 AddChildrenRightItem(_ritem, _rightList);
             }
             this.treeList2.BeginUpdate();
             this.treeList2.DataSource = RightList;
             this.treeList2.ExpandAll();
             this.treeList2.EndUpdate();
         }
     }
 }