protected void ddlmudelid_SelectedIndexChanged(object sender, EventArgs e) { if (this.ddlmudelid.SelectedIndex != 0) { this.ddltableid.Items.Clear(); //根据模块ID得到表单ID HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt = Hyoa_tableconfig.GetTablesbymudelid(this.ddlmudelid.SelectedValue); if (dt.Rows.Count > 0) { for (var i = 0; i < dt.Rows.Count; i++) { this.ddltableid.Items.Insert(i, new ListItem(dt.Rows[i]["hy_name"].ToString(), dt.Rows[i]["ID"].ToString())); } this.ddltableid.Items.Insert(0, new ListItem("--请选择--", "")); this.ddltableid.Attributes.Add("onchange ", "mudelidonchang() "); } } else { //清空 this.ddltableid.Items.Clear(); } }
private void DataPlay() { //加载一级目录ID、一级目录名称、每个一级目录最大的二级目录 HyoaClass.Hyoa_ml Hyoa_firstml = new HyoaClass.Hyoa_ml(); DataTable dtfirstml = Hyoa_firstml.GetFirstmls(); if (dtfirstml.Rows.Count > 0) { this.ddlfirstmlid.DataSource = dtfirstml; this.ddlfirstmlid.DataTextField = "MLID"; this.ddlfirstmlid.DataValueField = "MLID"; this.ddlfirstmlid.DataBind(); this.ddlfirstmlid.Items.Insert(0, "--请选择--"); this.ddlfirstmlid.SelectedIndex = 0; this.ddlfirstmlname.DataSource = dtfirstml; this.ddlfirstmlname.DataTextField = "MLName"; this.ddlfirstmlname.DataValueField = "MLName"; this.ddlfirstmlname.DataBind(); this.ddlfirstmlname.Items.Insert(0, "--请选择--"); this.ddlfirstmlname.SelectedIndex = 0; //加载每个一级目录最大的二级目录 string ls_id; for (var i = 0; i < dtfirstml.Rows.Count; i++) { ls_id = Hyoa_firstml.GetMaxMLID(dtfirstml.Rows[i]["MLID"].ToString()); this.ddlsecondmlid.Items.Insert(i, ls_id); } this.ddlsecondmlid.Items.Insert(0, "--请选择--"); this.ddlsecondmlid.SelectedIndex = 0; } //加载模块信息 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; } //加载权限 HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role(); DataTable dtrole = Hyoa_role.Getroles(); if (dtrole.Rows.Count > 0) { this.ddlrole.DataSource = dtrole; this.ddlrole.DataTextField = "hy_rolename"; this.ddlrole.DataValueField = "hy_roleid"; this.ddlrole.DataBind(); this.ddlrole.Items.Insert(0, "--请选择--"); this.ddlrole.SelectedIndex = 0; } this.ddlisenabled.Items.Insert(0, "是"); this.ddlisenabled.Items.Insert(1, "否"); 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_ml Hyoa_ml = new HyoaClass.Hyoa_ml(); //旧文档 if (this.Request.QueryString["op"] == "modify") { if (this.Request.QueryString["id"] != null) { //根据id得到信息 this.lblid.Value = this.Request.QueryString["id"].ToString(); this.txtMLID.Value = this.Request.QueryString["id"].ToString(); DataTable dt = Hyoa_ml.Getml(this.lblid.Value); if (dt.Rows.Count > 0) { this.txtname.Value = dt.Rows[0]["MLName"].ToString(); this.txtlink.Value = dt.Rows[0]["hy_link"].ToString(); this.ddltarget.SelectedValue = dt.Rows[0]["hy_target"].ToString(); this.ddlrole.SelectedValue = dt.Rows[0]["hy_role"].ToString(); this.txtsort.Value = dt.Rows[0]["hy_sort"].ToString(); //模块信息定位 for (var i = 0; i < this.ddlmudelid.Items.Count; i++) { if (this.ddlmudelid.Items[i].Value == dt.Rows[0]["hy_mudelid"].ToString()) { this.ddlmudelid.SelectedIndex = i; } } //一级目录定位 for (var i = 0; i < this.ddlfirstmlid.Items.Count; i++) { if (this.ddlfirstmlid.Items[i].Value == dt.Rows[0]["MLID"].ToString().Substring(0,3)) { this.ddlfirstmlid.SelectedIndex = i; this.ddlfirstmlname.SelectedIndex = i; } } if (dt.Rows[0]["hy_ifqy"].ToString() == "是") this.ddlisenabled.SelectedIndex = 0; else this.ddlisenabled.SelectedIndex = 1; //根据模块信息得到对应的选择表单值 if (dt.Rows[0]["hy_tableid"] != "" && dt.Rows[0]["hy_tableid"] != null) { this.ddltableid.Items.Clear(); //根据模块ID得到表单ID HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dtgettableid = Hyoa_tableconfig.GetTablesbymudelid(dt.Rows[0]["hy_mudelid"].ToString()); if (dtgettableid.Rows.Count > 0) { for (var i = 0; i < dtgettableid.Rows.Count; i++) { this.ddltableid.Items.Insert(i, new ListItem(dtgettableid.Rows[i]["hy_name"].ToString(), dtgettableid.Rows[i]["ID"].ToString())); } this.ddltableid.Items.Insert(0, new ListItem("--请选择--", "")); //定位 this.ddltableid.SelectedValue = dt.Rows[0]["hy_tableid"].ToString(); } } } dt.Clear(); } } } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "复制成功!"; try { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role(); HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig(); HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield(); HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield(); HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); #region 生成权限 DataTable dt = Hyoa_role.Getrole("Role" + this.txtmudelid.Text); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该权限编号已存在,请重新填写!');history.back();</script>"); return; } else { Hyoa_role.hy_roleid = "Role" + this.txtmudelid.Text; Hyoa_role.hy_rolename = this.txtmudelname.Text; Hyoa_role.hy_sort = System.Int32.Parse(this.txtno.Value); Hyoa_role.Insert(); } #endregion #region 生成模块 dt = Hyoa_mudel.Getmudel("Mudel" + this.txtmudelid.Text); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该模块编号已存在,请重新填写!');history.back();</script>"); return; } else { Hyoa_mudel.hy_mudelid = "Mudel" + this.txtmudelid.Text; Hyoa_mudel.hy_mudelname = this.txtmudelname.Text; Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtno.Value); Hyoa_mudel.hy_isenabled = "是"; Hyoa_mudel.hy_roleid = "Role" + this.txtmudelid.Text; Hyoa_mudel.hy_qqroleid = "Role" + this.txtmudelid.Text; Hyoa_mudel.Insert(); } #endregion #region 生成表单 DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.ddlmudelid.SelectedValue); if (tableconfigdt.Rows.Count > 0) { Hyoa_tableconfig.ID = "Table" + this.txtmudelid.Text; Hyoa_tableconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text; Hyoa_tableconfig.hy_name = this.txtmudelname.Text; Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString(); Hyoa_tableconfig.hy_sort = float.Parse(this.txtno.Value); Hyoa_tableconfig.hy_ifflowdoc = tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString(); Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString(); Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString(); Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString(); Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString(); Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString()); Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString(); Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString(); Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString(); Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString(); Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString(); Hyoa_tableconfig.Insert(); } #endregion #region 生成表单字段 int i; DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.ddltableid.SelectedValue); if (flowfielddt.Rows.Count > 0) { for (i = 0; i < flowfielddt.Rows.Count; i++) { Hyoa_flowfield.ID = Hyoa_global.GetRandom(); Hyoa_flowfield.hy_tableid = "Table" + this.txtmudelid.Text; Hyoa_flowfield.hy_mudelid = "Mudel" + this.txtmudelid.Text; Hyoa_flowfield.hy_flowid = "Flow" + this.txtmudelid.Text; Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString(); Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString(); Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString(); Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString()); Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString(); Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString()); Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString(); Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString(); Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString(); Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString(); Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString(); Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString(); Hyoa_flowfield.hy_onfocus = flowfielddt.Rows[i]["hy_onfocus"].ToString(); Hyoa_flowfield.hy_onblur = flowfielddt.Rows[i]["hy_onblur"].ToString(); Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString(); Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString(); Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString(); Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString(); Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString()); Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString(); Hyoa_flowfield.hy_sort = float.Parse(flowfielddt.Rows[i]["hy_sort"].ToString()); Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString()); Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString(); Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString(); Hyoa_flowfield.hy_ifhiddle = flowfielddt.Rows[i]["hy_ifhiddle"].ToString(); Hyoa_flowfield.hy_ifdbsybt = flowfielddt.Rows[i]["hy_ifdbsybt"].ToString(); Hyoa_flowfield.hy_field1 = flowfielddt.Rows[i]["hy_field1"].ToString(); Hyoa_flowfield.hy_field2 = flowfielddt.Rows[i]["hy_field2"].ToString(); Hyoa_flowfield.hy_field3 = flowfielddt.Rows[i]["hy_field3"].ToString(); Hyoa_flowfield.hy_field4 = flowfielddt.Rows[i]["hy_field4"].ToString(); Hyoa_flowfield.hy_field5 = flowfielddt.Rows[i]["hy_field5"].ToString(); Hyoa_flowfield.Insert(); } } #endregion #region 生成SQL/ORACLE中的表 string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "select * into hyc_Table" + this.txtmudelid.Text + " from hyc_" + this.ddltableid.SelectedValue + " where 1=0"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "create table hyc_Table" + this.txtmudelid.Text + " as select * from hyc_" + this.ddltableid.SelectedValue + " where 1=2"; } Hyoa_global.ExcuteSQL(sql); #endregion #region 生成列表 DataTable listconfigdt = Hyoa_listconfig.GetlistconfigsbyMudelidAndTableid(this.ddlmudelid.SelectedValue, this.ddltableid.SelectedValue); //列表ID string strListId = Hyoa_global.GetRandom(); if (listconfigdt.Rows.Count > 0) { Hyoa_listconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text; Hyoa_listconfig.hy_tableid = "Table" + this.txtmudelid.Text; Hyoa_listconfig.hy_ifflowdoc = listconfigdt.Rows[0]["hy_ifflowdoc"].ToString(); Hyoa_listconfig.hy_sort = System.Int32.Parse(this.txtno.Value); Hyoa_listconfig.hy_columnshowid = listconfigdt.Rows[0]["hy_columnshowid"].ToString(); Hyoa_listconfig.hy_columnshow = listconfigdt.Rows[0]["hy_columnshow"].ToString(); Hyoa_listconfig.hy_ifsearch = listconfigdt.Rows[0]["hy_ifsearch"].ToString(); Hyoa_listconfig.hy_ifshowsearch = listconfigdt.Rows[0]["hy_ifshowsearch"].ToString(); Hyoa_listconfig.hy_width = listconfigdt.Rows[0]["hy_width"].ToString(); Hyoa_listconfig.hy_listname = this.txtmudelname.Text; Hyoa_listconfig.hy_sortfield1 = listconfigdt.Rows[0]["hy_sortfield1"].ToString(); Hyoa_listconfig.hy_sorttype1 = listconfigdt.Rows[0]["hy_sorttype1"].ToString(); Hyoa_listconfig.hy_sortfield2 = listconfigdt.Rows[0]["hy_sortfield2"].ToString(); Hyoa_listconfig.hy_sorttype2 = listconfigdt.Rows[0]["hy_sorttype2"].ToString(); Hyoa_listconfig.hy_sortfield3 = listconfigdt.Rows[0]["hy_sortfield3"].ToString(); Hyoa_listconfig.hy_sorttype3 = listconfigdt.Rows[0]["hy_sorttype3"].ToString(); Hyoa_listconfig.hy_fieldid_fl1 = listconfigdt.Rows[0]["hy_fieldid_fl1"].ToString(); Hyoa_listconfig.hy_fieldname_fl1 = listconfigdt.Rows[0]["hy_fieldname_fl1"].ToString(); Hyoa_listconfig.hy_sql_fl1 = listconfigdt.Rows[0]["hy_sql_fl1"].ToString(); Hyoa_listconfig.hy_fieldid_fl2 = listconfigdt.Rows[0]["hy_fieldid_fl2"].ToString(); Hyoa_listconfig.hy_fieldname_fl2 = listconfigdt.Rows[0]["hy_fieldname_fl2"].ToString(); Hyoa_listconfig.hy_sql_fl2 = listconfigdt.Rows[0]["hy_sql_fl2"].ToString(); Hyoa_listconfig.hy_fieldid_fl3 = listconfigdt.Rows[0]["hy_fieldid_fl3"].ToString(); Hyoa_listconfig.hy_fieldname_fl3 = listconfigdt.Rows[0]["hy_fieldname_fl3"].ToString(); Hyoa_listconfig.hy_sql_fl3 = listconfigdt.Rows[0]["hy_sql_fl3"].ToString(); Hyoa_listconfig.ID = strListId; Hyoa_listconfig.Insert(); } #endregion #region 生成列表查询条件 DataTable listsearchdt = Hyoa_listsearchfield.GetlistsearchfieldsbyMudelidAndTableid(this.ddlmudelid.SelectedValue, this.ddltableid.SelectedValue); for (int m = 0; m < listsearchdt.Rows.Count; m++) { Hyoa_listsearchfield.ID = Hyoa_global.GetRandom(); Hyoa_listsearchfield.hy_listid = strListId; Hyoa_listsearchfield.hy_mudelid = "Mudel" + this.txtmudelid.Text; Hyoa_listsearchfield.hy_tableid = "Table" + this.txtmudelid.Text; Hyoa_listsearchfield.hy_field = listsearchdt.Rows[m]["hy_field"].ToString(); Hyoa_listsearchfield.hy_fieldid = listsearchdt.Rows[m]["hy_fieldid"].ToString(); Hyoa_listsearchfield.hy_sort = m + 2; Hyoa_listsearchfield.Insert(); } #endregion #region 生成流程信息 string lssoureceflowid = ""; if (tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString() == "是") { DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.ddlmudelid.SelectedValue); if (flowinfordt.Rows.Count > 0) { //得到老模块的flowid 后面要用到 lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString(); //插入流程信息start Hyoa_flowinfor.hy_flowid = "Flow" + this.txtmudelid.Text; Hyoa_flowinfor.hy_flowname = this.txtmudelname.Text; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtno.Value); Hyoa_flowinfor.hy_mudelid = "Mudel" + this.txtmudelid.Text; // Hyoa_flowinfor.hy_addbyalluser = flowinfordt.Rows[0]["hy_addbyalluser"].ToString(); Hyoa_flowinfor.Insert(); } //插入流程信息end //流程环节 DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid); if (flowtachedt.Rows.Count > 0) { for (i = 0; i < flowtachedt.Rows.Count; i++) { Hyoa_flowtache.ID = Hyoa_global.GetRandom(); Hyoa_flowtache.hy_flowid = "Flow" + this.txtmudelid.Text; Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString(); Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString()); Hyoa_flowtache.hy_ifshowcurcomp = flowtachedt.Rows[i]["hy_ifshowcurcomp"].ToString(); Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString(); Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString(); Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString(); Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString(); Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString(); Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString(); Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString(); Hyoa_flowtache.hy_enablecondition = flowtachedt.Rows[i]["hy_enablecondition"].ToString(); Hyoa_flowtache.Insert(); } } //流程环节对应的域 DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid); if (flowtachefielddt.Rows.Count > 0) { for (i = 0; i < flowtachefielddt.Rows.Count; i++) { Hyoa_flowtachefield.ID = Hyoa_global.GetRandom(); Hyoa_flowtachefield.hy_flowid = "Flow" + this.txtmudelid.Text; Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowtachefield.Insert(); } } //流程环节对应的用户 DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid); if (flowtacheuserdt.Rows.Count > 0) { for (i = 0; i < flowtacheuserdt.Rows.Count; i++) { Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom(); Hyoa_flowtacheuser.hy_flowid = "Flow" + this.txtmudelid.Text; Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString(); Hyoa_flowtacheuser.Insert(); } } //工作流 DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid); if (flowworkdt.Rows.Count > 0) { for (i = 0; i < flowworkdt.Rows.Count; i++) { Hyoa_flowwork.ID = Hyoa_global.GetRandom(); Hyoa_flowwork.hy_flowid = "Flow" + this.txtmudelid.Text; Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString(); Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString(); Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString(); Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString(); Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString()); Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString(); Hyoa_flowwork.hy_identity_type = flowworkdt.Rows[i]["hy_identity_type"].ToString(); Hyoa_flowwork.hy_identity_id = flowworkdt.Rows[i]["hy_identity_id"].ToString(); Hyoa_flowwork.hy_jscondition = flowworkdt.Rows[i]["hy_jscondition"].ToString(); Hyoa_flowwork.hy_jscondition1 = flowworkdt.Rows[i]["hy_jscondition1"].ToString(); Hyoa_flowwork.hy_jscondition2 = flowworkdt.Rows[i]["hy_jscondition2"].ToString(); Hyoa_flowwork.hy_zdcyuserids = flowworkdt.Rows[i]["hy_zdcyuserids"].ToString(); Hyoa_flowwork.Insert(); } } } #endregion } catch { ls_tip = "复制失败!"; } finally { Response.Write("<script>alert('" + ls_tip + "');window.location.href='" + txturl.Text + "';</script>"); } }
private void DataPlay() { //是否启用 this.ddlifsearch.Items.Insert(0, "是"); this.ddlifsearch.Items.Insert(1, "否"); //this.ddlifflowdoc.Items.Insert(0, "是"); //this.ddlifflowdoc.Items.Insert(1, "否"); //模块编号 //加载模块信息 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, new ListItem("请选择", "请选择")); this.ddlmudelid.SelectedIndex = 0; //this.ddlmudelid.Items.Insert(0, new ListItem(lsmudel, lsmudelid)); } //dtmudel.Clear(); //加载列信息 HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtflowfield; dtflowfield = Hyoa_flowfield.Getflowfields(); if (dtflowfield.Rows.Count > 0) { this.ddlcolumnshow.DataSource = dtflowfield; this.ddlcolumnshow.DataTextField = "hy_fieldname"; this.ddlcolumnshow.DataValueField = "hy_fieldid"; this.ddlcolumnshow.DataBind(); this.ddlcolumnshow.SelectedIndex = 0; } dtflowfield.Clear(); 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; //保存 } //旧文档 if (this.Request.QueryString["op"] == "modify") { string ls_xszd=""; string ls_xszdid=""; if (this.Request.QueryString["id"] != null) { //根据id得到信息 this.txtdocid.Value = this.Request.QueryString["id"].ToString(); HyoaClass.DAO db = new HyoaClass.DAO(); string sql = "select * from hyt_searchconfig where ID='" + this.txtdocid.Value + "'"; DataTable dt = db.GetDataTable(sql); if (dt.Rows.Count > 0) { this.txtsort.Text = dt.Rows[0]["hy_sort"].ToString(); //this.txtwidth.Text = dt.Rows[0]["hy_width"].ToString(); if (dt.Rows[0]["hy_ifsearch"].ToString() == "是") this.ddlifsearch.SelectedIndex = 0; else this.ddlifsearch.SelectedIndex = 1; this.ddlmudelid.SelectedValue = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_field41_1.Value = dt.Rows[0]["hy_kckry"].ToString(); this.hy_field43_1.Value = dt.Rows[0]["hy_kckryid"].ToString(); //将列都列出来 string[] lv_columnshowselect; string[] lv_columnshowselectid; lv_columnshowselect = dt.Rows[0]["hy_columnshow"].ToString().Split(','); lv_columnshowselectid = dt.Rows[0]["hy_columnshowid"].ToString().Split(','); for (int j = 0; j < lv_columnshowselect.Length; j++) { this.ddlcolumnshowselect.Items.Insert(j, new ListItem(lv_columnshowselect[j], lv_columnshowselectid[j])); } //根据模块信息得到对应的选择表单值 if (dt.Rows[0]["hy_tableid"] != "" && dt.Rows[0]["hy_tableid"] != null) { this.ddltableid.Items.Clear(); //根据模块ID得到表单ID HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dtgettableid = Hyoa_tableconfig.GetTablesbymudelid(dt.Rows[0]["hy_mudelid"].ToString()); if (dtgettableid.Rows.Count > 0) { for (var i = 0; i < dtgettableid.Rows.Count; i++) { this.ddltableid.Items.Insert(i, new ListItem(dtgettableid.Rows[i]["hy_name"].ToString(), dtgettableid.Rows[i]["ID"].ToString())); } this.ddltableid.Items.Insert(0, new ListItem("--请选择--", "")); this.ddltableid.Attributes.Add("onchange ", "mudelidonchang() "); //定位 this.ddltableid.SelectedValue = dt.Rows[0]["hy_tableid"].ToString(); } } //排序的字段 //根据模块ID+表单ID+字段ID得到字段中文名 //DataTable dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield"].ToString(), dt.Rows[0]["hy_tableid"].ToString()); //if(dt_flowfield.Rows.Count>0) // this.searchsort.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield"].ToString())); //this.ddlsorttype.SelectedValue = dt.Rows[0]["hy_sorttype"].ToString(); ls_xszd = dt.Rows[0]["hy_xszd"].ToString(); ls_xszdid = dt.Rows[0]["hy_xszdid"].ToString(); } dt.Clear(); //HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield(); //DataTable dt5 = Hyoa_listsearchfield.Getlistsearchfieldsbylistid(this.txtdocid.Value); //if (dt5.Rows.Count > 0) //{ // for (int m = 0; m < dt5.Rows.Count; m++) // { // this.searchselect.Items.Insert(m, new ListItem(dt5.Rows[m]["hy_field"].ToString(), dt5.Rows[m]["hy_fieldid"].ToString())); // } //} string[] lv_xszd = ls_xszd.Split(','); string[] lv_xszdid = ls_xszdid.Split(','); for (int jj = 0; jj < lv_xszd.Length; jj++) { this.searchselect.Items.Insert(jj, new ListItem(lv_xszd[jj], lv_xszdid[jj])); } } } } }
private void DataPlay() { //是否启用 this.ddlifsearch.Items.Insert(0, "是"); this.ddlifsearch.Items.Insert(1, "否"); this.ddlifflowdoc.Items.Insert(0, "是"); this.ddlifflowdoc.Items.Insert(1, "否"); this.ddlifshowsearch.Items.Insert(0, "是"); this.ddlifshowsearch.Items.Insert(1, "否"); //模块编号 //加载模块信息 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, new ListItem("请选择", "请选择")); this.ddlmudelid.SelectedIndex = 0; } 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_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig(); if (this.Request.QueryString["op"] == "modify") { if (this.Request.QueryString["id"] != null) { //根据id得到信息 this.txtdocid.Value = this.Request.QueryString["id"].ToString(); DataTable dt = Hyoa_listconfig.Getlistconfig(this.txtdocid.Value); if (dt.Rows.Count > 0) { this.txtsort.Text = dt.Rows[0]["hy_sort"].ToString(); if (dt.Rows[0]["hy_ifsearch"].ToString() == "是") { this.ddlifsearch.SelectedIndex = 0; } else { this.ddlifsearch.SelectedIndex = 1; } if (dt.Rows[0]["hy_ifshowsearch"].ToString() != "否") { this.ddlifshowsearch.SelectedIndex = 0; } else { this.ddlifshowsearch.SelectedIndex = 1; } this.ddlmudelid.SelectedValue = dt.Rows[0]["hy_mudelid"].ToString(); if (dt.Rows[0]["hy_ifflowdoc"].ToString() == "是") { this.ddlifflowdoc.SelectedIndex = 0; } else { this.ddlifflowdoc.SelectedIndex = 1; } this.txthy_listname.Text = dt.Rows[0]["hy_listname"].ToString(); this.txtwidth.Text = dt.Rows[0]["hy_width"].ToString(); //加载所有列信息 HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtflowfield; //dtflowfield = Hyoa_flowfield.Getflowfields(); dtflowfield = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_tableid"].ToString()); if (dtflowfield.Rows.Count > 0) { this.ddlcolumnshow.DataSource = dtflowfield; this.ddlcolumnshow.DataTextField = "hy_fieldname"; this.ddlcolumnshow.DataValueField = "hy_fieldid"; this.ddlcolumnshow.DataBind(); this.ddlcolumnshow.SelectedIndex = 0; } dtflowfield.Clear(); //将列都列出来 string[] lv_columnshowselect; string[] lv_columnshowselectid; lv_columnshowselect = dt.Rows[0]["hy_columnshow"].ToString().Split(','); lv_columnshowselectid = dt.Rows[0]["hy_columnshowid"].ToString().Split(','); for (int j = 0; j < lv_columnshowselect.Length; j++) { this.ddlcolumnshowselect.Items.Insert(j, new ListItem(lv_columnshowselect[j], lv_columnshowselectid[j])); } //根据模块信息得到对应的选择表单值 if (dt.Rows[0]["hy_tableid"] != "" && dt.Rows[0]["hy_tableid"] != null) { this.ddltableid.Items.Clear(); //根据模块ID得到表单ID HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dtgettableid = Hyoa_tableconfig.GetTablesbymudelid(dt.Rows[0]["hy_mudelid"].ToString()); if (dtgettableid.Rows.Count > 0) { for (var i = 0; i < dtgettableid.Rows.Count; i++) { this.ddltableid.Items.Insert(i, new ListItem(dtgettableid.Rows[i]["hy_name"].ToString(), dtgettableid.Rows[i]["ID"].ToString())); } this.ddltableid.Items.Insert(0, new ListItem("--请选择--", "")); this.ddltableid.Attributes.Add("onchange ", "mudelidonchang() "); //定位 this.ddltableid.SelectedValue = dt.Rows[0]["hy_tableid"].ToString(); } } //排序的字段 //根据模块ID+表单ID+字段ID得到字段中文名 DataTable dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield1"].ToString(), dt.Rows[0]["hy_tableid"].ToString()); if (dt_flowfield.Rows.Count > 0) { this.searchsort1.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield1"].ToString())); } this.ddlsorttype1.SelectedValue = dt.Rows[0]["hy_sorttype1"].ToString(); dt_flowfield.Clear(); dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield2"].ToString(), dt.Rows[0]["hy_tableid"].ToString()); if (dt_flowfield.Rows.Count > 0) { this.searchsort2.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield2"].ToString())); } this.ddlsorttype2.SelectedValue = dt.Rows[0]["hy_sorttype2"].ToString(); dt_flowfield.Clear(); dt_flowfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(dt.Rows[0]["hy_mudelid"].ToString(), dt.Rows[0]["hy_sortfield3"].ToString(), dt.Rows[0]["hy_tableid"].ToString()); if (dt_flowfield.Rows.Count > 0) { this.searchsort3.Items.Insert(0, new ListItem(dt_flowfield.Rows[0]["hy_fieldname"].ToString(), dt.Rows[0]["hy_sortfield3"].ToString())); } this.ddlsorttype3.SelectedValue = dt.Rows[0]["hy_sorttype3"].ToString(); dt_flowfield.Clear(); //分类的字段 this.txthy_field_fl1.Text = dt.Rows[0]["hy_sql_fl1"].ToString(); if (dt.Rows[0]["hy_fieldid_fl1"].ToString() != "") { this.flfield1.Items.Insert(0, new ListItem(dt.Rows[0]["hy_fieldname_fl1"].ToString(), dt.Rows[0]["hy_fieldid_fl1"].ToString())); } this.txthy_field_fl2.Text = dt.Rows[0]["hy_sql_fl2"].ToString(); if (dt.Rows[0]["hy_fieldid_fl2"].ToString() != "") { this.flfield2.Items.Insert(0, new ListItem(dt.Rows[0]["hy_fieldname_fl2"].ToString(), dt.Rows[0]["hy_fieldid_fl2"].ToString())); } this.txthy_field_fl3.Text = dt.Rows[0]["hy_sql_fl3"].ToString(); if (dt.Rows[0]["hy_fieldid_fl3"].ToString() != "") { this.flfield3.Items.Insert(0, new ListItem(dt.Rows[0]["hy_fieldname_fl3"].ToString(), dt.Rows[0]["hy_fieldid_fl3"].ToString())); } } dt.Clear(); HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield(); DataTable dt5 = Hyoa_listsearchfield.Getlistsearchfieldsbylistid(this.txtdocid.Value); if (dt5.Rows.Count > 0) { for (int m = 0; m < dt5.Rows.Count; m++) { this.searchselect.Items.Insert(m, new ListItem(dt5.Rows[m]["hy_field"].ToString(), dt5.Rows[m]["hy_fieldid"].ToString())); } } } } else { //自动获取最大排序号,然后+2 DataTable dt_maxsort = Hyoa_listconfig.GetMaxlistconfigsort(); if (dt_maxsort.Rows.Count > 0) txtsort.Text = (int.Parse(dt_maxsort.Rows[0]["hy_sort"].ToString()) + 2).ToString(); else txtsort.Text = "1"; } } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //判断目的表单ID是否重复 DataTable dt_table = Hyoa_tableconfig.GetTable(txttableidbymd.Text); if (dt_table.Rows.Count > 0) { Response.Write("<script>alert('目的表单ID已存在!');</script>"); return; } //插入TABLE配置 DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.lbmudelidbysource.Text); if (tableconfigdt.Rows.Count > 0) { Hyoa_tableconfig.ID = txttableidbymd.Text; Hyoa_tableconfig.hy_mudelid = this.ddlmudelidbymd.SelectedValue; Hyoa_tableconfig.hy_name = this.txttablenamebymd.Text; Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString(); Hyoa_tableconfig.hy_sort = float.Parse(this.txttablesortbymd.Text); Hyoa_tableconfig.hy_ifflowdoc = this.ddlifflowdoc.SelectedValue; Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString(); Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString(); Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString(); Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString(); Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString()); Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString(); Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString(); Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString(); Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString(); Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString(); Hyoa_tableconfig.Insert(); } //插入FIELD配置 int i; DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.lbtableidbysorce.Text); if (flowfielddt.Rows.Count > 0) { for (i = 0; i < flowfielddt.Rows.Count; i++) { Hyoa_flowfield.ID = Hyoa_global.GetRandom(); Hyoa_flowfield.hy_tableid = txttableidbymd.Text; Hyoa_flowfield.hy_mudelid = this.ddlmudelidbymd.SelectedValue; Hyoa_flowfield.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString(); Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString(); Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString(); Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString()); Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString(); Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString()); Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString(); Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString(); Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString(); Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString(); Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString(); Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString(); Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString(); Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString(); Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString(); Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString(); Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString()); Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString(); Hyoa_flowfield.hy_sort = float.Parse(flowfielddt.Rows[i]["hy_sort"].ToString()); Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString()); Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString(); Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString(); Hyoa_flowfield.hy_ifhiddle = flowfielddt.Rows[i]["hy_ifhiddle"].ToString(); Hyoa_flowfield.hy_ifdbsybt = flowfielddt.Rows[i]["hy_ifdbsybt"].ToString(); Hyoa_flowfield.hy_field1 = flowfielddt.Rows[i]["hy_field1"].ToString(); Hyoa_flowfield.hy_field2 = flowfielddt.Rows[i]["hy_field2"].ToString(); Hyoa_flowfield.hy_field3 = flowfielddt.Rows[i]["hy_field3"].ToString(); Hyoa_flowfield.hy_field4 = flowfielddt.Rows[i]["hy_field4"].ToString(); Hyoa_flowfield.hy_field5 = flowfielddt.Rows[i]["hy_field5"].ToString(); Hyoa_flowfield.Insert(); } } //生成SQL/ORACLE中的表 string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "select * into hyc_" + txttableidbymd.Text + " from hyc_" + this.lbtableidbysorce.Text + " where 1=0"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "create table hyc_" + txttableidbymd.Text + " as select * from hyc_" + this.lbtableidbysorce.Text + " where 1=2"; } Hyoa_global.ExcuteSQL(sql); //以下为流程模块的功能,非流程模块不需要执行 if (this.ddlifflowdoc.SelectedValue == "是") { HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.lbmudelidbysource.Text); string lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();//得到老模块的flowid 后面要用到 //插入流程信息start Hyoa_flowinfor.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowinfor.hy_flowname =this.txtflownamebymd.Text; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtflowsortbymd.Text); Hyoa_flowinfor.hy_mudelid = this.ddlmudelidbymd.SelectedValue; Hyoa_flowinfor.Insert(); //插入流程信息end //string lssql3 = "select * from hyt_flowtache where hy_flowid = 'flow0004'";//流程对应的环节 HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid); if (flowtachedt.Rows.Count > 0) { for (i = 0; i < flowtachedt.Rows.Count; i++) { Hyoa_flowtache.ID = Hyoa_global.GetRandom(); Hyoa_flowtache.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString(); Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString()); Hyoa_flowtache.hy_ifshowcurcomp = flowtachedt.Rows[i]["hy_ifshowcurcomp"].ToString(); Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString(); Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString(); Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString(); Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString(); Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString(); Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString(); Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString(); Hyoa_flowtache.hy_enablecondition = flowtachedt.Rows[i]["hy_enablecondition"].ToString(); Hyoa_flowtache.Insert(); } } //string lssql4 = "select * from hyt_flowtachefield where hy_flowid='flow0004'";//流程环节对应的域 HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield(); DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid); if (flowtachefielddt.Rows.Count > 0) { for (i = 0; i < flowtachefielddt.Rows.Count; i++) { Hyoa_flowtachefield.ID = Hyoa_global.GetRandom(); Hyoa_flowtachefield.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowtachefield.Insert(); } } //string lssql5 = "select * from hyt_flowtacheuser where hy_flowid='flow0004'";//流程环节对应的用户 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid); if (flowtacheuserdt.Rows.Count > 0) { for (i = 0; i < flowtacheuserdt.Rows.Count; i++) { Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom(); Hyoa_flowtacheuser.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString(); Hyoa_flowtacheuser.Insert(); } } //string lssql6 = "select * from hyt_flowwork where hy_flowid='flow0004'";//流程的下环节对应什么,即工作流 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid); if (flowworkdt.Rows.Count > 0) { for (i = 0; i < flowworkdt.Rows.Count; i++) { Hyoa_flowwork.ID = Hyoa_global.GetRandom(); Hyoa_flowwork.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString(); Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString(); Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString(); Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString(); Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString()); Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString(); Hyoa_flowwork.hy_identity_type = flowworkdt.Rows[i]["hy_identity_type"].ToString(); Hyoa_flowwork.hy_identity_id = flowworkdt.Rows[i]["hy_identity_id"].ToString(); Hyoa_flowwork.hy_jscondition = flowworkdt.Rows[i]["hy_jscondition"].ToString(); Hyoa_flowwork.hy_jscondition1 = flowworkdt.Rows[i]["hy_jscondition1"].ToString(); Hyoa_flowwork.hy_jscondition2 = flowworkdt.Rows[i]["hy_jscondition2"].ToString(); Hyoa_flowwork.hy_zdcyuserids = flowworkdt.Rows[i]["hy_zdcyuserids"].ToString(); Hyoa_flowwork.Insert(); } } } //处理完成后的提示及跳转 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>"); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //string lssql1 = "SELECT * FROM hyt_flowfield WHERE hy_tableid = '" + this.lbtableidbysorce.Text + "'"; //得到配置字段 HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); int i; DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.lbtableidbysorce.Text); string newtableid; newtableid = Hyoa_global.GetRandom(); if (flowfielddt.Rows.Count > 0) { for (i = 0; i < flowfielddt.Rows.Count; i++) { Hyoa_flowfield.ID = Hyoa_global.GetRandom(); Hyoa_flowfield.hy_tableid = newtableid; Hyoa_flowfield.hy_mudelid = this.ddlmudelidbymd.SelectedValue; Hyoa_flowfield.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString(); Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString(); Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString(); Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString()); Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString(); Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString()); Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString(); Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString(); Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString(); Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString(); Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString(); Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString(); Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString(); Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString(); Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString(); Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString(); Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString()); Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString(); Hyoa_flowfield.hy_sort = System.Int32.Parse(flowfielddt.Rows[i]["hy_sort"].ToString()); Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString()); Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString(); Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString(); Hyoa_flowfield.Insert(); } } HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); //hyt_tableconfig DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.lbmudelidbysource.Text); if (tableconfigdt.Rows.Count > 0) { Hyoa_tableconfig.ID = newtableid; Hyoa_tableconfig.hy_mudelid = this.ddlmudelidbymd.SelectedValue; Hyoa_tableconfig.hy_name = this.txttablenamebymd.Text; Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString(); Hyoa_tableconfig.hy_sort = System.Int32.Parse(this.txttablesortbymd.Text); Hyoa_tableconfig.hy_ifflowdoc = this.ddlifflowdoc.SelectedValue; Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString(); Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString(); Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString(); Hyoa_tableconfig.Insert(); } //以下为流程模块的功能,非流程模块不需要执行 if (this.ddlifflowdoc.SelectedValue == "是") { //string lssql2 = "SELECT * FROM hyt_flowinfor WHERE hy_mudelid = 'bgyply'";//得到模块对应的流程 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.lbmudelidbysource.Text); string lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();//得到老模块的flowid 后面要用到 //插入流程信息start Hyoa_flowinfor.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowinfor.hy_flowname =this.txtflownamebymd.Text; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtflowsortbymd.Text); Hyoa_flowinfor.hy_mudelid = this.ddlmudelidbymd.SelectedValue; Hyoa_flowinfor.Insert(); //插入流程信息end //string lssql3 = "select * from hyt_flowtache where hy_flowid = 'flow0004'";//流程对应的环节 HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid); if (flowtachedt.Rows.Count > 0) { for (i = 0; i < flowtachedt.Rows.Count; i++) { Hyoa_flowtache.ID = Hyoa_global.GetRandom(); Hyoa_flowtache.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString(); Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString()); Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString(); Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString(); Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString(); Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString(); Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString(); Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString(); Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString(); Hyoa_flowtache.Insert(); } } //string lssql4 = "select * from hyt_flowtachefield where hy_flowid='flow0004'";//流程环节对应的域 HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield(); DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid); if (flowtachefielddt.Rows.Count > 0) { for (i = 0; i < flowtachefielddt.Rows.Count; i++) { Hyoa_flowtachefield.ID = Hyoa_global.GetRandom(); Hyoa_flowtachefield.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString(); Hyoa_flowtachefield.Insert(); } } //string lssql5 = "select * from hyt_flowtacheuser where hy_flowid='flow0004'";//流程环节对应的用户 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid); if (flowtacheuserdt.Rows.Count > 0) { for (i = 0; i < flowtacheuserdt.Rows.Count; i++) { Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom(); Hyoa_flowtacheuser.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString(); Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString(); Hyoa_flowtacheuser.Insert(); } } //string lssql6 = "select * from hyt_flowwork where hy_flowid='flow0004'";//流程的下环节对应什么,即工作流 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid); if (flowworkdt.Rows.Count > 0) { for (i = 0; i < flowworkdt.Rows.Count; i++) { Hyoa_flowwork.ID = Hyoa_global.GetRandom(); Hyoa_flowwork.hy_flowid = this.txtflowidbymd.Text; Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString(); Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString(); Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString(); Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString(); Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString()); Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString(); Hyoa_flowwork.Insert(); } } } //处理完成后的提示及跳转 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>"); } }
//右侧默认页面 public string Hy_Rightlink() { string ls_retrun = ""; if (this.Request.QueryString["mid"] != null) { if (this.Request.QueryString["mid"].ToString() == "dbsy") { ls_retrun = "/system/list_dbsy.aspx"; } if (this.Request.QueryString["mid"].ToString() == "mail") { ls_retrun = "/system/list_mail_sjx.aspx"; } if (this.Request.QueryString["mid"].ToString() == "rwdb") { ls_retrun = "/list_rwdb_qc.aspx?mid=rwdb&tableid=81176f65-d959-4fb9-a313-174f82cdc227"; } if (this.Request.QueryString["mid"].ToString() == "zsgl") { ls_retrun = "/list.aspx?mid=zsgl&tableid=4682e856-efa0-447b-8180-59602f042f42"; } if (this.Request.QueryString["mid"].ToString() == "ldrcap") { ls_retrun = "/ldrcap/list_ldrcap.aspx"; } if (this.Request.QueryString["mid"].ToString() == "dxx") { ls_retrun = "/system/list_sms_df.aspx?mid=dxx"; } if (this.Request.QueryString["mid"].ToString() == "xtsz") { ls_retrun = "/system/list_mudel.aspx?mid=&tableid="; } if (this.Request.QueryString["mid"].ToString() == "rsgl") { ls_retrun = "/rsgl/list.aspx?mid=" + this.Request.QueryString["mid"].ToString(); ls_retrun += "&tableid=6047076e-6a95-4fb8-aec8-5551d3900590"; } if (this.Request.QueryString["mid"].ToString() == "tzgg") { ls_retrun = "/tzgg/list.aspx?mid=" + this.Request.QueryString["mid"].ToString(); HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt = Hyoa_tableconfig.Getflowtablebymudelid(this.Request.QueryString["mid"].ToString()); if (dt.Rows.Count > 0) ls_retrun += "&tableid=" + dt.Rows[0]["ID"].ToString(); } //投票管理 if (this.Request.QueryString["mid"].ToString() == "moduletpgl") { ls_retrun = "/tpgl/list_tpgl_wytp.aspx"; } ////群教专利 //if (this.Request.QueryString["mid"].ToString() == "moduleqjzl") //{ // ls_retrun = "/list_tpgl_wytp.aspx"; //} ////党建工作 //if (this.Request.QueryString["mid"].ToString() == "moduletpgl") //{ // ls_retrun = "/tpgl/list_tpgl_wytp.aspx"; //} if (ls_retrun == "") { ls_retrun = "/list.aspx?mid=" + this.Request.QueryString["mid"].ToString(); //得到当前模块的第一张表ID HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt = Hyoa_tableconfig.GetTablesbymudelid(this.Request.QueryString["mid"].ToString()); if (dt.Rows.Count > 0) ls_retrun += "&tableid=" + dt.Rows[0]["ID"].ToString(); } } else { ls_retrun = "/index_right.aspx"; } return ls_retrun; }