protected string showStatus(string status, string checkinfo, decimal recid)
    {
        WFRECheckInfo ck         = new WFRECheckInfo(recid, checkinfo);
        string        statusName = WFEnum.GetRecStatus(status);

        if (status == WFEnum.RecStatus.NoAccept.ToString("d") ||
            status == WFEnum.RecStatus.Checking.ToString("d"))
        {
            int stepid = ck.GetLastCheckedStepID();
            if (ck.IsReChecking(stepid))
            {
                status     = WFEnum.RecStatus.ReCheck.ToString("d");
                statusName = "重审中";
            }
        }
        try
        {
            if (status == WFEnum.RecStatus.Accepted.ToString("d") || status == WFEnum.RecStatus.NoAccept.ToString("d") || status == WFEnum.RecStatus.Stoped.ToString("d"))
            {
                return("<td class='sta" + status + "'>" + statusName + "</td>");//<td>" + ck.ShowLastCkInfo() + "</td>";
            }
            if (!string.IsNullOrEmpty(ck.CheckingSteps))
            {
                string str = "<td class='sta" + status + "'><a>" + statusName + "</a>";
                str += "</td>";
                return(str);
            }
            else
            {
                if (!string.IsNullOrEmpty(ck.LastCheckInfo))
                {
                    return("<td><font color='red'>" + ck.GetLastStepState() + "</font></td>");//<td>" + ck.ShowLastCkInfo() + "</td>";
                }
                else
                {
                    return("<td><font color='red'>未提交审批</font></td>");//<td>&nbsp;</td>";
                }
            }
        }
        catch
        {
            return("<td class='sta" + status + "'>获取状态异常</td>");//<td>&nbsp;</td>";
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        theme = WebHelper.GetAppPath() + "Themes/" + BasePage._ThemeName;

        if (!string.IsNullOrEmpty(Request["RECID"]))
        {
            recid = decimal.Parse(Request["RECID"]);
        }
        else
        {
            Response.Write("非法连接!");
            Response.End();
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            WF_OBJ_ID = int.Parse(Request["WFID"]);
        }
        if (!IsPostBack)
        {
            //try
            //{
            hideButton();

            ViewState["CHECK_INFO"] = "";
            StringBuilder sbDetail = new StringBuilder();
            if (recid > 0)
            {
                WF_FORMBASE valObj = BLLTable <WF_FORMBASE> .Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid);

                if (WF_OBJ_ID <= 0 && valObj != null)
                {
                    WF_OBJ_ID = valObj.WFID;
                }
                if (WF_OBJ_ID <= 0)
                {
                    return;
                }

                //WFINFO_EXD wfExd = new WFINFO_EXD(WFID, valObj.PROCID);
                //WFORM_EXD wform = wfExd.GetFORM();
                WFOBJECT_BLL wfbll = new WFOBJECT_BLL(WF_OBJ_ID, recid);
                litTitle.Text = valObj.RECNAME;
                WFRecordInfo recObj = new WFRecordInfo(valObj, true);
                if (recObj.HadRecord == false)
                {
                    Response.Write("您要查看的申请记录不存在!");
                    Response.End();
                    return;
                }
                PROCID = valObj.PROCID;
                title  = valObj.RECNAME;
                //zlg
                if (MyDebugger.IsAttached)
                {
                    title += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|" + wfbll.FORM_BLL.DbTable.TB_NAME
                             + "|" + wfbll.WFExd.Base._FORM_TB + "|" + wfbll.WFExd.Base._FILE_TB;
                }
                //CHECK_INFO 为空,是有问题的。
                if (!string.IsNullOrEmpty(valObj.CHECK_INFO))
                {
                    ViewState["CHECK_INFO"] = valObj.CHECK_INFO;
                }
                else
                {
                    "".ToString();
                }
                if (sbDetail.Length > 1)
                {
                    ViewState["HadDetail"] = true;
                    litDetail.Text         = sbDetail.ToString();
                }

                if ((valObj.STATUS == WFEnum.RecStatus.Submit.ToString("d") ||
                     valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d") ||
                     valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d")) && valObj.CSTAFF_ID == userBase.StaffID)
                {
                    btnSubmit.Enabled = true;
                    if (valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d"))
                    {
                        btnSubmit.Text = "重新提交";
                    }
                    if (valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d"))
                    {
                        btnSubmit.Text = "重新启动";
                    }
                }
                else
                {
                    btnSubmit.Enabled = false;
                }
                bool canStop = valObj.STATUS == WFEnum.RecStatus.Checking.ToString("d") && valObj.CSTAFF_ID == userBase.StaffID;

                btnStop.Enabled = canStop;

                if ((valObj.STATUS == WFEnum.RecStatus.Submit.ToString("d") || valObj.STATUS == WFEnum.RecStatus.NoAccept.ToString("d") || valObj.STATUS == WFEnum.RecStatus.Stoped.ToString("d")) && valObj.CSTAFF_ID == userBase.StaffID)
                {
                    btnToEdit.Enabled = true;
                }
                else
                {
                    btnToEdit.Enabled = false;
                }

                if (valObj.PROCID > 0)
                {
                    ViewState["PROCID"] = valObj.PROCID;
                }

                //jinsj  从字段中获取HTML
                //litDetail.Text = wfbll.FORM_BLL.WF_HtmlShowForm(recObj);// wform.HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                string status = valObj.STATUS;
                status         = WFEnum.GetRecStatus(status);
                litDetail.Text = valObj.HTML_TEXT.Replace("!STATUS!", status);// wform.HtmlShowForm(recObj);// WFRecord.ShowRecordDetail(wfid, recid, recObj);
                if (!string.IsNullOrEmpty(valObj.ANNEX_FILE))
                {
                    string[] lstAnnex = valObj.ANNEX_FILE.Split(',');
                    string   html     = "";
                    foreach (string strAnnex in lstAnnex)
                    {
                        html += "<a href='" + WebHelper.GetAppPath() + strAnnex + "' target='_blank'>" + strAnnex.Substring(strAnnex.LastIndexOf("/") + 1) + "</a></br>";
                    }
                    //litAnnex.Text = "<dl class='row'><dt>附件:</dt><dd><a href='" + WebHelper.GetAppPath() + valObj.ANNEX_FILE + "' target='_blank'>" + valObj.ANNEX_FILE.Substring(valObj.ANNEX_FILE.LastIndexOf("/") + 1) + "</a></dd></dl>";
                    string tempStr = "<tr><td class='lbl'><label>员工名:</label></td><td colspan='4'><span>陈焕许</span></td></tr>";
                    tempStr       = StringHelper.ReplaceNonCase(tempStr, "员工名", "附件");
                    litAnnex.Text = StringHelper.ReplaceNonCase(tempStr, "陈焕许", html);
                }

                bool hadPower = false;
                litWFPath.Text = wfbll.HtmlWFTextMapNew(recid, userBase.StaffID, ref hadPower);// wfExd.HtmlWFTextMap(recid, userBase.StaffID, ref hadPower);// WFHtml.ShowProcessTextMap(wfid, valObj.PROCID, recid, userBase.StaffID, ref hadPower);
                //获取流程图
                htmlText = wfbll.GetStepPath(recid, ref script);
                //zlg
                if (!hadPower)
                {
                    hadPower = (userBase.UserName == "sys");
                }

                btnToCheck.Enabled = hadPower && (valObj.STATUS == WFEnum.RecStatus.Checking.ToString("d") || valObj.STATUS == WFEnum.RecStatus.ReCheck.ToString("d"));// && (ViewState["PROCID"] != null);
                //Response.Write(hadPower.ToString());
            }
            //}
            //catch (Exception ex)
            //{
            //    litWarn.Text = ex.Message; txtREASON.Value = "00000000";
            //}

            if (Request["fromTab"] != null)
            {
                btnBack.Value = "关闭";
            }

            if (Request["notice"] != null)
            {
                hideButton();
                btnBack.Value = "关闭";
            }
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    intWfId  = Common.GetReqIntValue("wfid");
        string strWhere = Common.GetReqStrValue("where");
        int    recount  = -1;
        string strCOLS  = "";

        string[]  arr = null;
        DataTable dt  = null;

        WFOBJECT_BLL wfbll   = new WFOBJECT_BLL(intWfId);
        FORM_BLL     bllform = null;

        if (wfbll.Base != null)
        {
            bllform = wfbll.FORM_BLL;
        }

        if (bllform != null)
        {
            dt = bllform.WF_SelectByPage(intWfId, 12, 1, ref recount, strWhere, out strCOLS);

            //在合同里增加 金额 字段
            arr = StringHelper.GetStringArray(strCOLS, ',');
        }

        Response.Clear();
        Response.Buffer  = true;
        Response.Charset = "GB2312";
        //Response.ContentEncoding = System.Text.Encoding.UTF8;

        Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("流程列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls"));
        Response.ContentType = "application/vnd.ms-excel";
        string header = "";
        string body   = "";

        header += "编号\t";
        header += "提交人\t";
        header += "申请单名称\t";
        header += "申请部门\t";
        header += "提交时间\t";
        header += "审批情况\t";
        if (arr != null)
        {
            for (int i = 0; i < arr.Length; i++)
            {
                string[] aaa = arr[i].Split(':');
                if (aaa.Length > 1)
                {
                    header += aaa[1] + "\t";
                }
            }
        }
        header += "\n";

        if (dt != null)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                body += Convert.ToString(dt.Rows[i]["RECID"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["CSTAFF_NAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["RECNAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["DEPT_NAME"]) + "\t";
                body += Convert.ToString(dt.Rows[i]["ADDTIME"]) + "\t";
                body += WFEnum.GetRecStatus(Convert.ToString(dt.Rows[i]["STATUS"])) + "\t";
                if (arr != null)
                {
                    for (int j = 0; j < arr.Length; j++)
                    {
                        string[] aaa = arr[j].Split(':');
                        if (aaa.Length > 1)
                        {
                            body += Convert.ToString(dt.Rows[i][aaa[0]]) + "\t";
                        }
                    }
                }
                body += "\n";
            }
        }

        Response.Write(header);
        Response.Write(body);
        Response.End();
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region
        if (!string.IsNullOrEmpty(Request["DEL_RECID"]))
        {
            int recid = int.Parse(Request["DEL_RECID"]);

            WF_FORMBASE objVal = BLLTable <WF_FORMBASE> .Factory(conn).GetRowData(WF_FORMBASE.Attribute.RECID, recid);

            WFRecordInfo recObj = new WFRecordInfo(objVal, true);
            if (objVal != null)
            {
                int wfid = objVal.WFID;
                // Dictionary<string, FormField> dicObj = WFRecord.GetFormFieldDicByRecID(wfid, recid);
                if (objVal.STATUS == "0")
                {
                    recObj.DeleteByRecID(wfid, recid);
                    if (preUrl == "")
                    {
                        preUrl = "FormList.aspx?WFID=" + wfid + "&Mine=" + StringHelperExd.GetRandomCode(6);
                    }
                    else
                    {
                        if (preUrl.IndexOf("&r=") != -1)
                        {
                            preUrl = preUrl.Replace("&r=", "&r=" + StringHelperExd.GetRandomCode(3));
                        }
                        else
                        {
                            if (preUrl.IndexOf("?") != -1)
                            {
                                preUrl += "&r=" + StringHelperExd.GetRandomCode(6);
                            }
                            else
                            {
                                preUrl += "?r=" + StringHelperExd.GetRandomCode(6);
                            }
                        }
                    }
                    Response.Redirect(preUrl);
                    //ScriptHelper.AlertAndGo(Page, "删除成功!", preUrl);
                }
                else
                {
                    if (userBase.UserType == "1")
                    {
                        recObj.DeleteByRecID(wfid, recid);
                        if (preUrl == "")
                        {
                            preUrl = "FormList.aspx?WFID=" + wfid + "&Mine=" + StringHelperExd.GetRandomCode(6);
                        }
                        else
                        {
                            if (preUrl.IndexOf("&r=") != -1)
                            {
                                preUrl = preUrl.Replace("&r=", "&r=" + StringHelperExd.GetRandomCode(3));
                            }
                            else
                            {
                                if (preUrl.IndexOf("?") != -1)
                                {
                                    preUrl += "&r=" + StringHelperExd.GetRandomCode(6);
                                }
                                else
                                {
                                    preUrl += "?r=" + StringHelperExd.GetRandomCode(6);
                                }
                            }
                        }
                        Response.Redirect(preUrl);
                        //ScriptHelper.AlertAndGo(Page, "删除成功!", preUrl);
                    }
                    else
                    {
                        Response.Write("<h3>已经在审批中,不能删除!<a href='" + preUrl + "'>返回</a></h3>");
                    }
                }
            }
            else
            {
                ScriptHelper.AlertAndGo(Page, "该记录不存在或已被删除!", preUrl);
            }
        }

        #endregion

        if (Request["GetRECNO"] != null)
        {
            Response.ContentEncoding = System.Text.Encoding.UTF8;
            Response.Write(WFRecordInfo.GetRECNO(Request["DEPT_ID"]));
            Response.End();
        }
        if (Request["showlog"] != null)
        {
            #region
            WF_CHECK_LOG ccc = new WF_CHECK_LOG();
            ccc.WFID    = int.Parse(Request["WFID"]);
            ccc.PROCID  = int.Parse(Request["PROCID"]);
            ccc.STEP_ID = int.Parse(Request["StepID"]);
            ccc.RECID   = int.Parse(Request["RECID"]);
            WF_CHECK_LOG log = BLLTable <WF_CHECK_LOG> .Factory(conn).GetRowData(ccc);

            if (log != null)
            {
                try
                {
                    StringBuilder sb = new StringBuilder();
                    string[]      a  = StringHelper.GetStringArray(log.RESULTS, '|');
                    string[]      b  = StringHelper.GetStringArray(log.CHECKERS, '|');
                    string[]      c  = StringHelper.GetStringArray(log.CHECK_TIMES, '|');
                    string[]      d  = null;
                    string[]      f  = null;
                    if (!string.IsNullOrEmpty(log.NOTES))
                    {
                        d = StringHelper.GetStringArray(log.NOTES, '|');
                    }
                    if (!string.IsNullOrEmpty(log.ANNEX_FILE))
                    {
                        f = StringHelper.GetStringArray(log.ANNEX_FILE, '|');
                    }
                    for (int i = 0; i < a.Length; i++)
                    {
                        string mbr = "", entrust = "";

                        if (b[i].IndexOf(":") >= 0)
                        {
                            mbr     = b[i].Split(':')[0];
                            entrust = b[i].Split(':')[1];
                        }
                        else
                        {
                            mbr = b[i];
                        }
                        sb.Append("<div class='l-row'><p><span>" + mbr + "</span><b>" + WFEnum.GetLogResult(a[i]) + "</b>");
                        sb.Append("<span>" + entrust + "</span>");
                        sb.Append("<label>" + c[i] + "</label></p>");
                        if (d != null && d.Length > i)
                        {
                            sb.Append("<p>" + d[i] + "</p>");
                        }
                        else
                        {
                            sb.Append("<p>无</p>");
                        }
                        if (f != null)
                        {
                            if (!string.IsNullOrEmpty(f[i]))
                            {
                                sb.Append("<p>附件:");
                                string[] lstAnnex = f[i].Split(',');
                                foreach (string strAnnex in lstAnnex)
                                {
                                    sb.Append("<a href='" + WebHelper.GetAppPath() + strAnnex + "' target='_blank'>" + strAnnex.Substring(strAnnex.LastIndexOf("/") + 1) + "</a></br>");
                                }
                                sb.Append("</p>");
                            }
                        }
                        sb.Append("</div>");
                    }
                    Response.Write(sb.ToString());
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
            }
            else
            {
                Response.Write("<div class='l-row'><p>无审批记录</p></div>");
            }

            #endregion
        }

        if (Request["selVal"] != null)
        {
            //获取父下拉框选中的ITEM_ID
            V_TF_F_COLUMN_ITEM objVC = new V_TF_F_COLUMN_ITEM();
            objVC.COLUMN_ID = Convert.ToInt32(Request["Pcolumnid"]);
            objVC.VALUE     = Request["selVal"];

            V_TF_F_COLUMN_ITEM objI = BLLTable <V_TF_F_COLUMN_ITEM> .GetRowData(objVC);

            //获取子下拉框的内容项
            if (objI != null)
            {
                V_TF_F_COLUMN_ITEM objV = new V_TF_F_COLUMN_ITEM();
                objV.Distinct = true;
                objV.VALUE    = "";
                objV.TEXT     = "";

                objVC           = new V_TF_F_COLUMN_ITEM();
                objVC.COLUMN_ID = Convert.ToInt32(Request["columnid"]);
                objVC.DROP_REAL = Convert.ToString(objI.ITEM_ID);

                List <V_TF_F_COLUMN_ITEM> lstv = BLLTable <V_TF_F_COLUMN_ITEM> .Select(objV, objVC);

                if (lstv.Count > 0)
                {
                    Response.Write("{\"list\":" + JsonUtil.getJsonStr <V_TF_F_COLUMN_ITEM>(lstv) + ",\"first\":\"" + lstv[0].ITEM_ID + "\"}");
                }
                else
                {
                    Response.Write("{\"list\":\"\",\"first\":\"\"}");
                }
            }
        }

        Response.End();
    }