protected void BtnAdd_Click(object sender, System.EventArgs e) { string[] array = new string[3]; if (this.TemplateCount > 1) { array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID); this.hdnNodeId.Value = array[0].ToString(); this.hdnOrderNumber.Value = array[1].ToString(); } else { if (this.TemplateCount == 1) { if (this.OffsetCount > 1) { this.hdnNodeId.Value = this.NodeID.ToString(); this.hdnOrderNumber.Value = "1"; } else { array = FlowAuditAction.GetOffsetNodeFirst(this.TemplateID, this.BusinessClass, this.RecordID); this.hdnNodeId.Value = array[0].ToString(); this.hdnOrderNumber.Value = array[1].ToString(); } } } int offsetorder = System.Convert.ToInt32(this.hdnOrderNumber.Value.ToString().Trim()); this.NodeID = System.Convert.ToInt32(this.hdnNodeId.Value.ToString().Trim()); if (this.hdnNodeId.Value.Trim() == "0") { this.JS.Text = "alert('工作流程多分支模板未设置分支条件!')"; return; } if (FlowAuditAction.BeginFlow(this.BusinessClass, this.BusinessCode, this.RecordID, this.TemplateID, this.NodeID, offsetorder, this.ProjectCode, this.UserCode)) { if (FlowAuditAction.FirstNodeIsSelected(this.TemplateID)) { if (this.DDLSuperordinateDuty.Items.Count > 0) { this.hdnReceiver.Value = this.DDLSuperordinateDuty.SelectedValue; } FlowAuditAction.InsertOperator(this.BusinessClass, this.BusinessCode, this.RecordID, this.hdnReceiver.Value); } this.JS.Text = "alert('工作流程已成功启动!');window.close();returnValue=true;"; return; } this.JS.Text = "alert('请找管理员设置 " + this.LbTemName.Text + " 流程的负责人。');"; }
protected void ddltTemplate_SelectedIndexChanged(object sender, System.EventArgs e) { if (this.ddltTemplate.SelectedValue != "-1") { this.TemplateID = System.Convert.ToInt32(this.ddltTemplate.SelectedItem.Value.ToString()); DataTable dataTable = FlowTemplateAction.QueryOneTemplate(this.TemplateID); string text = dataTable.Rows[0]["Remark"].ToString(); if (text.Length > 30) { this.lbltishi.Text = text.Substring(0, 30) + "..."; this.lbltishi.ToolTip = text; } else { this.lbltishi.Text = text; } if (FlowAuditAction.FirstNodeIsSelected(this.TemplateID)) { this.txtReceiver.Enabled = true; this.txtReceiver.Text = ""; this.IBPick.Attributes["onclick"] = "return pickPerson();"; this.IBPick.Attributes["Style"] = "cursor: hand"; DataTable dataTable2 = FlowTemplateAction.QueryOffsetNodeFirst("0", this.TemplateID); this.Type.Value = dataTable2.Rows[0]["AuditorType"].ToString(); if (this.Type.Value == "2") { this.Message.Visible = true; this.lblMessage.Text = "此节点类型为多人"; } else { this.Message.Visible = false; } DataTable fistDt = FlowAuditAction.GetFistDt(this.TemplateID); if (fistDt.Rows.Count > 0) { this.hfldNextAuditDepCode.Value = fistDt.Rows[0]["DepCode"].ToString(); } } else { this.Message.Visible = false; this.IBPick.Attributes["onclick"] = "return false"; this.IBPick.Attributes["Style"] = "cursor: default"; this.txtReceiver.Enabled = false; DataTable fistDt2 = FlowAuditAction.GetFistDt(this.TemplateID); if (fistDt2.Rows.Count != 0) { if (fistDt2.Rows[0][3].ToString() != "1") { string text2 = fistDt2.Rows[0][2].ToString(); if (fistDt2.Rows[0][1].ToString() == "2" || fistDt2.Rows[0][1].ToString() == "1") { if (!FlowAuditAction.GetUsersis(text2)) { this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "top.ui.alert('此审核流程中的接收人在系统中已离职或不存在,请重新选择流程模板');", true); this.ddltTemplate.SelectedValue = "-1"; return; } this.txtReceiver.Text = FlowAuditAction.GetUsers(text2); } else { if (fistDt2.Rows[0][1].ToString() == "3" || fistDt2.Rows[0][1].ToString() == "4" || fistDt2.Rows[0][1].ToString() == "5") { DataTable role = FlowAuditAction.GetRole(text2); this.txtReceiver.Text = role.Rows[0][0].ToString(); } } } else { this.txtReceiver.Text = ""; } } if (this.TemplateID == -1) { this.txtReceiver.Text = ""; this.hdnReceiver.Value = ""; } } FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID); return; } this.txtReceiver.Text = ""; this.hdnReceiver.Value = ""; this.lblMessage.Text = ""; this.lbltishi.Text = ""; this.IBPick.Attributes["onclick"] = ""; }
protected void CreateTemplateInfo() { DataTable dataSource = FlowTemplateAction.QueryTempByClass(this.BusinessClass, this.BusinessCode, this.UserCode); this.ddltTemplate.Items.Clear(); this.ddltTemplate.DataSource = dataSource; this.ddltTemplate.DataTextField = "TemplateName"; this.ddltTemplate.DataValueField = "TemplateID"; this.ddltTemplate.DataBind(); ListItem listItem = new ListItem("---请选择流程模板---", "-1"); listItem.Selected = true; this.ddltTemplate.Items.Insert(0, listItem); if (!string.IsNullOrEmpty(base.Request["templateid"])) { this.TemplateID = System.Convert.ToInt32(base.Request["templateid"]); this.hdnTemplateID.Value = base.Request["templateid"]; this.ddltTemplate.Enabled = false; this.ddltTemplate.SelectedValue = base.Request["templateid"]; FlowChartAction.display_FlowChart(this.tbFlowChart, this.TemplateID); if (FlowAuditAction.FirstNodeIsSelected(this.TemplateID)) { this.txtReceiver.Enabled = true; this.IBPick.Attributes["onclick"] = "return pickPerson();"; this.IBPick.Attributes["Style"] = "cursor: hand"; DataTable dataTable = FlowTemplateAction.QueryOffsetNodeFirst("0", this.TemplateID); this.Type.Value = dataTable.Rows[0]["AuditorType"].ToString(); if (this.Type.Value == "2") { this.Message.Visible = true; this.lblMessage.Text = "此节点类型为多人,必须选择多个人"; } else { this.Message.Visible = false; } this.hfldNextAuditDepCode.Value = dataTable.Rows[0]["DepCode"].ToString(); return; } this.Message.Visible = false; DataTable fistDt = FlowAuditAction.GetFistDt(this.TemplateID); if (fistDt.Rows.Count > 0) { if (fistDt.Rows[0][3].ToString() != "1") { string text = fistDt.Rows[0][2].ToString(); if (fistDt.Rows[0][1].ToString() == "2" || fistDt.Rows[0][1].ToString() == "1") { this.txtReceiver.Text = FlowAuditAction.GetUsers(text); } else { if (fistDt.Rows[0][1].ToString() == "3" || fistDt.Rows[0][1].ToString() == "4" || fistDt.Rows[0][1].ToString() == "5") { DataTable role = FlowAuditAction.GetRole(text); this.txtReceiver.Text = role.Rows[0][0].ToString(); } } this.txtReceiver.Enabled = false; } else { this.txtReceiver.Text = ""; } } this.IBPick.Attributes["onclick"] = "return false"; this.IBPick.Attributes["Style"] = "cursor: default"; if (this.TemplateID == -1) { this.txtReceiver.Text = ""; this.hdnReceiver.Value = ""; } } }