Пример #1
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 + " 流程的负责人。');";
    }
Пример #2
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;
    }