/// <summary> /// 回写单据审批意见 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { WRunListBC runListBC = new WRunListBC(); try { runListBC.SetAuditMark(Convert.ToInt32(this.RunId), this.auditMark.Text, this.fileId.Value); ClientScript.RegisterStartupScript(this.GetType(), "CloseSubmit", "close();", true); } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); } finally { runListBC.Dispose(); } }
/// <summary> /// 加载审批页 /// </summary> /// <param name="runId">工作流Id</param> private void LoadAuditPage(string runId) { DataSet ds = new DataSet(); WRunListBB runListBB = new WRunListBB(); WRunListBC runListBC = new WRunListBC(); try { if (runId == null || runId == "") { throw new Exception("当前审批流程没有传入参数!"); } //取得审批页面 ds = runListBB.GetVList("id=" + runId); if (ds.Tables[0].Rows.Count > 0) { runListBC.SetReaded(Convert.ToInt32(runId)); string functionUrl = ""; string functionChangeUrl = ""; bool isApplyChange = false; int windowHeight; int windowWidth; int changeWindowHeight; int changeWindowWidth; string url = ""; string recordValue = ""; string functionNo = ""; DataRow row = ds.Tables[0].Rows[0]; functionUrl = row["functionUrl"].ToString(); functionChangeUrl = row["functionChangeUrl"].ToString(); isApplyChange = Convert.ToBoolean(row["isApplyChange"]); windowHeight = Convert.ToInt32(row["windowHeight"]); windowWidth = Convert.ToInt32(row["windowWidth"]); changeWindowHeight = Convert.ToInt32(row["changeWindowHeight"]); changeWindowWidth = Convert.ToInt32(row["changeWindowWidth"]); recordValue = row["recordValue"].ToString(); functionNo = row["functionNo"].ToString(); //得到连接地址 url = "../../../" + (isApplyChange ? functionChangeUrl : functionUrl); if (functionUrl.IndexOf('?') != -1) { url += "&"; } else { url += "?"; } url += "runId=" + HttpUtility.UrlEncode(runId); url += "&id=" + HttpUtility.UrlEncode(recordValue.ToString()); url += "&functionNo=" + HttpUtility.UrlEncode(functionNo); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<script language=\"javascript\">\r\n"); if (isApplyChange) { stringBuilder.Append(" OpenWindowCenter('" + url + "', '" + changeWindowWidth.ToString() + "', '" + changeWindowHeight.ToString() + "');\r\n"); } else { stringBuilder.Append(" OpenWindowCenter('" + url + "', '" + windowWidth.ToString() + "', '" + windowHeight.ToString() + "');\r\n"); } stringBuilder.Append(" window.close();\r\n"); stringBuilder.Append("</script>\r\n"); if (!this.ClientScript.IsStartupScriptRegistered("MessageScript")) { this.ClientScript.RegisterStartupScript(this.GetType(), "MessageScript", stringBuilder.ToString()); } } else { throw new Exception("审批已完成,请关闭重新刷新审批列表!"); } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); } finally { runListBB.Dispose(); runListBC.Dispose(); } }