Asp.net源码专业站
首页->留言本类->ajax奥运留言本v1.0源码>>RoleByAccess/UserInfo.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:ajax奥运留言本v1.0源码
当前文件:文件类型 OlympicBook/RoleByAccess/UserInfo.aspx.cs[2K,2009-6-12 11:51:24]打开代码结构图
普通视图
		            
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; 11using System.Data.OleDb; 12public partial class admin_UserInfo : System.Web.UI.Page 13{ 14 OleDbConnection conn = new OleDbConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString); 15 DataBase db = new DataBase(); 16 BaseClass bc = new BaseClass(); 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 if(!this.Page.IsPostBack) 20 { 21 this.ShowUser(); 22 } 23 } 24 protected void Button1_Click(object sender, EventArgs e) 25 { 26 int hideid=1; 27 int replyid=0; 28 int orderid = 1; 29 string adminreply=this.adminreply.Text.Trim(); 30 if (!this.RadioButton1.Checked) 31 { 32 hideid = 0; 33 } 34 if (this.adminreply.Text == String.Empty) 35 { 36 replyid = 0; 37 } 38 else 39 { 40 replyid = 1; 41 } 42 if (RadioButton3.Checked) 43 { 44 orderid = 2; 45 } 46 else 47 { 48 orderid = 1; 49 } 50 string sql = "update message set hideid="+hideid+",replyid="+replyid+",orderid="+orderid+",adminreply='"+adminreply+"' "; 51 sql+="where id="+Request.QueryString["id"].ToString(); 52 if (db.ExecSQl(sql)) 53 { 54 OleDbCommand comm = new OleDbCommand(sql, conn); 55 conn.Open(); 56 comm.ExecuteNonQuery(); 57 conn.Close(); 58 //bc.MessageBoxs("回复留言成功!"); 59 Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language=javascript>alert('回复留言成功!');</script>"); 60 61 } 62 else 63 { 64 // bc.MessageBoxs("回复留言失败!"); 65 Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language=javascript>alert('回复留言失败!');</script>"); 66 67 } 68 69 } 70 private void ShowUser() 71 { 72 string id = Request.QueryString["id"].ToString(); 73 if (id == "" || id == null) 74 { 75 id = "1"; 76 } 77 string sql ="select * from message where id="+id; 78 DataSet ds =db.GetDataSet(sql,"a"); 79 DataRowView rv=ds.Tables["a"].DefaultView[0]; 80 this.username.Text = rv["username"].ToString(); 81 this.msgtime.Text = rv["addtime"].ToString(); 82 this.userip.Text = rv["userip"].ToString(); 83 this.usercontent.Text = rv["usercontent"].ToString(); 84 this.adminreply.Text = rv["adminreply"].ToString(); 85 } 86} 87
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:ajax奥运留言本v1.0源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146