/// <summary> /// 绑定Grid /// </summary> protected void BindGrid() { WRunListBB runListBB = new WRunListBB(); DataSet ds = new DataSet(); try { ds = runListBB.GetPersonalWorkRun(this.currentUser.empId, this.currentUser.nowDepartId, this.StrWhere); // 组合列表属性 StringBuilder sBuilder = new StringBuilder(); sBuilder.Append("标题|@recordTitle|@|@left"); sBuilder.Append("|!提交人|@empNm|@|@left"); sBuilder.Append("|!提交时间|@creatTime|@|@left"); sBuilder.Append("|!已读|@isReadDesc|@|@center"); sBuilder.Append("|!已结束|@isEndDesc|@|@center"); //关联属性 this.dataGrid.TitleDescription = sBuilder.ToString(); this.dataGrid.DataSource = ds.Tables[0]; } finally { runListBB.Dispose(); } }
/// <summary> /// ���캯�� /// </summary> /// <param name="connection">��������</param> public WRunListBC(SqlConnection connection) { this.connection = connection; this.runListBB = new WRunListBB(this.connection); this.errorDiaryBB = new SErrorDiaryBB(this.connection); this.operatDiaryBB = new SOperatDiaryBB(this.connection); this.commBB = new SCommBB(this.connection); }
/// <summary> /// ���캯�� /// </summary> public WRunListBC() { this.selfConn = true; this.connection = new SqlConnection(HS.Config.SqlDataObject.GetSqlConnectionString); this.connection.Open(); this.runListBB = new WRunListBB(this.connection); this.errorDiaryBB = new SErrorDiaryBB(this.connection); this.operatDiaryBB = new SOperatDiaryBB(this.connection); this.commBB = new SCommBB(this.connection); }
protected void btnReaded_Click(object sender, EventArgs e) { WRunListBB runListBB = new WRunListBB(); try { runListBB.SetReadedByEmp(this.currentUser.empId, this.currentUser.nowDepartId); } finally { runListBB.Dispose(); } this.ClientScript.RegisterStartupScript(this.GetType(), "close", "close()", true); }
/// <summary> /// ��ֹ������ /// </summary> /// <param name="runId">��������¼Id</param> public void EndRun(int runId) { WRunListBB runListBB = new WRunListBB(); WRunListData model = new WRunListData(); try { //���¹�������¼״̬ model = this.runListBB.GetModel(runId); model.isEnd = true; runListBB.ModifyRecord(model); } finally { runListBB.Dispose(); } }
private void ShowPullInfo(string functionNo, string recordValue) { //����ԭʼ�����ڸù����������µ�ǰ�����ڴ� int lastRunNo = 0; WRunListBB runListBB = new WRunListBB(); try { lastRunNo = runListBB.GetLastRunNo(functionNo, recordValue, 0); } finally { runListBB.Dispose(); } StringBuilder vmlStr = new StringBuilder(); SCommBB commBB = new SCommBB(); WFunctionStepBB functionStepBB = new WFunctionStepBB(); DataSet ds = new DataSet(); try { //������ù�����������������ͬ������������������� int stepLevels = 0; int maxStepSeq = 0; int stepIntervalX = 0; int stepIntervalY = 0; ds = commBB.Query("select max(seq) from WFunctionStep where functionNo='" + functionNo + "'"); if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0][0] != DBNull.Value) { maxStepSeq = Convert.ToInt32(ds.Tables[0].Rows[0][0]); } ds = commBB.Query("select distinct stepNo from WFunctionStep where functionNo='" + functionNo + "'"); stepLevels = ds.Tables[0].Rows.Count; //����Y�������� if (stepLevels > 1) { stepIntervalY = 400 / (stepLevels - 1); } int roundrectId = 1; int currCenterRoundrectId = 0; int preCenterRoundrectId = 0; //��ʼ��ͼ������ for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow row = ds.Tables[0].Rows[i]; DataSet levelDs = new DataSet(); levelDs = functionStepBB.GetVList("functionNo='" + functionNo + "' and stepNo=" + row["stepNo"].ToString()); for (int j = 0; j < levelDs.Tables[0].Rows.Count; j++) { DataRow levelRow = levelDs.Tables[0].Rows[j]; string stepId = levelRow["id"].ToString(); string stepNm = levelRow["stepNm"].ToString(); string stepNo = levelRow["stepNo"].ToString(); string seq = levelRow["seq"].ToString(); string nodeType = ""; string fillcolor = ""; int coordinateX; int coordinateY; //�жϵ�ǰ�����Ƿ�����ͨ�� string workFlowState = ""; string strSql = "select workFlowState from WRunList where functionNo='" + functionNo + "' and recordValue='" + recordValue + "' and runNo=" + lastRunNo + " and stepId=" + stepId; DataSet auditDs = new DataSet(); auditDs = commBB.Query(strSql); if (auditDs.Tables[0].Rows.Count > 0) { workFlowState = auditDs.Tables[0].Rows[0][0].ToString(); } //��ǰ�������������� int currLevelSteps = levelDs.Tables[0].Rows.Count; //���㵱ǰ������X������ if (currLevelSteps > 1) { stepIntervalX = 400 / (currLevelSteps - 1); } if (workFlowState == "W2") { nodeType = "start"; fillcolor = "#00EE00"; } else if (workFlowState == "W3") { fillcolor = "red"; } else { nodeType = "end"; fillcolor = "#F4A8BD"; } //����X���� if (Convert.ToInt32(levelRow["coordinateX"]) != 0) { coordinateX = Convert.ToInt32(levelRow["coordinateX"]); } else { if (currLevelSteps > 1) { coordinateX = 30 + stepIntervalX * j; } else { coordinateX = 230; } } //����Y���� if (Convert.ToInt32(levelRow["coordinateY"]) != 0) { coordinateY = Convert.ToInt32(levelRow["coordinateY"]); } else { if (stepLevels > 1) { coordinateY = 30 + stepIntervalY * i; } else { coordinateY = 230; } } vmlStr.Append(" <vml:roundrect inset='2pt,2pt,2pt,2pt' id='" + roundrectId.ToString() + "' stepId='" + stepId + "' nodeType='" + nodeType + "'\r\n"); vmlStr.Append(" readonly='0' fillcolor='" + fillcolor + "' style='left: " + coordinateX.ToString() + ";\r\n"); vmlStr.Append(" top: " + coordinateY.ToString() + "; width: 100; position: absolute; height: 50; vertical-align: middle; cursor: hand; text-align: center;\r\n"); vmlStr.Append(" z-index: 1' arcsize='4321f' coordsize='21600,21600' title='��'>\r\n"); vmlStr.Append(" <vml:shadow on='T' type='single' color='#b3b3b3' offset='3px,3px' />\r\n"); vmlStr.Append(" <vml:textbox inset='1pt,2pt,1pt,1pt' onselectstart='return false;'><b>" + stepNo + "-" + seq + "</b><br />" + stepNm + "</vml:textbox>\r\n"); vmlStr.Append(" </vml:roundrect>\r\n"); vmlStr.Append("\r\n"); if (j > 0) { //��ͬ������֮������ vmlStr.Append(" <vml:line mfrid='1' title='' source='" + Convert.ToString(roundrectId - 1) + "' object='" + roundrectId.ToString() + "' from='0,0' to='0,0' style='position: absolute;\r\n"); vmlStr.Append(" display: none; z-index: 2' arcsize='4321f' coordsize='21600,21600'>\r\n"); vmlStr.Append(" <vml:shadow on='T' type='single' color='#b3b3b3' offset='1px,1px' />\r\n"); vmlStr.Append(" </vml:line>\r\n"); vmlStr.Append("\r\n"); } if (j == currLevelSteps / 2) { currCenterRoundrectId = roundrectId; } roundrectId += 1; } if (i > 0) { //����ͬ����֮������ vmlStr.Append(" <vml:line mfrid='1' title='' source='" + Convert.ToString(preCenterRoundrectId) + "' object='" + Convert.ToString(currCenterRoundrectId) + "' from='0,0' to='0,0' style='position: absolute;\r\n"); vmlStr.Append(" display: none; z-index: 2' arcsize='4321f' coordsize='21600,21600'>\r\n"); vmlStr.Append(" <vml:stroke endarrow='block'>\r\n"); vmlStr.Append(" </vml:stroke>\r\n"); vmlStr.Append(" <vml:shadow on='T' type='single' color='#b3b3b3' offset='1px,1px' />\r\n"); vmlStr.Append(" </vml:line>\r\n"); vmlStr.Append("\r\n"); } preCenterRoundrectId = currCenterRoundrectId; } } finally { commBB.Dispose(); functionStepBB.Dispose(); } this.vmlStr = vmlStr; }
/// <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(); } }