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;

namespace flash
{
	/// <summary>
	/// List 的摘要说明。
	/// </summary>
	public partial class List : PageBase
	{
 
		protected void Page_Load(object sender, System.EventArgs e)
		{
			int id = int.Parse(Request.QueryString["id"]);
			int pc = int.Parse(Request.QueryString["pc"]);

			this.CacheFile = string.Format("/CacheFile/List/{0}_{1}.html", id, pc);
			
			string sql = null;

			sql = string.Format("select top 1 * from class where id={0}", id);
			DataTable dt = DAL.DataProvider.ExecuteSql(sql);
			if (dt.Rows.Count>0)
			{
				title.Text = dt.Rows[0]["classname"].ToString();
				ClassName.Text = dt.Rows[0]["classname"].ToString();
				ClassName1.Text = dt.Rows[0]["classname"].ToString();
			}

			sql = string.Format("select top 20 id,title from flash where class={0} and isrecomment=1 order by id desc", id);
			recomment.DataSource = DAL.DataProvider.ExecuteSql(sql);
			recomment.DataBind();

			int count = -1;
			flash.DataSource = DAL.DataProvider.GetList(out count, true, "flash", 30, pc-1, "id,title,picture", "id", string.Format("class={0}", id), "desc");
			flash.DataBind();
			pager1.UrlFormat = "/" + id + "_{0}.aspx";
			pager1.RecordCount = count;
		}

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

		}
		#endregion
	}
}
