using System;
using System.Collections.Generic;
namespace Stat.web.v
{
    /// <summary>
    /// 
    /// </summary>
    public partial class PVStat : Html.ReportPage
    {
        /// <summary>
        /// 
        /// </summary>
        protected Model.StatInfo statModel = new Stat.Model.StatInfo();
        Model.PageInfo pageModel = new Stat.Model.PageInfo(100);
        /// <summary>
        /// 
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            statModel.WebID = base.Webid;
            //
            Model.WebSites websiteModel = base.Website;
            if (websiteModel != null)
            {
                this.Page.Title = "访问页面分析 " + websiteModel.WebName;
                statModel.GatherID = websiteModel.GatherServerID;
                //
                pageModel.PageIndex = base.PageIndex;
                statModel.StartTime = base.StartTime;
                statModel.EndTime = statModel.StartTime.AddDays(1);
                //   
                Show();
            }
            else
            {
                Response.Write("该站点不存在！");
                Response.End();
            }
        }
        /// <summary>
        /// 分析数据
        /// </summary>
        protected void Show()
        {
            ShowHtml(BLL.ViewPage.Get(statModel));
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="list"></param>
        protected void ShowHtml(List<Model.StatItem> list)
        {
            this.LtrPVStatList.Text = Stat.Html.PVStat.GetList_PV(list, pageModel.PageIndex, pageModel.PageSize);
            Response.Flush();
            if (list.Count > pageModel.PageSize)
            {
                string urlPar = "wid=" + statModel.WebID + "&st=" + statModel.StartTime.ToShortDateString() + "&et=" + statModel.EndTime.ToShortDateString();
                this.LtrPVStatPageIndex.Text = JPageIndex.GetIndex.Get(list.Count, pageModel.PageIndex, pageModel.PageSize, urlPar, 1, 0, 1, 5);
                Response.Flush();
            }
        }
    }
}