public PrincipalSelectFieldNode(bool loading = true) { this.Children = new ObservableCollection<PrincipalSelectFieldNode>(); if (loading == true) { PrincipalSelectFieldNode dummy = new PrincipalSelectFieldNode(false); dummy.parent = this; dummy.Label = "正在加载数据..."; _children.Add(dummy); } }
private void onSelectChange(PrincipalSelectFieldNode node) { if (node.type == "P") btnOK.IsEnabled = true; else btnOK.IsEnabled = false; }
private void cb_getOrganizationRoot(object data) { ASObject record = data as ASObject; PrincipalSelectFieldNode node = new PrincipalSelectFieldNode(); node.Label = "部门"; node.id = record.getLong("departmentRootId"); node.type = "D"; PrincipalList.Add(node); }
private void getChildPri(int groupId, PrincipalSelectFieldNode node) { object result = Remoting.call("PrincipalService.getPrincipals", new object[] { groupId, 0, 99999 }); if (result == null) return; object[] data = result as object[]; PrincipalSelectFieldNode childNode = null; for (int i = 0; i < data.Length; i++) { ASObject record = data[i] as ASObject; childNode = new PrincipalSelectFieldNode(false); childNode.id = record.getLong("id"); childNode.Label = record.getString("name"); childNode.type = "P"; childNode.entity = record; childNode.parent = node; childNode.IsLoading = true; node.Children.Add(childNode); } }
private void cb_findDepartmentGroup(ASObject data) { PrincipalSelectFieldNode node = new PrincipalSelectFieldNode(); node.id = data.getLong("id"); if (data.getString("name") == "%DepartmentRoot%") node.Label = "部门"; else node.Label = data.getString("name"); node.type = "D"; node.entity = data; PrincipalList.Add(node); }