/// <summary> /// 创建表单树 /// </summary> /// <param name="nodeParent"></param> /// <param name="parentId"></param> public static void CreateBizdefForm(Node nodeParent, String parentId) { String url = StaticValue.ServicePath.BizdefFormPath; url += "?bizDefGuid=" + parentId + "&parentGuid=&recursive=true"; String userName = StaticValue.ServicePath.UserName; String passWord = StaticValue.ServicePath.PassWord; String result = RestUserLoginService.Get(url, "", userName, passWord); List <BizdefFormDataEntity> bizdefFormDataList = JsonConvert.DeserializeObject <List <BizdefFormDataEntity> >(result); foreach (BizdefFormDataEntity bizdefFormData in bizdefFormDataList) { Node nodeChildPackage = new Node(); nodeChildPackage.Name = "FORMBACKAGE_" + bizdefFormData.Id; nodeChildPackage.Text = bizdefFormData.DisplayText; nodeChildPackage.Tag = bizdefFormData; nodeChildPackage.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"\icon\application_form.png"); nodeParent.Nodes.Add(nodeChildPackage); nodeParent.Expanded = true; List <BizdefFormEntity> bizdefFormList = bizdefFormData.Items; bizdefFormList = bizdefFormList.OrderBy(o => o.DisplayText).ToList(); foreach (var bizdefForm in bizdefFormList) { Node nodeChild = new Node(); nodeChild.Name = "FORMS_" + bizdefForm.BdfrGuid; nodeChild.Text = bizdefForm.DisplayText; nodeChild.Tag = bizdefForm; nodeChild.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"\icon\book.png"); nodeChildPackage.Nodes.Add(nodeChild); nodeChildPackage.Expanded = false; } } }
/// <summary> /// 创建部门用户信息 /// </summary> /// <param name="nodeParent"></param> /// <param name="parentId"></param> public static void CreateDepartmentUser(Node nodeParent, String parentId, String userSelectValue) { String url = StaticValue.ServicePath.DeparmentUserPath; url += "?departmentid=" + parentId; String userName = StaticValue.ServicePath.UserName; String passWord = StaticValue.ServicePath.PassWord; String result = RestUserLoginService.Get(url, "", userName, passWord); List <DepartmentUserEntity> departmentUserList = JsonConvert.DeserializeObject <List <DepartmentUserEntity> >(result); foreach (DepartmentUserEntity departmentUser in departmentUserList) { Node nodeChild = new Node(); nodeChild.Name = "DEPARTMENTUSER_" + departmentUser.Id; nodeChild.Text = departmentUser.Name; nodeChild.Tag = departmentUser; nodeChild.Expanded = true; if (departmentUser.Id.Equals(userSelectValue)) { nodeSelect = nodeChild; } nodeChild.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"\icon\user.png"); nodeParent.Nodes.Add(nodeChild); } }
/// <summary> /// 获取流程配置包信息 /// </summary> /// <param name="parentNode"></param> /// <param name="parentId"></param> public static void CreateProPackage(Node parentNode, String parentId) { String url = StaticValue.ServicePath.PackagePath; url += "?parentId=" + parentId; String userName = StaticValue.ServicePath.UserName; String passWord = StaticValue.ServicePath.PassWord; String result = RestUserLoginService.Get(url, "", userName, passWord); List <PropackageEntity> propackages = JsonConvert.DeserializeObject <List <PropackageEntity> >(result); foreach (PropackageEntity propackage in propackages) { Node nodeChild = new Node(); nodeChild.Name = "PROPACKAGE_" + propackage.Id; nodeChild.Text = propackage.Caption; nodeChild.Tag = propackage; nodeChild.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"\icon\package.png"); parentNode.Nodes.Add(nodeChild); if (nodeChild.Level <= 1) { nodeChild.Expanded = true; } CreateProPackage(nodeChild, propackage.Id); } }
public static void CreateDepartment(AdvTree tree, Node nodeParent, String departmentSelectValue, String userSelectValue) { String url = StaticValue.ServicePath.DepartmentPath; String userName = StaticValue.ServicePath.UserName; String passWord = StaticValue.ServicePath.PassWord; String result = RestUserLoginService.Get(url, "", userName, passWord); List <DepartmentEntity> departmentList = JsonConvert.DeserializeObject <List <DepartmentEntity> >(result); List <DepartmentEntity> firstNodeDepartment = departmentList.Where(o => String.IsNullOrEmpty(o.Pid)).ToList(); LoadAllDepartment(departmentList, firstNodeDepartment, nodeParent, departmentSelectValue, userSelectValue); tree.Nodes.Add(nodeParent); tree.SelectNode(nodeSelect, eTreeAction.Mouse); }
/// <summary> /// 创建业务定制树 /// </summary> /// <param name="tree"></param> public static void CreateBizdef(AdvTree tree) { String url = StaticValue.ServicePath.BizdefPath; url += "?parentGuid=&recursive=1"; String userName = StaticValue.ServicePath.UserName; String passWord = StaticValue.ServicePath.PassWord; String result = RestUserLoginService.Get(url, "", userName, passWord); List <BizdefPackageEntity> bidefPackageList = JsonConvert.DeserializeObject <List <BizdefPackageEntity> >(result); foreach (var bizdefPackage in bidefPackageList) { Node nodePackage = new Node(); nodePackage.Name = "PACKAGE_" + bizdefPackage.Id; nodePackage.Text = bizdefPackage.Name; nodePackage.Tag = bizdefPackage; nodePackage.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"\icon\package.png"); nodePackage.Expanded = true; nodePackage.Nodes.Add(CreateDataCategortyNode());//窗口收件材料 List <Entity.BizdefEntity> lstBizdef = new List <Entity.BizdefEntity>(bizdefPackage.Items); lstBizdef = lstBizdef.OrderBy(t => t.Name).ToList(); foreach (var bizdef in lstBizdef) { Node nodeGroup = new Node(); nodeGroup.Name = "BIZDEF_" + bizdef.Id; nodeGroup.Text = bizdef.Name; nodeGroup.Tag = bizdef; nodeGroup.Image = Image.FromFile(AppDomain.CurrentDomain.BaseDirectory + @"\icon\application_form.png"); nodePackage.Nodes.Add(nodeGroup); } tree.Nodes.Add(nodePackage); } }