//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "提交成功!"; string ls_insert = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); ls_insert = "insert into hyp_gzlxdhf (id,hy_jsrdocid,hy_fsrdocid,hy_userid,hy_username,hy_deptid,hy_deptname,hy_time,hy_body,hy_ip,hy_ifshow)"; ls_insert += " values ('" + Hyoa_global.GetRandom() + "','" + this.txtid.Value + "','" + this.txtdocid.Value + "','" + this.Session["hyuid"].ToString() + "'"; ls_insert += ",'" + this.Session["hyuname"].ToString() + "','" + this.Session["hydeptid"].ToString() + "','" + this.Session["hydeptname"].ToString() + "'"; ls_insert += ",'" + System.DateTime.Now.ToString() + "','" + this.txthfnr.Text + "','" + HttpContext.Current.Request.UserHostAddress + "','')"; Hyoa_global.ExcuteSQL(ls_insert); //收件中置为已回复 string ls_update; ls_update = "update hyp_wjcd set hy_ifyhf='1' where ID='" + this.txtid.Value + "' "; Hyoa_global.ExcuteSQL(ls_update); //处理完成后的提示及跳转 Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); }
protected void btnLogin_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt = Hyoa_tableconfig.GetTables(); string sql = ""; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //增加字段,先删除再添加 sql = "ALTER TABLE hyc_" + dt.Rows[i]["ID"].ToString(); sql += " ADD hy_clrylist text "; Hyoa_global.ExcuteSQL(sql); sql = "ALTER TABLE hyc_" + dt.Rows[i]["ID"].ToString(); sql += " ADD hy_cyrylist text "; //Hyoa_global.ExcuteSQL(sql); //第一次要执行一下添加字段 //处理数据 sql = "select * from hyc_" + dt.Rows[i]["ID"].ToString(); DataTable dt2 = Hyoa_global.GetDataTable(sql); if (dt2.Rows.Count > 0) { for (int j = 0; j < dt2.Rows.Count; j++) { //先置为, sql = "update hyc_" + dt.Rows[i]["ID"].ToString() + " set hy_clrylist=',',hy_cyrylist=',' where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; Hyoa_global.ExcuteSQL(sql); //再根据cl表更新 sql = "select * from hyp_flowhistoryinfo_cl where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; DataTable dt3 = Hyoa_global.GetDataTable(sql); if (dt3.Rows.Count > 0) { for (int m = 0; m < dt3.Rows.Count; m++) { //得到初始值 sql = "select * from hyc_" + dt.Rows[i]["ID"].ToString() + " where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; DataTable dt4 = Hyoa_global.GetDataTable(sql); string ls_value = dt4.Rows[0]["hy_clrylist"].ToString() + dt3.Rows[m]["hy_clrid"].ToString() + ","; sql = "update hyc_" + dt.Rows[i]["ID"].ToString() + " set hy_clrylist='" + ls_value + "',hy_cyrylist=',' where DOCID='" + dt2.Rows[j]["DOCID"].ToString() + "'"; //Response.Write(sql); Hyoa_global.ExcuteSQL(sql); } } } } } } Response.Write("更新完成"); }
protected void Button_Save_Click(object sender, EventArgs e) { if (txtsql.Text != "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = this.txtsql.Text; Hyoa_global.ExcuteSQL(sql); Response.Write("<script>alert('提交成功');window.location='excutesql.aspx'</script>"); } else { Response.Write("<script>alert('请填写SQL语句');window.location='excutesql.aspx'</script>"); } }
protected void Button_Save_Click(object sender, EventArgs e) { string ls_olduserid = this.txtolduserid.Text; string ls_newuserid = this.txtnewuserid.Text; if (ls_olduserid != "" && ls_newuserid != "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = "update hyt_user set hy_userid='" + ls_newuserid + "' where hy_userid='" + ls_olduserid + "'"; Hyoa_global.ExcuteSQL_USER(sql); sql = "update hyt_user set hy_loginuid='" + ls_newuserid + "' where hy_loginuid='" + ls_olduserid + "'"; Hyoa_global.ExcuteSQL_USER(sql); sql = "update hyt_roleuser set hy_userid='" + ls_newuserid + "' where hy_userid='" + ls_olduserid + "'"; Hyoa_global.ExcuteSQL_BASE(sql); sql = "update hyt_flowtacheuser set hy_userid='" + ls_newuserid + "' where hy_userid='" + ls_olduserid + "'"; Hyoa_global.ExcuteSQL_BASE(sql); sql = "update hyt_dbsy set hy_dbrid='" + ls_newuserid + "' where hy_dbrid='" + ls_olduserid + "'"; Hyoa_global.ExcuteSQL(sql); sql = "update hyt_dbsy set hy_fsrid='" + ls_newuserid + "' where hy_fsrid='" + ls_olduserid + "'"; Hyoa_global.ExcuteSQL(sql); sql = "update hyp_flowhistoryinfo_cy set hy_cyrid=replace(hy_cyrid,'" + ls_olduserid + "','" + ls_newuserid + "') where ','+hy_cyrid+',' like '%," + ls_olduserid + ",%' "; Hyoa_global.ExcuteSQL(sql); sql = "update hyp_flowhistoryinfo_cl set hy_clrid=replace(hy_clrid,'" + ls_olduserid + "','" + ls_newuserid + "') where ','+hy_clrid+',' like '%," + ls_olduserid + ",%' "; Hyoa_global.ExcuteSQL(sql); sql = "update hyp_flowhistoryinfo_cl set hy_cyrid=replace(hy_cyrid,'" + ls_olduserid + "','" + ls_newuserid + "') where ','+hy_cyrid+',' like '%," + ls_olduserid + ",%'"; Hyoa_global.ExcuteSQL(sql); Response.Write("<script>alert('更改成功');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string ls_fsrid = ""; string ls_fsrname = ""; string ls_jsrid = ""; string ls_jsrname = ""; string ls_content = ""; string ls_id = ""; string ls_txfs = ""; string lssql = ""; string ls_update = ""; lssql = "select * from hyp_wjcd where hy_type='收件' and hy_ifyhf='0' and hy_txstatus='0' "; DataTable dt = Hyoa_global.GetDataTable(lssql); if (dt.Rows.Count > 0) { for (var i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["hy_txfs"].ToString() != "") { System.TimeSpan ts = System.DateTime.Parse(dt.Rows[i]["hy_jzsj"].ToString()) - System.DateTime.Parse(System.DateTime.Now.ToString("yyyy-MM-dd")); int day = ts.Days; //距离一天且是下午进行提醒 if (day == 1) { //string.Compare(DateTime.Now.ToString("HH:mm").ToString(), "11:00") > 0 & string.Compare(DateTime.Now.ToString("HH:mm").ToString(), "13:00") < 0 if (string.Compare(DateTime.Now.ToString("HH:mm").ToString(), "14:00") > 0) { ls_fsrid = dt.Rows[i]["hy_fsrid"].ToString(); ls_fsrname = dt.Rows[i]["hy_fsrname"].ToString(); ls_jsrid = dt.Rows[i]["hy_jsrid"].ToString(); ls_jsrname = dt.Rows[i]["hy_jsrname"].ToString(); ls_content = "请尽快办理[工作联系单]-" + dt.Rows[i]["hy_title"].ToString(); ls_id = dt.Rows[i]["ID"].ToString(); ls_txfs = dt.Rows[i]["hy_txfs"].ToString(); hysendxx2(ls_fsrid, ls_fsrname,ls_jsrid, ls_jsrname, ls_content, ls_id, ls_txfs); ls_update = "update hyp_wjcd set hy_txstatus='1' where hy_type='收件' and ID='" + ls_id + "' "; Hyoa_global.ExcuteSQL(ls_update); } } } } } }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); string sql = ""; for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { sql = "update hyc_" + this.txttableid.Value + " set hy_readuserlist=hy_readuserlist+','+'" + Session["hyuid"].ToString() + "' ,hy_readdatelist = hy_readdatelist + ','+'" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'"; sql += " where DOCID='" + v_uids[i].ToString() + "' and hy_readuserlist+',' not like '%," + Session["hyuid"].ToString() + ",%' "; Hyoa_global.ExcuteSQL(sql); } } this.txtuids.Value = ""; DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); for(var i=0;i<v_uids.Length;i++) { if (v_uids[i] != "") { string sql = "delete from hyt_blzt where ID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
private void DataPlay() { //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}"; string hy_json = ""; string ls_success = "true"; //调用方法成功 string ls_flag = "0"; //删除失败 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string txtuids = ""; if (this.Request.Form["txtuids"] != null) txtuids = this.Request.Form["txtuids"].ToString(); String[] v_uids = txtuids.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "delete from hyt_dbsy where ID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //生成删除日志 start string ls_oppcontent = "表名:hyt_dbsy;文档ID:" + v_uids[i] + "被删除。"; HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log(); Hyoa_log.ID = System.Guid.NewGuid().ToString(); Hyoa_log.hy_createtime = System.DateTime.Now.ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } Hyoa_log.hy_oppip = userip; Hyoa_log.hy_opptype = "删除"; Hyoa_log.hy_oppcontent = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end ls_flag = "1"; } } hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}"; Response.Write(hy_json); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (txtmid.Text == "dbsy" || txtmid.Text == "dysy" || txtmid.Text == "ybsy" || txtmid.Text == "yysy") { HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.ID = this.txtuids.Value; Hyoa_dbsy.Delete(); } if (this.Request.QueryString["mid"] == "mail") { HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); Hyoa_mail.ID = this.txtuids.Value; Hyoa_mail.Delete(); } if (this.Request.QueryString["mid"] == "Mudelrcap") { string sql = "delete from hyc_Tablercap where DOCID='" + this.txtuids.Value + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = this.txtuids.Value; Hyoa_dbsy.Deletebydocid(this.txtuids.Value); //删除文档时将待办事宜删除end } if (this.Request.QueryString["mid"] == "Mudelgrtxl" || this.Request.QueryString["mid"] == "Mudelgrtxllb" || this.Request.QueryString["mid"] == "Mudeltzgg" || this.Request.QueryString["mid"] == "Mudelgzrz" || this.Request.QueryString["mid"] == "Mudelqjsq") { string sql = "delete from hyc_" + this.Request.QueryString["tableid"] + " where DOCID='" + this.txtuids.Value + "'"; Hyoa_global.ExcuteSQL(sql); } if (this.Request.QueryString["mid"] == "gwk") { string sql = "delete from hyp_gwk where ID='" + this.txtuids.Value + "'"; Hyoa_global.ExcuteSQL(sql); } this.txtuids.Value = ""; DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { //HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //Hyoa_flowmain.DOCID = v_uids[i]; //Hyoa_flowmain.Delete(); string lssqldel = "delete hyc_" + this.txttableid.Value + " where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(lssqldel); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end } } this.txtuids.Value = ""; DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //找到字段配置信息 DataTable dt = Hyoa_flowfield.Getflowfield(v_uids[i]); //删除SQL中的字段 string sql = "ALTER TABLE hyc_" + this.txttableid.Value; sql += " DROP COLUMN hyc_" + dt.Rows[0]["hy_fieldid"].ToString(); Hyoa_global.ExcuteSQL(sql); Hyoa_flowfield.ID = v_uids[i]; Hyoa_flowfield.Delete(); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); string ls_filepath = ""; for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start add by xf 20121016 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cl.DeleteByDOCID(); HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cy.DeleteByDOCID(); //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end //删的时候将附件也删除start HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]); if (dtfileatt.Rows.Count > 0) { for (int k = 0; k < dtfileatt.Rows.Count; k++) { ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString(); if (File.Exists(ls_filepath)) { System.IO.File.Delete(ls_filepath); } Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString(); Hyoa_fileatt.Delete(); } } //删的时候将附件也删除end //生成删除日志 start string ls_oppcontent = "表名:hyc_" + txttableid.Value + ";文档ID:" + v_uids[i] + "被删除。"; HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log(); Hyoa_log.ID = System.Guid.NewGuid().ToString(); Hyoa_log.hy_createtime = System.DateTime.Now.ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } Hyoa_log.hy_oppip = userip; Hyoa_log.hy_opptype = "删除"; Hyoa_log.hy_oppcontent = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
//保存 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>"); } }
protected void btndelinfo_my_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); string ls_filepath = ""; for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //判断是否是当前用户的文档 string sql = "select * from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'"; DataTable dt_judge = Hyoa_global.GetDataTable(sql); if (dt_judge.Rows.Count > 0) { if (dt_judge.Rows[0]["hy_djrid"].ToString() == Session["hyuid"].ToString()) { sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start add by xf 20121016 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cl.DeleteByDOCID(); HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cy.DeleteByDOCID(); //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end //删的时候将附件也删除start HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]); if (dtfileatt.Rows.Count > 0) { for (int k = 0; k < dtfileatt.Rows.Count; k++) { ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString(); if (File.Exists(ls_filepath)) { System.IO.File.Delete(ls_filepath); } Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString(); Hyoa_fileatt.Delete(); } } //删的时候将附件也删除end } } } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string ls_fssql = "select * from hyp_wjcd where hy_type='发件' and ID='" + v_uids[i] + "' "; DataTable dt_fs = Hyoa_global.GetDataTable(ls_fssql); if (dt_fs.Rows.Count > 0) { //得到属于此发件的所有收件 string ls_sjsql = "select * from hyp_wjcd where hy_type='收件' and DOCID='" + dt_fs.Rows[0]["DOCID"].ToString() + "' "; DataTable dt_sj = Hyoa_global.GetDataTable(ls_sjsql); if (dt_sj.Rows.Count > 0) { for (var j = 0; j < dt_sj.Rows.Count; j++) { //删除文档时将收件人的待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = dt_sj.Rows[j]["ID"].ToString(); Hyoa_dbsy.Deletebydocid(dt_sj.Rows[j]["ID"].ToString()); //删除文档时将收件人的待办事宜删除end //删除文档时将收件删除start string ls_sjdel = "delete from hyp_wjcd where ID='" + dt_sj.Rows[j]["ID"].ToString() + "' "; Hyoa_global.ExcuteSQL(ls_sjdel); //删除文档时将收件删除end } } } Hyoa_wjcd.ID = v_uids[i]; Hyoa_wjcd.Delete(); //生成删除日志 start string ls_oppcontent = "工作联系单(已发送的);文档ID:" + v_uids[i] + "被删除。同时该工作联系单的所有收件已删除。"; HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log(); Hyoa_log.ID = System.Guid.NewGuid().ToString(); Hyoa_log.hy_createtime = System.DateTime.Now.ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } Hyoa_log.hy_oppip = userip; Hyoa_log.hy_opptype = "删除"; Hyoa_log.hy_oppcontent = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
//判断单位名称是否存在并添加 private void Khdaxx() { HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global(); string ls_sql = ""; string sql = ""; DataTable dt = new DataTable(); ls_sql = "select * from hyc_Tablekhda where 1=1"; if (Request.Form["jfmc"] != null) { ls_sql += "and hyc_dwmc='" + Request.Form["jfmc"].ToString() + "'"; } dt = db.GetDataTable(ls_sql); if (dt.Rows.Count == 0) { sql = "insert into hyc_Tablekhda(DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djrbmname,hyc_dwmc,hyc_dwdz)"; sql += " values ('" + System.Guid.NewGuid().ToString() + "'"; sql += ",'Mudelkhda','Tablekhda','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptname"].ToString() + "'"; if (Request.Form["jfmc"] != null) { sql += ",'" + Request.Form["jfmc"].ToString() + "','"; } if (Request.Form["jfdz"] != null) { sql += Request.Form["jfdz"].ToString() + "')"; } db.ExcuteSQL(sql); } }
//置为文档已读状态 edited by xf 20140625 private void UpdateReadFlag() { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = ""; //得到初始值 sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'"; DataTable dt = Hyoa_global.GetDataTable(sql); string ls_readuserlist = ""; string ls_readdatelist = ""; if ((dt.Rows[0]["hy_readuserlist"].ToString() + ",").IndexOf("," + Session["hyuid"].ToString() + ",") < 0) { ls_readuserlist = dt.Rows[0]["hy_readuserlist"].ToString() + "," + Session["hyuid"].ToString(); ls_readdatelist = dt.Rows[0]["hy_readdatelist"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); sql = "update hyc_" + this.hy_tableid.Text + " set hy_readuserlist='" + ls_readuserlist + "' ,hy_readdatelist = '" + ls_readdatelist + "'"; sql += " where DOCID='" + this.txtdocid.Value + "'"; Hyoa_global.ExcuteSQL(sql); } }
//付款后合同处理 private void htfk() { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string lsDate = ""; string lsFkfs = ""; string sqlSelect = " select * from hyc_Tablefpbd where docid='" + this.txtdocid.Value + "' "; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { sqlSelect = " select hyc_fkdqr,hyc_fkfs from hyc_" + dt.Rows[0]["hyc_tableid"].ToString() + " where docid = '" + dt.Rows[0]["hyc_fatherid"].ToString() + "' "; } DataTable dt2 = Hyoa_global.GetDataTable(sqlSelect); if (dt2.Rows.Count > 0) { lsDate = dt2.Rows[0]["hyc_fkdqr"].ToString(); lsFkfs = dt2.Rows[0]["hyc_fkfs"].ToString(); } if (lsDate != "") { if (lsFkfs == "年付") { lsDate = Convert.ToDateTime(lsDate).AddYears(1).ToString("yyyy-MM-dd"); } else if (lsFkfs == "半年付") { lsDate = Convert.ToDateTime(lsDate).AddMonths(6).ToString("yyyy-MM-dd"); } else if (lsFkfs == "季付") { lsDate = Convert.ToDateTime(lsDate).AddMonths(3).ToString("yyyy-MM-dd"); } else if (lsFkfs == "月付") { lsDate = Convert.ToDateTime(lsDate).AddMonths(1).ToString("yyyy-MM-dd"); } string sqlUpdate = " update hyc_" + dt.Rows[0]["hyc_tableid"].ToString() + " set hyc_fkdqr='" + lsDate + "' where docid = '" + dt.Rows[0]["hyc_fatherid"].ToString() + "' "; Hyoa_global.ExcuteSQL(sqlUpdate); } }
//流程提交时的特殊处理 private string hylctjtscl() { string sql = ""; #region 收文管理(更新流水号)(登记环节) if (hy_curtacheid.Text == "tache0001" & hy_mudelid.Text == "Mudelswgl" & this.hy_tableid.Text == "Tableswgl") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string random = Hyoa_global.GetRandom(); string sqlswwh; string sqlinsertswwh; string sqlupdateswwh; sqlswwh = "select * from hyc_Tableswlsh where hyc_lb='" + Request.Form["swlx"].ToString() + "' and hyc_nf='" + Request.Form["swnf"].ToString() + "' "; sqlinsertswwh = "insert into hyc_Tableswlsh (DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname"; sqlinsertswwh += ",hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_iftx"; sqlinsertswwh += ",hy_readuserlist,hy_readdatelist,hy_motherid,hy_ifconfirm"; sqlinsertswwh += ",hyc_lb,hyc_nf,hyc_pxh,hyc_lsh) values("; sqlinsertswwh += "'" + random + "','Mudelfwlsh','Tablefwlsh','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "'"; sqlinsertswwh += ",'" + Session["hydeptid"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','',''"; sqlinsertswwh += ",'','','',''"; sqlinsertswwh += ",'" + Request.Form["swlx"].ToString() + "','" + Request.Form["swnf"].ToString() + "',1,1)"; sqlupdateswwh = "update hyc_Tableswlsh set hyc_lsh = " + (System.Int32.Parse(Request.Form["swbh"].ToString()) + 1).ToString() + " where hyc_lb='" + Request.Form["swlx"].ToString() + "' and hyc_nf='" + Request.Form["swnf"].ToString() + "' "; DataTable swdt = Hyoa_global.GetDataTable(sqlswwh); if (swdt.Rows.Count > 0) { Hyoa_global.ExcuteSQL(sqlupdateswwh); } else { Hyoa_global.ExcuteSQL(sqlinsertswwh); Hyoa_global.ExcuteSQL(sqlupdateswwh); } } #endregion #region 发文管理(更新流水号)(办公室编号环节) if (hy_curtacheid.Text == "tache0007" & hy_mudelid.Text == "Mudelfwgl" & this.hy_tableid.Text == "Tablefwgl") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string random = Hyoa_global.GetRandom(); string sqlfwwh; string sqlinsertfwwh; string sqlupdatefwwh; sqlfwwh = "select * from hyc_Tablefwlsh where hyc_lb='" + Request.Form["fwlb"].ToString() + "' and hyc_nf='" + Request.Form["nf"].ToString() + "' "; sqlinsertfwwh = "insert into hyc_Tablefwlsh (DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname"; sqlinsertfwwh += ",hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_iftx"; sqlinsertfwwh += ",hy_readuserlist,hy_readdatelist,hy_motherid,hy_ifconfirm"; sqlinsertfwwh += ",hyc_lb,hyc_nf,hyc_pxh,hyc_lsh) values("; sqlinsertfwwh += "'" + random + "','Mudelfwlsh','Tablefwlsh','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "'"; sqlinsertfwwh += ",'" + Session["hydeptid"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','',''"; sqlinsertfwwh += ",'','','',''"; sqlinsertfwwh += ",'" + Request.Form["fwlb"].ToString() + "','" + Request.Form["nf"].ToString() + "',1,1)"; sqlupdatefwwh = "update hyc_Tablefwlsh set hyc_lsh = " + (System.Int32.Parse(Request.Form["fwbh"].ToString()) + 1).ToString() + " where hyc_lb='" + Request.Form["fwlb"].ToString() + "' and hyc_nf='" + Request.Form["nf"].ToString() + "' "; DataTable fwdt = Hyoa_global.GetDataTable(sqlfwwh); if (fwdt.Rows.Count > 0) { Hyoa_global.ExcuteSQL(sqlupdatefwwh); } else { Hyoa_global.ExcuteSQL(sqlinsertfwwh); Hyoa_global.ExcuteSQL(sqlupdatefwwh); } } #endregion return sql; }
//置为文档已读状态 private void UpdateReadFlag() { string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "update hyc_" + this.hy_tableid.Text + " set hy_readuserlist=hy_readuserlist+','+'" + Session["hyuid"].ToString() + "' ,hy_readdatelist = hy_readdatelist + ','+'" + System.DateTime.Now.ToString() + "'"; sql += " where DOCID='" + this.txtdocid.Value + "' and hy_readuserlist+',' not like '%," + Session["hyuid"].ToString() + ",%' "; } if (Session["conntype"].ToString() == "ORACLE") { sql = "update hyc_" + this.hy_tableid.Text + " set hy_readuserlist=CONCAT(CONCAT(hy_readuserlist,','),'" + Session["hyuid"].ToString() + "') ,hy_readdatelist = CONCAT(CONCAT(hy_readdatelist,','),'" + System.DateTime.Now.ToString() + "')"; sql += " where DOCID='" + this.txtdocid.Value + "' and CONCAT(hy_readuserlist,',') not like '%," + Session["hyuid"].ToString() + ",%' "; } HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); Hyoa_global.ExcuteSQL(sql); }
//fy20130801 导入功能 protected void btnDRToSQL_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); //链接SQL数据库 if (FileUpload1.HasFile == false) //HasFile用来检查FileUpload是否有指定文件 { Response.Write("<script>alert('请您选择Excel文件')</script> "); return; //当无文件时,返回 } string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower(); //System.IO.Path.GetExtension获得文件的扩展名 if (IsXls != ".xls" && IsXls != ".xlsx") { Response.Write("<script>alert('只可以选择Excel文件')</script>"); return; //当选择的不是Excel文件时,返回 } //根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹 string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString(); //HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。 if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny)) { //System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。 System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny); } string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName; //重新为文件命名,获取Execle文件名 DateTime日期函数 // 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替 string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径 FileUpload1.SaveAs(savePath); //SaveAs 将上传的文件内容保存在服务器上 DataSet ds = ExecleDs(savePath, filename); //调用自定义方法 DataRow[] dr = ds.Tables[0].Select(); //定义一个DataRow数组 int rowsnum = ds.Tables[0].Rows.Count; int i_into = 0; if (rowsnum == 0) { Response.Write("<script>alert('Excel表为空表,无数据!')</script>"); //当Excel表为空时,对用户进行提示 } else { for (int i = 0; i < dr.Length; i++) { string lsHyfl = dr[i]["行业分类"].ToString(); string lsJtfl = dr[i]["具体分类"].ToString(); string lsDw = dr[i]["单位"].ToString(); string lsWhjb = dr[i]["维护级别"].ToString(); string lsZrbm = dr[i]["责任部门/责任人"].ToString(); string lsXzbm = dr[i]["协助部门/协助人"].ToString(); string lsQt = dr[i]["其他"].ToString(); string lsBz = dr[i]["备注"].ToString(); string lsBgdz = dr[i]["办公(单位)地址"].ToString(); string lsXm = dr[i]["姓名"].ToString(); string lsCs = dr[i]["处室"].ToString(); string lsZw = dr[i]["职位"].ToString(); string lsXb = dr[i]["性别"].ToString(); string lsSr = dr[i]["生日"].ToString(); string lsSj = dr[i]["手机"].ToString(); string lsBgdh = dr[i]["办公室电话"].ToString(); string lsZzdh = dr[i]["住宅电话"].ToString(); string lsDzyx = dr[i]["电子邮箱"].ToString(); string lsQQ = dr[i]["QQ"].ToString(); string lsWx = dr[i]["微信"].ToString(); string lsJtzz = dr[i]["家庭住址"].ToString(); //先插入客户表 string SqlInsert = "insert into hyc_Tablekhda (DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,"; SqlInsert += " hyc_hyfl,hyc_jtfl,hyc_dwmc,hyc_whjb,hyc_khjl,hyc_xzbm,hyc_bz,hyc_qt,hyc_dwdz) values("; SqlInsert += "'" + Hyoa_global.GetRandom() + "','Mudelkhda','Tablekhda','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptid"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', "; SqlInsert += " '" + lsHyfl + "','" + lsJtfl + "','" + lsDw + "','" + lsWhjb + "','" + lsZrbm + "','" + lsXzbm + "','" + lsBz + "','" + lsQt + "','"+lsBgdz+"')"; Hyoa_global.ExcuteSQL(SqlInsert); //插入联系人表 if (lsXm.Contains(",")) { string[] arryLxrxm = lsXm.Split(','); string[] arryLxrcs = lsCs.Split(','); string[] arryLxrzw = lsZw.Split(','); string[] arryLxrxb= lsXb.Split(','); string[] arryLxrsr = lsSr.Split(','); string[] arryLxrsj = lsSj.Split(','); string[] arryLxrbgdh = lsBgdh.Split(','); string[] arryLxrzzdh = lsZzdh.Split(','); string[] arryLxrdzyx = lsDzyx.Split(','); string[] arryLxrqq = lsQQ.Split(','); string[] arryLxrwx = lsWx.Split(','); string[] arryLxrjtzz = lsJtzz.Split(','); for (int j = 0; j< arryLxrxm.Length;j++ ) { SqlInsert = "insert into hyc_Tablelxr (DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,"; SqlInsert += " hyc_dwmc,hyc_cs,hyc_lxrmc,hyc_zw,hyc_xb,hyc_sr,hyc_sjhm,hyc_dh,hyc_zzdh,hyc_dzyx,hyc_qq,hyc_wx,hyc_dz,hyc_jtdz) values("; SqlInsert += "'" + Hyoa_global.GetRandom() + "','Mudelkhda','Tablelxr','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptid"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', "; SqlInsert += " '" + lsDw + "','" + arryLxrcs[j] + "','" + arryLxrxm[j] + "','" + arryLxrzw[j] + "','" + arryLxrxb[j] + "','" + arryLxrsr[j] + "','" + arryLxrsj[j] + "','" + arryLxrbgdh[j] + "','" + arryLxrzzdh[j] + "','" + arryLxrdzyx[j] + "','" + arryLxrqq[j] + "','" + arryLxrwx[j] + "','" + lsBgdz + "','" + arryLxrjtzz[j] + "')"; Response.Write(SqlInsert); Hyoa_global.ExcuteSQL(SqlInsert); } } else { SqlInsert = "insert into hyc_Tablelxr (DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,"; SqlInsert += " hyc_dwmc,hyc_cs,hyc_lxrmc,hyc_zw,hyc_xb,hyc_sr,hyc_sjhm,hyc_dh,hyc_zzdh,hyc_dzyx,hyc_qq,hyc_wx,hyc_dz,hyc_jtdz) values("; SqlInsert += "'" + Hyoa_global.GetRandom() + "','Mudelkhda','Tablelxr','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptid"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', "; SqlInsert += " '" + lsDw + "','" + lsCs + "','" + lsXm + "','" + lsZw + "','" + lsXb + "','" + lsSr + "','" + lsSj + "','" + lsBgdh + "','" + lsZzdh + "','" + lsDzyx + "','" + lsQQ + "','" + lsWx + "','" + lsBgdz + "','" + lsJtzz + "')"; Hyoa_global.ExcuteSQL(SqlInsert); } } // Response.Write("<script>alert('导入成功!');</script>"); } }
protected void btn_dc_Click(object sender, EventArgs e) { string htbm = ""; int bh = 0; string lsHtbh = DateTime.Now.ToString("yyyyMMdd"); string sqlSelect = " select hyc_htbh,hyc_nf,docid from hyc_Tablehtbhwh order by hyc_pxh "; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { if (DateTime.Now.Year.ToString() != dt.Rows[0]["hyc_nf"].ToString()) { sqlSelect = " update hyc_Tablehtbhwh set hyc_nf='" + DateTime.Now.Year.ToString() + "',hyc_htbh='0' where docid='" + dt.Rows[0]["docid"].ToString() + "' "; Hyoa_global.ExcuteSQL(sqlSelect); } } dt.Clear(); sqlSelect = " select hyc_htbh,hyc_nf,docid from hyc_Tablehtbhwh order by hyc_pxh "; dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { bh = Convert.ToInt32(dt.Rows[0]["hyc_htbh"].ToString()) + 1; if (Convert.ToString(bh).Length == 1) { htbm = "000" + bh; } if (Convert.ToString(bh).Length == 2) { htbm = "00" + bh; } if (Convert.ToString(bh).Length == 3) { htbm = "0" + bh; } if (Convert.ToString(bh).Length == 4) { htbm = Convert.ToString(bh); } lsHtbh += htbm; //插入当前合同中 sqlSelect = " update hyc_" + this.hy_tableid.Text + " set hyc_htbh='" + lsHtbh + "' where docid = '" + this.txtdocid.Value + "' "; Hyoa_global.ExcuteSQL(sqlSelect); sqlSelect = " update hyc_Tablehtbhwh set hyc_htbh='" + bh + "' where docid = '" + dt.Rows[0]["docid"].ToString() + "' "; Hyoa_global.ExcuteSQL(sqlSelect); Response.AddHeader("Refresh", "0"); } }
//fy20130801 导入功能 protected void btnDRToSQL_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); //链接SQL数据库 if (FileUpload1.HasFile == false) //HasFile用来检查FileUpload是否有指定文件 { Response.Write("<script>alert('请您选择Excel文件')</script> "); return; //当无文件时,返回 } string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower(); //System.IO.Path.GetExtension获得文件的扩展名 if (IsXls != ".xls" && IsXls != ".xlsx") { Response.Write("<script>alert('只可以选择Excel文件')</script>"); return; //当选择的不是Excel文件时,返回 } //根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹 string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString(); //HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。 if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny)) { //System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。 System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny); } string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName; //重新为文件命名,获取Execle文件名 DateTime日期函数 // 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替 string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径 FileUpload1.SaveAs(savePath); //SaveAs 将上传的文件内容保存在服务器上 DataSet ds = ExecleDs(savePath, filename); //调用自定义方法 DataRow[] dr = ds.Tables[0].Select(); //定义一个DataRow数组 int rowsnum = ds.Tables[0].Rows.Count; int i_into = 0; string sqlInsert = ""; string strDocid = ""; string sqlSelect = ""; string strUserid = ""; string strUserDeptid = ""; string strUserDeptName = ""; string strYwxf = ""; string strZcl = ""; if (rowsnum == 0) { Response.Write("<script>alert('Excel表为空表,无数据!')</script>"); //当Excel表为空时,对用户进行提示 } else { for (int i = 0; i < dr.Length; i++) { /* 导入整体思路:数据来自一个excel表,导入的时候先导主表,后导字表。主表按照常规来导,指定哪些字段导入到数据库中,字表依据主表的docid作为父id, * 进行导入,导入之前先判断是excel表中有没有数据,如果有数据,而且不是一些特定的不需要导入的数据,就导入 */ sqlSelect = " select u.hy_userid,d.hy_deptid,d.hy_deptname from hyt_user u join hyt_dept d on u.hy_deptid=d.hy_deptid where u.hy_username='******' "; DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect); if (dt.Rows.Count > 0) { strUserid = dt.Rows[0]["hy_userid"].ToString(); strUserDeptid = dt.Rows[0]["hy_deptid"].ToString(); strUserDeptName = dt.Rows[0]["hy_deptname"].ToString(); } else { Response.Write("<script>alert('这条数据导错了" + i_into + dr[i][0].ToString() + "');</script>"); Response.Write(sqlSelect); return; } strDocid = System.Guid.NewGuid().ToString(); //导入主表 sqlInsert = " insert into hyc_Tablefpbd( DOCID,hy_bt,hy_clrylist,hy_curclrid,hy_curclrname,hy_curtacheid"; sqlInsert += " ,hy_curtachename,hy_cyrylist,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj"; sqlInsert += " ,hy_flowid,hy_flowname,hy_ifconfirm,hy_iftx,hy_motherid,hy_mudelid,hy_readdatelist"; sqlInsert += " ,hy_readuserlist,hy_tableid,hy_zhtxsj,hyc_bxje,hyc_bxjedx,hyc_djr,hyc_djsj"; sqlInsert += " ,hyc_djz,hyc_fatherid,hyc_fplx,hyc_fplxx,hyc_cpmc1,hyc_fptt,hyc_htkp,hyc_kpsj"; sqlInsert += " ,hyc_muild,hyc_sfbf,hyc_skrq,hyc_tableid,hyc_yf) values ( '" + strDocid + "','',''"; sqlInsert += " ,'" + strUserid + "','" + dr[i][0].ToString() + "','**','流程已结束','," + strUserid + ",'"; sqlInsert += " ,'" + strUserDeptid + "','" + strUserDeptName + "','" + strUserid + "','" + dr[i][0].ToString() + "',getdate(),'Flowfp','发票管理'"; sqlInsert += " ,'','','','Mudelfp','',''"; sqlInsert += " ,'Tablefpbd','','" + dr[i][53].ToString() + "','','" + dr[i][0].ToString() + "',getdate(),'" + strUserDeptName + "'"; sqlInsert += " ,'','" + dr[i][2].ToString() + "','普通增值税发票','" + dr[i][3].ToString() + "','" + dr[i][1].ToString() + "','否','" + dr[i][54].ToString() + "'"; sqlInsert += " ,'','','" + dr[i][55].ToString() + "','','') "; Hyoa_global.ExcuteSQL(sqlInsert); //开始导字表 for (int j = 4; j < 57; j++) { if (dr[i][j].ToString() != "" && (j != 5 || j != 7 || j != 9) && dr[i][j].ToString() != "0") { strYwxf = getChildTable(j); if (strYwxf != "") { //先将“增量”这两个字去掉 if (strYwxf.Contains("增量")) { //将“增量”特定的给一个字符串 strZcl = "增量"; strYwxf = strYwxf.Replace("增量", ""); } else if (strYwxf.Contains("存量")) { strZcl = "存量"; strYwxf = strYwxf.Replace("存量", ""); } else { strZcl = "增量"; } sqlInsert = " insert into hyc_Tablejemx( DOCID,hy_bt,hy_clrylist,hy_curclrid,hy_curclrname,hy_curtacheid"; sqlInsert += " ,hy_curtachename,hy_cyrylist,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj"; sqlInsert += " ,hy_flowid,hy_flowname,hy_ifconfirm,hy_iftx,hy_motherid,hy_mudelid,hy_readdatelist"; sqlInsert += " ,hy_readuserlist,hy_tableid,hy_zhtxsj,hyc_bxje,hyc_bxjedx,hyc_bz,hyc_sl"; sqlInsert += " ,hyc_ywxf,hyc_zcl) values ( '" + System.Guid.NewGuid().ToString() + "','','','',''"; sqlInsert += " ,'','','','" + strUserDeptid + "','" + strUserDeptName + "','" + strUserid + "'"; sqlInsert += " ,'" + dr[i][0].ToString() + "',getdate(),'','','','','" + strDocid + "'"; sqlInsert += " ,'Mudelfp','','','Tablejemx',''"; if (strYwxf == "基本型" || strYwxf == "交互型") { sqlInsert += " ,'" + dr[i][j + 1].ToString() + "','','" + dr[i][56].ToString() + "','" + dr[i][j].ToString() + "','" + strYwxf + "','" + strZcl + "') "; } else { sqlInsert += " ,'" + dr[i][j].ToString() + "','','" + dr[i][56].ToString() + "','','" + strYwxf + "','" + strZcl + "') "; } Hyoa_global.ExcuteSQL(sqlInsert); } } } i_into = i_into + 1; } } Response.Write("<script>alert('导入成功!共导入" + i_into + "条数据');</script>"); }
private void DataPlay() { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (this.Request.QueryString["id"] != null) { this.txtid.Value = this.Request.QueryString["id"].ToString(); } HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); DataTable dt = Hyoa_mail.Getmail(this.txtid.Value); if (dt.Rows.Count > 0) { this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString(); this.txtid.Value = dt.Rows[0]["ID"].ToString(); this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.txtfsrid.Text = dt.Rows[0]["hy_fsrid"].ToString(); this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.txtfrsname.Text = dt.Rows[0]["hy_fsrname"].ToString(); this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString(); this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString(); this.lblhy_title.Text = dt.Rows[0]["hy_title"].ToString(); //附件 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value); if (dt_fileatt.Rows.Count > 0) { string ls_temp = ""; for (var i = 0; i < dt_fileatt.Rows.Count; i++) { ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />"; } this.lblhy_field2.Text = ls_temp; } this.lblhy_content1.Text = dt.Rows[0]["hy_body"].ToString(); } //20120210 start string sccksj = System.DateTime.Now.ToString(); string sql = ""; if (dt.Rows[0]["hy_type"].ToString() == "收件" & dt.Rows[0]["hy_sccksj"].ToString() == "") { sql = "update hyt_mail set hy_sccksj = '" + sccksj + "' where ID='" + this.txtid.Value + "' "; Hyoa_global.ExcuteSQL(sql); } //20120210 end }
//保存 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_back Hyoa_back = new HyoaClass.Hyoa_back(); string lssql = "Select * from hyt_back where hy_fatherid = '" + this.txtfatherid.Value + "' and hy_fkrid = '" + this.Session["hyuid"].ToString() + "'"; //DataTable dt = Hyoa_back.Getbackbyfatheridandfkrid(this.txtfatherid.Value, this.Session["hyuid"].ToString()); DataTable dt = Hyoa_global.GetDataTable(lssql); if (dt.Rows.Count > 0) { //Hyoa_back.ID = this.txtdocid.Value; //Hyoa_back.hy_fatherid = this.txtfatherid.Value; //Hyoa_back.hy_backidea = this.txtbackidea.Text; //Hyoa_back.hy_backdate = this.txtbackdate.Value; //Hyoa_back.hy_qfr = this.txtqfr.Value; //Hyoa_back.hy_fkrid = this.Session["hyuid"].ToString(); //Hyoa_back.hy_fkrname = this.Session["hyuname"].ToString(); //Hyoa_back.hy_tjdate = ""; //Hyoa_back.hy_iftj = ""; //Hyoa_back.Update(); String sql = "update hyt_back set hy_backidea='" + this.txtbackidea.Text + "' "; if (Session["conntype"].ToString() == "SQL") { sql += ",hy_backdate='" + this.txtbackdate.Value + "' "; } if (Session["conntype"].ToString() == "ORACLE") { sql += ",hy_backdate=to_date('" + this.txtbackdate.Value + "','YYYY-MM-DD HH24:MI:SS')"; } sql += ",hy_qfr='" + this.txtqfr.Value + "' "; sql += ",hy_tjdate='' "; sql += ",hy_iftj='' "; sql += " where ID='" + this.txtdocid.Value + "' "; Hyoa_global.ExcuteSQL(sql); } else { //Hyoa_back.ID = this.txtdocid.Value; //Hyoa_back.hy_fatherid = this.txtfatherid.Value; //Hyoa_back.hy_backidea = this.txtbackidea.Text; //Hyoa_back.hy_backdate = this.txtbackdate.Value; //Hyoa_back.hy_qfr = this.txtqfr.Value; //Hyoa_back.hy_fkrid = this.Session["hyuid"].ToString(); //Hyoa_back.hy_fkrname = this.Session["hyuname"].ToString(); //Hyoa_back.hy_tjdate = ""; //Hyoa_back.hy_iftj = ""; //Hyoa_back.Insert(); String sql = "insert into hyt_back(ID,hy_fatherid,hy_backidea,hy_backdate,hy_qfr,hy_fkrid,hy_fkrname,hy_tjdate,hy_iftj) values "; if (Session["conntype"].ToString() == "SQL") { sql += "('" + this.txtdocid.Value + "','" + this.txtfatherid.Value + "','" + this.txtbackidea.Text + "','" + this.txtbackdate.Value + "','" + this.txtqfr.Value + "','" + this.Session["hyuid"].ToString() + "','" + this.Session["hyuname"].ToString() + "','','') "; } if (Session["conntype"].ToString() == "ORACLE") { sql += "('" + this.txtdocid.Value + "','" + this.txtfatherid.Value + "','" + this.txtbackidea.Text + "',to_date('" + this.txtbackdate.Value + "','YYYY-MM-DD HH24:MI:SS'),'" + this.txtqfr.Value + "','" + this.Session["hyuid"].ToString() + "','" + this.Session["hyuname"].ToString() + "','','') "; } //Response.Write(sql); Hyoa_global.ExcuteSQL(sql); } //////处理完成后的提示及跳转 ////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>"); ////} Response.Write("<script>window.opener.location.reload();self.close();</script>"); }
//创建SQL表 private Boolean CreateSQLTable() { Boolean ret = true; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "CREATE TABLE [hyc_" + this.txtdocid.Text + "] ("; sql += "[DOCID] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_mudelid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_tableid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_flowid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_flowname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_curtacheid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_curtachename] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_curclrid] [varchar] (3999) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_curclrname] [varchar] (3999) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_djrid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_djrname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_djrbmid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_djrbmname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_djsj] [datetime] NULL ,"; sql += "[hy_bt] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_iftx] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_zhtxsj] [datetime] NULL ,"; sql += "[hy_readuserlist] text COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_readdatelist] text COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_clrylist] text COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_cyrylist] text COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_motherid] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,"; sql += "[hy_ifconfirm] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL "; sql += ") ON [PRIMARY]"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "CREATE TABLE hyc_" + this.txtdocid.Text + " ("; sql += "DOCID VARCHAR2(255 BYTE),"; sql += "hy_mudelid VARCHAR2(50 BYTE),"; sql += "hy_tableid VARCHAR2(50 BYTE),"; sql += "hy_flowid VARCHAR2(50 BYTE),"; sql += "hy_flowname VARCHAR2(50 BYTE),"; sql += "hy_curtacheid VARCHAR2(50 BYTE),"; sql += "hy_curtachename VARCHAR2(50 BYTE),"; sql += "hy_curclrid VARCHAR2(3999),"; sql += "hy_curclrname VARCHAR2(3999),"; sql += "hy_djrid VARCHAR2(50 BYTE),"; sql += "hy_djrname VARCHAR2(50 BYTE),"; sql += "hy_djrbmid VARCHAR2(50 BYTE),"; sql += "hy_djrbmname VARCHAR2(50 BYTE),"; sql += "hy_djsj TIMESTAMP (6),"; sql += "hy_bt VARCHAR2(255 BYTE),"; sql += "hy_iftx VARCHAR2(50 BYTE),"; sql += "hy_zhtxsj TIMESTAMP (6),"; sql += "hy_readuserlist CLOB,"; sql += "hy_readdatelist CLOB,"; sql += "hy_clrylist CLOB,"; sql += "hy_cyrylist CLOB,"; sql += "hy_motherid VARCHAR2(255 BYTE),"; sql += "hy_ifconfirm VARCHAR2(50 BYTE)"; sql += ")"; } ret = Hyoa_global.ExcuteSQL(sql); return ret; }
//合同办理状态 完成 protected void btn_wc_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global(); string sql = ""; DataTable dt = new DataTable(); sql = "update hyt_blzt set hy_state='已完成' where DOCID='" + this.txtdocid.Value + "'"; db.ExcuteSQL(sql); string sqlSelect = " select * from hyt_listconfig where hy_mudelid='" + this.hy_mudelid.Text + "' and hy_tableid='" + this.hy_tableid.Text + "' "; dt.Clear(); dt = db.GetDataTable_BASE(sqlSelect); string url = ""; if (dt.Rows.Count > 0) { url = "list_flc.aspx?mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&listid=" + dt.Rows[0]["id"].ToString() + "&rnd=" + System.Guid.NewGuid().ToString(); Response.Write("<script>alert('已完成');window.location='" + this.txturl.Value + "'</script>"); } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("login.aspx"); string ls_tip = "保存成功!"; #region 新建时先进行一次保存 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = ""; if (this.txtop.Value == "add") { //处理特殊字符 this.hy_bt.Text = ReplaceString_Tszf(this.hy_bt.Text); if (Session["conntype"].ToString() == "SQL") { //edited by xf 20140625 sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values ("; sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'"; sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'"; sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "','" + this.hy_djsj.Text + "','" + this.hy_bt.Text + "'"; sql += ",'','','," + Session["hyuid"].ToString() + ",',',') "; } if (Session["conntype"].ToString() == "ORACLE") { //edited by xf 20140625 sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values ("; sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'"; sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'"; sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "',to_date('" + this.hy_djsj.Text + "','YYYY-MM-DD HH24:MI:SS'),'" + this.hy_bt.Text + "'"; sql += ",'','','," + Session["hyuid"].ToString() + ",',',') "; } Hyoa_global.ExcuteSQL(sql); //插入历史处理表 Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.hy_curtacheid.Text, this.hy_curtachename.Text, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "", "", "", this.hy_djsj.Text, ""); } #endregion //更新内容 sql = "update hyc_" + this.hy_tableid.Text + " set hy_tableid='" + hy_tableid.Text + "',hy_bt='" + hy_bt.Text + "' "; #region 根据“需要保存的字段”来进行保存 if (txtsavefields.Text != "") { string[] lv_savefields = txtsavefields.Text.Split(','); string[] lv_savefields_sx = txtsavefields_sx.Text.Split(','); string fielddocvalue = ""; for (int i = 0; i < lv_savefields.Length; i++) { if (lv_savefields_sx[i].ToString() == "0") //文本 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } } if (lv_savefields_sx[i].ToString() == "1") //日期 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); if (Session["conntype"].ToString() == "SQL") { if (fielddocvalue == "") sql += ",hyc_" + lv_savefields[i].ToString() + "=null"; else sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } if (Session["conntype"].ToString() == "ORACLE") { if (fielddocvalue == "") sql += ",hyc_" + lv_savefields[i].ToString() + "=null"; else sql += ",hyc_" + lv_savefields[i].ToString() + "=to_date('" + fielddocvalue + "','YYYY-MM-DD HH24:MI:SS')"; } } } if (lv_savefields_sx[i].ToString() == "3") //数值 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); if (fielddocvalue == "") sql += ",hyc_" + lv_savefields[i].ToString() + "=0"; else sql += ",hyc_" + lv_savefields[i].ToString() + "=" + fielddocvalue; } } if (lv_savefields_sx[i].ToString() == "5") //口令 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } } if (lv_savefields_sx[i].ToString() == "6") //编辑器 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } } if (lv_savefields_sx[i].ToString() == "7") //复选框 { string s = ""; CheckBoxList txfs = (CheckBoxList)this.FindControl(lv_savefields[i].ToString()); foreach (ListItem li in txfs.Items) { if (li.Selected) { if (li.Selected) s += li.Value + ","; } } s = s.TrimEnd(','); s = ReplaceString_Tszf(s); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'"; } if (lv_savefields_sx[i].ToString() == "8") //单选框 { string s = ""; RadioButtonList txfs = (RadioButtonList)this.FindControl(lv_savefields[i].ToString()); foreach (ListItem li in txfs.Items) { if (li.Selected) { if (li.Selected) s += li.Value + ","; } } s = s.TrimEnd(','); s = ReplaceString_Tszf(s); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'"; } if (lv_savefields_sx[i].ToString() == "9") //意见 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); if (fielddocvalue != "") { HyoaClass.Hyoa_yj Hyoa_yj = new HyoaClass.Hyoa_yj(); Hyoa_yj.yjid = Hyoa_global.GetRandom(); Hyoa_yj.hy_tableid = this.hy_tableid.Text; Hyoa_yj.hy_fatherid = this.txtdocid.Value; Hyoa_yj.hy_fieldid = lv_savefields[i].ToString(); Hyoa_yj.hy_yjuserid = Session["hyuid"].ToString(); Hyoa_yj.hy_yjusername = Session["hyuname"].ToString(); Hyoa_yj.hy_yjdeptid = Session["hydeptid"].ToString(); Hyoa_yj.hy_yjdeptname = Session["hydeptname"].ToString(); Hyoa_yj.hy_yjtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); Hyoa_yj.hy_yjbody = fielddocvalue; Hyoa_yj.hy_yjip = HttpContext.Current.Request.UserHostAddress; Hyoa_yj.hy_yjifshow = ""; Hyoa_yj.Insert(); } } } } } #endregion #region 保存 if (this.txtwhichoperation.Value == "1") { sql += hylcbctscl(); //特殊处理 } #endregion #region 提交 if (this.txtwhichoperation.Value == "2") { //更新主文档 sql += ",hy_curtacheid='" + this.txtnexttacheid.Value + "'"; sql += ",hy_curtachename='" + this.txtnexttachename.Value + "'"; sql += ",hy_curclrid='" + this.txtnextclrid.Value + "'"; sql += ",hy_curclrname='" + this.txtnextclrname.Value + "'"; //---- 添加当前环节的处理时间 ---- start HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocidtacheid(this.txtdocid.Value, this.hy_curtacheid.Text); if (dt_clinfo.Rows.Count > 0) { string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString(); //当前处理的记录ID Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc; if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "") { Hyoa_flowhistoryinfo_cl.hy_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } else { Hyoa_flowhistoryinfo_cl.hy_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } Hyoa_flowhistoryinfo_cl.Update(); } //---- 添加当前环节的处理时间 ---- end ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start////////////////////// HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); if (this.txtnexttacheid.Value != "**") { //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- start Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", this.txtnextcyrid.Value, this.txtnextcyrname.Value, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ""); //待办事宜、短信、即时消息 string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' }); string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' }); for (var i = 0; i < lv_dbrid.Length; i++) { if (lv_dbrid[i].ToString() != "") { //得到当前用户手机号 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString()); //得到后续处理人手机号 string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString()); //给后续处理人发送一个新的待办事宜(提醒) Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text); //给后续处理人发送即时消息(提醒) if (this.txtisSendjstx_clr.Value == "1") { Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text); } //给后续处理人发送短信(提醒) if (this.txtisSendsms_clr.Value == "1") { Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text); } } } //--- 创建后续处理的处理记录+建立处理人待办事宜 ---- end //--- 创建后续传阅记录+建立待办事宜 ---- start string[] lv_cyrid = this.txtnextcyrid.Value.Split(new Char[] { ',' }); string[] lv_cyrname = this.txtnextcyrname.Value.Split(new Char[] { ',' }); for (var i = 0; i < lv_cyrid.Length; i++) { if (lv_cyrid[i].ToString() != "") { //建立传阅数据 Hyoa_global.Saveflowhistoryinfo_cy_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), "", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //待办事宜、短信、即时消息 //得到当前用户手机号 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString()); //得到后续传阅人手机号 string cb_cyrsjh = Hyoa_user.GetMobilebyuserid(lv_cyrid[i].ToString()); //给后续处理人发送一个新的待办事宜(提醒) Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待阅", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请阅读", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text); //给后续处理人发送即时消息(提醒) if (this.txtisSendjstx_cyr.Value == "1") { Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text); } //给后续处理人发送短信(提醒) if (this.txtisSendsms_cyr.Value == "1") { Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_cyrid[i].ToString(), lv_cyrname[i].ToString(), cb_cyrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text); } } } //--- 创建后续传阅记录+建立待办事宜 ---- end } ////////////////////如果后续环节选择了“结束”,则不需要发待办事宜和短消息 start////////////////////// //--- 当前处理人的待办事宜转已办 ---- start Hyoa_dbsy.Dbsytoybbydocidtacheiduserid(this.txtdocid.Value, this.hy_curtacheid.Text, this.Session["hyuid"].ToString()); //--- 当前处理人的待办事宜转已办 ---- end ls_tip = "文档已成功发送到[" + this.txtnexttachename.Value + "]环节"; sql += hylcclcylist(); //更新hy_clrylist hy_cyrylist edited by xf 20140625 sql += hylctjtscl();//特殊处理 //调用添加客户名称的方法 if (this.hy_mudelid.Text == "MudelVODfwxy" && this.hy_tableid.Text == "TableVODfwxy" || this.hy_mudelid.Text == "Mudelffpdfwht" && this.hy_tableid.Text == "Tableffpdfwht" || this.hy_mudelid.Text == "Mudeljdhazfwht" && this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_mudelid.Text == "Mudelsyyhfwxy" && this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_mudelid.Text == "Mudeljwdsjsxy" && this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_mudelid.Text == "Mudeljwdscsxy" && this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_mudelid.Text == "Mudelkdjrht" && this.hy_tableid.Text == "Tablekdjrht" || this.hy_mudelid.Text == "Mudelsjcsfwht" && this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_mudelid.Text == "Mudelsjgdcsfwht" && this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy" && this.hy_tableid.Text == "Tablesjtxyyhzxy" || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht") { if (this.txtop.Value == "add") { Khdaxx(); } } } #endregion #region 收回 if (this.txtwhichoperation.Value == "3") { //得到上个环节处理人 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value); if (dt_clinfo.Rows.Count > 1) { //删除当前处理人员的待办事宜 HyoaClass.Hyoa_dbsy Hyoa_dbsy_sh = new HyoaClass.Hyoa_dbsy(); //edited by xf 20140625 string[] lv_temp = dt_clinfo.Rows[0]["hy_clrid"].ToString().Split(','); for (int xf = 0; xf < lv_temp.Length; xf++) { Hyoa_dbsy_sh.DeleteByDocid_flowid_tacheid_userid(this.txtdocid.Value, dt_clinfo.Rows[0]["hy_flowid"].ToString(), dt_clinfo.Rows[0]["hy_tacheid"].ToString(), lv_temp[xf]); } string ls_lastclrid = dt_clinfo.Rows[1]["hy_clrid"].ToString(); //上个环节处理人ID string ls_lastclrname = dt_clinfo.Rows[1]["hy_clrname"].ToString(); //上个环节处理人中文名 string ls_lastcldoc = dt_clinfo.Rows[1]["ID"].ToString(); //上个环节处理的记录ID string ls_lasttacheid = dt_clinfo.Rows[1]["hy_tacheid"].ToString(); //上个环节处理环节ID string ls_lasttachename = dt_clinfo.Rows[1]["hy_tachename"].ToString(); //上个环节处理环节名称 string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString(); //当前处理的记录ID dt_clinfo.Clear(); //删除当前处理的记录 Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc; Hyoa_flowhistoryinfo_cl.Delete(); //清空上个环节处理时间,更新创建时间 Hyoa_flowhistoryinfo_cl.ID = ls_lastcldoc; Hyoa_flowhistoryinfo_cl.hy_clsj = ""; Hyoa_flowhistoryinfo_cl.hy_createtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); Hyoa_flowhistoryinfo_cl.Update_sh(); //更新主文档中的当前环节ID、当前环节名称、当前处理人ID和中文名 sql += ",hy_curtacheid='" + ls_lasttacheid + "'"; sql += ",hy_curtachename='" + ls_lasttachename + "'"; sql += ",hy_curclrid='" + ls_lastclrid + "'"; sql += ",hy_curclrname='" + ls_lastclrname + "'"; ls_tip = "文档已成功收回到[" + ls_lasttachename + "]环节"; sql += hylcclcylist(); //更新hy_clrylist hy_cyrylist edited by xf 20140625 sql += hylcshtscl();//特殊处理 } } #endregion #region 退回 if (this.txtwhichoperation.Value == "4") { //更新主文档 sql += ",hy_curtacheid='" + this.txtnexttacheid.Value + "'"; sql += ",hy_curtachename='" + this.txtnexttachename.Value + "'"; sql += ",hy_curclrid='" + this.txtnextclrid.Value + "'"; sql += ",hy_curclrname='" + this.txtnextclrname.Value + "'"; //处理历史处理记录 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value); if (dt_clinfo.Rows.Count > 0) { string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString(); //当前处理的记录ID string ls_clsj = ""; //当前处理的记录处理时间 if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "") ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); else ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); dt_clinfo.Clear(); Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc; Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj; Hyoa_flowhistoryinfo_cl.Update(); } //新建一条处理记录 Hyoa_global.Saveflowhistoryinfo_cl_global(this.txtdocid.Value, this.hy_flowid.Text, this.hy_flowname.Text, this.txtnexttacheid.Value, this.txtnexttachename.Value, this.txtnextclrid.Value, this.txtnextclrname.Value, "", "", "", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "是"); //处理待办事宜 //转已办-当前处理人的待办事宜 HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); //得到发送人手机号 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString()); //(考虑多人的情况) string[] lv_dbrid = this.txtnextclrid.Value.Split(new Char[] { ',' }); string[] lv_dbrname = this.txtnextclrname.Value.Split(new Char[] { ',' }); for (var i = 0; i < lv_dbrid.Length; i++) { if (lv_dbrid[i].ToString() != "") { //得到接收人手机号 string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString()); HyoaClass.Hyoa_global Hyoa_global2 = new HyoaClass.Hyoa_global(); //给退回到的处理人发送一个新的待办事宜(提醒) Hyoa_global2.Senddbsy_global(this.txtdocid.Value, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1", "待办", this.hy_mudelid.Text, "待办箱", "一般", this.hy_bt.Text, "请办理", 0, this.hy_flowid.Text, this.txtnexttacheid.Value, this.hy_tableid.Text); //给退回到的处理人发送即时消息(提醒) if (this.txtisSendjstx.Value == "1") { Hyoa_global.Sendjstx_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), this.hy_mudelid.Text, this.hy_bt.Text, 0, this.hy_tableid.Text); } //给退回到的处理人发送短信(提醒) if (this.txtisSendsms.Value == "1") { Hyoa_global.Sendsms_global(this.txtdocid.Value, this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, this.hy_mudelid.Text, this.hy_bt.Text, 1, "", "", 0, this.hy_tableid.Text); } } } ls_tip = "已成功退回到[" + this.txtnexttachename.Value + "]环节"; sql += hylcthtscl();//特殊处理 } #endregion #region 多人处理 if (this.txtwhichoperation.Value == "5") { //更新主文档 string ls_newclrid = Hyoa_global.MoveOneString_dh(this.hy_curclrid.Text, this.Session["hyuid"].ToString()); string ls_newclrname = Hyoa_global.MoveOneString_dh(this.hy_curclrname.Text, this.Session["hyuname"].ToString()); sql += ",hy_curclrid='" + ls_newclrid + "'"; sql += ",hy_curclrname='" + ls_newclrname + "'"; //处理当前记录 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt_clinfo = new DataTable(); dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value); if (dt_clinfo.Rows.Count > 0) { string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString(); //当前处理的记录ID string ls_clsj = ""; //当前处理的记录处理时间 if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "") ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); else ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); dt_clinfo.Clear(); Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc; Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj; Hyoa_flowhistoryinfo_cl.Update(); } //处理待办事宜 //转已办-当前处理人的待办事宜 HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); ls_tip = "提交成功,当前环节还需要[" + ls_newclrname + "]进行办理"; sql += hylcdrcltscl();//特殊处理 } #endregion #region 催办 if (this.txtwhichoperation.Value == "6") { string cb_docid = this.txtdocid.Value; string cb_dbrid = this.hy_curclrid.Text; string cb_dbrname = this.hy_curclrname.Text; string cb_fsrid = this.Session["hyuid"].ToString(); string cb_fsrname = this.Session["hyuname"].ToString(); string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1"; string cb_property = "催办"; string cb_mudelid = this.hy_mudelid.Text; string cb_foldername = "待办箱"; string cb_hj = "一般"; string cb_bt = this.txtcbideas.Value + "-" + this.hy_bt.Text; string cb_subbt = "请阅读"; float cb_ifyb = 0; string cb_flowid = this.hy_flowid.Text; string cb_tacheid = this.hy_curtacheid.Text; string cb_from = this.hy_mudelid.Text; //得到发送人手机号 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(cb_fsrid); //得到接收人手机号 string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(cb_dbrid); //给当前处理人发送一个新的待办事宜(提醒) Hyoa_global.Senddbsy_global(cb_docid, cb_dbrid, cb_dbrname, cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, cb_ifyb, cb_flowid, cb_tacheid, this.hy_tableid.Text); //给当前处理人发送即时消息(提醒) if (this.txtisSendjstx.Value == "1") { Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, cb_dbrid, cb_dbrname, cb_from, cb_bt, 0, this.hy_tableid.Text); } //给当前处理人发送短信(提醒) if (this.txtisSendsms.Value == "1") { Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, cb_dbrid, cb_dbrname, cb_jsrsjh, cb_from, cb_bt, 1, "", "", 0, this.hy_tableid.Text); } ls_tip = "催办成功!"; sql += hylccbtscl();//特殊处理 } #endregion #region 流程结束时的提交 if (this.txtwhichoperation.Value == "7") { //更新主文档 sql += ",hy_curtacheid='**'"; sql += ",hy_curtachename='结束'"; sql += ",hy_curclrid=''"; sql += ",hy_curclrname=''"; //更新处理表 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt_clinfo = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value); if (dt_clinfo.Rows.Count > 0) { string ls_curcldoc = dt_clinfo.Rows[0]["ID"].ToString(); //当前处理的记录ID string ls_clsj = ""; //当前处理的记录处理时间 if (dt_clinfo.Rows[0]["hy_clsj"].ToString() == "") ls_clsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); else ls_clsj = dt_clinfo.Rows[0]["hy_clsj"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); dt_clinfo.Clear(); Hyoa_flowhistoryinfo_cl.ID = ls_curcldoc; Hyoa_flowhistoryinfo_cl.hy_clsj = ls_clsj; Hyoa_flowhistoryinfo_cl.Update(); //开票流程中开票在流程结束时付款处理。 if (this.hy_tableid.Text == "Tablefpbd") { htfk(); } } ////流程结束时删除所有该文档对应的待办事宜 //HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); //Hyoa_dbsy.Deletebydocid(this.txtdocid.Value); //处理待办事宜 //转已办-当前处理人的待办事宜 HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.Dbsytoybbydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); ls_tip = "流程结束!"; sql += hylcjstscl();//特殊处理 } #endregion #region 收文阅件分发 if (this.txtwhichoperation.Value == "8") { string cb_docid = this.txtdocid.Value; string cb_dbrid = this.hy_curclrid.Text; string cb_dbrname = this.hy_curclrname.Text; string cb_fsrid = this.Session["hyuid"].ToString(); string cb_fsrname = this.Session["hyuname"].ToString(); string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1"; string cb_property = "待阅"; string cb_mudelid = this.hy_mudelid.Text; string cb_foldername = "待办箱"; string cb_hj = "一般"; string cb_bt = this.hy_bt.Text; string cb_subbt = "请阅读"; float cb_ifyb = 0; string cb_flowid = this.hy_flowid.Text; string cb_tacheid = this.hy_curtacheid.Text; string cb_from = this.hy_mudelid.Text; string[] lv_dbrid = this.txtswly_dbsy_userids.Text.Split(new Char[] { '+' }); string[] lv_dbrname = this.txtswly_dbsy_usernames.Text.Split(new Char[] { '+' }); for (var i = 0; i < lv_dbrid.Length; i++) { if (lv_dbrid[i].ToString() != "") { //得到当前用户手机号 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString()); //得到后续处理人手机号 string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString()); //给后续处理人发送一个新的待办事宜(提醒) Hyoa_global.Senddbsy_global(cb_docid, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, 0, cb_flowid, cb_tacheid, this.hy_tableid.Text); //给后续处理人发送即时消息(提醒) Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_mudelid, cb_bt, 0, this.hy_tableid.Text); //给后续处理人发送短信(提醒) Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, cb_mudelid, cb_bt, 1, "", "", 0, this.hy_tableid.Text); //在hyp_flowhistoryinfo_cy中添加传阅信息 string sql_cy = "select * from hyp_flowhistoryinfo_cy where DOCID='" + this.txtdocid.Value + "' and hy_cyrid='" + lv_dbrid[i] + "' order by hy_createtime DESC "; DataTable dt_cy = Hyoa_global.GetDataTable(sql_cy); if (dt_cy.Rows.Count > 0) { } else { HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.ID = Hyoa_global.GetRandom(); Hyoa_flowhistoryinfo_cy.DOCID = this.txtdocid.Value; Hyoa_flowhistoryinfo_cy.hy_flowid = this.hy_flowid.Text; Hyoa_flowhistoryinfo_cy.hy_flowname = this.hy_flowname.Text; Hyoa_flowhistoryinfo_cy.hy_tacheid = this.hy_curtacheid.Text; Hyoa_flowhistoryinfo_cy.hy_tachename = this.hy_curtachename.Text; Hyoa_flowhistoryinfo_cy.hy_cyrid = lv_dbrid[i]; Hyoa_flowhistoryinfo_cy.hy_cyrname = lv_dbrname[i]; Hyoa_flowhistoryinfo_cy.hy_ydsj = ""; Hyoa_flowhistoryinfo_cy.hy_createtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); Hyoa_flowhistoryinfo_cy.Insert(); } } } //在当前环节处理的记录中添加传阅信息,主要用于列表的显示控制 string sql_cl = "select * from hyp_flowhistoryinfo_cl where DOCID='" + this.txtdocid.Value + "' order by hy_createtime DESC "; DataTable dt_cl = Hyoa_global.GetDataTable(sql_cl); if (dt_cl.Rows.Count > 0) { if (dt_cl.Rows[0]["hy_cyrid"].ToString() == "") { sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid='" + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "',hy_cyrname='" + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'"; Hyoa_global.ExcuteSQL(sql_cl); } else { if (Session["conntype"].ToString() == "SQL") { sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=hy_cyrid+'," + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "',hy_cyrname=hy_cyrname+'," + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + "' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'"; } if (Session["conntype"].ToString() == "ORACLE") { sql_cl = "update hyp_flowhistoryinfo_cl set hy_cyrid=CONCAT(hy_cyrid,'," + this.txtswly_dbsy_userids.Text.Replace("+", ",") + "'),hy_cyrname=CONCAT(hy_cyrname,'," + this.txtswly_dbsy_usernames.Text.Replace("+", ",") + ")' where ID='" + dt_cl.Rows[0]["ID"].ToString() + "'"; } Hyoa_global.ExcuteSQL(sql_cl); } } ls_tip = "阅件分发成功!"; sql += hylcclcylist(); //更新hy_clrylist hy_cyrylist edited by xf 20140625 } #endregion //20140809 hjadd start #region 收发文分发 if (this.txtwhichoperation.Value == "11") { string cb_docid = this.txtdocid.Value; string cb_dbrid = this.hy_curclrid.Text; string cb_dbrname = this.hy_curclrname.Text; string cb_fsrid = this.Session["hyuid"].ToString(); string cb_fsrname = this.Session["hyuname"].ToString(); string cb_url = "main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1"; string cb_property = "待阅"; string cb_mudelid = this.hy_mudelid.Text; string cb_foldername = "待办箱"; string cb_hj = "一般"; string cb_bt = this.hy_bt.Text; string cb_subbt = "请阅读"; float cb_ifyb = 0; string cb_flowid = this.hy_flowid.Text; string cb_tacheid = this.hy_curtacheid.Text; string cb_from = this.hy_mudelid.Text; string[] lv_dbrid = this.txtffly_dbsy_userids.Text.Split(new Char[] { '+' }); string[] lv_dbrname = this.txtffly_dbsy_usernames.Text.Split(new Char[] { '+' }); for (var i = 0; i < lv_dbrid.Length; i++) { if (lv_dbrid[i].ToString() != "") { //得到当前用户手机号 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string cb_fsrsjh = Hyoa_user.GetMobilebyuserid(this.Session["hyuid"].ToString()); //得到后续处理人手机号 string cb_jsrsjh = Hyoa_user.GetMobilebyuserid(lv_dbrid[i].ToString()); //给后续处理人发送一个新的待办事宜(提醒) Hyoa_global.Senddbsy_global(cb_docid, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_fsrid, cb_fsrname, cb_url, cb_property, cb_mudelid, cb_foldername, cb_hj, cb_bt, cb_subbt, 0, cb_flowid, cb_tacheid, this.hy_tableid.Text); //给后续处理人发送即时消息(提醒) Hyoa_global.Sendjstx_global(cb_docid, cb_fsrid, cb_fsrname, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_mudelid, cb_bt, 0, this.hy_tableid.Text); //给后续处理人发送短信(提醒) Hyoa_global.Sendsms_global(cb_docid, cb_fsrid, cb_fsrname, cb_fsrsjh, lv_dbrid[i].ToString(), lv_dbrname[i].ToString(), cb_jsrsjh, cb_mudelid, cb_bt, 1, "", "", 0, this.hy_tableid.Text); //在hyp_flowhistoryinfo_cy中添加传阅信息 string sql_cy = "select * from hyp_flowhistoryinfo_cy where DOCID='" + this.txtdocid.Value + "' and hy_cyrid='" + lv_dbrid[i] + "' order by hy_createtime DESC "; DataTable dt_cy = Hyoa_global.GetDataTable(sql_cy); if (dt_cy.Rows.Count > 0) { } else { HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.ID = Hyoa_global.GetRandom(); Hyoa_flowhistoryinfo_cy.DOCID = this.txtdocid.Value; Hyoa_flowhistoryinfo_cy.hy_flowid = this.hy_flowid.Text; Hyoa_flowhistoryinfo_cy.hy_flowname = this.hy_flowname.Text; Hyoa_flowhistoryinfo_cy.hy_tacheid = this.hy_curtacheid.Text; Hyoa_flowhistoryinfo_cy.hy_tachename = this.hy_curtachename.Text; Hyoa_flowhistoryinfo_cy.hy_cyrid = lv_dbrid[i]; Hyoa_flowhistoryinfo_cy.hy_cyrname = lv_dbrname[i]; Hyoa_flowhistoryinfo_cy.hy_ydsj = ""; Hyoa_flowhistoryinfo_cy.hy_createtime = System.DateTime.Now.ToString(); Hyoa_flowhistoryinfo_cy.Insert(); } } } ls_tip = "分发成功!"; } #endregion //20140809 hj add end #region 在主表单内嵌列表的功能中,保存、提交和确认子表单时,需要将父文档的DOCID保存到当前记录的hy_motherid中 //ADD BY XF 2011-11-17 if (this.txtwhichoperation.Value == "1" || this.txtwhichoperation.Value == "2" || this.txtwhichoperation.Value == "111") { if (Request.QueryString["op"] != null) { if (Request.QueryString["op"].ToString() != "") { if (Request.QueryString["motherid"] != null) { if (Request.QueryString["motherid"].ToString() != "") { sql += ",hy_motherid='" + Request.QueryString["motherid"].ToString() + "'"; } } } } } #endregion sql += " where DOCID='" + this.txtdocid.Value + "'"; Hyoa_global.ExcuteSQL(sql); #region 处理完成后的提示及跳转(增加刷新附件功能) if (this.txtifsxfj.Text == "1") { Response.Write("<script>window.location='main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>"); } else { if (this.txturl.Value == "2") { Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();parent.location.reload();</script>"); } else if (this.txtifpop.Value == "") { if (this.hy_tableid.Text == "Tablefpbd") { Response.Write("<script>alert('" + ls_tip + "');window.location='list_myadd.aspx?mid=Mudelfp&tableid=Tablefpbd&listid=6b07b57d-2906-4f5b-bc47-a8c7754ea5bf&rnd=afc25663-de8a-43ba-bc48-db224b3e5c92'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } } else { Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();</script>"); } } #endregion }
protected void Button_Fabu_Click(object sender, EventArgs e) { //收发文发布,将主文档的信息复制到公文库中 if (this.Request.QueryString["docid"] != null) { string lssqlgwk; lssqlgwk = "select * from hyp_gwk where hy_fatherid = '" + this.Request.QueryString["docid"].ToString() + "'"; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dtgwk = Hyoa_global.GetDataTable(lssqlgwk); if (dtgwk.Rows.Count > 0) { Response.Write("<script>alert('此文档已发布到公文库,无法重复发布,若要再次发布,请先删除公文库中的文档!')</script>"); return; } else { //根据主文档ID得到记录 string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.Request.QueryString["docid"].ToString() + "'"; DataTable dt = Hyoa_global.GetDataTable(sql); string gwkid; string gwkmudelid; string gwktableid; string gwkdjrid; string gwkdjrname; string gwkdjbmid; string gwkdjbmname; string gwkbt; string gwkfatherid; string gwkwh = ""; string gwklwwh = ""; gwkid = Hyoa_global.GetRandom(); gwkmudelid = this.hy_mudelid.Text; gwktableid = this.hy_tableid.Text; gwkdjrid = this.hy_djrid.Text; gwkdjrname = this.hy_djrname.Text; gwkdjbmid = this.hy_djrbmid.Text; gwkdjbmname = this.hy_djrbmname.Text; gwkbt = this.hy_bt.Text; gwkfatherid = this.txtdocid.Value; string lsinsertgwk; if (this.hy_mudelid.Text == "Mudelfwgl") { //发文 gwkwh = dt.Rows[0]["hyc_fwlb"].ToString() + "[" + dt.Rows[0]["hyc_nf"].ToString() + "]" + dt.Rows[0]["hyc_fwbh"].ToString() + "号"; gwklwwh = ""; } else { //收文 gwkwh = dt.Rows[0]["hyc_swlx"].ToString() + "[" + dt.Rows[0]["hyc_swnf"].ToString() + "]" + dt.Rows[0]["hyc_swbh"].ToString() + "号"; gwklwwh = dt.Rows[0]["hyc_lwwh"].ToString(); } lsinsertgwk = "insert into hyp_gwk (ID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djbmid,hy_djbmname,hy_bt,hy_wh,hy_lwwh,hy_djsj,hy_fatherid,hy_typeid,hy_typename) "; if (Session["conntype"].ToString() == "SQL") { lsinsertgwk += "values('" + gwkid + "','" + gwkmudelid + "','" + gwktableid + "','" + gwkdjrid + "','" + gwkdjrname + "','" + gwkdjbmid + "','" + gwkdjbmname + "','" + gwkbt + "','" + gwkwh + "','" + gwklwwh + "','" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + gwkfatherid + "','" + this.txttypeid.Value + "','" + this.txttypename.Value + "')"; } if (Session["conntype"].ToString() == "ORACLE") { lsinsertgwk += "values('" + gwkid + "','" + gwkmudelid + "','" + gwktableid + "','" + gwkdjrid + "','" + gwkdjrname + "','" + gwkdjbmid + "','" + gwkdjbmname + "','" + gwkbt + "','" + gwkwh + "','" + gwklwwh + "',to_date('" + System.DateTime.Now.ToString() + "','YYYY-MM-DD HH24:MI:SS'),'" + gwkfatherid + "','" + this.txttypeid.Value + "','" + this.txttypename.Value + "')"; } Hyoa_global.ExcuteSQL(lsinsertgwk); Response.Write("<script>alert('文档发布成功!')</script>"); } } }
//已办转在办add by xf 2014-04-11 protected void Button_YbtozbSave_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //得到历史处理记录最后一条 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value); if (dt.Rows.Count > 0) { string ls_hy_tacheid = dt.Rows[0]["hy_tacheid"].ToString(); string ls_hy_tachename = dt.Rows[0]["hy_tachename"].ToString(); string ls_hy_clrid = dt.Rows[0]["hy_clrid"].ToString(); string ls_hy_clrname = dt.Rows[0]["hy_clrname"].ToString(); string sql = "update hyc_" + hy_tableid.Text + " set hy_curtacheid='" + ls_hy_tacheid + "',hy_curtachename='" + ls_hy_tachename + "',hy_curclrid='" + ls_hy_clrid + "',hy_curclrname='" + ls_hy_clrname + "' where DOCID='" + this.txtdocid.Value + "'"; Hyoa_global.ExcuteSQL(sql); } //Response.Write("<script>alert('已办文件转在办成功!');window.location='" + this.Request.Url.ToString() + "'</script>"); Response.Write("<script>alert('已办文件转在办成功!');window.location='" + this.txturl.Value + "'</script>"); }