Beispiel #1
0
    private TableCell createCheckWorkFlowTableCell(DataRow dr)
    {
        string strText = string.Empty;

        if (this.IsView)
        {
            strText = DBNullConverter.ToStr(dr["RegionCaption"])
                      + "</br>" + "审批人:" + DBNullConverter.ToStr(dr["Approver"])
                      + "</br>" + "单据状态:" + DBNullConverter.ToStr(dr["FlowStatus"]) + setHighLight(dr["IsOutTime"].ToString())
                      + "</br>" + "日期:" + DBNullConverter.ToStr(dr["AuditDate"])
                      + "</br>" + "审批意见:"
                      + "</br>" + exchangeString(DBNullConverter.ToStr(dr["Comment"]));
            if (DBNullConverter.ToInteger(dr["isPending"]) == 0)
            {
                //Return createViewTabelCell(strText)
                return(createViewTabelCell(dr));
            }
            else
            {
                //Return createIsPendingViewTableCell(strText)
                return(createIsPendingViewTableCell(dr));
            }
        }
        else
        {
            if (DBNullConverter.ToInteger(dr["isView"]) == 0)
            {
                strText = DBNullConverter.ToStr(dr["RegionCaption"]) +
                          "</br>" + "审批人:" + DBNullConverter.ToStr(dr["Approver"]) +
                          "</br>" + "单据状态:" + DBNullConverter.ToStr(dr["FlowStatus"]) + setHighLight(dr["IsOutTime"].ToString()) +

                          "</br>" + "日期:" + DBNullConverter.ToStr(dr["AuditDate"]) +
                          "</br>" + "审批意见:" + "</br>" + exchangeString(DBNullConverter.ToStr(dr["Comment"]));
                if (DBNullConverter.ToInteger(dr["isPending"]) == 0)
                {
                    //Return createViewTabelCell(strText)
                    return(createViewTabelCell(dr));
                }
                else
                {
                    //Return createIsPendingViewTableCell(strText)
                    return(createIsPendingViewTableCell(dr));
                }
            }
            else
            {
                this.AllowSubmit = true;
                if (isLastIndex)
                {
                    _isAllowInput = true;
                }
                return(createEditTableCell(dr));
            }
        }
    }
Beispiel #2
0
    private void generaAddRowToDt(ref DataTable dt, lib.APWorkFlow.NodeStatusRow drwfh, string regionCaption, string status)
    {
        DataRow dr;

        dr = dt.NewRow();
        dr["RegionCaption"] = regionCaption;
        dr["Approver"]      = DBNullConverter.ToStr(drwfh.APPROVED_BY);
        dr["FlowStatus"]    = status;
        dr["AuditDate"]     = DBNullConverter.ToStr(drwfh.COMPLETED_DATE);
        dr["Comment"]       = DBNullConverter.ToStr(drwfh.COMMENTS);
        dr["IsView"]        = 0;
        dr["IsPending"]     = 0;
        dt.Rows.Add(dr);
    }
Beispiel #3
0
    private void generaAddErrorInTurnRowToDt(ref DataTable dt, lib.APWorkFlow.NodeStatusRow drwfh, string regionCaption, string status)
    {
        string  userName = ((AuthorizationDS.StuffUserRow)Session["StuffUser"]).StuffName;
        DataRow dr;

        dr = dt.NewRow();
        dr["RegionCaption"] = regionCaption;
        dr["Approver"]      = userName;
        dr["FlowStatus"]    = status;
        dr["AuditDate"]     = string.Empty;
        dr["IsView"]        = 1;
        dr["IsPending"]     = 0;
        dr["OnError"]       = 1;
        dr["Comment"]       = DBNullConverter.ToStr(drwfh.ERROR_MSG);
        dt.Rows.Add(dr);
    }
Beispiel #4
0
    private void generaAddPendingRowToDt(ref DataTable dt, lib.APWorkFlow.NodeStatusRow drwfh, string regionCaption)
    {
        AuthorizationBLL auBLL         = new AuthorizationBLL();
        string           approvalNames = auBLL.GetApprovalNamesByUserIds(DBNullConverter.ToStr(drwfh.PARTICIPANT));

        DataRow dr = dt.NewRow();

        dr["RegionCaption"] = regionCaption;
        dr["Approver"]      = approvalNames;
        dr["FlowStatus"]    = waitingStatus;
        dr["AuditDate"]     = string.Empty;
        dr["Comment"]       = null;
        dr["IsView"]        = 0;
        dr["IsPending"]     = 1;

        dt.Rows.Add(dr);
    }
Beispiel #5
0
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    /// <remarks></remarks>
    protected DataSet GetCheckWorkFlowData()
    {
        DataSet   ds = new DataSet();
        DataTable dt;

        //创建数据表
        dt = new DataTable();
        dt.Columns.Add(new DataColumn("RegionCaption", typeof(string)));
        dt.Columns.Add(new DataColumn("Approver", typeof(string)));
        dt.Columns.Add(new DataColumn("FlowStatus", typeof(string)));
        dt.Columns.Add(new DataColumn("AuditDate", typeof(string)));
        dt.Columns.Add(new DataColumn("Comment", typeof(string)));
        dt.Columns.Add(new DataColumn("IsView", typeof(int)));
        dt.Columns.Add(new DataColumn("IsPending", typeof(int)));
        dt.Columns.Add(new DataColumn("OnError", typeof(int)));
        dt.Columns.Add(new DataColumn("RejectReason", typeof(string)));
        dt.Columns.Add(new DataColumn("IsOutTime", typeof(int)));//是否超时

        //HU
        APHelper AP = CommonUtility.GetAPHelper(Session);

        lib.APWorkFlow.NodeStatusDataTable APTable = AP.getApprovalStatus(this.ProcID);
        if (APTable == null)
        {
            return(ds);
        }

        AuthorizationBLL authorizationBLL = new AuthorizationBLL();

        QueryDS.FormViewRow          formRow     = new FormQueryBLL().GetFormViewByID(this.FormID);
        AuthorizationDS.StuffUserRow stuffuserDr = authorizationBLL.GetStuffUserById(formRow.UserID);

        //创建节点,先创建申请节点
        DataRow dr;

        dr = dt.NewRow();
        dr["RegionCaption"] = strDraft;
        dr["Approver"]      = stuffuserDr.StuffName;
        dr["AuditDate"]     = formRow.SubmitDate.ToString("yyyy-MM-dd HH:mm");
        dr["FlowStatus"]    = submittedStatus;

        dr["Comment"]   = string.Empty;
        dr["IsView"]    = 0;
        dr["IsPending"] = 0;
        dr["OnError"]   = 0;
        dr["IsOutTime"] = 0;
        dt.Rows.Add(dr);
        //再创建审批节点
        foreach (lib.APWorkFlow.NodeStatusRow drwfh in APTable.Rows)
        {
            switch (DBNullConverter.ToStr(drwfh.STATUS))
            {
            //case (int)SystemEnums.FlowNodeStatus.Wait:
            //    generaAddPendingRowToDt(ref dt, drwfh, strApproving);
            //    break;
            case APHelper.FlowNodeStatus.ONERROR:
                if (this.IsView)
                {
                    generaAddErrorPendingRowToDt(ref dt, drwfh, strError);
                }
                else
                {
                    generaAddErrorInTurnRowToDt(ref dt, drwfh, strError, errorStatus);
                }
                break;

            case APHelper.FlowNodeStatus.ASSIGNED:
                if (this.IsView)
                {
                    generaAddPendingRowToDt(ref dt, drwfh, strApproving);
                }
                else
                {
                    generaAddInTurnRowToDt(ref dt, drwfh, strApproving, approvedStatus);
                }
                //if (this.ViewState["CurrentApproveIndex"] == null) {
                //    CurrentApproveIndex = int.Parse(drwfh["ApprovalIndex"].ToString());
                //    this.ViewState["CurrentApproveIndex"] = CurrentApproveIndex;
                //} else {
                //    CurrentApproveIndex = int.Parse(this.ViewState["CurrentApproveIndex"].ToString());
                //}
                break;

            case APHelper.FlowNodeStatus.APPROVED:
                generaAddRowToDt(ref dt, drwfh, strApproved, approvedStatus);
                break;

            case APHelper.FlowNodeStatus.CANCELLED:
                generaAddRowToDt(ref dt, drwfh, strReturnModify, rejectedStatus);
                break;

            default:
                break;
            }
        }
        for (int n = 0; n < dt.Rows.Count; n++)
        {
            DataRow dr1 = dt.Rows[n];
            DataRow dr2 = dt.Rows[n + 1];//后一个节点
            if (string.IsNullOrEmpty(dr2["AuditDate"].ToString()))
            {
                dr2["AuditDate"] = DateTime.Now.ToString();
            }
            TimeSpan ts = Convert.ToDateTime(dr2["AuditDate"]) - Convert.ToDateTime(dr1["AuditDate"]);
            if (ts.Days >= 2)
            {
                dr2["IsOutTime"] = 1;
            }
            else
            {
                dr2["IsOutTime"] = 0;
            }
            if (n + 1 == dt.Rows.Count - 1)
            {
                break;
            }
        }

        ds.Tables.Add(dt);
        return(ds);
    }
Beispiel #6
0
    private TableCell createEditTableCell(DataRow dr)
    {
        TableCell tcTemp = new TableCell();

        tcTemp.Attributes.Add("class", "FlowBg_now");//此处添加的是当前步骤的cell


        Label lblRegionCaption = new Label();

        lblRegionCaption.Text = DBNullConverter.ToStr(dr["RegionCaption"]);
        lblRegionCaption.ID   = "lblRegionCaption";
        lblRegionCaption.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblRegionCaption);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        Label lblApproverEx = new Label();

        if (DBNullConverter.ToInt32(dr["OnError"]) == 1)
        {
            lblApproverEx.Text = "操作人:";
        }
        else
        {
            lblApproverEx.Text = "审批人:";
        }
        lblApproverEx.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblApproverEx);

        Label lblApprover = new Label();

        lblApprover.ID   = "lblApprover";
        lblApprover.Text = DBNullConverter.ToStr(dr["Approver"]);
        tcTemp.Controls.Add(lblApprover);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        Label lblrequiredLable = new Label();

        lblrequiredLable.Text      = "*";
        lblrequiredLable.ForeColor = System.Drawing.Color.Red;
        tcTemp.Controls.Add(lblrequiredLable);
        Label lblStatus = new Label();

        lblStatus.ID   = "lblStatus";
        lblStatus.Text = "单据状态:" + setHighLight(dr["IsOutTime"].ToString());
        lblStatus.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblStatus);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        //Dim radApprove As RadioButton = New RadioButton
        radApprove.ID = "radApprove";
        if (DBNullConverter.ToInt32(dr["OnError"]) == 1)
        {
            radApprove.Text = "尝试恢复";
        }
        else
        {
            radApprove.Text            = "同意";
            radApprove.CheckedChanged += new EventHandler(radApprove_CheckedChanged);
        }
        radApprove.GroupName    = "gnStatus";
        radApprove.Checked      = true;
        radApprove.AutoPostBack = true;
        tcTemp.Controls.Add(radApprove);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        //Dim radReject As RadioButton = New RadioButton
        radReject.ID = "radReject";
        if (DBNullConverter.ToInt32(dr["OnError"]) == 1)
        {
            radReject.Text = "退回单据";
        }
        else
        {
            radReject.Text            = "拒绝";
            radReject.CheckedChanged += new EventHandler(radApprove_CheckedChanged);
        }
        radReject.GroupName    = "gnStatus";
        radReject.AutoPostBack = true;
        tcTemp.Controls.Add(radReject);
        tcTemp.Controls.Add(new LiteralControl("&nbsp;&nbsp;"));

        //if (radReject.Checked)
        //{
        //    lblRejectReason.Text = "Reject Reason:";
        //    lblRejectReason.ID = "lblRejectReason";
        //    lblRejectReason.Attributes.Add("class", "TxtB");
        //    lblRejectReason.Visible = false;
        //    tcTemp.Controls.Add(lblRejectReason);
        //    tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        ddlReject.ID             = "ddlReject";
        ddlReject.Width          = new Unit("142px");
        ddlReject.Visible        = false;
        ddlReject.DataValueField = "RejectReasonId";
        ddlReject.DataTextField  = "RejectReasonTitle";
        ddlReject.AutoPostBack   = true;
        //RejectReasonBLL bll = new RejectReasonBLL();
        if (DBNullConverter.ToInt32(dr["OnError"]) == 1)
        {
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));
        }
        else
        {
            MasterDataBLL bll = new MasterDataBLL();
            ddlReject.DataSource = bll.GetRejectReason();
            ddlReject.DataBind();
            ddlReject.Items.Insert(0, new ListItem("---请您选择---", ""));
            ddlReject.SelectedIndexChanged += new EventHandler(ddlReject_SelectedIndexChanged);
            tcTemp.Controls.Add(ddlReject);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));

            Label lblComments = new Label();
            lblComments.Text = "审批意见:";
            lblComments.ID   = "lblComments";
            lblComments.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblComments);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));
        }

        txtComments.ID       = "txtComments";
        txtComments.Width    = 200;
        txtComments.Height   = 50;
        txtComments.TextMode = TextBoxMode.MultiLine;
        txtComments.Rows     = 5;
        txtComments.Columns  = 20;
        if (DBNullConverter.ToInt32(dr["OnError"]) == 1)
        {
            txtComments.Text     = DBNullConverter.ToStr(dr["Comment"]);
            txtComments.ReadOnly = true;
        }
        else
        {
            txtComments.Attributes.Add("onchange", "javascript:return textLimit(this,100);");
        }
        //txtComments.Attributes.Add("onKeyUp", "javascript:textLimit(this,100);")
        tcTemp.Controls.Add(txtComments);

        return(tcTemp);
    }
Beispiel #7
0
    private TableCell createIsPendingViewTableCell(DataRow dr)
    {
        TableCell tcTemp = new TableCell();

        tcTemp.Attributes.Add("class", "FlowBg_Pending");

        Label lblRegionCaption = new Label();

        lblRegionCaption.Text = DBNullConverter.ToStr(dr["RegionCaption"]);
        lblRegionCaption.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblRegionCaption);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        Label lblApproverEx = new Label();

        if (DBNullConverter.ToInt32(dr["OnError"]) == 1)
        {
            lblApproverEx.Text = "操作人:";
        }
        else
        {
            lblApproverEx.Text = "审批人:";
        }
        lblApproverEx.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblApproverEx);

        Label lblApprover = new Label();

        lblApprover.Text = DBNullConverter.ToStr(dr["Approver"]);
        tcTemp.Controls.Add(lblApprover);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        Label lblStatusEx = new Label();

        lblStatusEx.Text = "单据状态:";
        lblStatusEx.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblStatusEx);

        Label lblStatus = new Label();

        lblStatus.Text = DBNullConverter.ToStr(dr["FlowStatus"]) + setHighLight(dr["IsOutTime"].ToString());
        tcTemp.Controls.Add(lblStatus);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        Label lblApproveDateEx = new Label();

        lblApproveDateEx.Text = "日期:";
        lblApproveDateEx.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblApproveDateEx);

        Label lblApproveDate = new Label();

        lblApproveDate.Text = DBNullConverter.ToStr(dr["AuditDate"]);
        tcTemp.Controls.Add(lblApproveDate);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        Label lblCommentsEx = new Label();

        lblCommentsEx.Text = "审批意见:";
        lblCommentsEx.Attributes.Add("class", "TxtB");
        tcTemp.Controls.Add(lblCommentsEx);
        tcTemp.Controls.Add(new LiteralControl("<br><br>"));

        //Dim lblComments As Label = New Label()
        //lblComments.Text = DBNullConverter.ToStr(dr["Comments"])
        //tcTemp.Controls.Add(lblComments)
        TextBox txtCommentsEx = new TextBox();

        txtCommentsEx.Width    = 200;
        txtCommentsEx.Height   = 50;
        txtCommentsEx.TextMode = TextBoxMode.MultiLine;
        txtCommentsEx.Rows     = 5;
        txtCommentsEx.Columns  = 20;
        txtCommentsEx.Text     = DBNullConverter.ToStr(dr["Comment"]);
        txtCommentsEx.ReadOnly = true;
        txtCommentsEx.Attributes.Add("class", "FlowCom_Pending");
        tcTemp.Controls.Add(txtCommentsEx);

        return(tcTemp);
    }
Beispiel #8
0
    private TableCell createViewTabelCell(DataRow dr)
    {
        TableCell tcTemp = new TableCell();

        if ((dr["RegionCaption"].ToString() != "已完成"))
        {
            tcTemp.Attributes.Add("class", "FlowBg_old");//此处为审批通过的节点
            Label lblRegionCaption = new Label();
            lblRegionCaption.Text = DBNullConverter.ToStr(dr["RegionCaption"]);
            lblRegionCaption.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblRegionCaption);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));

            Label lblApproverEx = new Label();
            lblApproverEx.Text = "审批人:";
            if ((dr["RegionCaption"].ToString() == strDraft))
            {
                lblApproverEx.Text = "申请人:";
            }
            lblApproverEx.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblApproverEx);

            Label lblApprover = new Label();
            lblApprover.Text = DBNullConverter.ToStr(dr["Approver"]);
            tcTemp.Controls.Add(lblApprover);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));

            Label lblStatusEx = new Label();
            lblStatusEx.Text = "单据状态:";
            lblStatusEx.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblStatusEx);

            Label lblStatus = new Label();
            lblStatus.Text = DBNullConverter.ToStr(dr["FlowStatus"]) + setHighLight(dr["IsOutTime"].ToString());
            tcTemp.Controls.Add(lblStatus);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));

            Label lblApproveDateEx = new Label();
            lblApproveDateEx.Text = "日期:";
            lblApproveDateEx.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblApproveDateEx);

            Label lblApproveDate = new Label();
            lblApproveDate.Text = DBNullConverter.ToStr(dr["AuditDate"]);
            tcTemp.Controls.Add(lblApproveDate);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));

            Label lblCommentsEx = new Label();
            lblCommentsEx.Text = "审批意见:";
            lblCommentsEx.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblCommentsEx);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));

            TextBox txtCommentsEx = new TextBox();
            txtCommentsEx.Width    = 200;
            txtCommentsEx.Height   = 50;
            txtCommentsEx.TextMode = TextBoxMode.MultiLine;
            txtCommentsEx.Rows     = 5;
            txtCommentsEx.Columns  = 20;
            txtCommentsEx.Text     = DBNullConverter.ToStr(dr["Comment"]);
            txtCommentsEx.ReadOnly = true;
            txtCommentsEx.Attributes.Add("class", "FlowCom_checked");
            tcTemp.Controls.Add(txtCommentsEx);
        }
        else
        {
            tcTemp.Attributes.Add("class", "FlowBg_old");
            tcTemp.Attributes.Add("style", "vertical-align:top");

            Label lblRegionCaption = new Label();
            lblRegionCaption.Text = DBNullConverter.ToStr(dr["RegionCaption"]);
            lblRegionCaption.Attributes.Add("class", "TxtB");
            tcTemp.Controls.Add(lblRegionCaption);
            tcTemp.Controls.Add(new LiteralControl("<br><br>"));
        }
        return(tcTemp);
    }