温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:网上办公系统源码
当前文件路径:OfficeOnline/BBS/BBS_Edit.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_Edit : 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
if (!Page.IsPostBack) 23
{ 24
strSql = "Select BM_Title,BM_Content,BM_AddPersonID from z_BbsMessage where BM_ID='" + Request.QueryString["bid"] + "';"; 25
DataTable table = webService.ExcuteSelect(strSql); 26
this.tbTitle.Text = table.Rows[0]["BM_Title"].ToString(); 27
this.tbContent.Text = table.Rows[0]["BM_Content"].ToString(); 28
if(table.Rows[0]["BM_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
strSql = "Update z_BbsMessage set BM_Title='" + this.tbTitle.Text + "',BM_Content='" + this.tbContent.Text + "',BM_ModifyDate='" + DateTime.Now + "' where BM_ID='" + Request.QueryString["bid"] + "';"; 37
webService.ExcuteSql(strSql); 38
Response.Redirect("BBS_Info.aspx?bid="+Request.QueryString["bid"]); 39
} 40
protected void btnCancel_Click(object sender, EventArgs e) 41
{ 42
Response.Redirect("BBS_Info.aspx?bid=" + Request.QueryString["bid"]); 43
} 44
} 45




WebService webService 
}
}