您目前尚未登陆,请选择【登陆】或【注册
首页->会员交友->网博直销系统软件源码>>admin/webhww_gg.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:网博直销系统软件源码
当前文件:文件类型 WangBoDirect/admin/webhww_gg.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11 12public partial class admin_webhww_gg : System.Web.UI.Page 13{ 14 protected void Page_Load(object sender, EventArgs e) 15 { 16 if (Session["aid"] == null) 17 { Response.Write("<script language=javascript>top.location.href='login.aspx';alert('您未登录!');</script>"); } 18 else 19 { 20 if (!IsPostBack) 21 { 22 bind(); 23 if (Request.QueryString["sid"] != null) 24 { 25 delete(); 26 } 27 if (Request.QueryString["bid"] != null) 28 { 29 updata(); 30 Button1.Text = "修改"; 31 } 32 } 33 } 34 } 35 void delete() 36 { 37 access.DoSql("delete * from webhww_gonggao where id="+Request.QueryString["sid"]+""); 38 bind(); 39 } 40 void updata() 41 { 42 string sql = "select * from webhww_gonggao where id="+Request.QueryString["bid"]+" order by id desc"; 43 DataTable dt = new DataTable(); 44 dt = access.GreatDs(sql).Tables[0]; 45 TextBox1.Text = dt.Rows[0]["webhww_biaoti"].ToString(); 46 txtcontent.Value = dt.Rows[0]["webhww_neirong"].ToString(); 47 } 48 void bind() 49 { 50 string sql = "select * from webhww_gonggao order by id desc"; 51 GridView1.DataSource = access.GreatDs(sql); 52 GridView1.DataBind(); 53 } 54 protected void Button1_Click(object sender, EventArgs e) 55 { 56 string sql = ""; 57 string _webhww_biaoti = re.replace(TextBox1.Text); 58 string _webhww_neirong = re.replace(txtcontent.Value); 59 if (Request.QueryString["bid"] != null) 60 { 61 sql = "update webhww_gonggao set webhww_biaoti='" + _webhww_biaoti + "',webhww_neirong='" + _webhww_neirong + "' where id="+Request.QueryString["bid"]+""; 62 63 } 64 else 65 { 66 sql = "insert into webhww_gonggao(webhww_biaoti,webhww_neirong,webhww_shijian) values ('" + _webhww_biaoti + "','" + _webhww_neirong + "','" + DateTime.Now + "')"; 67 } 68 access.DoSql(sql); 69 bind(); 70 } 71} 72
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:网博直销系统软件源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号