Esempio n. 1
0
        private void ShowChildren(TreeListNode _fnode, MD_RightDefine _fRight)
        {
            MC_FindRightByStr     _finder          = new MC_FindRightByStr(_fRight.RightID);
            List <MD_RightDefine> _childRightItems = RightData.FindAll(new Predicate <MD_RightDefine>(_finder.FindByFatherID));

            _childRightItems.Sort(new MC_RightComparer());
            foreach (MD_RightDefine _rd in _childRightItems)
            {
                TreeListNode _dwnode = this.treeList1.AppendNode(null, _fnode);
                _dwnode.SetValue(this.treeListColumn1, _rd.RightName);
                _dwnode.ImageIndex       = 0;
                _dwnode.SelectImageIndex = 2;
                _dwnode.Tag = _rd;
                ShowChildren(_dwnode, _rd);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 显示授权树
        /// </summary>
        private void ShowRightData()
        {
            this.treeList1.BeginUpdate();
            this.treeList1.Nodes.Clear();
            MC_FindRightByStr     _finder        = new MC_FindRightByStr("");
            List <MD_RightDefine> _topRightItems = RightData.FindAll(new Predicate <MD_RightDefine>(_finder.FindByFatherID));

            _topRightItems.Sort(new MC_RightComparer());
            foreach (MD_RightDefine _rd in _topRightItems)
            {
                TreeListNode _dwnode = this.treeList1.AppendNode(null, null);
                _dwnode.SetValue(this.treeListColumn1, _rd.RightName);
                _dwnode.ImageIndex       = 1;
                _dwnode.SelectImageIndex = 2;
                _dwnode.Tag = _rd;
                ShowChildren(_dwnode, _rd);
            }
            this.treeList1.ExpandAll();
            this.treeList1.EndUpdate();
        }