Ejemplo n.º 1
0
    private bool BeforeSubmit()
    {
        string erpFormCode = Request["erpFormId"];

        if (!string.IsNullOrEmpty(_BPMContext.ProcID))
        {
            erpFormCode = PaymentApplication.GetPaymentApplicationInfoByInstanceId(_BPMContext.ProcID).ErpFormId;
        }
        ERP_CallbackResultType resultType = new ERP_PaymentApplication_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);
    }
Ejemplo n.º 2
0
    public static string GetErpUrl()
    {
        string erpFormId   = HttpContext.Current.Request["erpFormId"];
        string erpFormType = HttpContext.Current.Request["erpFormType"];
        string startDeptId = HttpContext.Current.Request["startDeptId"];
        string id          = HttpContext.Current.Request["Id"];

        if (string.IsNullOrEmpty(id))
        {//新建页面
            if (string.IsNullOrEmpty(erpFormId) ||
                string.IsNullOrEmpty(erpFormType)
                )
            {
                //参数错误
                ExceptionHander.GoToErrorPage();
                return(null);
            }
        }
        else
        {
            PaymentApplicationInfo info = PaymentApplication.GetPaymentApplicationInfoByInstanceId(id);
            if (info == null)
            {
                ExceptionHander.GoToErrorPage();
                return(null);
            }
            erpFormId   = info.ErpFormId;
            erpFormType = info.ErpFormType;
        }

        Dictionary <string, string> pageNames = IFrameHelper.GetUrlDatas();

        if (!pageNames.Keys.Contains(erpFormType))
        {
            ExceptionHander.GoToErrorPage();
            return(null);
        }
        string pageName = pageNames[erpFormType];

        return(string.Format("{0}{1}", pageName, erpFormId));
    }
Ejemplo n.º 3
0
    private void InintData()
    {
        string methodName = "InintData";

        try
        {
            WorkFlowInstance       Instance = wf_WorkFlowInstance.GetWorkFlowInstanceById(ViewState["InstanceID"].ToString());
            PaymentApplicationInfo item     = PaymentApplication.GetPaymentApplicationInfoByInstanceId(ViewState["InstanceID"].ToString());
            if (item != null)
            {
                PaymentApplicationInfo info     = PaymentApplication.GetPaymentApplicationInfo(Instance.FormId);
                Department             deptInfo = new Pkurg.PWorld.Services.DepartmentService().GetByDepartCode(info.StartDeptId);
                ddlDepartName.Text = deptInfo.Remark;

                cblisoverCotract.Checked = info.IsOverContract == 1;
                cbChairman.Checked       = info.IsCheckedChairman == 1;

                if (info.StartDeptId.Contains("S972"))
                {
                    lbPresident.Text = "总经理意见:";
                }
                else
                {
                    lbPresident.Text = "总裁意见:";
                }
                //LoadRelationPerson(info.StartDeptId);
                //cbRelatonUsers.Visible = cbPayer.Checked;
                //cbRelatonUsers.Enabled = false;
                //if (!string.IsNullOrEmpty(info.LeadersSelected))
                //{
                //    string[] cbDatas = info.LeadersSelected.Split(',');
                //    foreach (var cbItem in cbDatas)
                //    {
                //        ListItem listItem = cbRelatonUsers.Items.FindByValue(cbItem);
                //        listItem.Selected = true;
                //    }
                //}
            }

            FlowRelated1.ProcId       = ViewState["InstanceID"].ToString();
            Countersign1.ProcId       = ViewState["InstanceID"].ToString();
            UploadAttachments1.ProcId = ViewState["InstanceID"].ToString();

            ApproveOpinionUCDeptleader.InstanceId  = ViewState["InstanceID"].ToString();
            ApproveOpinionUCRealateDept.InstanceId = ViewState["InstanceID"].ToString();
            ApproveOpinionUCLeader.InstanceId      = ViewState["InstanceID"].ToString();
            Option_4.InstanceId           = ViewState["InstanceID"].ToString();
            ApproveOpinionUC1.InstanceId  = ViewState["InstanceID"].ToString();
            ApproveOpinionUC2.InstanceId  = ViewState["InstanceID"].ToString();
            ApproveOpinionUC22.InstanceId = ViewState["InstanceID"].ToString();
            ApproveOpinionUC3.InstanceId  = ViewState["InstanceID"].ToString();
            Option_0.InstanceId           = ViewState["InstanceID"].ToString();
            ApproveOpinionUC4.InstanceId  = ViewState["InstanceID"].ToString();
            Option_10.InstanceId          = ViewState["InstanceID"].ToString();
            Option_11.InstanceId          = ViewState["InstanceID"].ToString();
            Option_12.InstanceId          = ViewState["InstanceID"].ToString();
            Option_13.InstanceId          = ViewState["InstanceID"].ToString();
        }
        catch (Exception ex)
        {
            Logger.Write(this.GetType(), EnumLogLevel.Fatal, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.Exception + ":" + string.Format("Exception={0}", ex));
            throw ex;
        }
        Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.OUT);
    }