private void InitLeader() { BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment(); DataTable dtDeptManager = bfurd.GetSelectRoleUser(StartDeptId, "部门负责人"); DataTable dtPresident = bfurd.GetSelectRoleUser(GroupCode, "总裁"); DataTable dtChairman = bfurd.GetSelectRoleUser(GroupCode, "董事长"); if (dtDeptManager.Rows.Count != 0) { lbDeptManager.Text = "(" + dtDeptManager.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtPresident.Rows.Count != 0) { lbPresident.Text = "(" + dtPresident.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtChairman.Rows.Count != 0) { lbChairman.Text = "(" + dtChairman.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (!StartDeptId.Contains(GroupCode)) { trDept.Visible = false; cbAP.Checked = false; cbVP.Checked = false; cbChairman.Checked = false; } else { trDept.Visible = true; } }
private void InitCheckButton() { if (K2_TaskItem.ActivityInstanceDestination.Name == "部门负责人意见" || K2_TaskItem.ActivityInstanceDestination.Name == "集团部门负责人意见") { cbAP.Enabled = true; cbVP.Enabled = true; if (StartDeptId.Contains("S366-S976")) { cblIsReportToGroup.Enabled = true; Countersign_Group1.IsCanEdit = true; } else { cblIsReportToWY.Enabled = true; Countersign1.IsCanEdit = true; } } else { cbAP.Enabled = false; cbVP.Enabled = false; Countersign1.IsCanEdit = false; Countersign_Group1.IsCanEdit = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["sn"])) { WorkflowHelper.CurrentUser = "******" + _BPMContext.CurrentUser.LoginId; sn.Value = Request.QueryString["sn"]; WorklistItem listItem = WorkflowHelper.GetWorklistItemWithSN(sn.Value, "founder\\" + _BPMContext.CurrentUser.LoginId); taskID.Value = listItem.ID.ToString(); nodeID.Value = listItem.ActivityInstanceDestination.ActID.ToString(); nodeName.Value = listItem.ActivityInstanceDestination.Name; } ///加载页面数据 string instId = Request.QueryString["id"]; if (!string.IsNullOrEmpty(instId)) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); } else { ExceptionHander.GoToErrorPage(); } } //初始化勾选部门 InitCheckButton(); ShowButton(); SetMenu(); //判断分公司和物业集团显示 if (StartDeptId.Contains("S366-S976")) { Company.Visible = false; Group.Visible = true; Group1.Visible = false; IsReportToWY.Visible = false; } else if (!StartDeptId.Contains("S366-S976") && cblIsReportToWY.SelectedItem.Value == "1") { Company.Visible = true; Company1.Visible = true; Group.Visible = true; IsReportToGroup.Visible = false; } else if (!StartDeptId.Contains("S366-S976") && cblIsReportToWY.SelectedItem.Value == "0") { Company.Visible = true; Company1.Visible = false; Group.Visible = false; IsReportToGroup.Visible = false; } }
/// <summary> /// 页面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { //防止二次提交 ScriptManager.RegisterOnSubmitStatement(Page, typeof(Page), "Go_disabled", "disabledButton('lbAgree');disabledButton('lbReject');disabledButton('lbSubmit');"); ScriptManager.RegisterStartupScript(Page, typeof(Page), "Clear_disabled", "enableButton('lbAgree');enableButton('lbReject');enableButton('lbSubmit');", true); if (!IsPostBack) { //初始化起始部门 InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { //得到表单编号 FormId = BPMHelp.GetSerialNumber("RWSP_"); //得到起始部门列表 StartDeptId = ddlDepartName.SelectedItem.Value; Department deptInfo = new Pkurg.PWorld.Services.DepartmentService().GetByDepartCode(StartDeptId); //根据登录名得到申请时间 tbDateTime.Text = DateTime.Now.ToString(); } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; //根据FormId初始化表单数据 InitFormData(FormId); //设置用户控制实例 SetUserControlInstance(); } if (ddlDepartName.SelectedItem.Text.Contains("开封")) { cblFirstLevel.Visible = true; } //根据发起部门来判断是属于集团还是子公司 if (StartDeptId.Contains("S363")) { cblIsImpowerProject.Visible = false; lbIsImpowerProject.Visible = false; zbcgOpinion.Visible = false; fwOpinion.Visible = false; } else { cblIsImpowerProject.Visible = true; lbIsImpowerProject.Visible = true; zbcgOpinion.Visible = true; fwOpinion.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ///加载页面数据 string instId = Request.QueryString["id"]; if (!string.IsNullOrEmpty(instId)) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); } else { ExceptionHander.GoToErrorPage(); } } InitCheckButton(); ShowButton(); SetMenu(); //判断分公司和物业集团显示 if (StartDeptId.Contains("S366-S976")) { Company.Visible = false; Group.Visible = true; Group1.Visible = false; IsReportToWY.Visible = false; } else if (!StartDeptId.Contains("S366-S976") && cblIsReportToWY.SelectedItem.Value == "1") { Company.Visible = true; Company1.Visible = true; Group.Visible = true; IsReportToGroup.Visible = false; } else if (!StartDeptId.Contains("S366-S976") && cblIsReportToWY.SelectedItem.Value == "0") { Company.Visible = true; Company1.Visible = false; Group.Visible = false; IsReportToGroup.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //初始化起始部门 InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("OA_WYQS_"); FormTitle = SysContext.WF_AppDict.FirstOrDefault(x => x.AppId == AppID).AppName; StartDeptId = ddlDepartName.SelectedItem.Value; tbReportCode.Text = FormId; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); tbUserName.Text = CurrentEmployee.EmployeeName; tbMobile.Text = CurrentEmployee.MobilePhone; cbAP.Checked = true; cbVP.Checked = true; } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); } } if (StartDeptId.Contains("S366-S976")) { Company.Visible = false; Group.Visible = true; Group1.Visible = false; IsReportToWY.Visible = false; //cblIsReportToWY.Visible = false; } else if (!StartDeptId.Contains("S366-S976")) { Company.Visible = true; Company1.Visible = true; Group.Visible = true; IsReportToGroup.Visible = false; } }
/// <summary> /// 设置常量型DataField /// </summary> /// <returns></returns> protected override NameValueCollection LoadConstDataField() { NameValueCollection dataFields = new NameValueCollection(); dataFields.Add("IsPass", "1"); if (StartDeptId.Contains("S366-S976")) { dataFields.Add("IsReportToGroup", cblIsReportToGroup.SelectedItem.Value); dataFields.Add("IsReportToWY", "0"); } else { dataFields.Add("IsReportToGroup", "0"); dataFields.Add("IsReportToWY", cblIsReportToWY.SelectedItem.Value); } return(dataFields); }
/// <summary> /// 设置常量型DataField /// </summary> /// <returns></returns> private NameValueCollection LoadConstDataField() { //DataField,控制流程流转,因业务而添加的DataField NameValueCollection dataFields = new NameValueCollection(); dataFields.Add("IsPass", "1"); //dataFields.Add("IsCancelTimeOutSkip", "0"); if (StartDeptId.Contains("S363")) { dataFields.Add("IsBelongToResource", "1"); dataFields.Add("IsReportToResource", "0"); } else { dataFields.Add("IsBelongToResource", "0"); dataFields.Add("IsReportToResource", cblIsImpowerProject.SelectedItem.Value); } return(dataFields); }
/// <summary> /// 初始化领导 /// </summary> private void InitLeader() { string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment(); DataTable dtDeptManager = bfurd.GetSelectRoleUser(StartDeptId, "部门负责人"); DataTable dtEVP = bfurd.GetSelectRoleUser(CompanyCode, "常务副总裁"); DataTable dtCFO = bfurd.GetSelectRoleUser(CompanyCode, "主管财务领导"); DataTable dtPresident = bfurd.GetSelectRoleUser(CompanyCode, "总裁"); DataTable dtChairman = bfurd.GetSelectRoleUser(CompanyCode, "董事长"); if (StartDeptId.Contains("S377")) { trEVP.Visible = true; cbEVP.Checked = true; } if (dtDeptManager.Rows.Count != 0) { lbDeptManager.Text = "(" + dtDeptManager.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtCFO.Rows.Count != 0) { lbCFO.Text = "(" + dtCFO.Rows[0]["EmployeeName"].ToString() + ")审批"; } else { lbCFO.Text = "尚未配置"; } if (dtEVP.Rows.Count != 0) { lbEVP.Text = "(" + dtEVP.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtPresident.Rows.Count != 0) { lbPresident.Text = "(" + dtPresident.Rows[0]["EmployeeName"].ToString() + ")审批"; } if (dtChairman.Rows.Count != 0) { lbChairman.Text = "(" + dtChairman.Rows[0]["EmployeeName"].ToString() + ")审批"; } }
/// <summary> /// 设置用户DataField /// </summary> /// <returns></returns> protected override List <K2_DataFieldInfo> LoadUserDataField() { //string startDeptId = _BPMContext.CurrentUser.MainDeptId; string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); string WYGroupCode = System.Configuration.ConfigurationManager.AppSettings["WYGroupCode"]; List <K2_DataFieldInfo> dfInfos = new List <K2_DataFieldInfo>(); ///自动生成 if (!StartDeptId.Contains("S366-S976")) { /////分公司 dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId, RoleName = "部门负责人", Name = "CityDeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { RoleName = "部门负责人", Name = "CounterSignUsers", DeptCode = Countersign1.Result, IsRepeatIgnore = true, IsHaveToExsit = true }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId, RoleName = "主管副总经理", Name = "ViceLeader" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "总裁", Name = "CityPresident" }); if (cblIsReportToWY.SelectedItem.Value == "0") { //物业集团 dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "部门负责人", Name = "DeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { RoleName = "部门负责人", Name = "CounterSignUsers_Group", Result = "noapprovers", IsRepeatIgnore = true }); dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "主管助理总裁", Name = "AssiPresident" }); dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "主管副总裁", Name = "VicePresident" }); dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "总裁", Name = "President" }); } else { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "部门负责人", Name = "DeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { RoleName = "部门负责人", Name = "CounterSignUsers_Group", DeptCode = Countersign_Group1.Result, IsRepeatIgnore = true, IsHaveToExsit = true }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = Countersign_Group1.Result, RoleName = "主管助理总裁", Name = "AssiPresident" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = Countersign_Group1.Result, RoleName = "主管副总裁", Name = "VicePresident" }); dfInfos.Add(new K2_DataFieldInfo() { DeptCode = WYGroupCode, RoleName = "总裁", Name = "President" }); } } else { /////分公司 dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "部门负责人", Name = "CityDeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { RoleName = "部门负责人", Name = "CounterSignUsers", Result = "noapprovers", IsRepeatIgnore = true }); dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "主管副总经理", Name = "ViceLeader" }); dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", RoleName = "总裁", Name = "CityPresident" }); //物业集团 dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId, RoleName = "部门负责人", Name = "DeptManager" }); dfInfos.Add(new K2_DataFieldInfo() { RoleName = "部门负责人", Name = "CounterSignUsers_Group", DeptCode = Countersign_Group1.Result, IsRepeatIgnore = true, IsHaveToExsit = true }); if (cbAP.Checked) { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId + "," + Countersign1.Result, RoleName = "主管助理总裁", Name = "AssiPresident" }); } else { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "AssiPresident" }); } if (cbVP.Checked) { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = StartDeptId + "," + Countersign1.Result, RoleName = "主管副总裁", Name = "VicePresident" }); } else { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "VicePresident" }); } dfInfos.Add(new K2_DataFieldInfo() { DeptCode = WYGroupCode, RoleName = "总裁", Name = "President" }); } return(dfInfos); }
/// <summary> /// 设置流程参数 /// </summary> /// <returns></returns> private NameValueCollection SetWFParams() { //存储过程的四个参数 string startDeptId = ddlDepartName.SelectedItem.Value; //部门【条件1】 string startDeptName = ddlDepartName.SelectedItem.Text; //定义合同类型的取值 // string erpFormType = HttpContext.Current.Request["erpFormType"]; //根据formTitle中的第七位取两位得到合同类型【条件2】 string type = PaymentApplication_Common.GetErpFormTitle(this).Substring(5, 2); //得到金额amount,需要先判断改单子是打开拟稿的还是新打开的,根据ID来判断是哪一类【条件3】 string amounts = null; //用info和_BPMContext.ProcID是否为空来判断是打开的拟稿还是新打开的有什么区别 //如果为null或者为空时,则为新打开的页面,新打开页面的amount值 if (_BPMContext.ProcID == null || _BPMContext.ProcID == "") { amounts = HttpContext.Current.Request["amount"]; } //如果不为null,则为打开的拟稿 else { PaymentApplicationInfo info = PaymentApplication.GetPaymentApplicationInfo(FormId); amounts = info.Amount; } //是否在计划内【条件4】 string isInPlan = cblIsInPan.SelectedItem.Value; NameValueCollection dataFields = new NameValueCollection(); Department deptInfo = new Pkurg.PWorld.Services.DepartmentService().GetByDepartCode(startDeptId); string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); StringBuilder firstFieldBuilder = new StringBuilder(); foreach (ListItem item in cbRelatonUsers.Items) { if (item.Selected) { firstFieldBuilder.AppendFormat("K2:Founder\\{0},", item.Value); } } string firstField = firstFieldBuilder.ToString().Trim(','); dataFields.Add("RelatedPersonnel", !string.IsNullOrEmpty(firstField) ? firstField : "noapprovers"); bool flag = true;//标记datafields内的变量是否均赋值 //验证部分步骤的审批人是否尚未配置 if (string.IsNullOrEmpty(GetRoleUsers(deptInfo.DepartCode, "部门负责人"))) { flag = false; Alert(Page, "发起部门负责人尚未配置!"); } List <string> countersigns = Countersign1.Result.Split(',').ToList(); foreach (var item in countersigns) { if (!string.IsNullOrEmpty(item)) { if (string.IsNullOrEmpty(GetRoleUsers(item, "部门负责人"))) { flag = false; Alert(Page, item + "会签部门负责人尚未配置!"); } } } string financialManagementDepartmentCode = BPMHelp.GetDeptIDByOtherIDAndName(deptInfo.DepartCode, "财务管理部"); if (string.IsNullOrEmpty(financialManagementDepartmentCode)) { flag = false; Alert(Page, "财务管理部尚未设置!"); } else { string financialManagementDepartmentInfoManager = GetRoleUsers(financialManagementDepartmentCode, "部门负责人"); if (string.IsNullOrEmpty(financialManagementDepartmentInfoManager)) { flag = false; Alert(Page, "财务管理部门负责人尚未配置!"); } //else //{ // if (string.IsNullOrEmpty(GetRoleUsers(financialManagementDepartmentInfo.DepartCode, "主管副总裁"))) // { // flag = false; // Alert(Page, "财务管理部门主管副总裁尚未配置!"); // } //} } if (string.IsNullOrEmpty(GetRoleUsers(CompanyCode, "总裁"))) { flag = false; Alert(Page, "公司总裁尚未配置!"); } if (string.IsNullOrEmpty(GetRoleUsers(PKURGICode, "总裁"))) { flag = false; Alert(Page, "集团总裁尚未配置!"); } StringBuilder leaders = new StringBuilder(); StringBuilder Viceleaders = new StringBuilder(); StringBuilder deptsofGroup = new StringBuilder(); StringBuilder leaderofgroup = new StringBuilder(); StringBuilder AssistantPresident = new StringBuilder(); StringBuilder VicePresident = new StringBuilder(); countersigns.Add(startDeptId); foreach (var item in countersigns) { string leadersTmp = GetRoleUsers(item, "主管助理总裁"); if (!leaders.ToString().Contains(leadersTmp)) { leaders.AppendFormat("{0},", leadersTmp); } string ViceleadersTmp = GetRoleUsers(item, "主管副总裁"); if (!Viceleaders.ToString().Contains(ViceleadersTmp)) { Viceleaders.AppendFormat("{0},", ViceleadersTmp); } string deptsofGroupTmp = GetRoleDepts(item, "集团主管部门"); if (!deptsofGroup.ToString().Contains(deptsofGroupTmp)) { deptsofGroup.AppendFormat("{0},", deptsofGroupTmp); } } //集团审批人员 if (cblisoverCotract.Checked) { foreach (var item in deptsofGroup.ToString().Trim(',').Split(',')) { string leaderofgroupTmp = GetRoleUsers(item, "部门负责人"); if (!leaderofgroup.ToString().Contains(leaderofgroupTmp)) { leaderofgroup.AppendFormat("{0},", leaderofgroupTmp); } string AssistantPresidentTmp = GetRoleUsers(item, "主管助理总裁"); if (!AssistantPresident.ToString().Contains(AssistantPresidentTmp)) { AssistantPresident.AppendFormat("{0},", AssistantPresidentTmp); } string VicePresidentTmp = GetRoleUsers(item, "主管副总裁"); if (!VicePresident.ToString().Contains(VicePresidentTmp)) { VicePresident.AppendFormat("{0},", VicePresidentTmp); } } dataFields.Add("CEOGroup", FilterDataField2(GetRoleUsers(PKURGICode, "总裁"))); dataFields.Add("VicePresident", FilterDataField2(VicePresident)); dataFields.Add("AssistantPresident", FilterDataField2(AssistantPresident)); dataFields.Add("leadersofgroup", FilterDataField2(leaderofgroup)); } if (cbChairman.Checked) { dataFields.Add("chairman", FilterDataField2(GetRoleUsers(CompanyCode, "董事长"))); } else { dataFields.Add("chairman", "noapprovers"); } string CQCompanyCode = "S374"; string CPDeptCode = "S366-S976-S219"; string JSDeptCode = "S366-S976-S782"; string SCKFDeptCode = "S366-S976-S860"; //如果是重庆公司或者是北京北大资源物业公司,则进行判断 if (StartDeptId.Contains(CQCompanyCode) || StartDeptId.Contains(CPDeptCode) || StartDeptId.Contains(JSDeptCode) || StartDeptId.Contains(SCKFDeptCode)) { //判断“分管副总裁”“分管财务副总裁”“总裁”需要审批还是不需要审批 int grade = ERP_PaymentApplication_Grade.GetERP_PaymentApplication_GradeInfo(type, startDeptName, isInPlan, amounts); //如果grade为别的值,则抛出异常 if (grade == -1) { //throw new InvalidDataException("输入的参数不正确!"); grade = 111; } //分管财务副总裁审批 dataFields.Add("financialManagementViceleaders", (grade - (grade / 100 * 100)) / 10 == 1 ? this.FilterDataField2(GetRoleUsers(financialManagementDepartmentCode, "主管副总裁")) : "noapprovers"); //分管副总裁审批【因为总是会审批,所以不需要进行grade的判断】 if ((grade / 100) == 1) { dataFields.Add("Viceleaders", this.FilterDataField2(Viceleaders)); dataFields.Add("leaders", this.FilterDataField2(leaders)); } //总裁审批 dataFields.Add("CEO", (grade - (grade / 100 * 100) - ((grade - grade / 100 * 100) / 10 * 10)) == 1 ? this.FilterDataField2(GetRoleUsers(CompanyCode, "总裁")) : "noapprovers"); } else { //分管财务副总裁审批 dataFields.Add("financialManagementViceleaders", FilterDataField2(GetRoleUsers(financialManagementDepartmentCode, "主管副总裁"))); //分管副总裁审批 dataFields.Add("Viceleaders", this.FilterDataField2(Viceleaders)); dataFields.Add("leaders", this.FilterDataField2(leaders)); //总裁审批 dataFields.Add("CEO", FilterDataField2(GetRoleUsers(CompanyCode, "总裁"))); } dataFields.Add("StandingViceCEO", FilterDataField2(GetRoleUsers(CompanyCode, "常务副总裁"))); dataFields.Add("financialManagement", FilterDataField2(GetRoleUsers(financialManagementDepartmentCode, "部门负责人"))); dataFields.Add("CounterSignUsers", Countersign1.GetCounterSignUsers()); dataFields.Add("DeptManager", GetRoleUsers(deptInfo.DepartCode, "部门负责人")); dataFields.Add("IsOverContract", cblisoverCotract.Checked ? "1" : "0"); dataFields.Add("IsPass", "1"); if (!flag) { dataFields = null; } return(dataFields); }
/// <summary> /// 保存审批人员参数 /// </summary> private string SaveWFParams() { XmlDocument xmldoc = new XmlDocument(); XmlElement xmleLeaders = xmldoc.CreateElement("Leaders"); xmldoc.AppendChild(xmleLeaders); List <string> ApproverList = new List <string>(); string LeaderTemp = string.Empty; List <string> countersigns = Countersign1.Result.Split(',').ToList(); bool flag = true;//标记 if (string.IsNullOrEmpty(GetRoleUsers(GroupCode, "董事长"))) { flag = false; Alert(Page, "董事长尚未配置!"); } if (string.IsNullOrEmpty(GetRoleUsers(GroupCode, "流程审核人"))) { flag = false; Alert(Page, "流程审核人尚未配置!"); } //需要去重,所以顺序从后向前 //董事长意见 if (this.cbChairman.Checked) { LeaderTemp = GetRoleUsers(GroupCode, "董事长"); XmlElement xmleChairman = xmldoc.CreateElement("Chairman"); xmleLeaders.AppendChild(xmleChairman); xmleChairman.SetAttribute("ID", LeaderTemp); ApproverList.Add(LeaderTemp); } //总裁意见 if (this.cbCEO.Checked) { LeaderTemp = GetRoleUsers(GroupCode, "总裁"); XmlElement xmlePresident = xmldoc.CreateElement("President"); xmleLeaders.AppendChild(xmlePresident); xmlePresident.SetAttribute("ID", LeaderTemp); ApproverList.Add(LeaderTemp); } //相关部门主管副总裁 if (StartDeptId.Contains(GroupCode)) { countersigns.Add(StartDeptId); } countersigns.Add(FWDeptCode); if (cbVP.Checked) { LeaderTemp = string.Empty; XmlElement xmlVP = xmldoc.CreateElement("VicePresident"); xmleLeaders.AppendChild(xmlVP); foreach (var item in countersigns) { string LeaderVPTemp = GetRoleUsers(item, "主管副总裁"); if (!string.IsNullOrEmpty(LeaderVPTemp) && !ApproverList.Contains(LeaderVPTemp)) { ApproverList.Add(LeaderVPTemp); LeaderTemp += LeaderVPTemp + ","; } } LeaderTemp = LeaderTemp.TrimEnd(','); xmlVP.SetAttribute("ID", LeaderTemp); } //法务部主管助理总裁 if (1 == 1) { LeaderTemp = GetRoleUsers(FWDeptCode, "部门负责人"); XmlElement xmleWorkflowAuditor = xmldoc.CreateElement("LawDeptAssistantPresident"); xmleLeaders.AppendChild(xmleWorkflowAuditor); xmleWorkflowAuditor.SetAttribute("ID", LeaderTemp); } //相关部门主管助理总裁 if (cbAP.Checked) { LeaderTemp = string.Empty; XmlElement xmlAP = xmldoc.CreateElement("AssiPresident"); xmleLeaders.AppendChild(xmlAP); foreach (var item in countersigns) { string LeaderAPTemp = GetRoleUsers(item, "主管助理总裁"); if (!string.IsNullOrEmpty(LeaderAPTemp) && !ApproverList.Contains(LeaderAPTemp)) { ApproverList.Add(LeaderAPTemp); LeaderTemp += LeaderAPTemp + ","; } } LeaderTemp = LeaderTemp.TrimEnd(','); xmlAP.SetAttribute("ID", LeaderTemp); } //其他董事意见【其他总办会领导意见】 if (cblDirectors.SelectedIndex != -1) { LeaderTemp = string.Empty; XmlElement xmlDirectors = xmldoc.CreateElement("Directors"); xmleLeaders.AppendChild(xmlDirectors); for (int i = 0; i < cblDirectors.Items.Count; i++) { if (cblDirectors.Items[i].Selected && !ApproverList.Contains(cblDirectors.Items[i].Value)) { ApproverList.Add(cblDirectors.Items[i].Value); LeaderTemp += cblDirectors.Items[i].Value + ","; } } xmlDirectors.SetAttribute("ID", LeaderTemp); } //法务部意见 if (1 == 1) { LeaderTemp = GetRoleUsers(FWDeptCode, "部门副总经理"); XmlElement xmleWorkflowAuditor = xmldoc.CreateElement("LawDeptManager"); xmleLeaders.AppendChild(xmleWorkflowAuditor); xmleWorkflowAuditor.SetAttribute("ID", LeaderTemp); } //会签【相关部门意见】 countersigns.Remove(StartDeptId); if (!string.IsNullOrEmpty(Countersign1.Result)) { LeaderTemp = FilterDataField2(Countersign1.GetCounterSignUsers()); XmlElement xmleCountersign = xmldoc.CreateElement("CounterSignUsers"); xmleLeaders.AppendChild(xmleCountersign); xmleCountersign.SetAttribute("ID", LeaderTemp); } //流程审核员审核 if (1 == 1) { LeaderTemp = GetRoleUsers(GroupCode, "流程审核人"); XmlElement xmleWorkflowAuditor = xmldoc.CreateElement("WorkflowAuditor"); xmleLeaders.AppendChild(xmleWorkflowAuditor); xmleWorkflowAuditor.SetAttribute("ID", LeaderTemp); } //经办部门负责人 if (StartDeptId.Contains(GroupCode)) { LeaderTemp = GetRoleUsers(StartDeptId, "部门负责人"); XmlElement xmleDeptManager = xmldoc.CreateElement("DeptManager"); xmleLeaders.AppendChild(xmleDeptManager); xmleDeptManager.SetAttribute("ID", LeaderTemp); } //后面三个审批步骤放在一起 if (StartDeptId.Contains(GroupCode)) { //法务复核意见 LeaderTemp = GetRoleUsers(GroupCode, "合同法务复核员"); XmlElement xmleLawAudit = xmldoc.CreateElement("LawAuditOpinion"); xmleLeaders.AppendChild(xmleLawAudit); xmleLawAudit.SetAttribute("ID", LeaderTemp); //印章管理员盖章 LeaderTemp = GetRoleUsers(GroupCode, "公章管理员"); XmlElement xmleSealManager = xmldoc.CreateElement("SealManager"); xmleLeaders.AppendChild(xmleSealManager); xmleSealManager.SetAttribute("ID", LeaderTemp); //档案管理员归档 LeaderTemp = GetRoleUsers(GroupCode, "档案管理员"); XmlElement xmleFileManager = xmldoc.CreateElement("FileManager"); xmleLeaders.AppendChild(xmleFileManager); xmleFileManager.SetAttribute("ID", LeaderTemp); } else { string EFWDeptCode = BPMHelp.GetDeptIDByOtherIDAndName(StartDeptId, "法务部"); string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); //法务复核意见 if (!string.IsNullOrEmpty(GetRoleUsers(CompanyCode, "合同法务复核员"))) { LeaderTemp = GetRoleUsers(CompanyCode, "合同法务复核员"); } else { LeaderTemp = GetRoleUsers(CompanyCode + "-S496", "部门负责人"); } XmlElement xmleLawAudit = xmldoc.CreateElement("LawAuditOpinion"); xmleLeaders.AppendChild(xmleLawAudit); xmleLawAudit.SetAttribute("ID", LeaderTemp); //印章管理员盖章 LeaderTemp = GetRoleUsers(CompanyCode, "公章管理员"); XmlElement xmleSealManager = xmldoc.CreateElement("SealManager"); xmleLeaders.AppendChild(xmleSealManager); xmleSealManager.SetAttribute("ID", LeaderTemp); //档案管理员归档 LeaderTemp = GetRoleUsers(CompanyCode, "档案管理员"); XmlElement xmleFileManager = xmldoc.CreateElement("FileManager"); xmleLeaders.AppendChild(xmleFileManager); xmleFileManager.SetAttribute("ID", LeaderTemp); } if (!flag) { lblApprovers.Text = null; } else { lblApprovers.Text = xmleLeaders.OuterXml; } return(lblApprovers.Text); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //初始化起始部门 InitDepartName(); //合同类型 ddlContractType1.DataSource = ContractTypeInfosHelper.GetFirstContractTypeInfos1(); ddlContractType1.DataTextField = "value"; ddlContractType1.DataValueField = "key"; ddlContractType1.DataBind(); //合同主体 ddlContractSubject.DataSource = ContractSubjectHelper.GetContractSubjectInfos1(); ddlContractSubject.DataTextField = "value"; ddlContractSubject.DataValueField = "key"; ddlContractSubject.DataBind(); WorkflowHelper.CurrentUser = "******" + _BPMContext.CurrentUser.LoginId; string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("OA_WYHT_"); FormTitle = SysContext.WF_AppDict.FirstOrDefault(x => x.AppId == AppID).AppName; StartDeptId = ddlDepartName.SelectedItem.Value; tbReportCode.Text = FormId; UpdatedTextBox.Value = DateTime.Now.ToShortDateString(); tbUserName.Text = CurrentEmployee.EmployeeName; tbMobile.Text = CurrentEmployee.MobilePhone; cbAP.Checked = true; cbVP.Checked = true; if (ddlContractType1.Items.Count != 0) { ddlContractType1.SelectedIndex = 0; ddlContractType2.DataSource = ContractTypeInfosHelper.GetSecondContractTypeInfos1(ddlContractType1.SelectedItem.Value); ddlContractType2.DataTextField = "value"; ddlContractType2.DataValueField = "key"; ddlContractType2.DataBind(); if (ddlContractType2.Items.Count != 0) { ddlContractType2.SelectedIndex = 0; ddlContractType3.DataSource = ContractTypeInfosHelper.GetThirdContractTypeInfos1(ddlContractType2.SelectedItem.Value); ddlContractType3.DataTextField = "value"; ddlContractType3.DataValueField = "key"; ddlContractType3.DataBind(); } } //InitCheckBoxList(); } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; //初始化表单数据 InitFormData(); } //判断分公司和物业集团显示 if (StartDeptId.Contains("S366-S976")) { Company.Visible = false; Group.Visible = true; Group1.Visible = false; IsReportToWY.Visible = false; //cblIsReportToWY.Visible = false; } else if (!StartDeptId.Contains("S366-S976")) { Company.Visible = true; Company1.Visible = true; Group.Visible = true; IsReportToGroup.Visible = false; } } }
/// <summary> /// 设置变量型[用户型]DataField /// </summary> /// <returns></returns> private List <K2_DataFieldInfo> LoadUserDataField() { string CGDepartmentCode = BPMHelp.GetDeptIDByOtherIDAndName(StartDeptId, "招标采购部"); string FWDepartmentCode = BPMHelp.GetDeptIDByOtherIDAndName(StartDeptId, "法务部"); List <K2_DataFieldInfo> dfInfos = new List <K2_DataFieldInfo>(); ///已存在dataField //招标采购部 dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CGDepartmentCode, RoleName = "部门负责人", Name = "TenderandPurchaseManage", IsHaveToExsit = false }); //法务部 dfInfos.Add(new K2_DataFieldInfo() { DeptCode = FWDepartmentCode, RoleName = "部门负责人", Name = "LegalDeptManager", IsHaveToExsit = false }); //招标委员会成员和招标委员会主任(集团授权,需要判断是一级开发还是二级开发) string CompanyCode = BPMHelp.GetCompanyCodeByDeptID(StartDeptId); if (cblFirstLevel.SelectedIndex == 0) { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "招标委员会成员(一级)", Name = "TenderCommitteeManager", IsHaveToExsit = true }); } else { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "招标委员会成员", Name = "TenderCommitteeManager", IsHaveToExsit = true }); } dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CompanyCode, RoleName = "招标委员会主任", Name = "TenderCommitteeChairman", IsHaveToExsit = true }); //采购管理部 //string DepartmentId = "B04-D319-S541"; if (!cbGroupPurchaseDept.Items[0].Selected) { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "GroupTenderandPurchaseManage", IsHaveToExsit = false }); } else { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = CGDeptCode, RoleName = "部门负责人", Name = "GroupTenderandPurchaseManage", IsHaveToExsit = false }); } //集团法务部 // string DepartmentId1 = "B04-D319-S496"; if (!cbGroupLegalDept.Items[0].Selected) { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "GroupLegalDeptManager", IsHaveToExsit = false }); } else { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = FWDeptCode, RoleName = "部门副总经理", Name = "GroupLegalDeptManager", IsHaveToExsit = false }); } //执行主任 如果不上报集团,则执行主任为noapprovers,否则为执行主任 if (StartDeptId.Contains("S363") || cblIsImpowerProject.SelectedItem.Value == "0") { string directors = Workflow_Common.GetRoleUsersWithNoApproval(PKURGICode, "执行主任").Trim(','); dfInfos.Add(new K2_DataFieldInfo() { Result = Workflow_Common.FilterDataField(directors), Name = "ExecutiveDirector", IsHaveToExsit = true }); } else { dfInfos.Add(new K2_DataFieldInfo() { Result = "noapprovers", Name = "ExecutiveDirector", IsHaveToExsit = false }); } //集团招标委员会成员和集团招标委员会主任(非集团授权项目) //string groupId = "B04-D319"; //如果是集团发起的,则招委会只是招委会成员 if (StartDeptId.Contains("S363")) { dfInfos.Add(new K2_DataFieldInfo() { DeptCode = PKURGICode, RoleName = "招标委员会成员", Name = "GroupTenderCommitteeManager", IsHaveToExsit = true }); } else { string leaders = Workflow_Common.GetRoleUsersWithNoApproval(CompanyCode, "招标委员会主任") + "," + Workflow_Common.GetRoleUsersWithNoApproval(PKURGICode, "招标委员会成员").Trim(','); dfInfos.Add(new K2_DataFieldInfo() { Result = Workflow_Common.FilterDataField(leaders), Name = "GroupTenderCommitteeManager", IsHaveToExsit = true }); } dfInfos.Add(new K2_DataFieldInfo() { DeptCode = PKURGICode, RoleName = "招标委员会主任", Name = "GroupTenderCommitteeChairman", IsHaveToExsit = true }); return(dfInfos); }