private void LbAll_Bound(string frontNodeStr) { bool flag = FlowChartAction.IsPoolNode(this.TemplateID); if (flag) { int num = 0; int i = frontNodeStr.IndexOf(","); if (i > 0) { string value; object value2; while (i > 0) { value = frontNodeStr.Substring(0, i); value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value)); ListItem item = new ListItem(System.Convert.ToString(value2), value); this.LbAll.Items.Insert(num, item); frontNodeStr = frontNodeStr.Substring(i + 1, frontNodeStr.Length - i - 1); i = frontNodeStr.IndexOf(","); num++; } value = frontNodeStr; value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(value)); ListItem item2 = new ListItem(System.Convert.ToString(value2), value); this.LbAll.Items.Insert(num, item2); } else { object value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(frontNodeStr)); ListItem item3 = new ListItem(System.Convert.ToString(value2), frontNodeStr); this.LbAll.Items.Insert(num, item3); } this.LoadNoPostPosition(num + 1); return; } if (this.LoadNoPostPosition(0) == 0) { object value2 = FlowTemplateAction.QueryNodeName(System.Convert.ToInt32(frontNodeStr)); ListItem item4 = new ListItem(System.Convert.ToString(value2), frontNodeStr); this.LbAll.Items.Insert(0, item4); } }
protected void ImgComplete_Click(object sender, ImageClickEventArgs e) { if (!FlowChartAction.IsHaveNode(this.TemplateID)) { string cmdText = "\r\n\t\t\t\t\tUPDATE WF_FlowChart SET Column2 = '7', Column3 = '2', Column4 = '4;00;结束'\r\n\t\t\t\t\tWHERE TemplateID = @TemplateID"; string cmdText2 = "UPDATE WF_Template SET IsComplete = '1' WHERE TemplateID = @TemplateID"; SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@TemplateID", this.TemplateID) }; SqlHelper.ExecuteNonQuery(CommandType.Text, cmdText, commandParameters); SqlHelper.ExecuteNonQuery(CommandType.Text, cmdText2, commandParameters); this.fmNavigation.Attributes["src"] = "WorkFlowChart.aspx?tid=" + this.TemplateID.ToString(); return; } object value = FlowTemplateAction.QueryTemplateState(this.TemplateID); if (System.Convert.ToString(value) == "1") { this.JS.Text = "alert('该流程模板已创建结束!')"; return; } string text = ""; string text2 = ""; int nodeID = 0; bool flag = FlowChartAction.IsPoolNode(this.TemplateID); if (flag) { if (!FlowChartAction.FlowComplete(this.TemplateID)) { this.JS.Text = "alert('创建工作流程失败!');"; } } else { DataTable dataTable = FlowTemplateAction.QueryFlowChart(this.TemplateID); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i += 2) { int j = dataTable.Columns.Count - 2; while (j > 2) { if (dataTable.Rows[i].ItemArray[j] != null && dataTable.Rows[i].ItemArray[j].ToString() != "") { int num = 0; string str = ""; string text3 = dataTable.Rows[i].ItemArray[j].ToString(); int k = text3.IndexOf(";"); if (k > 0) { while (k > 0) { int num2 = num; if (num2 == 1) { text2 = text2 + text3.Substring(0, k) + ","; str = string.Concat(new string[] { (j - 1).ToString(), ";", (i + 1).ToString(), ";", text3.Substring(0, k) }); } text3 = text3.Substring(k + 1, text3.Length - k - 1); k = text3.IndexOf(";"); num++; } text = text + str + ","; break; } break; } else { j--; } } } } if (!FlowChartAction.CreatePoolNode(text, text2, nodeID, this.TemplateID, "结束", "", "New", "0")) { this.JS.Text = "alert('创建工作流程失败!');"; } } System.Collections.Hashtable hashtable = new System.Collections.Hashtable(); hashtable.Add("IsComplete", SqlStringConstructor.GetQuotedString("1")); string where = "where TemplateID = " + this.TemplateID.ToString(); if (!FlowTemplateAction.UpdTemplate(hashtable, where)) { this.JS.Text = "alert('创建工作流程失败!');"; } string str2 = string.Concat(new string[] { "TemplateList.aspx?ti=", this.businessCode.ToString(), "&class=", this.BusinessClass.ToString(), "&flag=", this.IsGeneral }); this.JS.Text = "parent.fraTemplate.location.href= '" + str2 + "';"; }