protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text.Length == 0) { Label1.Text = ("输入子行业名称,不允许为空!"); return; } //if (TextBox2.Text.Length == 0) //{ // Label1.Text = ("输入子行业描述,不允许为空!"); // return; //} string sql = @"INSERT INTO [dbo].[ZhuanXiang2] ([HangYeID] ,[Name] ,[Description] ,[state]) VALUES ('" + stype + "','" + TextBox1.Text.Trim().ToString() + "','', 1)"; int count = DBZhengce.getRowsCount(sql); if (count > 0) { Label1.Text = "保存成功"; } else { Label1.Text = "保存失败" + sql; } BindGrid(); }
protected void myGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name = ((TextBox)(myGrid.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim(); string desc = ((TextBox)(myGrid.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim(); string id = myGrid.DataKeys[e.RowIndex].Value.ToString(); //id = myGrid.DataKeys[e.RowIndex].Value.ToString(); string sql = "update [ZhuanXiang2] set[Name] = '" + name + "',[Description]='" + desc + "' where [ID]='" + id + "'"; DBZhengce.getRowsCount(sql); myGrid.EditIndex = -1; BindGrid(); }
protected void myGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name = ((TextBox)(myGrid.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim(); //string id = ((TextBox)(myGrid.Rows[e.RowIndex].Cells[0].Controls[0])).Text.ToString().Trim(); string id = myGrid.DataKeys[e.RowIndex].Value.ToString(); string sql = "update[Setting] set[Name] = '" + name + "' where ID='" + id + "'"; DBZhengce.getRowsCount(sql); myGrid.EditIndex = -1; BindGrid(); }
protected void Button1_Click(object sender, EventArgs e) { string sql = ""; if (id == 0) { //sql = "insert into zqhl_news([title],[content],classid,qz,pic,en,sel,writer,author,typename,cdate)values("; //sql += "'" + Common.strFilter(title.Text) + "','" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "'," + classid + "," + Common.strFilter(qz.Text); //sql += ",'" + Common.strFilter(pic.Text) + "'," + ((en.Checked) ? "1" : "0") + "," + ((sel.Checked) ? "1" : "0") + ",'" + Common.strFilter(writer.Text) + "','" + Session["adminloginuser"] + "','" + cbtext1 + "','" + cdate.Text + "')"; sql = @"INSERT INTO [dbo].[caijiset] ([url] ,[domain] ,[startstr] ,[endstr] ,[titlestart] ,[titleend] ,[urlstart] ,[urlend] ,[configstart] ,[configend] ,[textstart] ,[textend] ,[fwhaostart] ,[fwhaoend] ,[cwdatestart] ,[cwdateend] ,[fwjigoustart] ,[fwjigouend] ,[fbriqistart] ,[fbriqiend] ,[chinaname] ,[classname] ,[update] ,[state], [userid],[cishu],[cityid],[error]) VALUES ('" + Common.strFilter(url.Text) + "','" + Common.strFilter(domain.Text) + "','" + Common.strFilter(startstr.Text) + "','" + Common.strFilter(endstr.Text) + "','" + Common.strFilter(titlestart.Text) + "','" + Common.strFilter(titleend.Text) + "','" + Common.strFilter(urlstart.Text) + "','" + Common.strFilter(urlend.Text) + "','" + Common.strFilter(configstart.Text) + "','" + Common.strFilter(configend.Text) + "','" + Common.strFilter(textstart.Text) + "','" + Common.strFilter(textend.Text) + "','" + Common.strFilter(fwhaostart.Text) + "','" + Common.strFilter(fwhaoend.Text) + "','" + Common.strFilter(cwdatestart.Text) + "','" + Common.strFilter(cwdateend.Text) + "','" + Common.strFilter(fwjigoustart.Text) + "','" + Common.strFilter(fwjigouend.Text) + "','" + Common.strFilter(fbriqistart.Text) + "','" + Common.strFilter(fbriqiend.Text) + "','" + Common.strFilter(chinaname.Text) + "','" + Common.strFilter(classname.Text) + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',1,'" + Session["userid"] + "','" + Common.strFilter(cishu.Text) + "','" + Common.strFilter(cityid.Text) + "',1)"; } else { sql = @"UPDATE [dbo].[caijiset] set [url]='" + Common.strFilter(url.Text) + "' ,[domain]='" + Common.strFilter(domain.Text) + "' ,[startstr]='" + Common.strFilter(startstr.Text) + "' ,[endstr]='" + Common.strFilter(endstr.Text) + "',[titlestart] ='" + Common.strFilter(titlestart.Text) + "' ,[titleend]='" + Common.strFilter(titleend.Text) + "' ,[urlstart]='" + Common.strFilter(urlstart.Text) + "' ,[urlend]='" + Common.strFilter(urlend.Text) + "',[configstart] ='" + Common.strFilter(configstart.Text) + "' ,[configend]='" + Common.strFilter(configend.Text) + "' ,[textstart]='" + Common.strFilter(textstart.Text) + "' ,[textend]='" + Common.strFilter(textend.Text) + "',[fwhaostart]='" + Common.strFilter(fwhaostart.Text) + "' ,[fwhaoend]='" + Common.strFilter(fwhaoend.Text) + "' ,[cwdatestart]='" + Common.strFilter(cwdatestart.Text) + "' ,[cwdateend]='" + Common.strFilter(cwdateend.Text) + "',[fwjigoustart]='" + Common.strFilter(fwjigoustart.Text) + "' ,[fwjigouend]='" + Common.strFilter(fwjigouend.Text) + "' ,[fbriqistart]='" + Common.strFilter(fbriqistart.Text) + "' ,[fbriqiend]='" + Common.strFilter(fbriqiend.Text) + "',[chinaname]='" + Common.strFilter(chinaname.Text) + "' ,[classname]='" + Common.strFilter(classname.Text) + "' ,[update]='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "', [cishu]='" + Common.strFilter(cishu.Text) + "', [cityid]='" + Common.strFilter(cityid.Text) + "', [error]='" + Common.strFilter(error.Text) + "' WHERE id=" + id + ""; } int count = DBZhengce.getRowsCount(sql); if (count > 0) { msg.Text = "配制信息保存成功"; } else { msg.Text = "保存失败" + sql; } Response.Write("<script language=javascript >window.opener.location.reload('zhengcelist.aspx?id=0'); </script > "); }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text.Length == 0) { Label1.Text = ("输入类型,不允许为空!"); return; } string sql = @"INSERT INTO [dbo].[Setting] ([SettingID] ,[Name] ,[state]) VALUES ('" + stype + "','" + TextBox1.Text.Trim().ToString() + "', 1)"; int count = DBZhengce.getRowsCount(sql); if (count > 0) { Label1.Text = "保存成功"; } else { Label1.Text = "保存失败" + sql; } BindGrid(); }
protected void sc_Command(object sender, CommandEventArgs e) { DBZhengce.getRowsCount("update zhengce set state=0 where id=" + e.CommandArgument); BindGrid(); noupdate(); }
public int GetHtmlfeixi(string url, string title) { int count = 0; string Html = GetHtml(url.Trim()); try { Html = Html.ToString().Replace("\"", "").Replace("'", ""); string xinxi = Html.Substring(Html.IndexOf(configstart.Text.Trim())); xinxi = xinxi.Remove(xinxi.IndexOf(configend.Text.Trim())).Trim();//信息 //Response.Write( xinxi); string Introduce = Html.Substring(Html.IndexOf(textstart.Text.Trim()) + 7); //全文内容 Introduce = Introduce.Remove(Introduce.IndexOf(textend.Text.Trim())).Trim(); //内容 bool bkeyword = false; foreach (object k1 in keyword) { if (Introduce.Contains(k1.ToString()) || title.Contains(k1.ToString())) { bkeyword = true; break; } } if (bkeyword) { //textBox5.Text = title.ToString()+"---|"; //string sql = @"INSERT INTO [dbo].[zhengce] // ([mingcheng] ,[wenhao] ,[faburiqi] ,[fawendanwen] // ,[cengji] ,[buwensheng] ,[gongcheng] ,[lingyu] // ,[yiju] ,[mubiao] ,[youxiaoqi] ,[hangye] // ,[chanpin] ,[zhengceqw] ,[zcywdizhi] ,[state] ,[createdate] // ,[userid]) // VALUES // ('" + Common.strFilter(mingcheng.Text) + "','" + Common.strFilter(wenhao.Text) + "','" + Common.strFilter(faburiqi.Text) + "','" + Common.strFilter(fawendanwen.Text) + "','" + // Common.strFilter(cengji.SelectedValue) + "','" + Common.strFilter(buwensheng.Text) + "','" + Common.strFilter(gongcheng.Text) + "','" + Common.strFilter(lingyu.Text) + "','" + // Common.strFilter(yiju.Text) + "','" + Common.strFilter(mubiao.Text) + "','" + Common.strFilter(youxiaoqi.Text) + "','" + Common.strFilter(hangye.SelectedValue) + "','" + // Common.strFilter(chanpin.Text) + "','" + Common.strFilter(content.Text) + "','" + Common.strFilter(zcywdizhi.Text) + "',1,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // + "','" + Session["userid"] + "')"; string wenhao = chuli(xinxi, "[发文字号]", "</span>", 6); string faburiqi = chuli(xinxi, "[成文日期]", "</span>", 6); string fawendanwen = chuli(xinxi, "[发文机构]", "</li>", 6); string youxiaoqi = chuli(xinxi, "[发布日期]", "</span>", 6); string sql = @"INSERT INTO [dbo].[zhengce] ([mingcheng] ,[wenhao] ,[faburiqi] ,[fawendanwen],[youxiaoqi] ,[zhengceqw] ,[zcywdizhi] ,[state] ,[createdate] ,[userid],[caiji]) VALUES ('" + Common.strFilter(title) + "','" + Common.strFilter(wenhao) + "','" + Common.strFilter(faburiqi) + "','" + Common.strFilter(fawendanwen) + "','" + Common.strFilter(youxiaoqi) + "','" + Common.strFilter(Introduce) + "','" + Common.strFilter(url) + "',1,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + Session["userid"] + "',1)"; count = DBZhengce.getRowsCount(sql); } } catch { return(0); } if (count > 0) { return(1); } else { return(0); } }
//public static string SetChecked(CheckBoxList checkList, string selval, string separator) //{ // selval = separator + selval + separator; //例如:"0,1,1,2,1"->",0,1,1,2,1," // for (int i = 0; i < checkList.Items.Count; i++) // { // checkList.Items[i].Selected = false; // string val = separator + checkList.Items[i].Value + separator; // if (selval.IndexOf(val) != -1) // { // checkList.Items[i].Selected = true; // selval = selval.Replace(val, separator); //然后从原来的值串中删除已经选中了的 // if (selval == separator) //selval的最后一项也被选中的话,此时经过Replace后,只会剩下一个分隔符 // { // selval += separator; //添加一个分隔符 // } // } // } // selval = selval.Substring(1, selval.Length - 2); //除去前后加的分割符号 // return selval; //} //private DataTable NewMethod(int itype, CheckBoxList cl) //{ // string sql = ""; // sql = "select * from zqhl_class where en>0 and typeid='" + itype + "' and fl<>4 order by typeid asc,fl asc,sx asc";//fl=4为专家类别 // DataTable dt = DBC.getDataTable(sql); // cl.DataSource = dt; // cl.DataTextField = "class";//绑定的字段名 // cl.DataValueField = "id";//绑定的值 // cl.DataBind(); // return dt; //} //protected void scfile_Click(object sender, EventArgs e) //{ // msg.Text = ""; // if (!upfile.HasFile) { msg.Text = "请选择文件后上传"; return; } // if (upfile.FileBytes.Length > 1024 * 1024) // { msg.Text = "文件不能大于1M"; return; } // string ext = upfile.FileName.Substring(upfile.FileName.Length - 3).ToLower(); // if (ext != "png" && ext != "jpg" && ext != "gif") // { // msg.Text = "文件格式只能是png或jpg或gif"; return; // } // string file = DateTime.Now.ToString("yyyMMddHHmmss.ss"); // string filename = Server.MapPath("../upload/") + file + "." + ext; // upfile.SaveAs(filename); // pic.Text = "/upload/" + file + "." + ext; //} protected void bc_Click(object sender, EventArgs e) { //foreach (Control ct in this.form1.Controls)//循环查询表单里面的子控件 //{ // if (ct.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBox")) // { // CheckBox cb = (CheckBox)ct; // if (cb.Checked == true) // { // stext+=(cb.Text + "<br/>");//这句换成取值 // } // } //} ///Response.Write(stext); string classid = "0"; string cbtext1 = ""; string sql = ""; try { Convert.ToDateTime(faburiqi.Text); } catch { msg.Text = "发布日期,时间格式不正确 !"; return; } if (mingcheng.Text == "") { msg.Text = "政策名称,不能为空"; return; } if (wenhao.Text == "") { msg.Text = "政策文号,不能为空"; return; } if (fawendanwen.Text == "") { msg.Text = "发文单位,不能为空"; return; } if (buwensheng.Text == "") { msg.Text = "部委省级,不能为空"; return; } //if (cbtext1 == "") //{ // msg.Text = "必须选择一个分类"; // return; //} //cbtext1 = cbtext1.Substring(0, cbtext1.Length - 1); string cbtexthy = ""; for (int i = 0; i < hangyec.Items.Count; i++) { if (hangyec.Items[i].Selected == true) { //这个打勾的 cbtexthy += hangyec.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } string gongcheng = ""; for (int i = 0; i < gongchengc.Items.Count; i++) { if (gongchengc.Items[i].Selected == true) { //这个打勾的 gongcheng += gongchengc.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } string cengji = ""; for (int i = 0; i < cengjicb.Items.Count; i++) { if (cengjicb.Items[i].Selected == true) { //这个打勾的 cengji = cengjicb.Items[i].Value; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } string hangye = ""; for (int i = 0; i < hangyecbl.Items.Count; i++) { if (hangyecbl.Items[i].Selected == true) { //这个打勾的 hangye += hangyecbl.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } //hangye = tbhangye.Text; ////hangye = hangyejs.Value; if (hangye == "") { msg.Text = "必须选择一个或多个行业"; return; } if (id == 0) { //sql = "insert into zqhl_news([title],[content],classid,qz,pic,en,sel,writer,author,typename,cdate)values("; //sql += "'" + Common.strFilter(title.Text) + "','" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "'," + classid + "," + Common.strFilter(qz.Text); //sql += ",'" + Common.strFilter(pic.Text) + "'," + ((en.Checked) ? "1" : "0") + "," + ((sel.Checked) ? "1" : "0") + ",'" + Common.strFilter(writer.Text) + "','" + Session["adminloginuser"] + "','" + cbtext1 + "','" + cdate.Text + "')"; sql = @"INSERT INTO [dbo].[zhengce] ([mingcheng] ,[wenhao] ,[faburiqi] ,[fawendanwen] ,[cengji] ,[buwensheng] ,[gongcheng] ,[lingyu] ,[yiju] ,[mubiao] ,[youxiaoqi] ,[hangye] ,[zhengceqw] ,[zcywdizhi] ,[state] ,[createdate] ,[userid],[caiji]) VALUES ('" + Common.strFilter(mingcheng.Text) + "','" + Common.strFilter(wenhao.Text) + "','" + Common.strFilter(faburiqi.Text) + "','" + Common.strFilter(fawendanwen.Text) + "','" + Common.strFilter(cengji) + "','" + Common.strFilter(buwensheng.Text) + "','" + Common.strFilter(gongcheng) + "','" + Common.strFilter(cbtexthy) + "','" + Common.strFilter(yiju.Text) + "','" + Common.strFilter(mubiao.Text) + "','" + Common.strFilter(youxiaoqi.Text) + "','" + Common.strFilter(hangye) + "','" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "','" + Common.strFilter(zcywdizhi.Text) + "',1,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + Session["userid"] + "',0)"; //以下字段编辑时上传 //// ,[glchanneng] ,[gldiqu] ,[gldixiang] // ,[zcshijian] ,[zcshuoming] ,[gmfangshi] ,[gmshuoming] // ,[psfangshi] ,[psshuoming] ,[shenbaotj] ,[sbjttiaojian] // ,[xzchanneng] ,[xzdiqu] ,[xzzhuti] ,[xzfashism] // } else { //sql = "update zqhl_news set [title]='" + Common.strFilter(title.Text) + "',[content]='" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "',classid=" + classid + ",qz=" + Common.strFilter(qz.Text); //sql += ",pic='" + Common.strFilter(pic.Text) + "',en=" + ((en.Checked) ? "1" : "0") + ",sel=" + ((sel.Checked) ? "1" : "0") + ",writer='" + Common.strFilter(writer.Text) + "',typename='" + cbtext1 + "',cdate='" + cdate.Text + "' where id=" + id; sql = @"update zhengce set [mingcheng]='" + Common.strFilter(mingcheng.Text) + "',[wenhao]='" + Common.strFilter(wenhao.Text) + "' ,[faburiqi]='" + Common.strFilter(faburiqi.Text) + "',[fawendanwen]='" + Common.strFilter(fawendanwen.Text) + "' ,[cengji] ='" + Common.strFilter(cengji) + "' ,[buwensheng] ='" + Common.strFilter(buwensheng.Text) + "' ,[gongcheng]='" + Common.strFilter(gongcheng) + "' ,[lingyu]='" + Common.strFilter(cbtexthy) + "' ,[yiju]='" + Common.strFilter(yiju.Text) + "' ,[mubiao]='" + Common.strFilter(mubiao.Text) + "' ,[youxiaoqi]='" + Common.strFilter(youxiaoqi.Text) + "' ,[hangye]='" + Common.strFilter(hangye) + "' ,[zhengceqw] ='" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "' ,[zcywdizhi] ='" + Common.strFilter(zcywdizhi.Text) + "' ,[update]='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where id=" + id + ""; } int count = DBZhengce.getRowsCount(sql); if (count > 0) { msg.Text = "保存成功"; } else { msg.Text = "保存失败" + sql; } Response.Write("<script language=javascript >window.opener.location.reload('zhengce.aspx'); </script > "); }
protected void bc_Click(object sender, EventArgs e) { //foreach (Control ct in this.form1.Controls)//循环查询表单里面的子控件 //{ // if (ct.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBox")) // { // CheckBox cb = (CheckBox)ct; // if (cb.Checked == true) // { // stext+=(cb.Text + "<br/>");//这句换成取值 // } // } //} ///Response.Write(stext); string classid = "0"; string cbtext1 = ""; string sql = ""; //try { Convert.ToDateTime(faburiqi.Text); } //catch //{ // msg.Text = "时间格式不正确 !"; // return; //} //if (pic.Text == "") //{ // msg.Text = "必须上传图片"; // return; //} //if (cbtext1 == "") //{ // msg.Text = "必须选择一个分类"; // return; //} //cbtext1 = cbtext1.Substring(0, cbtext1.Length - 1); if (id == 0) { //sql = "insert into zqhl_news([title],[content],classid,qz,pic,en,sel,writer,author,typename,cdate)values("; //sql += "'" + Common.strFilter(title.Text) + "','" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "'," + classid + "," + Common.strFilter(qz.Text); //sql += ",'" + Common.strFilter(pic.Text) + "'," + ((en.Checked) ? "1" : "0") + "," + ((sel.Checked) ? "1" : "0") + ",'" + Common.strFilter(writer.Text) + "','" + Session["adminloginuser"] + "','" + cbtext1 + "','" + cdate.Text + "')"; //以下字段编辑时上传 //// ,[glchanneng] ,[gldiqu] ,[gldixiang] // ,[zcshijian] ,[zcshuoming] ,[gmfangshi] ,[gmshuoming] // ,[psfangshi] ,[psshuoming] ,[shenbaotj] ,[sbjttiaojian] // ,[xzchanneng] ,[xzdiqu] ,[xzzhuti] ,[xzfashism] // } else { string gldixiang = ""; //string gldixiang = ""; if (jishu1_1.Checked == true) { gldixiang += "支持园区/地方(高新区,市等)"; } //组织机构/企业 if (jishu1_2.Checked == true) { gldixiang += "支持企业(支持央企/国企;不限企业类型)"; } //个人 //if (jishu1_3.Checked == true) { gldixiang += "项目,"; }//技术转让 //if (jishu1_4.Checked == true) { gldixiang += "其他:" + txtjishu4_3.Value.ToString(); }//其他 string zcshijian = ""; //string gldixiang = ""; //if (CheckBox1.Checked == true) { zcshijian = "投资前"; }//投资前 //if (CheckBox2.Checked == true) { zcshijian = "投资后"; }//投资后 //if (CheckBox3.Checked == true) { zcshijian = "其他:" + Text1.Value.ToString(); }//其他 string psfangshi = ""; //string gldixiang = ""; if (RadioButton1.Checked == true) { psfangshi = "招投标"; } //招投标 if (RadioButton2.Checked == true) { psfangshi = "评审"; } //评审 if (RadioButton3.Checked == true) { psfangshi = "其他:" + Text3.Value.ToString(); } //其他 int zczijin = 0; //string gldixiang = ""; if (RadioButton4.Checked == true) { zczijin = 1; } //固定资产投资比例 if (RadioButton5.Checked == true) { zczijin = 0; } //一定额度资金 //if (CheckBox6.Checked == true) { gmfangshi += "退税,"; }//技术转让 //if (CheckBox7.Checked == true) { gmfangshi += "其他:" + Text2.Value.ToString(); }//其他 string zcjibie = ""; //string gldixiang = ""; if (RadioButton6.Checked == true) { zcjibie += "国家中央支持,"; } //资产/规模要求 if (RadioButton7.Checked == true) { zcjibie += "部委支持,"; } //企业性质要求 if (RadioButton8.Checked == true) { zcjibie += "地方支持,"; } //技术要求 //if (CheckBox11.Checked == true) { shenbaotj += "其他:" + Text4.Value.ToString(); }//其他 //sql = "update zqhl_news set [title]='" + Common.strFilter(title.Text) + "',[content]='" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "',classid=" + classid + ",qz=" + Common.strFilter(qz.Text); //sql += ",pic='" + Common.strFilter(pic.Text) + "',en=" + ((en.Checked) ? "1" : "0") + ",sel=" + ((sel.Checked) ? "1" : "0") + ",writer='" + Common.strFilter(writer.Text) + "',typename='" + cbtext1 + "',cdate='" + cdate.Text + "' where id=" + id; sql = @"update zhengce set [gldiqu]='" + Common.strFilter(gldiqu.Text) + "' ,[gldixiang]='" + Common.strFilter(gldixiang) + "',[zcshijian]='" + Common.strFilter(zcshijian) + "' ,[zczijin]='" + zczijin + "' ,[zcjibie]='" + Common.strFilter(zcjibie) + "' ,[psfangshi]='" + Common.strFilter(psfangshi) + "' ,[update]='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where id=" + id + ""; } int count = DBZhengce.getRowsCount(sql); if (count > 0) { msg.Text = "保存成功"; } else { msg.Text = "保存失败" + sql; } }
//public static string SetChecked(CheckBoxList checkList, string selval, string separator) //{ // selval = separator + selval + separator; //例如:"0,1,1,2,1"->",0,1,1,2,1," // for (int i = 0; i < checkList.Items.Count; i++) // { // checkList.Items[i].Selected = false; // string val = separator + checkList.Items[i].Value + separator; // if (selval.IndexOf(val) != -1) // { // checkList.Items[i].Selected = true; // selval = selval.Replace(val, separator); //然后从原来的值串中删除已经选中了的 // if (selval == separator) //selval的最后一项也被选中的话,此时经过Replace后,只会剩下一个分隔符 // { // selval += separator; //添加一个分隔符 // } // } // } // selval = selval.Substring(1, selval.Length - 2); //除去前后加的分割符号 // return selval; //} //private DataTable NewMethod(int itype, CheckBoxList cl) //{ // string sql = ""; // sql = "select * from zqhl_class where en>0 and typeid='" + itype + "' and fl<>4 order by typeid asc,fl asc,sx asc";//fl=4为专家类别 // DataTable dt = DBC.getDataTable(sql); // cl.DataSource = dt; // cl.DataTextField = "class";//绑定的字段名 // cl.DataValueField = "id";//绑定的值 // cl.DataBind(); // return dt; //} //protected void scfile_Click(object sender, EventArgs e) //{ // msg.Text = ""; // if (!upfile.HasFile) { msg.Text = "请选择文件后上传"; return; } // if (upfile.FileBytes.Length > 1024 * 1024) // { msg.Text = "文件不能大于1M"; return; } // string ext = upfile.FileName.Substring(upfile.FileName.Length - 3).ToLower(); // if (ext != "png" && ext != "jpg" && ext != "gif") // { // msg.Text = "文件格式只能是png或jpg或gif"; return; // } // string file = DateTime.Now.ToString("yyyMMddHHmmss.ss"); // string filename = Server.MapPath("../upload/") + file + "." + ext; // upfile.SaveAs(filename); // pic.Text = "/upload/" + file + "." + ext; //} protected void bc_Click(object sender, EventArgs e) { //foreach (Control ct in this.form1.Controls)//循环查询表单里面的子控件 //{ // if (ct.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBox")) // { // CheckBox cb = (CheckBox)ct; // if (cb.Checked == true) // { // stext+=(cb.Text + "<br/>");//这句换成取值 // } // } //} ///Response.Write(stext); string classid = "0"; string cbtext1 = ""; string sql = ""; try { Convert.ToDateTime(faburiqi.Text); } catch { msg.Text = "发布日期,时间格式不正确 !"; return; } if (mingcheng.Text == "") { msg.Text = "政策名称,不能为空"; return; } if (wenhao.Text == "") { msg.Text = "政策文号,不能为空"; return; } if (fawendanwen.Text == "") { msg.Text = "发文单位,不能为空"; return; } //if (buwensheng.Text == "") //{ // msg.Text = "层级,不能为空"; // return; //} //单位层级 string cengji = ""; if (Request.Form["cengji"] != null) { cengji = (int.Parse(Request.Form["cengji"]) + 11391).ToString(); } if (cengji == "") { msg.Text = "层级,不能为空"; return; } //国家部委 string buwei = ""; if (Request.Form["buwei"] != null) { buwei = (int.Parse(Request.Form["buwei"]) + 11396).ToString(); } string xmleixing = ""; if (Request.Form["xiangmu"] != null) { xmleixing = (int.Parse(Request.Form["xiangmu"]) + 11742).ToString(); } string zxming = ""; if (xmleixing == "11743") { zxming = zhangxiang1.SelectedValue; } else if (xmleixing == "11744") { zxming = zhangxiang2.SelectedValue; } else if (xmleixing == "11745") { zxming = zhangxiang3.SelectedValue; } string zxnian = ""; if (Request.Form["zxnian"] != null) { zxnian = (int.Parse(Request.Form["zxnian"])).ToString(); } //if (cbtext1 == "") //{ // msg.Text = "必须选择一个分类"; // return; //} //cbtext1 = cbtext1.Substring(0, cbtext1.Length - 1); string cbtexthy = ""; for (int i = 0; i < hangyec.Items.Count; i++) { if (hangyec.Items[i].Selected == true) { //这个打勾的 cbtexthy += hangyec.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } string gongcheng = ""; for (int i = 0; i < gongchengc.Items.Count; i++) { if (gongchengc.Items[i].Selected == true) { //这个打勾的 gongcheng += gongchengc.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } string gldiqusheng = ""; for (int i = 0; i < gldiqu.Items.Count; i++) { if (gldiqu.Items[i].Selected == true) { //这个打勾的 gldiqusheng += gldiqu.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} } else { //这是没打的 } } //for (int i = 0; i < cengjicb.Items.Count; i++) //{ // if (cengjicb.Items[i].Selected == true) // { // //这个打勾的 // cengji = cengjicb.Items[i].Value; // //if (classid == "0") // //{ // // classid = hangye.Items[i].Value; // //} // } // else // { // //这是没打的 // } //} string hangye = ""; string hangyesql = "delete from [dbo].[hangye] where zhengceid='" + id + "';"; for (int i = 0; i < hangyecbl.Items.Count; i++) { if (hangyecbl.Items[i].Selected == true) { //这个打勾的 hangye += hangyecbl.Items[i].Value + ","; //if (classid == "0") //{ // classid = hangye.Items[i].Value; //} hangyesql += "INSERT INTO [dbo].[hangye]([zhengceid],[hangye]) VALUES ('" + id + "','" + hangyecbl.Items[i].Value + "');"; } else { //这是没打的 } } if (hangye == "") { msg.Text = "必须选择一个或多个行业"; return; } int zczijin = 0; //string gldixiang = ""; if (RadioButton4.Checked == true) { zczijin = 1; } //固定资产投资比例 if (RadioButton5.Checked == true) { zczijin = 0; } //一定额度资金 //string zcjibie = ""; //string gldixiang = ""; //if (RadioButton6.Checked == true) { zcjibie += "国家中央支持,"; }//资产/规模要求 //if (RadioButton7.Checked == true) { zcjibie += "部委支持,"; }//企业性质要求 //if (RadioButton8.Checked == true) { zcjibie += "地方支持,"; }//技术要求 string gldixiang = ""; //string gldixiang = ""; if (jishu1_1.Checked == true) { gldixiang += "园区"; } //组织机构/企业 if (jishu1_2.Checked == true) { gldixiang += "企业"; } //个人 if (jishu1_3.Checked == true) { gldixiang += " 科研单位"; } //个人 //hangye = tbhangye.Text; ////hangye = hangyejs.Value; string psfangshi = ""; //string gldixiang = ""; if (RadioButton1.Checked == true) { psfangshi = "招投标"; } //招投标 if (RadioButton2.Checked == true) { psfangshi = "评审"; } //评审 if (RadioButton3.Checked == true) { psfangshi = "其他:" + Text3.Value.ToString(); } //其他 int zxleixing = -1; if (zhengcel1.Checked) { zxleixing = 1; } //专项 if (zhengcel2.Checked) { zxleixing = 0; } //非专项 if (id == 0) { //sql = "insert into zqhl_news([title],[content],classid,qz,pic,en,sel,writer,author,typename,cdate)values("; //sql += "'" + Common.strFilter(title.Text) + "','" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "'," + classid + "," + Common.strFilter(qz.Text); //sql += ",'" + Common.strFilter(pic.Text) + "'," + ((en.Checked) ? "1" : "0") + "," + ((sel.Checked) ? "1" : "0") + ",'" + Common.strFilter(writer.Text) + "','" + Session["adminloginuser"] + "','" + cbtext1 + "','" + cdate.Text + "')"; sql = @"INSERT INTO [dbo].[zhengce] ([mingcheng] ,[wenhao] ,[faburiqi] ,[fawendanwen] ,[cengji] ,[buwei] ,[buwensheng] ,[gongcheng] ,[lingyu] ,[youxiaoqi] ,[hangye] ,[zhengceqw] ,[zcywdizhi] ,[state] ,[createdate] ,[userid],[caiji],[gldiqu],[zczijin] ,[zcjibie],[gldixiang],[psfangshi],[zxleixing] ,[xmleixing],[zxming],[zxnian],[ketifx],[shishizq]) VALUES ('" + Common.strFilter(mingcheng.Text) + "','" + Common.strFilter(wenhao.Text) + "','" + Common.strFilter(faburiqi.Text) + "','" + Common.strFilter(fawendanwen.Text) + "','" + Common.strFilter(cengji) + "','" + Common.strFilter(buwei) + "','" + Common.strFilter(gldiqusheng) + "','" + Common.strFilter(gongcheng) + "','" + Common.strFilter(cbtexthy) + "','" + Common.strFilter(youxiaoqi.Text) + "','" + Common.strFilter(hangye) + "','" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "','" + Common.strFilter(zcywdizhi.Text) + "',1,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + Session["userid"] + "',0,'" + Common.strFilter(gldiqusheng) + "','" + zczijin + "','" + cengji + "','" + gldixiang + "','" + psfangshi + "','" + zxleixing + "','" + xmleixing + "','" + zxming + "','" + zxnian + "','" + Common.strFilter(ketifx.Text) + "','" + Common.strFilter(shishizq.Text) + "');"; //以下字段编辑时上传 //// ,[glchanneng] ,[gldiqu] ,[gldixiang] // ,[zcshijian] ,[zcshuoming] ,[gmfangshi] ,[gmshuoming] // ,[psfangshi] ,[psshuoming] ,[shenbaotj] ,[sbjttiaojian] // ,[xzchanneng] ,[xzdiqu] ,[xzzhuti] ,[xzfashism] // } else { //sql = "update zqhl_news set [title]='" + Common.strFilter(title.Text) + "',[content]='" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "',classid=" + classid + ",qz=" + Common.strFilter(qz.Text); //sql += ",pic='" + Common.strFilter(pic.Text) + "',en=" + ((en.Checked) ? "1" : "0") + ",sel=" + ((sel.Checked) ? "1" : "0") + ",writer='" + Common.strFilter(writer.Text) + "',typename='" + cbtext1 + "',cdate='" + cdate.Text + "' where id=" + id; sql = @"update zhengce set [mingcheng]='" + Common.strFilter(mingcheng.Text) + "',[wenhao]='" + Common.strFilter(wenhao.Text) + "' ,[faburiqi]='" + Common.strFilter(faburiqi.Text) + "',[fawendanwen]='" + Common.strFilter(fawendanwen.Text) + "' ,[cengji] ='" + Common.strFilter(cengji) + "' ,[buwei] ='" + Common.strFilter(buwei) + "' ,[buwensheng] ='" + Common.strFilter(gldiqusheng) + "' ,[gongcheng]='" + Common.strFilter(gongcheng) + "' ,[lingyu]='" + Common.strFilter(cbtexthy) + "' ,[youxiaoqi]='" + Common.strFilter(youxiaoqi.Text) + "', [gldiqu]='" + Common.strFilter(gldiqusheng) + "' , [zczijin]='" + zczijin + "' , [hangye]='" + Common.strFilter(hangye) + "' ,[zhengceqw] ='" + Common.strFilter(content1.Text.Replace("&emsp ", " ")) + "' ,[zcywdizhi] ='" + Common.strFilter(zcywdizhi.Text) + "' ,[zcjibie]='" + Common.strFilter(cengji) + "' ,[gldixiang]='" + Common.strFilter(gldixiang) + "' ,[psfangshi]='" + Common.strFilter(psfangshi) + "' ,[zxleixing]='" + zxleixing + "' ,[xmleixing]='" + Common.strFilter(xmleixing) + "' ,zxming='" + zxming + "',zxnian='" + zxnian + "',ketifx='" + Common.strFilter(ketifx.Text) + "',shishizq='" + Common.strFilter(shishizq.Text) + "' ,[update]='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where id=" + id + ";"; } int count = DBZhengce.getRowsCount(sql + hangyesql); if (count > 0) { msg.Text = "保存成功"; } else { msg.Text = "保存失败" + sql + hangyesql; } //NewMethod2(); if (cengji == "11392")//层级 { zhichiview = ""; gongchengview = "style=\"display:none;\""; } else if (cengji == "11393") { buweiview = ""; if (buwei == "11397")//工信部 { gongchengview = ""; zhichiview = ""; xiangmuliview = "style=\"display:none;\""; xiangmuliview = "style=\"display:none;\""; } else if (buwei == "11398")//发改委 { zhichiview = ""; gongchengview = "style=\"display:none;\""; xiangmuliview = "style=\"display:none;\""; } else if (buwei == "11399") { zhichiview = ""; gongchengview = "style=\"display:none;\""; xiangmuliview = "style=\"display:none;\""; } else if (buwei == "11400") { zhichiview = ""; gongchengview = "style=\"display:none;\""; xiangmuliview = "style=\"display:none;\""; } else if (buwei == "11401")//科技部 { kejiview = ""; zhichiview = ""; gongchengview = "style=\"display:none;\""; if (zxleixing == 1)//专项 { xiangmuliview = ""; zhichiview = "style=\"display:none;\""; if (xmleixing == "11743")//项目类型 { xiangmu1.Checked = true; zhangxiang1.SelectedValue = zxming;//专项名称 zhangxiangli1view = ""; zhangxiangli2view = "style=\"display:none;\""; zhangxiangli3view = "style=\"display:none;\""; } else if (xmleixing == "11744")//项目类型 { xiangmu2.Checked = true; zhangxiang2.SelectedValue = zxming;//专项名称 zhangxiangli1view = "style=\"display:none;\""; zhangxiangli2view = ""; zhangxiangli3view = "style=\"display:none;\""; } else if (xmleixing == "11745")//项目类型 { xiangmu3.Checked = true; zhangxiang3.SelectedValue = zxming;//专项名称 zhangxiangli1view = "style=\"display:none;\""; zhangxiangli2view = "style=\"display:none;\""; zhangxiangli3view = ""; } } else if (zxleixing == 0)//非专项 { zhichiview = ""; xiangmuliview = "style=\"display:none;\""; } } } else if (cengji == "11394") { difangview = ""; zhichiview = ""; gongchengview = "style=\"display:none;\""; } Response.Write("<script language=javascript >window.opener.location.reload('zhengce.aspx'); </script > "); }