using System;
using System.Collections;
using System.Collections.Generic;
namespace Stat.web.v
{
    /// <summary>
    /// 
    /// </summary>
    public partial class vIP : Html.ReportPage
    {
        /// <summary>
        /// 
        /// </summary>
        protected Model.StatInfo statModel = new Stat.Model.StatInfo();
        Model.PageInfo pageModel = new Stat.Model.PageInfo(100);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            statModel.WebID = base.Webid;
            //
            Model.WebSites websiteModel = base.Website;
            if (websiteModel != null)
            {
                this.Page.Title = "访问 IP 分析 " + 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()
        {
            List<Model.StatItem> list = BLL.ViewIP.Get(statModel);

            string strdtDomainList = Html.ViewIP.GetList(list, statModel.WebID, pageModel.PageIndex, pageModel.PageSize, statModel.StartTime.ToShortDateString(), statModel.EndTime.ToShortDateString());
            this.LtrVIPList.Text = strdtDomainList;
            Response.Flush();
            if (list.Count > pageModel.PageSize)
            {
                string urlPar = "wid=" + statModel.WebID + "&st=" + statModel.StartTime.ToShortDateString() + "&et=" + statModel.EndTime.ToShortDateString();
                this.LtrvIPPageIndex.Text = JPageIndex.GetIndex.Get(list.Count, pageModel.PageIndex, pageModel.PageSize, urlPar, 1, 0, 1, 6);

                Response.Flush();
            }
        }
    }
}
