//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); if (this.txtop.Value == "add") { //先判断是否已经存在 DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtid.Text); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该流程已存在,请重新填写!');history.back();</script>"); return; } else { Hyoa_flowinfor.hy_flowid = this.txtid.Text; Hyoa_flowinfor.hy_flowname = this.txtname.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Insert(); } } else { Hyoa_flowinfor.hy_flowid = this.txtid.Text; Hyoa_flowinfor.hy_flowname = this.txtname.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Update(); } //保存时更新选中的模块对应的流程字段(hy_flowid) HyoaClass.DAO db = new HyoaClass.DAO(); string sql; sql = "select a.id from hyt_flowfield a,hyt_tableconfig b where a.hy_tableid=b.ID and b.hy_ifflowdoc='是' and a.hy_mudelid='"+this.ddlmudelid.SelectedValue+"'"; DataTable dt_update = db.GetDataTable(sql); if (dt_update.Rows.Count > 0) { for (var i = 0; i < dt_update.Rows.Count; i++) { sql = "update hyt_flowfield set hy_flowid='" + this.txtid.Text + "' where id='" + dt_update.Rows[i]["id"].ToString()+"'"; db.Execute(sql); } } db.Close(); //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }
private void DataPlay() { if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 //判断当前用户是否有保存的权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) { this.btn_submit.Visible = true; //保存 } else { this.btn_submit.Visible = false; //保存 } //加载模块 HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dtmudel = Hyoa_mudel.Getmudels(); if (dtmudel.Rows.Count > 0) { this.ddlmudelid.DataSource = dtmudel; this.ddlmudelid.DataTextField = "hy_mudelname"; this.ddlmudelid.DataValueField = "hy_mudelid"; this.ddlmudelid.DataBind(); this.ddlmudelid.Items.Insert(0, "--请选择--"); this.ddlmudelid.SelectedIndex = 0; } //旧文档 if (this.Request.QueryString["op"] == "modify") { if (this.Request.QueryString["id"] != null) { //根据id得到信息 this.txtid.Text = this.Request.QueryString["id"].ToString(); HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtid.Text); if (dt.Rows.Count > 0) { this.txtname.Value = dt.Rows[0]["hy_flowname"].ToString(); this.txtsort.Value = dt.Rows[0]["hy_sort"].ToString(); this.ddlmudelid.SelectedValue = dt.Rows[0]["hy_mudelid"].ToString(); } dt.Clear(); this.txtid.Enabled = false; } } } }
private void DataPlay() { //判断当前用户是否有保存的权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) { this.btn_submit.Visible = true; //保存 } else { this.btn_submit.Visible = false; //保存 } //加载模块 HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dtmudel = Hyoa_mudel.Getmudels(); if (dtmudel.Rows.Count > 0) { this.ddlmudelid.DataSource = dtmudel; this.ddlmudelid.DataTextField = "hy_mudelname"; this.ddlmudelid.DataValueField = "hy_mudelid"; this.ddlmudelid.DataBind(); this.ddlmudelid.Items.Insert(0, "--请选择--"); this.ddlmudelid.SelectedIndex = 0; } //根据流程ID得到流程名称 if (this.txtSrcFlowID.Value != "") { HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtSrcFlowID.Value); if(dt.Rows.Count>0) { this.lblSrcFlowID.Text = this.txtSrcFlowID.Value; this.lblSrcFlowName.Text = dt.Rows[0]["hy_flowname"].ToString(); } } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield(); HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); //先判断流程是否已经存在 DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtFlowID.Value); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该流程已存在,请重新填写!');history.back();</script>"); return; } else { //添加流程信息 Hyoa_flowinfor.hy_flowid = this.txtFlowID.Value; Hyoa_flowinfor.hy_flowname = this.txtFlowCh.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtFlowSort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Insert(); //添加环节信息 DataTable dtflowtache = Hyoa_flowtache.Getflowtachebyflowid(this.txtSrcFlowID.Value); if (dtflowtache.Rows.Count > 0) { for (var i = 0; i < dtflowtache.Rows.Count; i++) { //复制到新流程中 Hyoa_flowtache.ID = Hyoa_global.GetRandom(); Hyoa_flowtache.hy_flowid = this.txtFlowID.Value; Hyoa_flowtache.hy_tacheid = dtflowtache.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtache.hy_tachename = dtflowtache.Rows[i]["hy_tachename"].ToString(); Hyoa_flowtache.hy_sort = System.Int32.Parse(dtflowtache.Rows[i]["hy_sort"].ToString()); Hyoa_flowtache.hy_ifshowcurdept = dtflowtache.Rows[i]["hy_ifshowcurdept"].ToString(); Hyoa_flowtache.hy_XValue = dtflowtache.Rows[i]["hy_XValue"].ToString(); Hyoa_flowtache.hy_YValue = dtflowtache.Rows[i]["hy_YValue"].ToString(); Hyoa_flowtache.hy_rdDoIsSendSms = dtflowtache.Rows[i]["hy_rdDoIsSendSms"].ToString(); Hyoa_flowtache.hy_rdDoIsSendMessage = dtflowtache.Rows[i]["hy_rdDoIsSendMessage"].ToString(); Hyoa_flowtache.hy_rdPassIsSendSms = dtflowtache.Rows[i]["hy_rdPassIsSendSms"].ToString(); Hyoa_flowtache.hy_rdPassIsSendMessage = dtflowtache.Rows[i]["hy_rdPassIsSendMessage"].ToString(); Hyoa_flowtache.Insert(); } } //添加流转信息 DataTable dtflowwork = Hyoa_flowwork.Getflowworksbyflowid(this.txtSrcFlowID.Value); if (dtflowwork.Rows.Count > 0) { for (var i = 0; i < dtflowwork.Rows.Count; i++) { //复制到新流程中 Hyoa_flowwork.ID = Hyoa_global.GetRandom(); Hyoa_flowwork.hy_flowid = this.txtFlowID.Value; Hyoa_flowwork.hy_curtacheid = dtflowwork.Rows[i]["hy_curtacheid"].ToString(); Hyoa_flowwork.hy_curtachename = dtflowwork.Rows[i]["hy_curtachename"].ToString(); Hyoa_flowwork.hy_nexttacheid = dtflowwork.Rows[i]["hy_nexttacheid"].ToString(); Hyoa_flowwork.hy_nexttachename = dtflowwork.Rows[i]["hy_nexttachename"].ToString(); Hyoa_flowwork.hy_sort = System.Int32.Parse(dtflowwork.Rows[i]["hy_sort"].ToString()); Hyoa_flowwork.hy_actiontype = dtflowwork.Rows[i]["hy_actiontype"].ToString(); Hyoa_flowwork.Insert(); } } //添加流程对应的域 DataTable dtflowfield = Hyoa_flowfield.Getflowfieldsbyflowid(this.txtSrcFlowID.Value); if (dtflowfield.Rows.Count > 0) { for (var i = 0; i < dtflowfield.Rows.Count; i++) { //复制到新流程中 Hyoa_flowfield.ID = Hyoa_global.GetRandom(); Hyoa_flowfield.hy_flowid = this.txtFlowID.Value; Hyoa_flowfield.hy_fieldid = dtflowfield.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowfield.hy_fieldname = dtflowfield.Rows[i]["hy_fieldname"].ToString(); Hyoa_flowfield.hy_fieldtype = dtflowfield.Rows[i]["hy_fieldtype"].ToString(); Hyoa_flowfield.hy_config = dtflowfield.Rows[i]["hy_config"].ToString(); Hyoa_flowfield.hy_sort = System.Int32.Parse(dtflowfield.Rows[i]["hy_sort"].ToString()); Hyoa_flowfield.Insert(); } } //添加流程环节对应的域 DataTable dtflowtachefield = Hyoa_flowtachefield.Getflowtachefieldbyflowid(this.txtSrcFlowID.Value); if (dtflowtachefield.Rows.Count > 0) { for (var i = 0; i < dtflowtachefield.Rows.Count; i++) { //复制到新流程中 Hyoa_flowtachefield.ID = Hyoa_global.GetRandom(); Hyoa_flowtachefield.hy_flowid = this.txtFlowID.Value; Hyoa_flowtachefield.hy_tacheid = dtflowtachefield.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtachefield.hy_fieldid = dtflowtachefield.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowtachefield.Insert(); } } //添加流程环节对应的人员 DataTable dtflowtacheuser = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(this.txtSrcFlowID.Value); if (dtflowtacheuser.Rows.Count > 0) { for (var i = 0; i < dtflowtacheuser.Rows.Count; i++) { //复制到新流程中 Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom(); Hyoa_flowtacheuser.hy_flowid = this.txtFlowID.Value; Hyoa_flowtacheuser.hy_tacheid = dtflowtacheuser.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtacheuser.hy_userid = dtflowtacheuser.Rows[i]["hy_userid"].ToString(); Hyoa_flowtacheuser.Insert(); } } } //处理完成后的提示及跳转 Response.Write("<script>alert('" + ls_tip + "');window.opener.location.reload();self.close();</script>"); }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); if (this.txtop.Value == "add") { //先判断是否已经存在 DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtid.Text); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该流程已存在,请重新填写!');history.back();</script>"); return; } if (this.txtid.Text.Length < 5) { Response.Write("<script>alert('模块编号长度必须大于4位!');history.back();</script>"); return; } if (this.txtid.Text.Substring(0, 4) != "Flow") { Response.Write("<script>alert('模块编号必须以Flow开头!');history.back();</script>"); return; } Hyoa_flowinfor.hy_flowid = this.txtid.Text; Hyoa_flowinfor.hy_flowname = this.txtname.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Insert(); } else { Hyoa_flowinfor.hy_flowid = this.txtid.Text; Hyoa_flowinfor.hy_flowname = this.txtname.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Update(); } //保存时更新选中的模块对应的流程字段(hy_flowid) HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dt_update = Hyoa_flowfield.Getflowfieldsbymudelid_For_flowinfor(this.ddlmudelid.SelectedValue); if (dt_update.Rows.Count > 0) { for (var i = 0; i < dt_update.Rows.Count; i++) { Hyoa_flowfield.Updateflowid_For_flowinfor(this.txtid.Text, dt_update.Rows[i]["id"].ToString()); } } //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } }