private List <UserQueryModelInfo> GetSelectedModelRights() { List <UserQueryModelInfo> _ret = new List <UserQueryModelInfo>(); foreach (TreeListNode _node in this.treeList3.Nodes) { TObj_ModelRightItem _ritem = treeList3.GetDataRecordByNode(_node) as TObj_ModelRightItem; if (_ritem.HaveRight) { _ret.Add(_ritem.Data); } } return(_ret); }
private void InitQueryViewRightTree() { if (CurrentPost != null) { using (SinoSZClientBase.UserManagerService.UserManagerServiceClient _umsc = new SinoSZClientBase.UserManagerService.UserManagerServiceClient()) { List <UserQueryModelInfo> _qvRightList = _umsc.GetModelRightListByPostID(CurrentPost.PostID).ToList <UserQueryModelInfo>(); TObj_ModelRightList _qvRights = new TObj_ModelRightList(); foreach (UserQueryModelInfo _qmRight in _qvRightList) { TObj_ModelRightItem _ritem = new TObj_ModelRightItem(_qmRight); _qvRights.Add(_ritem); } this.treeList3.BeginUpdate(); this.treeList3.DataSource = _qvRights; this.treeList3.EndUpdate(); } } }
private void InitQueryViewRightTree(SinoRole _sr) { using (SinoSZClientBase.UserManagerService.UserManagerServiceClient _umsc = new SinoSZClientBase.UserManagerService.UserManagerServiceClient()) { List <UserQueryModelInfo> _qvRightList = _umsc.GetModelRightListByRoleID(_sr.RoleID).ToList <UserQueryModelInfo>(); TObj_ModelRightList _qvRights = new TObj_ModelRightList(); foreach (UserQueryModelInfo _qmRight in _qvRightList) { string _qvname = string.Format("{0}.{1}", _qmRight.QueryModelNamespace, _qmRight.QueryModelName); if (this.CanUseQueryModelNames.Contains(_qvname)) { TObj_ModelRightItem _ritem = new TObj_ModelRightItem(_qmRight); _qvRights.Add(_ritem); } } this.treeList3.BeginUpdate(); this.treeList3.DataSource = _qvRights; this.treeList3.EndUpdate(); } }