温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:网上办公系统源码
当前文件路径:OfficeOnline/BBS/BBS_AddReply.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
12
public partial class BBS_BBS_AddReply : System.Web.UI.Page 13
{ 14
WebService webService = new WebService(); 15
string strSql; 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
if (Session["UserID"] == null || Session["UserLevel"] == null) 19
{ 20
Response.Redirect("~/Error.aspx"); 21
} 22
strSql = "Select BM_Title from z_BbsMessage where BM_ID = '" + Request.QueryString["bid"] + "';"; 23
DataTable table = webService.ExcuteSelect(strSql); 24
this.lblTitle.Text = table.Rows[0]["BM_Title"].ToString(); 25
} 26
protected void btnSubmit_Click(object sender, EventArgs e) 27
{ 28
if (this.tbContent.Text == "") 29
{ 30
this.lblMsg.Text = "请输入完整信息!"; 31
} 32
else 33
{ 34
//插入回复信息数据表 35
strSql = "Insert into z_Reply(BBS_ID,Reply_Content,Reply_AddDate,Reply_AddPersonID) values ('" + Request.QueryString["bid"] + "','" + this.tbContent.Text + "','" + DateTime.Now + "','" + Session["UserID"].ToString() + "');"; 36
webService.ExcuteSql(strSql); 37
//修改主题表中的回复数 38
strSql = "Update z_BbsMessage set BM_Replies=BM_Replies+1 where BM_ID='" + Request.QueryString["bid"] + "';"; 39
webService.ExcuteSql(strSql); 40
Response.Redirect("BBS_Info.aspx?bid="+Request.QueryString["bid"]); 41
} 42
} 43
} 44




WebService webService 
}
}