温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:ajax奥运留言本v1.0源码
当前文件:
OlympicBook/RoleByAccess/UserInfo.aspx.cs[2K,2009-6-12 11:51:24],打开代码结构图
OlympicBook/RoleByAccess/UserInfo.aspx.cs[2K,2009-6-12 11:51:24],打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Data.OleDb; 12
public 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





OleDbConnection conn 
}
}