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> </td>"; } } } catch { return("<td class='sta" + status + "'>获取状态异常</td>");//<td> </td>"; } }
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 += " |" + 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 = "关闭"; } } }
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(); }