Esempio n. 1
0
    protected void btnStartWF_Click(object sender, System.EventArgs e)
    {
        System.Guid recordID   = new System.Guid(this.HdnRecordID.Value);
        string      value      = this.HdnBusinessCode.Value;
        int         templateId = System.Convert.ToInt32(this.HdnTemplateID.Value);
        string      text       = FlowAuditAction.BeginFlow("999", value, recordID, "", base.UserCode, templateId);

        if (text == "工作流程已成功启动")
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "err", "alert('" + text + "!');", true);
        }
        else
        {
            if (text == "请先设置当前模块的审核流程")
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ok", "alert('" + text + "!');", true);
            }
            else
            {
                if (text == "尚未定义流程,请与系统管理员联系")
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ok", "alert('" + text + "!');", true);
                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ok", "if(window.showModalDialog('" + text + "',window,'dialogHeight:180px;dialogWidth:450px;center:1;help:0;status:0;')=='1'){window.location.href=window.location.href};", true);
                }
            }
        }
        this.GVBook.DataBind();
    }
Esempio n. 2
0
    protected string CheckTemplate(string bcode, string bclass, System.Guid fid, string prjguid)
    {
        string a = FlowAuditAction.BeginFlow(this.BusinessCode, this.BusinessClass, fid, prjguid, this.Session["yhdm"].ToString());

        if (a == "请先设置当前模块的审核流程")
        {
            return("1");
        }
        return("2");
    }
Esempio n. 3
0
    protected void btnStartWF_Click(object sender, EventArgs e)
    {
        Guid   recordID = new Guid(this.hfRecord.Value);
        string text     = FlowAuditAction.BeginFlow("005", "005", recordID, "", base.UserCode);

        if (text == "工作流程已成功启动")
        {
            this.JS.Text = "alert('" + text + "!');document.getElementById(\"btnRefresh\").click();";
            return;
        }
        this.JS.Text = "if(window.showModalDialog('" + text + "',window,'dialogHeight:180px;dialogWidth:450px;center:1;help:0;status:0;')=='1'){document.getElementById(\"btnRefresh\").click();}; ";
    }
Esempio n. 4
0
    protected void BtnAdd_Click(object sender, System.EventArgs e)
    {
        string[] array = new string[3];
        if (this.TemplateCount > 1)
        {
            array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID);
            this.hdnNodeId.Value      = array[0].ToString();
            this.hdnOrderNumber.Value = array[1].ToString();
        }
        else
        {
            if (this.TemplateCount == 1)
            {
                if (this.OffsetCount > 1)
                {
                    this.hdnNodeId.Value      = this.NodeID.ToString();
                    this.hdnOrderNumber.Value = "1";
                }
                else
                {
                    array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID);
                    this.hdnNodeId.Value      = array[0].ToString();
                    this.hdnOrderNumber.Value = array[1].ToString();
                }
            }
        }
        int offsetorder = System.Convert.ToInt32(this.hdnOrderNumber.Value.ToString().Trim());

        this.NodeID = System.Convert.ToInt32(this.hdnNodeId.Value.ToString().Trim());
        if (this.hdnNodeId.Value.Trim() == "0")
        {
            this.JS.Text = "alert('工作流程多分支模板未设置分支条件!')";
            return;
        }
        if (FlowAuditAction.BeginFlow(this.BusinessClass, this.BusinessCode, this.RecordID, this.TemplateID, this.NodeID, offsetorder, this.ProjectCode, this.UserCode))
        {
            if (FlowAuditAction.FirstNodeIsSelected(this.TemplateID))
            {
                if (this.DDLSuperordinateDuty.Items.Count > 0)
                {
                    this.hdnReceiver.Value = this.DDLSuperordinateDuty.SelectedValue;
                }
                FlowAuditAction.InsertOperator(this.BusinessClass, this.BusinessCode, this.RecordID, this.hdnReceiver.Value);
            }
            this.JS.Text = "alert('工作流程已成功启动!');window.close();returnValue=true;";
            return;
        }
        this.JS.Text = "alert('请找管理员设置 " + this.LbTemName.Text + " 流程的负责人。');";
    }
Esempio n. 5
0
    protected void BtnAudit_Click(object sender, EventArgs e)
    {
        Guid instanceCode = new Guid(this.RecordID.Value);
        bool flag         = FlowAuditAction.BeginFlow("112", instanceCode, 17, this.PrjCode.Value.ToString(), base.UserCode);

        if (flag)
        {
            this.Js.Text = "alert('启动申请审核成功!')";
        }
        else
        {
            this.Js.Text = "alert('启动申请审核失败!')";
        }
        this.Data_Bind();
    }
Esempio n. 6
0
    protected void BtnApply_Click(object sender, EventArgs e)
    {
        Guid instanceCode = new Guid(this.hdnRecordID.Value);
        bool flag         = FlowAuditAction.BeginFlow("101", instanceCode, 1, this.PrjCode, base.UserCode);

        if (flag)
        {
            this.JS.Text = "alert('启动申请审核成功!')";
        }
        else
        {
            this.JS.Text = "alert('启动申请审核失败!')";
        }
        this.DGrdList_DataBind();
    }
Esempio n. 7
0
    protected void btnStartWF_Click(object sender, EventArgs e)
    {
        Guid   recordID = new Guid(this.HdnRecordID.Value);
        string text     = FlowAuditAction.BeginFlow("009", "001", recordID, "", base.UserCode);

        if (text == "工作流程已成功启动")
        {
            this.GVBook.DataBind();
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "err", "alert('" + text + "!');", true);
        }
        if (text == "请先设置当前模块的审核流程")
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ok", "alert('" + text + "!');", true);
            return;
        }
        this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ok", "if(window.showModalDialog('" + text + "',window,'dialogHeight:180px;dialogWidth:450px;center:1;help:0;status:0;')=='1'){window.location.href=window.location.href};", true);
    }
Esempio n. 8
0
    protected void btnStartWF_Click(object sender, EventArgs e)
    {
        Guid   recordID = new Guid(this.hfRecord.Value);
        string text     = FlowAuditAction.BeginFlow("006", "001", recordID, "", base.UserCode);

        if (text == "工作流程已成功启动")
        {
            this.JS.Text = "alert('" + text + "!');";
        }
        else
        {
            if (text == "请先设置当前模块的审核流程")
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "ok", "alert('" + text + "!');", true);
            }
            else
            {
                this.JS.Text = "if(window.showModalDialog('" + text + "',window,'dialogHeight:180px;dialogWidth:450px;center:1;help:0;status:0;')=='1'){}; ";
            }
        }
        this.SystemInfoBind();
    }
Esempio n. 9
0
    protected void BtnAdd_ClickWX(object sender, System.EventArgs e)
    {
        if (this.ddltTemplate.SelectedValue == "-1")
        {
            base.RegisterScript("alert('请选择流程模板')");
            return;
        }
        WFInstanceMainService wFInstanceMainService = new WFInstanceMainService();
        WFTemplateNodeService wFTemplateNodeService = new WFTemplateNodeService();

        if (wFTemplateNodeService.GetNodes(this.TemplateID).Count == 0)
        {
            wFInstanceMainService.UpdateBusinessData(this.RecordID.ToString(), this.BusinessCode, 1);
            WFBusinessCodeService wFBusinessCodeService = new WFBusinessCodeService();
            WFBusinessCode        byId = wFBusinessCodeService.GetById(this.BusinessCode);
            string path     = base.Server.MapPath("~/SelfEventInfo.xml");
            string typeName = SelfEventAction.GetTypeName(path, byId.LinkTable, byId.StateField);
            if (!string.IsNullOrEmpty(typeName))
            {
                ISelfEvent selfEvent = (ISelfEvent)System.Reflection.Assembly.Load("PmBusinessLogic").CreateInstance(typeName);
                if (selfEvent != null)
                {
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(selfEvent.CommitEvent), this.RecordID.ToString());
                }
            }
            if (this.BusinessCode == "089")
            {
                PTPrjInfoZTB byId2 = this.ptInfoZTbSer.GetById(this.RecordID);
                this.ptInfoZTbSer.UpdatePrjState(byId2, new int?(2));
            }
            else
            {
                if (this.BusinessCode == "100")
                {
                    PrjMember.AddLimit(this.RecordID);
                }
                else
                {
                    if (this.BusinessCode == "107")
                    {
                        Progress.UpdateLatest(this.RecordID.ToString());
                    }
                    else
                    {
                        if (this.BusinessCode == "108")
                        {
                            cn.justwin.BLL.ProgressManagement.Version.UpdateLatest(this.RecordID.ToString());
                        }
                    }
                }
            }

            stringBuilder.Append("alert('审核通过');");
            stringBuilder.Append(" page_close();");
            stringBuilder.Append("window.parent.location.reload();");
            base.RegisterScript(stringBuilder.ToString());
            base.RegisterScript(stringBuilder.ToString());
            //base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('审核通过'); ");

            return;
        }
        if (wFInstanceMainService.IsReSubmit(this.RecordID.ToString(), this.BusinessCode))
        {
            this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('当前数据已经被提交,禁止二次提交');", true);
            return;
        }
        if (this.ddltTemplate.SelectedValue != "-1")
        {
            FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID);
            if (this.txtReceiver.Text != "")
            {
                if (this.TemplateID == 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('请选择流程模板');", true);
                    return;
                }
                string[] array = new string[3];
                this.TemplateID = System.Convert.ToInt32(this.hdnTemplateID.Value);
                if (this.TemplateCount > 1)
                {
                    array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID);
                    this.hdnNodeId.Value      = array[0].ToString();
                    this.hdnOrderNumber.Value = array[1].ToString();
                }
                else
                {
                    if (this.TemplateCount == 1)
                    {
                        if (this.OffsetCount > 1)
                        {
                            this.hdnNodeId.Value      = this.NodeID.ToString();
                            this.hdnOrderNumber.Value = "1";
                        }
                        else
                        {
                            array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID);
                            this.hdnNodeId.Value      = array[0].ToString();
                            this.hdnOrderNumber.Value = array[1].ToString();
                        }
                    }
                }
                int offsetorder = System.Convert.ToInt32(this.hdnOrderNumber.Value.ToString().Trim());
                this.NodeID = System.Convert.ToInt32(this.hdnNodeId.Value.ToString().Trim());
                if (this.hdnNodeId.Value.Trim() == "0")
                {
                    this.JS.Text = "alert('工作流程多分支模板未设置分支条件!');";
                    return;
                }
                if (this.Type.Value != "")
                {
                    FlowAuditAction.UpdateNode(this.hdnReceiver.Value, this.TemplateID);
                }
                if (FlowAuditAction.BeginFlow(this.BusinessClass, this.BusinessCode, this.RecordID, this.TemplateID, this.NodeID, offsetorder, this.ProjectCode, this.UserCode))
                {
                    try
                    {
                        if (ConfigHelper.Get("SMS") != "")
                        {
                            DataTable dataTable  = publicDbOpClass.DataTableQuary("select * from wf_templatenode where templateid=" + this.TemplateID + " and frontnode=0");
                            DataTable dataTable2 = publicDbOpClass.DataTableQuary(string.Concat(new string[]
                            {
                                "select businessclassname from wf_business_class where businesscode='",
                                this.BusinessCode,
                                "' and businessclass='",
                                this.BusinessClass,
                                "'"
                            }));
                            if (dataTable.Rows.Count > 0)
                            {
                                string text = dataTable2.Rows[0][0].ToString();
                                if (dataTable.Rows[0]["isselreceiver"].ToString() == "1")
                                {
                                    SMS    sMS  = new SMS();
                                    string mbNo = new PhoozyanHelpAction().RePhoneCode(this.hdnReceiver.Value);
                                    string msg  = string.Concat(new string[]
                                    {
                                        "公司短信:",
                                        this.txtReceiver.Text,
                                        "您好!",
                                        new CommunicationAction().BackUserName(this.UserCode),
                                        "已发起",
                                        text,
                                        "流程,请您查看审核!"
                                    });
                                    if (!(bool)sMS.Send("", mbNo, msg, "", "", "")[0])
                                    {
                                    }
                                }
                                else
                                {
                                    string arg = "";
                                    System.Collections.ArrayList arrayList  = new System.Collections.ArrayList();
                                    System.Collections.ArrayList arrayList2 = new System.Collections.ArrayList();
                                    string text2 = dataTable.Rows[0]["Operater"].ToString();
                                    if (text2.Contains(","))
                                    {
                                        string[] array2 = text2.Split(new char[]
                                        {
                                            ','
                                        });
                                        for (int i = 0; i < array2.Length - 1; i++)
                                        {
                                            new userManageDb().GetUserName(array2[i]);
                                            arrayList.Add(arrayList);
                                            string value = new PhoozyanHelpAction().RePhoneCode(array2[i]);
                                            arrayList2.Add(value);
                                        }
                                        for (int j = 0; j < arrayList.Count; j++)
                                        {
                                            if (!string.IsNullOrEmpty(arrayList2[j].ToString()))
                                            {
                                                string msg2 = string.Concat(new object[]
                                                {
                                                    "公司短信:",
                                                    arrayList[j],
                                                    "您好!",
                                                    new CommunicationAction().BackUserName(this.UserCode),
                                                    "已发起",
                                                    text,
                                                    "流程,请您查看审核!"
                                                });
                                                SMS sMS2 = new SMS();
                                                if (!(bool)sMS2.Send("", arrayList2[j].ToString(), msg2, "", "", "")[0])
                                                {
                                                    arg += arrayList[j];
                                                }
                                            }
                                            else
                                            {
                                                arg = arg + arrayList[j] + " ";
                                            }
                                        }
                                    }
                                    else
                                    {
                                        string    text3      = new CommunicationAction().BackUserName(dataTable.Rows[0][0].ToString());
                                        DataTable dataTable3 = publicDbOpClass.DataTableQuary("select mobilephonecode from pt_yhmc where v_yhdm='" + dataTable.Rows[0]["Operater"].ToString() + "'");
                                        if (dataTable3.Rows.Count > 0)
                                        {
                                            string mbNo2 = dataTable3.Rows[0][0].ToString();
                                            if (dataTable2.Rows.Count > 0)
                                            {
                                                string msg3 = string.Concat(new string[]
                                                {
                                                    "公司短信:",
                                                    text3,
                                                    "您好!",
                                                    new CommunicationAction().BackUserName(this.UserCode),
                                                    "已发起",
                                                    text,
                                                    "流程,请您查看审核!"
                                                });
                                                SMS  sMS3      = new SMS();
                                                bool arg_85F_0 = (bool)sMS3.Send("", mbNo2, msg3, "", "", "")[0];
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    catch
                    {
                    }

                    if (!string.IsNullOrEmpty(base.Request["purl"]))
                    {
                        //base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('工作流程已成功启动'); ");
                        return;
                    }

                    stringBuilder.Append("alert('工作流程已成功启动');");
                    stringBuilder.Append(" page_close();");
                    stringBuilder.Append("window.parent.location.reload();");
                    base.RegisterScript(stringBuilder.ToString());
                    //base.RegisterScript("top.ui.winSuccess({parentName: '_StartWf'}); top.ui.show('工作流程已成功启动'); ");
                    return;
                }
                else
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), "myalert", "<script type='text/javascript'>alert('请找管理员设置 " + this.ddltTemplate.SelectedItem.Text.ToString() + " 流程的负责人。')</script>", false);
                }
            }
        }
    }