/// <summary> /// ��Grid /// </summary> protected void BindGrid(string functionNo) { WFunctionStepBB functionStepBB = new WFunctionStepBB(); DataSet ds = new DataSet(); try { ds = functionStepBB.GetVList("functionNo='" + functionNo + "'"); // ����б����� StringBuilder sBuilder = new StringBuilder(); sBuilder.Append("����|@functionNo|@|@left"); sBuilder.Append("|!��������|@stepNm|@|@left"); sBuilder.Append("|!������|@stepNo|@|@left"); sBuilder.Append("|!�������|@seq|@|@left"); sBuilder.Append("|!ִ����|@doEmp|@|@left"); //�������� this.dataGrid.TitleDescription = sBuilder.ToString(); this.dataGrid.DataSource = ds.Tables[0]; } finally { functionStepBB.Dispose(); } }
private void ShowPullInfo(string functionNo) { 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; //��ǰ�������������� int currLevelSteps = levelDs.Tables[0].Rows.Count; //���㵱ǰ������X������ if (currLevelSteps > 1) { stepIntervalX = 400 / (currLevelSteps - 1); } if (roundrectId == 1) { nodeType = "start"; fillcolor = "#00EE00"; } else if (i == ds.Tables[0].Rows.Count - 1 && j == levelDs.Tables[0].Rows.Count - 1) { nodeType = "end"; fillcolor = "#F4A8BD"; } else { fillcolor = "#EEEEEE"; } //����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 + "' ondblclick='EditStep(" + stepId + ");' 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; }