protected void TVDept_SelectedNodeChanged(object sender, System.EventArgs e) { if (this.TVDept.SelectedValue != "" && this.TVDept.SelectedValue.Substring(0, 1) != "r") { this.btnAdd.Disabled = false; this.HdnTemplateID.Value = this.TVDept.SelectedValue; this.ViewState["tid"] = this.TVDept.SelectedValue; DataTable dataTable = FlowTemplateAction.QueryOneTemplate(System.Convert.ToInt32(this.TVDept.SelectedValue)); if (dataTable.Rows.Count > 0) { this.HdnBusinessClass.Value = dataTable.Rows[0]["BusinessClass"].ToString(); } this.BindView(base.UserCode, System.Convert.ToInt32(this.TVDept.SelectedValue)); DataTable fistDt = FlowAuditAction.GetFistDt(System.Convert.ToInt32(this.HdnTemplateID.Value.ToString())); if (fistDt.Rows.Count > 0 && fistDt.Rows[0][3].ToString() != "1") { string text = fistDt.Rows[0][2].ToString(); this.hdflisDuty.Value = "1"; this.hdflisName.Value = "1"; if (!string.IsNullOrEmpty(text)) { if (fistDt.Rows[0][1].ToString() == "2" || fistDt.Rows[0][1].ToString() == "1") { if (!FlowAuditAction.GetUsersis(text)) { this.hdflisName.Value = "0"; } else { this.hdflisName.Value = "1"; } } 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); if (role.Rows.Count <= 0) { this.hdflisDuty.Value = "0"; } else { this.hdflisDuty.Value = "1"; } } } } } } else { this.btnAdd.Disabled = true; DataTable dataSource = new DataTable(); this.GVBook.DataSource = dataSource; this.GVBook.DataBind(); } this.hdfNodeValue.Value = this.TVDept.SelectedValue; }
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 = ""; } } }