private void BindData()
    {
        EWF_Flow_ProcessDecisionBLL bll = new EWF_Flow_ProcessDecisionBLL((Guid)ViewState["ProcessID"]);

        #region 绑定基本信息
        this.lb_ID.Text      = ViewState["ProcessID"].ToString();
        tbx_Name.Text        = bll.Model.Name;
        tbx_Description.Text = bll.Model.Description;
        ddl_DefaultNextProcess.SelectedValue = bll.Model.DefaultNextProcess.ToString();
        tbx_Sort.Text = bll.Model.Sort.ToString();
        #endregion

        ddl_RecipientRole_Decision.SelectedValue = bll.Model.RecipientRole.ToString();
        ddl_RecipientRole_Decision_SelectedIndexChanged(null, null);
        ddl_DataObject_Decision.SelectedValue = bll.Model.DataObject.ToString();
        ddl_AllowNotSure.SelectedValue        = bll.Model.AllowNotSure;
        ddl_PositiveNextProcess.SelectedValue = bll.Model.PositiveNextProcess.ToString();
        ddl_NegativeNextProcess.SelectedValue = bll.Model.NegativeNextProcess.ToString();
        tbx_TimeoutHours.Text   = bll.Model.TimeoutHours.ToString();
        tbx_MessageSubject.Text = bll.Model.MessageSubject;
        if (bll.Model.CanSkip != "")
        {
            ddl_CanSkip.SelectedValue = bll.Model.CanSkip;
        }
        if (bll.Model.CanBatchApprove != "")
        {
            ddl_CanBatchApprove.SelectedValue = bll.Model.CanBatchApprove;
        }
    }
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        if ((Guid)ViewState["ProcessID"] != Guid.Empty)//修改
        {
            EWF_Flow_ProcessDecisionBLL bll = new EWF_Flow_ProcessDecisionBLL((Guid)ViewState["ProcessID"]);

            if (!string.IsNullOrEmpty(ddl_AllowNotSure.SelectedValue))
            {
                bll.Model.AllowNotSure = ddl_AllowNotSure.SelectedValue;
            }
            bll.Model.DataObject         = new Guid(ddl_DataObject_Decision.SelectedValue);
            bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue);
            bll.Model.Description        = tbx_Description.Text;
            bll.Model.Sort = int.Parse(tbx_Sort.Text);

            bll.Model.MessageSubject      = tbx_MessageSubject.Text;
            bll.Model.Name                = tbx_Name.Text;
            bll.Model.NegativeNextProcess = new Guid(ddl_NegativeNextProcess.SelectedValue);
            bll.Model.PositiveNextProcess = new Guid(ddl_PositiveNextProcess.SelectedValue);
            bll.Model.RecipientRole       = new Guid(ddl_RecipientRole_Decision.SelectedValue);
            if (!string.IsNullOrEmpty(tbx_TimeoutHours.Text))
            {
                bll.Model.TimeoutHours = int.Parse(tbx_TimeoutHours.Text);
            }
            bll.Model.CanSkip         = ddl_CanSkip.SelectedValue;
            bll.Model.CanBatchApprove = ddl_CanBatchApprove.SelectedValue;
            bll.Update();
        }
        else//新增
        {
            EWF_Flow_ProcessDecisionBLL bll = new EWF_Flow_ProcessDecisionBLL();
            bll.Model.App = (Guid)ViewState["AppID"];
            if (!string.IsNullOrEmpty(ddl_AllowNotSure.SelectedValue))
            {
                bll.Model.AllowNotSure = ddl_AllowNotSure.SelectedValue;
            }
            bll.Model.DataObject         = new Guid(ddl_DataObject_Decision.SelectedValue);
            bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue);
            bll.Model.Description        = tbx_Description.Text;
            bll.Model.Sort = int.Parse(tbx_Sort.Text);
            bll.Model.Type = 3;

            bll.Model.MessageSubject      = tbx_MessageSubject.Text;
            bll.Model.Name                = tbx_Name.Text;
            bll.Model.NegativeNextProcess = new Guid(ddl_NegativeNextProcess.SelectedValue);
            bll.Model.PositiveNextProcess = new Guid(ddl_PositiveNextProcess.SelectedValue);
            bll.Model.RecipientRole       = new Guid(ddl_RecipientRole_Decision.SelectedValue);
            if (!string.IsNullOrEmpty(tbx_TimeoutHours.Text))
            {
                bll.Model.TimeoutHours = int.Parse(tbx_TimeoutHours.Text);
            }
            bll.Model.CanSkip         = ddl_CanSkip.SelectedValue;
            bll.Model.CanBatchApprove = ddl_CanBatchApprove.SelectedValue;
            bll.Add();
        }
        Response.Redirect("FlowProcessList.aspx?AppID=" + ViewState["AppID"].ToString());
    }
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        if ((Guid)ViewState["ProcessID"] != Guid.Empty)//修改
        {
            EWF_Flow_ProcessDecisionBLL bll = new EWF_Flow_ProcessDecisionBLL((Guid)ViewState["ProcessID"]);

            if (!string.IsNullOrEmpty(ddl_AllowNotSure.SelectedValue)) bll.Model.AllowNotSure = ddl_AllowNotSure.SelectedValue;
            bll.Model.DataObject = new Guid(ddl_DataObject_Decision.SelectedValue);
            bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue);
            bll.Model.Description = tbx_Description.Text;
            bll.Model.Sort = int.Parse(tbx_Sort.Text);

            bll.Model.MessageSubject = tbx_MessageSubject.Text;
            bll.Model.Name = tbx_Name.Text;
            bll.Model.NegativeNextProcess = new Guid(ddl_NegativeNextProcess.SelectedValue);
            bll.Model.PositiveNextProcess = new Guid(ddl_PositiveNextProcess.SelectedValue);
            bll.Model.RecipientRole = new Guid(ddl_RecipientRole_Decision.SelectedValue);
            if (!string.IsNullOrEmpty(tbx_TimeoutHours.Text)) bll.Model.TimeoutHours = int.Parse(tbx_TimeoutHours.Text);
            bll.Model.CanSkip = ddl_CanSkip.SelectedValue;
            bll.Model.CanBatchApprove = ddl_CanBatchApprove.SelectedValue;
            bll.Update();
        }
        else//新增
        {
            EWF_Flow_ProcessDecisionBLL bll = new EWF_Flow_ProcessDecisionBLL();
            bll.Model.App = (Guid)ViewState["AppID"];
            if (!string.IsNullOrEmpty(ddl_AllowNotSure.SelectedValue)) bll.Model.AllowNotSure = ddl_AllowNotSure.SelectedValue;
            bll.Model.DataObject = new Guid(ddl_DataObject_Decision.SelectedValue);
            bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue);
            bll.Model.Description = tbx_Description.Text;
            bll.Model.Sort = int.Parse(tbx_Sort.Text);
            bll.Model.Type = 3;

            bll.Model.MessageSubject = tbx_MessageSubject.Text;
            bll.Model.Name = tbx_Name.Text;
            bll.Model.NegativeNextProcess = new Guid(ddl_NegativeNextProcess.SelectedValue);
            bll.Model.PositiveNextProcess = new Guid(ddl_PositiveNextProcess.SelectedValue);
            bll.Model.RecipientRole = new Guid(ddl_RecipientRole_Decision.SelectedValue);
            if (!string.IsNullOrEmpty(tbx_TimeoutHours.Text)) bll.Model.TimeoutHours = int.Parse(tbx_TimeoutHours.Text);
            bll.Model.CanSkip = ddl_CanSkip.SelectedValue;
            bll.Model.CanBatchApprove = ddl_CanBatchApprove.SelectedValue;
            bll.Add();

        }
        Response.Redirect("FlowProcessList.aspx?AppID=" + ViewState["AppID"].ToString());
    }
    protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            EWF_Task_Job Job = new EWF_Task_JobBLL((int)gv_List.DataKeys[e.Row.RowIndex]["CurrentJobID"]).Model;
            if (Job == null)
            {
                return;
            }

            EWF_Flow_Process p = new EWF_Flow_ProcessBLL(Job.CurrentProcess).Model;
            if (p == null)
            {
                return;
            }

            if (p.Type == 3)
            {
                EWF_Flow_ProcessDecision Process = new EWF_Flow_ProcessDecisionBLL(Job.CurrentProcess).Model;
                if (Process == null)
                {
                    return;
                }

                if (Process.CanBatchApprove == "N")
                {
                    CheckBox cb_Check = (CheckBox)e.Row.FindControl("cb_Check");

                    if (cb_Check != null)
                    {
                        cb_Check.Checked = false;
                        cb_Check.Visible = false;
                    }
                }
            }
        }
    }
    protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            EWF_Task_Job Job = new EWF_Task_JobBLL((int)gv_List.DataKeys[e.Row.RowIndex]["CurrentJobID"]).Model;
            if (Job == null) return;

            EWF_Flow_Process p = new EWF_Flow_ProcessBLL(Job.CurrentProcess).Model;
            if (p == null) return;

            if (p.Type == 3)
            {
                EWF_Flow_ProcessDecision Process = new EWF_Flow_ProcessDecisionBLL(Job.CurrentProcess).Model;
                if (Process == null) return;

                if (Process.CanBatchApprove == "N")
                {
                    CheckBox cb_Check = (CheckBox)e.Row.FindControl("cb_Check");

                    if (cb_Check != null)
                    {
                        cb_Check.Checked = false;
                        cb_Check.Visible = false;
                    }
                }
            }

        }
    }
    private void BindData()
    {
        EWF_Flow_ProcessDecisionBLL bll = new EWF_Flow_ProcessDecisionBLL((Guid)ViewState["ProcessID"]);

        #region 绑定基本信息
        this.lb_ID.Text = ViewState["ProcessID"].ToString();
        tbx_Name.Text = bll.Model.Name;
        tbx_Description.Text = bll.Model.Description;
        ddl_DefaultNextProcess.SelectedValue = bll.Model.DefaultNextProcess.ToString();
        tbx_Sort.Text = bll.Model.Sort.ToString();
        #endregion

        ddl_RecipientRole_Decision.SelectedValue = bll.Model.RecipientRole.ToString();
        ddl_RecipientRole_Decision_SelectedIndexChanged(null, null);
        ddl_DataObject_Decision.SelectedValue = bll.Model.DataObject.ToString();
        ddl_AllowNotSure.SelectedValue = bll.Model.AllowNotSure;
        ddl_PositiveNextProcess.SelectedValue = bll.Model.PositiveNextProcess.ToString();
        ddl_NegativeNextProcess.SelectedValue = bll.Model.NegativeNextProcess.ToString();
        tbx_TimeoutHours.Text = bll.Model.TimeoutHours.ToString();
        tbx_MessageSubject.Text = bll.Model.MessageSubject;
        if (bll.Model.CanSkip != "") ddl_CanSkip.SelectedValue = bll.Model.CanSkip;
        if (bll.Model.CanBatchApprove != "") ddl_CanBatchApprove.SelectedValue = bll.Model.CanBatchApprove;
    }