Ejemplo n.º 1
0
        private static void AuditDefined(int instanceId, string instanceCode, string businessCode, string businessClass, string lastFlowState, string tableName, string columnName)
        {
            string str2 = SelfEventAction.GetTypeName(AppDomain.CurrentDomain.BaseDirectory + "SelfEventInfo.xml", tableName, columnName);

            if (!string.IsNullOrWhiteSpace(str2))
            {
                ISelfEvent event2 = (ISelfEvent)Assembly.Load("PmBusinessLogic").CreateInstance(str2);
                if (event2 != null)
                {
                    string maxSing = FlowAuditAction.GetMaxSing(instanceId);
                    if ((lastFlowState == "1") && (maxSing == "1"))
                    {
                        event2.CommitEvent(instanceCode.ToString());
                    }
                    else if (lastFlowState == "-2")
                    {
                        event2.RefuseEvent(instanceCode.ToString());
                    }
                    else if (lastFlowState == "-3")
                    {
                        event2.RestatedEvent(instanceCode.ToString());
                    }
                }
            }
            if (lastFlowState == "1")
            {
                if (businessCode == "089")
                {
                    TenderInfo.UpdatePrjState(Guid.Parse(instanceCode), 2);
                }
                else if (businessCode == "100")
                {
                    PrjMember.AddLimit(Guid.Parse(instanceCode));
                }
                else if (businessCode == "107")
                {
                    Progress.UpdateLatest(instanceCode.ToString());
                }
                else if (businessCode == "108")
                {
                    cn.justwin.BLL.ProgressManagement.Version.UpdateLatest(instanceCode.ToString());
                }
                MsgOrganiger(instanceId, businessCode, businessClass);
            }
        }
Ejemplo n.º 2
0
    private void save(string str)
    {
        try
        {
            if (this.isSecValidate == "1" && !FlowAuditAction.CheckAuditPwd(this.UserCode, this.txtAuditPwd.Text.Trim()))
            {
                this.JS.Text = "alert('审核密码不正确!');";
            }
            else
            {
                string auditInfo     = this.txtAuditInfo.Value.Trim();
                string value         = this.hdnType.Value;
                string insertAuditor = string.Empty;
                if (value == "前插")
                {
                    insertAuditor = this.hdnFrontPerson.Value;
                }
                if (value == "后插")
                {
                    insertAuditor = this.hdnAfterPerson.Value;
                }
                if (value == "前插" || value == "后插")
                {
                    if ((value == "前插" && this.txtFrontPerson.Text == "") || (value == "后插" && this.txtAfterPerson.Text == ""))
                    {
                        base.RegisterScript("alert('请选择" + value + "审核人');");
                    }
                    else
                    {
                        string value2 = this.txtAuditRemark.Value;
                        FlowAuditAction.InsertNode(this.InstanceID, this.UserCode, value, this.IsAllPass, insertAuditor, true, auditInfo, value2);
                        this.SendSMS(this.InstanceID);
                        System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                        if (str == "pc")
                        {
                            stringBuilder.Append("top.ui.refreshDesktop(); \n");
                            stringBuilder.Append("top.ui.show('" + value + "节点成功!'); \n");
                            stringBuilder.Append("top.ui.closeTab();\n");
                        }
                        else
                        {
                            stringBuilder.Append("alert('添加成功');");
                            stringBuilder.Append("parent.location.reload();");
                        }

                        this.JS.Text = stringBuilder.ToString();
                    }
                }
                else
                {
                    int num = System.Convert.ToInt32(this.RBLRoleType.SelectedValue);
                    if (!FlowAuditAction.GetNextOperator(this.InstanceID) && this.txtnextperson.Text == "" && num == 1)
                    {
                        this.JS.Text = "alert('请选择流程下一个审核人');";
                    }
                    else
                    {
                        if (!FlowAuditAction.GetNextOperator(this.InstanceID) && this.txtnextperson.Text != "" && num == 1)
                        {
                            string project = FlowAuditAction.GetProject(this.BusinessCode, this.InstanceCode);
                            if (!FlowAuditAction.SelectNextOperate(this.InstanceID, this.hdnNextPerson.Value.Trim(), int.Parse(this.NodeType.Value), this.UserCode, project))
                            {
                                this.JS.Text = "alert('请找管理员设置" + this.txtnextperson.Text + "的流程负责人');";
                                return;
                            }
                        }
                        if (num == -3 || num == -2)
                        {
                            string[] allFront = FlowAuditAction.GetAllFront(this.InstanceID);
                            for (int i = 0; i < allFront.Length; i++)
                            {
                                this.AddMsg(allFront[i]);
                            }
                            this.DealAgent();
                        }
                        if (num == 1)
                        {
                            this.SendSMS(this.InstanceID);
                        }
                        this.RecieveMsgAdd();
                        FlowAuditAction.ProcessFlow(this.InstanceID, this.IsAllPass, this.UserCode, num, auditInfo);
                        string maxSing = FlowAuditAction.GetMaxSing(this.InstanceID);
                        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.IsNullOrWhiteSpace(typeName))
                        {
                            ISelfEvent selfEvent = (ISelfEvent)System.Reflection.Assembly.Load("PmBusinessLogic").CreateInstance(typeName);
                            if (selfEvent != null)
                            {
                                if (num == 1 && maxSing == "1")
                                {
                                    selfEvent.CommitEvent(this.InstanceCode.ToString());
                                }
                                if (num == -2)
                                {
                                    selfEvent.RefuseEvent(this.InstanceCode.ToString());
                                }
                                if (num == -3)
                                {
                                    selfEvent.RestatedEvent(this.InstanceCode.ToString());
                                }
                            }
                        }
                        if (this.BusinessCode == "089")
                        {
                            PTPrjInfoZTB byId2 = this.ptInfoZTbSer.GetById(this.InstanceCode);
                            if (maxSing == "1" && num == 1)
                            {
                                this.ptInfoZTbSer.UpdatePrjState(byId2, new int?(2));
                            }
                        }
                        else
                        {
                            if (this.BusinessCode == "100")
                            {
                                if (maxSing == "1" && num == 1)
                                {
                                    PrjMember.AddLimit(this.InstanceCode);
                                }
                            }
                            else
                            {
                                if (this.BusinessCode == "107")
                                {
                                    if (maxSing == "1" && num == 1)
                                    {
                                        Progress.UpdateLatest(this.InstanceCode.ToString());
                                    }
                                }
                                else
                                {
                                    if (this.BusinessCode == "108" && maxSing == "1" && num == 1)
                                    {
                                        cn.justwin.BLL.ProgressManagement.Version.UpdateLatest(this.InstanceCode.ToString());
                                    }
                                }
                            }
                        }
                        if (maxSing == "1")
                        {
                            this.MsgOrganiger();
                        }
                        this.Session.Remove("HumanCode");
                        this.Session.Remove("HumanName");
                        this.JS.Text = "auditSuccess();";
                    }
                }
            }
        }
        catch
        {
            base.RegisterScript("alert('系统提示:\\n\\n此审核数据已经失效!')");
        }
    }
Ejemplo n.º 3
0
    protected void btnSubmit_Click(object sender, System.EventArgs e)
    {
        if (!FlowAuditAction.GetNextOperator(this.InstanceID) && this.txtnextperson.Text == "" && this.RBLRoleType.SelectedValue == "1")
        {
            this.JS.Text = "alert('请选择流程下一个审核人');";
            return;
        }
        if (!FlowAuditAction.GetNextOperator(this.InstanceID) && this.txtnextperson.Text != "" && this.RBLRoleType.SelectedValue == "1")
        {
            FlowAuditAction.InsertOperator(this.InstanceID, this.hdnNextPerson.Value.Trim());
        }
        if (this.isSecValidate == "1")
        {
            string password = this.txtAuditPwd.Text.Trim();
            if (!FlowAuditAction.CheckAuditPwd(this.UserCode, password))
            {
                this.JS.Text = "alert('审核密码不正确!');";
                return;
            }
        }
        string value = this.txtAuditInfo.Value;

        if (this.RBLRoleType.SelectedValue == "-3" || this.RBLRoleType.SelectedValue == "-2")
        {
            string[] allFront = FlowAuditAction.GetAllFront(this.InstanceID);
            for (int i = 0; i < allFront.Length; i++)
            {
                this.AddMsg(allFront[i]);
            }
        }
        if (this.RBLRoleType.SelectedValue == "-3")
        {
            DataTable instanceMain = FlowAuditAction.GetInstanceMain(this.InstanceID);
            FlowAuditAction.DealAudit(new System.Guid(instanceMain.Rows[0]["instancecode"].ToString()), instanceMain.Rows[0]["businesscode"].ToString(), instanceMain.Rows[0]["businessclass"].ToString(), -3);
            string text = " parent.desktop.flowclass.location='/SysFrame/showinfomation.aspx';";
            text        += "alert('保存审核结果成功');";
            text        += "top.frameWorkArea.window.desktop.getActive().close();";
            this.JS.Text = text;
            return;
        }
        int    num = 0;
        string selectedValue;

        if ((selectedValue = this.RBLRoleType.SelectedValue) != null)
        {
            if (!(selectedValue == "1"))
            {
                if (!(selectedValue == "-2"))
                {
                    if (selectedValue == "-3")
                    {
                        num = -3;
                    }
                }
                else
                {
                    num = -2;
                }
            }
            else
            {
                num = 1;
            }
        }
        string value2 = this.hdnType.Value;
        string value3;

        if (value2 == "前插")
        {
            value3 = this.hdnFrontPerson.Value;
            this.RequiredFieldValidator2.Enabled = true;
        }
        else
        {
            value3 = this.hdnAfterPerson.Value;
            this.RequiredFieldValidator3.Enabled = true;
        }
        if (!(value2 == "前插") && !(value2 == "后插"))
        {
            if (num == 1)
            {
                this.GetMsgDB(this.InstanceID);
            }
            if (this.Session["HumanCode"] != null)
            {
                this.RecieveMsgAdd();
            }
            FlowAuditAction.ProcessFlow(this.InstanceID, this.IsAllPass, this.UserCode, num, value);
            FlowAuditAction.GetbusinesscodeTable(this.InstanceID);
            DataTable dataTable = null;
            if (dataTable.Rows.Count > 0)
            {
                ISelfEvent selfEvent = (ISelfEvent)System.Reflection.Assembly.Load(dataTable.Rows[0]["assemblename"].ToString()).CreateInstance(dataTable.Rows[0]["assemblename"].ToString() + "." + dataTable.Rows[0]["classname"].ToString());
                string     maxSing   = FlowAuditAction.GetMaxSing(this.InstanceID);
                if (selfEvent != null)
                {
                    if (this.RBLRoleType.SelectedValue == "1" && maxSing == "1")
                    {
                        selfEvent.CommitEvent(this.InstanceCode.ToString());
                    }
                    if (this.RBLRoleType.SelectedValue == "0")
                    {
                        selfEvent.RefuseEvent(this.InstanceCode.ToString());
                    }
                }
            }
            this.MsgOrganiger();
            this.Session.Remove("HumanCode");
            this.Session.Remove("HumanName");
            string text2 = "parent.desktop.flowclass.location='/SysFrame/showinfomation.aspx';";
            text2       += "alert('保存审核结果成功!');";
            text2       += "top.frameWorkArea.window.desktop.getActive().close();";
            this.JS.Text = text2;
            return;
        }
        if ((value2 == "前插" && this.txtFrontPerson.Text == "") || (value2 == "后插" && this.txtAfterPerson.Text == ""))
        {
            base.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "", "alert('请选择" + value2 + "审核人');", true);
            return;
        }
        string value4 = this.txtAuditRemark.Value;

        FlowAuditAction.InsertNode(this.InstanceID, this.UserCode, value2, this.IsAllPass, value3, false, value, value4);
        string text3 = " parent.desktop.flowclass.location='/SysFrame/showinfomation.aspx';";

        text3        = text3 + "alert('" + value2 + "节点成功!');";
        text3       += "top.frameWorkArea.window.desktop.getActive().close();";
        this.JS.Text = text3;
    }