//public new string AppID = "2004"; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("ERP_SA_"); FormTitle = ContractApproval_Common.GetErpFormTitle(this);//设置标题 StartDeptId = ddlDepartName.SelectedItem.Value; if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_SupplementalAgreement)) { ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip_BPM + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; InitFormData(); //Countersign1.CounterSignDeptId = StartDeptId; } //detailContract.InnerHtml = string.Format("<a href='{0}'>原合同详细信息</a>", SupplementalAgreement_Common.GetPoUrl()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); FormId = info.FormId; InitFormData(); SetUserControlInstance(); } else { string erpFormId = HttpContext.Current.Request["erpFormId"]; string erpFormType = HttpContext.Current.Request["erpFormType"]; if (string.IsNullOrEmpty(erpFormId) || string.IsNullOrEmpty(erpFormType)) { //参数错误 ExceptionHander.GoToErrorPage(); return; } if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_PaymentApplication)) { ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip_BPM + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } ContractID = BPMHelp.GetSerialNumber("ERP_FK_"); FormId = ContractID; StartDeptId = ddlDepartName.SelectedItem.Value; LoadRelationPerson(); Countersign1.CounterSignDeptId = StartDeptId; } } //如果起始部门为“营销管理部”,则计划内外的控件隐藏 if (ddlDepartName.SelectedItem.Text.Contains("营销")) { //cblIsInPan.Visible = true; IsInPan.Visible = true; } else { //cblIsInPan.Visible = false; IsInPan.Visible = false; cblIsInPan.SelectedItem.Value = "0"; } }
/// <summary> /// 二次验证:提交完成之后通知并验证 /// </summary> /// <returns></returns> private bool AfterWorkflowStart(int wfInstanceId) { ContractApprovalInfo info = ContractApproval.GetModel(FormId); ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(info.ErpFormId, true); if (resultType != ERP_CallbackResultType.调用成功) { //删除流程实例 new WF_WorkFlowInstance().DeleteWorkFlowInstance(_BPMContext.ProcID); //撤销已发起的流程 WorkflowManage.StopWorkflow(wfInstanceId); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return(false); } return(true); }
/// <summary> /// 一次验证:提交流程之前验证 /// </summary> /// <returns></returns> private bool BeforeSubmit() { string erpFormCode = Request["erpFormId"]; if (!string.IsNullOrEmpty(_BPMContext.ProcID)) { erpFormCode = ContractApproval.GetModelByInstId(_BPMContext.ProcID).ErpFormId; } ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(erpFormCode, false); if (resultType != ERP_CallbackResultType.调用成功) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return(false); } return(true); }
/// <summary> /// 0次验证 /// </summary> /// <returns></returns> private bool VertifyOverTime() { string erpFormCode = Request["erpFormId"]; if (!string.IsNullOrEmpty(_BPMContext.ProcID)) { erpFormCode = ContractApproval.GetModelByInstId(_BPMContext.ProcID).ErpFormId; } ERP_CallbackResultType resultType = new ContractApproval_Service().VerifyERPWFStatus(erpFormCode); if (resultType != ERP_CallbackResultType.调用成功) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('流程已超时,请重新发起流程!'); window.opener=null;window.open('', '_self', '');window.close();", true); return(false); } return(true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitStartDeptment(); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(Request.QueryString["id"]); FormId = info.FormId; InitFormData(); //Countersign1.CounterSignDeptId = info.CreateDeptCode; SetUserControlInstance(); } else { string erpFormId = HttpContext.Current.Request["erpFormId"]; string erpFormType = HttpContext.Current.Request["erpFormType"]; if (string.IsNullOrEmpty(erpFormId) || string.IsNullOrEmpty(erpFormType)) { //参数错误 ExceptionHander.GoToErrorPage(); return; } if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_Instruction)) { ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip_BPM + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } FormId = BPMHelp.GetSerialNumber("ERP_QS_"); string StartDeptId = ddlDepartName.SelectedItem.Value; Department deptInfo = new Pkurg.PWorld.Services.DepartmentService().GetByDepartCode(StartDeptId); Countersign1.CounterSignDeptId = StartDeptId; } InitLeader(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //throw new Exception("这有错!!!"); InitStartDeptment(); string instId = Request.QueryString["id"]; if (string.IsNullOrEmpty(instId)) { FormId = BPMHelp.GetSerialNumber("ERP_HT_"); FormTitle = ContractApproval_Common.GetErpFormTitle(this);//设置标题 StartDeptId = ddlDepartName.SelectedItem.Value; if (Pkurg.PWorldBPM.Business.BIZ.ERP.ERP_Common.IsExsitRunFlow(Request["erpFormId"], ERP_WF_T_Name.ERP_ContractApproval)) { ERP_CallbackResultType resultType = new ContractApproval_Service().NotifyStartAdvance(Request["erpFormId"], true); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ajax", "alert('" + ConstString.RepeatAlertTip_BPM + "'); window.opener=null;window.open('', '_self', '');window.close();", true); return; } } else { WorkFlowInstance info = new WF_WorkFlowInstance().GetWorkFlowInstanceById(instId); FormId = info.FormId; FormTitle = info.FormTitle; if (!InitFormData(FormId)) { return; } SetUserControlInstance(); Countersign1.CounterSignDeptId = StartDeptId; } } }