using System;
using System.Collections.Generic;
namespace Stat.web.v
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks>By ： Juju 2010-12-11</remarks>
    public partial class SEngineList : Html.ReportPage
    {
        Model.PageInfo pageModel = new Stat.Model.PageInfo(10);
        /// <summary>
        /// 
        /// </summary>
        protected Model.SearchInfo searchModel = new Stat.Model.SearchInfo();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            searchModel.WebID = base.Webid;
            Model.WebSites websiteModel = base.Website;
            if (websiteModel.WebId > 0)
            {
                this.Page.Title = "搜索详细分析 " + websiteModel.WebName;
                searchModel.GatherID = websiteModel.GatherServerID;
                pageModel.PageIndex = base.PageIndex;
                searchModel.EngineID = base.EngineId;
                searchModel.KeyWord = base.Keyword;
                searchModel.StartTime = base.StartTime;
                searchModel.EndTime = base.EndTime;
                Show();
            }
            else
            {
                Response.Write("该站点不存在！");
                Response.End();
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>Juju 2011-10-25</remarks>
        protected void Show()
        {
            List<Model.ViewClick> list = BLL.ViewEngine.GetDetail(ref pageModel, searchModel);
            this.LtrEngineList.Text = Stat.Html.Engine.GetList(list, pageModel.PageIndex, pageModel.PageSize, searchModel.WebID, searchModel.StartTime.ToShortDateString(), searchModel.EndTime.ToShortDateString());
            Response.Flush();

            if (list != null && list.Count > 0)
            {
                string _Par = "wid=" + searchModel.WebID + "&st=" + searchModel.StartTime.ToShortDateString() + "&et=" + searchModel.EndTime.ToShortDateString() + "&e=" + searchModel.EngineID + "&k=" + searchModel.KeyWord;
                this.LtrEnginePageIndex.Text = JPageIndex.GetIndex.Get(pageModel.RecordCount, pageModel.PageIndex, pageModel.PageSize, _Par, 1, 0, 1, 5);
                Response.Flush();
            }
        }
    }
}