using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class detail : Ycbw.Data.OleDbClient
{
    protected void Page_Load(object sender, EventArgs e)
    {
		if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
		{
			Ycbw.Articles A = new Ycbw.Articles(this);

			//内容
			this.Fill("select top 1 * from [v_articles] where cid = "+ A.Cid +" order by state desc, addtime desc", "data_article");
			
			if( this.Data.Tables["data_article"].Rows.Count > 0 )
			{
				System.Data.DataRow dr = this.Data.Tables["data_article"].Rows[0];
				
				this.content.Text = dr["content"].ToString();

				//列表
				string sql = "select * from [v_articles]";
				string filter = " where id <> "+ dr["id"] +" and cid = "+ A.Cid;
				string order = " order by state desc, addtime asc";
				
				if( Request.QueryString["key"] != null && Request.QueryString["key"] != "" )
					filter += " and title like '%"+ Request.QueryString["key"] +"%'";
		
				this.BindList(sql +  filter + order, "b_articles", data_articles);
			}

			//控件
			this.navigation.Cid = A.Cid;
			this.category.Text  = A.ClassName;
			this.path.Text  	= "您的位置：<a href=\"/index.aspx\">首页</a> > " + A.Path;

			//SEO
			this.Head.Title 	= A.ClassName;
			this.Head.Keywords  = "宜昌" + A.ClassName + "," + this.Configuration["keywords"].ToString();
			this.Head.Describe  = Cutstring(RemoveHTML(this.content.Text), 360);
		}
    }
}
