예제 #1
0
        /// <summary>
        /// 添加工作流管理
        /// </summary>
        /// <param name="args">保存或已提交</param>
        private int SavePaymentWorkflow(string args, string auditsatus, string serialNumber)
        {
            int     result  = 0;
            JobFlow jobflow = null;

            if (Request.Params["jobflowid"] == null || Request.Params["jobflowid"] == "")
            {
                jobflow             = new JobFlow();
                jobflow.savestatus  = args.ToString();
                jobflow.createtime  = DateTime.Now;
                jobflow.endtime     = DateTime.Now;
                jobflow.cname       = serialNumber;
                jobflow.attachment  = "";
                jobflow.sort        = "05";
                jobflow.auditsort   = "";
                jobflow.auditstatus = auditsatus;
                jobflow.founderid   = ((LoginInfo)Session["login"]).Id;
                jobflow.txt         = "";
                jobflow.ruleid      = int.Parse(ddlApproval.SelectedValue);
                result = JobFlowManager.AddAndGetId(jobflow);
            }
            else
            {
                result  = int.Parse(Request.Params["jobflowid"]);
                jobflow = JobFlowManager.GetModel(int.Parse(Request.Params["jobflowid"]));
                if (jobflow != null)
                {
                    jobflow.savestatus  = args.ToString();
                    jobflow.auditstatus = auditsatus;
                    jobflow.ruleid      = int.Parse(ddlApproval.SelectedValue);
                    JobFlowManager.Update(jobflow);
                }
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// 更新的方法
        /// </summary>
        private string AuditUpdate(string args, string auditstatus, int id)
        {
            To_OrderInfo orderModle = To_OrderInfoManager.getTo_OrderInfoById(id);
            JobFlow      jobModel   = JobFlowManager.GetModel(orderModle.JobflowID);

            jobModel.savestatus  = args;
            jobModel.auditstatus = auditstatus;
            JobFlowManager.Update(jobModel);
            return(orderModle.OrderNum);
        }
예제 #3
0
        protected void RpPolicy_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "DELETE")
            {
                int id = Convert.ToInt32(e.CommandArgument);

                //if (To_PolicyManager.deleteTo_Policy(id) > 0)
                //{
                //    To_PolicyDetailManager.DeleteByPolicy(id);
                //  RpPolicyBindData();
                //}
                Del(id);
            }
            if (e.CommandName == "refresh")
            {
                int jfid = int.Parse(e.CommandArgument.ToString());
                Refresh(jfid);
            }

            if (e.CommandName == "audit")
            {
                string[] args      = e.CommandArgument.ToString().Split(',');
                int      jobFlowID = int.Parse(args[0].Trim());
                int      policyID  = int.Parse(args[1].Trim());
                string   num       = args[2].Trim();

                JobFlow jobFlow = JobFlowManager.GetModel(jobFlowID);
                if (jobFlow.savestatus == "草稿" && jobFlow.auditstatus == "01")
                {
                    jobFlow.savestatus  = "已提交";
                    jobFlow.auditstatus = "01";
                    JobFlowManager.Update(jobFlow);

                    int ruleID = jobFlow.ruleid;
                    CreateApproval(ruleID, jobFlowID);

                    SendMessage(ruleID, num);

                    ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('送审成功');", true);
                }
                else
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('该保单已送审,无需再次送审');", true);
                }
            }

            RpPolicyBindData();
        }
예제 #4
0
        /// <summary>
        /// 添加工作流管理
        /// </summary>
        /// <param name="args">保存或已提交</param>
        private int SavePolicyJob(string args, string auditsatus)
        {
            int     result  = 0;
            JobFlow jobflow = null;

            if (Request.Params["jobflowid"] == null || Request.Params["jobflowid"] == "")
            {
                string cuscode    = ""; //公司代码全称
                string codeformat = ""; //公司代码,不包含流水号
                string ordernum   = ""; //流水号

                StrNumbers(TxtSerialNum.Text.Trim(), out cuscode, out codeformat, out ordernum);

                jobflow             = new JobFlow();
                jobflow.savestatus  = args.ToString();
                jobflow.createtime  = DateTime.Now;
                jobflow.endtime     = DateTime.Now;
                jobflow.cname       = cuscode; //工作流名称
                jobflow.attachment  = "";      //附件上传(1表示有附件)
                jobflow.sort        = "02";
                jobflow.auditsort   = "";      //审核类型
                jobflow.auditstatus = auditsatus;
                jobflow.founderid   = ((LoginInfo)Session["login"]).Id;
                jobflow.txt         = "";
                jobflow.ruleid      = int.Parse(this.DdlIsVirify.SelectedValue); //审核流程图关联id
                result = JobFlowManager.AddAndGetId(jobflow);
            }
            else
            {
                result  = int.Parse(Request.Params["jobflowid"]);
                jobflow = JobFlowManager.GetModel(int.Parse(Request.Params["jobflowid"]));
                if (jobflow != null)
                {
                    jobflow.savestatus  = args.ToString();
                    jobflow.auditstatus = auditsatus;
                    jobflow.ruleid      = int.Parse(this.DdlIsVirify.SelectedValue);
                    JobFlowManager.Update(jobflow);
                }
            }
            return(result);
        }
예제 #5
0
        //通过审核
        protected void imgbtnpass_Click(object sender, ImageClickEventArgs e)
        {
            int jobflowid = int.Parse(Request.QueryString["jobflowid"].ToString()); //工作流的id

            EtNet_Models.LoginInfo login = (EtNet_Models.LoginInfo)Session["login"];

            string comparedata = " reviewerid=" + login.Id + " AND jobflowid=" + jobflowid.ToString();

            if (AuditJobFlowManager.GetList(comparedata).Rows.Count == 0)
            {
                //该工作流被收回或删除导致审批提交失败
                Response.Redirect("../Job/AuditJobFlow.aspx");
            }
            else if (JobFlowManager.GetModel(jobflowid).auditstatus == "03" || JobFlowManager.GetModel(jobflowid).auditstatus == "04")
            {
                //该工作流是审核方式是选审或会签所以在提交审核时,工作流已由他人审核通过
                Response.Redirect("../Job/AuditJobFlow.aspx");
            }
            else
            {
                JobFlow      jobflow = JobFlowManager.GetModel(jobflowid);
                ApprovalRule rule    = ApprovalRuleManager.GetModel(jobflow.ruleid);
                string       ruletxt = rule.sort; //审核的分类

                //修改当前审核人的记录
                AuditJobFlow auditmodel   = null;
                string       auditstr     = " jobflowid=" + jobflowid.ToString() + " AND reviewerid=" + ((LoginInfo)Session["login"]).Id;
                DataTable    audittbl     = AuditJobFlowManager.GetList(auditstr);             // 查找到当前审核人员的记录
                int          num          = int.Parse(audittbl.Rows[0]["numbers"].ToString()); //当前审核人员编号
                string       mainreviewer = audittbl.Rows[0]["mainreviewer"].ToString();       //当前审核人是不是最终审核人

                auditmodel              = new AuditJobFlow();
                auditmodel.auditoperat  = "通过";
                auditmodel.audittime    = DateTime.Now;
                auditmodel.id           = int.Parse(audittbl.Rows[0]["id"].ToString());
                auditmodel.jobflowid    = int.Parse(audittbl.Rows[0]["jobflowid"].ToString());
                auditmodel.mainreviewer = audittbl.Rows[0]["mainreviewer"].ToString();
                auditmodel.nowreviewer  = "P"; //能查找到工作流记录,但不能进行审核操作
                auditmodel.numbers      = int.Parse(audittbl.Rows[0]["numbers"].ToString());
                auditmodel.operatstatus = "已审批";
                auditmodel.reviewerid   = int.Parse(audittbl.Rows[0]["reviewerid"].ToString());
                auditmodel.opiniontxt   = Server.UrlDecode(this.treatxt.Value.Trim());
                AuditJobFlowManager.Update(auditmodel);



                //依据不同的审核类型进行操作
                switch (ruletxt)
                {
                case "单审":
                    if (mainreviewer != "T")
                    {
                        auditmodel = new AuditJobFlow();     //设置下一个审核人的数据记录
                        string    nextauditstr = " jobflowid=" + jobflowid.ToString() + " AND numbers=" + (num + 1).ToString();
                        DataTable nextaudittbl = AuditJobFlowManager.GetList(nextauditstr);
                        auditmodel.auditoperat  = nextaudittbl.Rows[0]["auditoperat"].ToString();
                        auditmodel.audittime    = DateTime.Parse(nextaudittbl.Rows[0]["audittime"].ToString());
                        auditmodel.id           = int.Parse(nextaudittbl.Rows[0]["id"].ToString());
                        auditmodel.jobflowid    = int.Parse(nextaudittbl.Rows[0]["jobflowid"].ToString());
                        auditmodel.mainreviewer = nextaudittbl.Rows[0]["mainreviewer"].ToString();
                        auditmodel.nowreviewer  = "T";    //设置其为审核人员
                        auditmodel.numbers      = int.Parse(nextaudittbl.Rows[0]["numbers"].ToString());
                        auditmodel.operatstatus = nextaudittbl.Rows[0]["operatstatus"].ToString();
                        auditmodel.reviewerid   = int.Parse(nextaudittbl.Rows[0]["reviewerid"].ToString());
                        auditmodel.opiniontxt   = nextaudittbl.Rows[0]["opiniontxt"].ToString();
                        AuditJobFlowManager.Update(auditmodel);
                        jobflow.auditstatus = "02";     //工作流的审核状态为“进行中”
                        JobFlowManager.Update(jobflow);
                    }
                    else
                    {
                        jobflow.endtime     = DateTime.Now;
                        jobflow.auditstatus = "04";     //工作流的审核状态为“已通过”
                        JobFlowManager.Update(jobflow);
                    }
                    break;

                case "选审":

                    jobflow.endtime     = DateTime.Now;
                    jobflow.auditstatus = "04";     //工作流的审核状态为“已通过”
                    JobFlowManager.Update(jobflow);
                    break;

                case "会审":
                    bool      pass        = true;
                    string    strsql      = " jobflowid=" + jobflowid.ToString();
                    DataTable auditjobtbl = AuditJobFlowManager.GetList(strsql);
                    for (int i = 0; i < auditjobtbl.Rows.Count; i++)
                    {
                        if (auditjobtbl.Rows[i]["auditoperat"].ToString() != "通过")
                        {
                            pass = false;     //说明还有其他审核人员未开始审核
                            break;
                        }
                    }

                    if (pass)
                    {
                        jobflow.endtime     = DateTime.Now;
                        jobflow.auditstatus = "04";     //工作流的状审核状态为“已通过”
                        JobFlowManager.Update(jobflow);
                    }
                    else
                    {
                        jobflow.auditstatus = "02";     //工作流的状审核状态为“进行中”
                        JobFlowManager.Update(jobflow);
                    }
                    break;
                }

                string    sqlpolicy           = " isVerify =" + jobflowid.ToString();
                DataTable tblpolicy           = EtNet_BLL.To_PolicyManager.GetList(1, sqlpolicy, "id");
                EtNet_Models.To_Policy policy = EtNet_BLL.To_PolicyManager.getTo_PolicyById(int.Parse(tblpolicy.Rows[0]["id"].ToString()));
                if (policy.Txt == "")
                {
                    policy.Txt = login.Cname + "的审批意见:" + Server.UrlDecode(this.treatxt.Value.Trim());
                }
                else
                {
                    policy.Txt = policy.Txt + "|" + login.Cname + "的审批意见:" + Server.UrlDecode(this.treatxt.Value.Trim());
                }
                EtNet_BLL.To_PolicyManager.updateTo_Policy(policy);

                SendMessage("【" + login.Cname + "】通过审批");
                SendNextAudit(jobflowid);
                Response.Redirect("../Job/AuditJobFlow.aspx");
            }
        }
예제 #6
0
        protected void RpPaymentList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            object objArg  = e.CommandArgument;
            string cmdName = e.CommandName;

            if (cmdName == "DELETE")//删除
            {
                string[] arrArg    = objArg.ToString().Split(',');
                string   paymentID = arrArg[0];
                string   jobflowID = arrArg[1];

                JobFlow jobFlow = JobFlowManager.GetModel(Convert.ToInt32(jobflowID));


                if (jobFlow.auditstatus != "01" || jobFlow.savestatus == "已提交")
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "delete", "alert('该申请已通过或者是正在审核,不能删除');", true);
                }
                else
                {
                    //string paymentID = objArg.ToString();
                    string resultMsg             = DeletePayment(paymentID);
                    To_PaymentDetailManager pcdm = new To_PaymentDetailManager();
                    pcdm.DeleteByPayment(paymentID);
                    ClientScript.RegisterClientScriptBlock(Page.GetType(), "delete", string.Format("alert(\"{0}\");", resultMsg), true);
                }
            }

            if (cmdName == "EDIT")//编辑
            {
                string[] arrArg    = objArg.ToString().Split(',');
                string   paymentID = arrArg[0];
                string   jobflowID = arrArg[1];
                JobFlow  jobFlow   = JobFlowManager.GetModel(Convert.ToInt32(jobflowID));
                if (jobFlow.auditstatus == "01" && jobFlow.savestatus == "草稿")
                {
                    Response.Redirect("PaymentEdit.aspx?payid=" + paymentID + "&jobflowid=" + jobflowID);
                }
                else
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "edit", "alert('该申请已通过或者是正在审核,不能编辑');", true);
                }
                return;
            }

            if (cmdName == "APPROVAL")//送审
            {
                string[] arrArg    = objArg.ToString().Split(',');
                int      jobflowID = int.Parse(arrArg[0]);
                string   paymentID = arrArg[1];
                string   serialNum = arrArg[2];

                JobFlow jobFlow = JobFlowManager.GetModel(jobflowID);
                if (jobFlow.savestatus == "草稿" && jobFlow.auditstatus == "01")
                {
                    jobFlow.savestatus  = "已提交";
                    jobFlow.auditstatus = "01";
                    JobFlowManager.Update(jobFlow);

                    int ruleID = jobFlow.ruleid;
                    CreateApproval(ruleID, jobflowID);

                    SendMessage(ruleID, serialNum);

                    ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('送审成功');", true);
                }
                else
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('该申请已送审,无需再次送审');", true);
                }
            }

            if (cmdName == "RECOVER")
            {
                int jobflowID = Convert.ToInt32(objArg);
                Recover(jobflowID);
            }

            if (cmdName == "PRINT")
            {
                string[] args = objArg.ToString().Split(',');
                if (args[1].Trim() != "04")
                {
                    ClientScript.RegisterClientScriptBlock(Page.GetType(), "aa", "alert('未通过审核申请不能打印')", true);
                }
                else
                {
                    Print(args[0].Trim());
                }

                return;
            }

            BindPaymentList();
        }