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

namespace Stat.web
{
    /// <summary>
    /// 
    /// </summary>
    public partial class Notice : System.Web.UI.Page
    {
        Stat.Cache.INotify notify = Stat.Cache.CacheFatory.CreateNotify();
        /// <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.Notify> list = notify.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();
            }
        }
    }
}
