reply.aspx.cs

来自「基于Asp.net、MS sql sever 2000、C# 论坛系统源码」· CS 代码 · 共 79 行

CS
79
字号
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Security.Permissions;

namespace Stella.Web.Pages
{
	/// <summary>
	/// reply 的摘要说明。
	/// </summary>
	[PrincipalPermission(SecurityAction.Demand,Authenticated=true)]
	public class reply : Container
	{
		protected System.Web.UI.WebControls.Button go;
		protected Stella.Web.Controls.NewTopic rep;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if(!this.IsPostBack)
				 setUp();
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.go.Click += new System.EventHandler(this.go_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void setUp()
		{
			Stella.Utility.DebugHelper.CheckCondition(Request["top"]!=null,"没有主题编号top传入reply.aspx页");
			Stella.Utility.DebugHelper.CheckCondition(Request["tid"]!=null,"没有版块编号tid传入reply.aspx页");
			rep.EditMode=true;
			Stella.Model.CommonArt ca=new Stella.Model.CommonArt();
			ca.Caption=(string)Session["caption"];
			Session.Remove("caption");

			rep.ComValue=ca;
		}

		private void go_Click(object sender, System.EventArgs e)
		{
			Stella.Model.CommonArt ca=rep.ComValue;
			ca.ReplyTid=int.Parse(Request["top"]);
			int tid=int.Parse(Request["tid"]);
			ca.ThemeId=tid;
			this.artLogic.Create(ca);

			this.themeCounter[tid].ArtSum++;
			this.forumCounter.ArtSum++;

			Response.Redirect(string.Format("topic.aspx?tid={0}&top={1}",Request["tid"],Request["top"]));
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?