private void AddChildNode(ZJGEportTreeNode pNode) { JCPT Jcpt = new JCPT(); //操作基础平台类 string OrgID = Convert.ToString(Session["ORGID"]); string GroupID = pNode.Value.Split('&')[0]; // string TreeCode = pNode.Value.Split('&')[1]; // List<GroupInfo> GIList = new List<GroupInfo>(); GIList = Jcpt.SelectGroupInfo(OrgID); //所有的树节点 List<UserInfo> UIList = new List<UserInfo>(); UIList = Jcpt.SelectUserInfoByGroup(OrgID, GroupID);//该节点下的所有人员信息 ZJGEportTreeNode node; //加载子部门 for (int i = 0; i < GIList.Count; i++) { if (GIList[i].TreeCode.Length == (TreeCode.Length + 4) && GIList[i].TreeCode.StartsWith(TreeCode)) //4位一级,该处为下一层 { node = new ZJGEportTreeNode(); node.Text = GIList[i].GroupName; node.Value = GIList[i].GroupID + "&" + GIList[i].TreeCode; node.PopulateOnDemand = true; pNode.ChildNodes.Add(node); } } //加载人员 for (int j = 0; j < UIList.Count; j++) { node = new ZJGEportTreeNode(); node.Text = UIList[j].RealName; node.Value = UIList[j].UserID; node.PopulateOnDemand = false; node.CtrlClickFunction = "AutoSetPValue(this,'" + node.Value + "','" + node.Text + "')"; pNode.ChildNodes.Add(node); } }