温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:替某公司写的一个小论坛(供新人参考)
当前文件:
lingdaBBS/NewTopic.aspx.cs[1K,2009-6-12 11:47:01],打开代码结构图
lingdaBBS/NewTopic.aspx.cs[1K,2009-6-12 11:47:01],打开代码结构图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 DataLogicLayer; 12
13
public partial class NewTitle : System.Web.UI.Page 14
{ 15
protected void Page_Load(object sender, EventArgs e) 16
{ 17
18
} 19
20
21
protected void btnSubmit_Click(object sender, EventArgs e) 22
{ 23
TopicClass topic = new TopicClass(); 24
topic.SectionID = Convert.ToInt32(Session["SectionID"].ToString()); 25
topic.UserID = Convert.ToInt32(Session["UserID"]); 26
topic.Click_Count = 1; 27
topic.Contents = txtContent.Text; 28
topic.CreateTime = System.DateTime.Now; 29
topic.ReplyCount = 0; 30
topic.Title = txtTitle.Text.Trim(); 31
topic.TitleType = ddlTitleType.SelectedValue; 32
topic.LastReplyTime = System.DateTime.Now; 33
if(topic.InsertTopic(topic)) 34
{ 35
LoginUser user = new LoginUser(); 36
//更新用户表 37
user.UserID = Convert.ToInt32(Session["UserID"]); 38
user.UserTitleCount = user.UserTitleCount + 1; 39
user.UpdateTitleCount(user); 40
41
//更新版块表 42
SectionClass section = new SectionClass(); 43
section.SectionID=Convert.ToInt32(Session["SectionID"]); 44
section.TitleCount++; 45
section.TopicCount++; 46
section.DayTitle++; 47
section.UpdateSection(section); 48
Response.Redirect("DisplayTitle.aspx?SectionID="+Session["SectionID"]); 49
} 50
else 51
{ 52
Response.Redirect("NewTopic.aspx"); 53
} 54
} 55
} 56






}
}