温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:三层班级留言本源码
当前文件路径:ClassSay/Class/AddBack.aspx.cs

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 UserInfoLib; 12
13
//该源码下载自www.51aspx.com(51aspx.com) 14
public partial class AddBack : System.Web.UI.Page 15
{ 16
17
private void Clea() 18
{ 19
this.TextBox1.Text = ""; 20
Session.Remove("TextID"); 21
this.Response.Write("<script>window.setTimeout('window.close()',0);</script>"); 22
} 23
24
private void InsertBack() 25
{ 26
UserInfo user = new UserInfo(); 27
user.TextID = int.Parse(Session["TextID"].ToString()); 28
user.BackBody = this.TextBox1.Text; 29
user.UserName = Session["User"].ToString(); 30
if (this.TextBox1.Text!=null && this.TextBox1.Text!="") 31
{ 32
if (user.InsertBack() == 2) 33
{ 34
this.Response.Write("<script>alert('回复成功!');</script>"); 35
} 36
else 37
this.Response.Write("<script>alert('出现未知错误,无法回复!');</script>"); 38
} 39
else 40
{ 41
this.Response.Write("<script>alert('出现未知错误,无法回复!');</script>"); 42
} 43
Clea(); 44
} 45
46
47
protected void Page_Load(object sender, EventArgs e) 48
{ 49
if (!Page.IsPostBack) 50
{ 51
if ((Session["User"] != null) && (Session["Root"] != null) && (Session["Root"].ToString()) != "0") 52
{ 53
this.Label1.Text = Session["User"].ToString(); 54
this.Button2.Attributes.Add("onclick", "window.close();"); 55
} 56
else 57
{ 58
this.Response.Write("<script>window.setTimeout('window.close()',1000);</script>"); 59
this.Response.Redirect("index.aspx"); 60
//this.Page.RegisterStartupScript("closewindow", "<script>window.close()</script>"); 61
} 62
} 63
} 64
protected void Button1_Click(object sender, EventArgs e) 65
{ 66
InsertBack(); 67
Clea(); 68
} 69
} 70





}
}