using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
namespace Stat.web.v
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks>By：Juju 2010-12-11</remarks>
    public partial class SKeyword : Stat.Html.ReportPage
    {
        /// <summary>
        /// 
        /// </summary>
        protected Model.StatInfo statModel = new Stat.Model.StatInfo();
        Model.PageInfo pageModel = new Stat.Model.PageInfo(50);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            statModel.WebID = base.Webid;
            this.Page.Title = "关键字分析 " + base.Website.WebName;
            statModel.GatherID = base.Website.GatherServerID;
            pageModel.PageIndex = base.PageIndex;
            statModel.StartTime = base.StartTime;
            statModel.EndTime = base.EndTime;
            statModel.EngineId = base.EngineId;
            statModel.EngineKeyWord = base.Keyword;
            statModel.EndTime = base.EndTime;
            statModel.StartTime = base.StartTime;
            //
            Show();
        }

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <remarks>Juju 2011-10-26</remarks>
        protected void Show()
        {
            IList<Model.StatItem> list = BLL.ViewEngine.GetKeyword(statModel);

            this.LtrKeyList.Text = Stat.Html.Engine.GetKey(list, pageModel.PageIndex, pageModel.PageSize, statModel.WebID, statModel.EngineId, statModel.StartTime.ToShortDateString(), statModel.EndTime.ToShortDateString());
            Response.Flush();
            if (list != null && list.Count > 1)
            {
                string urlPar = "wid=" + statModel.WebID + "&st=" + statModel.StartTime.ToShortDateString() + "&et=" + statModel.EndTime.ToShortDateString() + "&e=" + statModel.EngineId + "&k=" + statModel.EngineKeyWord;
                this.LtrKeywordPageIndex.Text = JPageIndex.GetIndex.Get(list.Count, pageModel.PageIndex, pageModel.PageSize, urlPar, 1, 0, 1, 7);
                Response.Flush();
            }
        }
    }
}