温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:网上办公系统源码
当前文件路径:OfficeOnline/BBS/BBS_EditReply.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_EditReply : System.Web.UI.Page 13
{ 14
string strSql; 15
WebService webService = new WebService(); 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
if (!Page.IsPostBack) 23
{ 24
strSql = "SELECT z_BbsMessage.BM_Title, z_Reply.BBS_ID, z_Reply.Reply_ID, z_Reply.Reply_Content, z_Reply.Reply_AddPersonID FROM z_BbsMessage INNER JOIN z_Reply ON z_BbsMessage.BM_ID = z_Reply.BBS_ID WHERE z_Reply.Reply_ID = '" + Request.QueryString["rid"] + "';"; 25
DataTable table = webService.ExcuteSelect(strSql); 26
this.lblTitle.Text = table.Rows[0]["BM_Title"].ToString(); 27
this.tbContent.Text = table.Rows[0]["Reply_Content"].ToString(); 28
if (table.Rows[0]["Reply_AddPersonID"].ToString() != Session["UserID"].ToString()) 29
{ 30
Response.Redirect("~/Error.aspx"); 31
} 32
} 33
} 34
protected void btnSubmit_Click(object sender, EventArgs e) 35
{ 36
if (this.tbContent.Text == "") 37
{ 38
this.lblMsg.Text = "请填写完整信息!"; 39
} 40
else 41
{ 42
strSql = "Update z_Reply set Reply_Content = '" + this.tbContent.Text + "',Reply_ModifyDate='" + DateTime.Now + "' where Reply_ID='" + Request.QueryString["rid"] + "';"; 43
webService.ExcuteSql(strSql); 44
Response.Redirect("BBS_Info.aspx?bid="+Request.QueryString["bid"]); 45
} 46
} 47
protected void btnCancel_Click(object sender, EventArgs e) 48
{ 49
Response.Redirect("BBS_Info.aspx?bid=" + Request.QueryString["bid"]); 50
} 51
} 52





}
}