using System;
using System.Collections;
using System.Collections.Generic;

namespace Stat.web
{
            
    /// <summary>
    /// 
    /// </summary>
    public partial class News1 : System.Web.UI.Page
    {
        Stat.Cache.INews news = Stat.Cache.CacheFatory.CreateNews();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Plugin.Common.Rq_Int("id");

            if (id > 0)
            {
                GetInfo(id);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        protected void GetInfo(int id)
        {
            IList<Model.News> list = news.Get(id);

            if (list != null && list.Count > 0)
            {
                if (list[0].IsPass == 1)
                {
                    this.Page.Title = this.ltrTitle.Text = list[0].title;
                    this.ltrSource.Text = list[0].Source;
                    this.ltrAdmin.Text = list[0].Author;
                    this.ltrDateTime.Text = list[0].AddTime.ToShortDateString();
                    this.ltrContent.Text = list[0].content;
                }
            }
            else
            {
                Response.Write("您访问的页面不存在！");
                Response.End();
                
            }
        }
    }
}
