/// <summary> /// 得到某一级组织的子对象 /// </summary> /// <param name="requestParams"></param> /// <param name="addedAction">添加了树节点以后的回调</param> /// <returns></returns> public static List <UserGraphTreeNode> GetChildren(UserGraphTreeParams requestParams, Func <IOguObject, bool> filter = null, Action <IOguObject, UserGraphTreeNode> addedAction = null) { List <UserGraphTreeNode> childNodes = new List <UserGraphTreeNode>(); requestParams.DoServiceCall(rp => { IOrganization parent = GetOrganization(requestParams); parent.Children.FillChildNodes(childNodes, requestParams.ListMask, filter, addedAction); }); return(childNodes); }
/// <summary> /// 得到根组织,如果传入的根组织路径为空,则返回系统组织架构树的根 /// </summary> /// <param name="fullPath"></param> /// <param name="requestParams"></param> /// <param name="filter">子对象的过滤器</param> /// <param name="addedAction">添加了树节点以后的回调</param> /// <returns></returns> public static UserGraphTreeNode GetRoot(UserGraphTreeParams requestParams, Func <IOguObject, bool> filter = null, Action <IOguObject, UserGraphTreeNode> addedAction = null) { UserGraphTreeNode rootNode = null; requestParams.DoServiceCall((rp) => { IOrganization parent = GetOrganization(requestParams); rootNode = parent.ToTreeNode(); parent.Children.FillChildNodes(rootNode.Children, rp.ListMask, filter, addedAction); rootNode.Open = true; }); return(rootNode); }