using System;
using System.Collections.Generic;
namespace Stat.web.v
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks>By ：Juju 2010-12-11</remarks>
    public partial class SJavaApplets : Html.ReportPage
    {
        /// <summary>
        /// 
        /// </summary>
        protected Model.StatInfo statModel = new Stat.Model.StatInfo();
        /// <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 = "支持 JavaApplets 情况 " + websiteModel.WebName;
                statModel.GatherID = websiteModel.GatherServerID;
                //
                statModel.StartTime = base.StartTime;
                statModel.EndTime = base.EndTime;
                //
                Show();
            }
            else
            {
                Response.Write("该站点不存在！");
                Response.End();
            }
        }

        /// <summary>
        /// 分析数据
        /// </summary>
        protected void Show()
        {
            List<Model.StatItem> list = Stat.Items.JavaApplet.Get(BLL.ViewJavaApplet.Get(statModel));
            ShowReport(list);
            ShowHtml(list);
        }
        /// <summary>
        /// 
        /// </summary>
        protected void ShowHtml(List<Model.StatItem> list)
        {
            this.LtrJavaAppletList.Text = Stat.Html.ItemList.Get(list, statModel.WebID, "JavaApplets 支持", "ja", statModel.StartTime.ToShortDateString(), statModel.EndTime.ToShortDateString());
            Response.Flush();
        }


        /// <summary>
        /// 获取数据
        /// </summary>
        protected void ShowReport(List<Model.StatItem> list)
        {
            //生成报表
            string strXML = Stat.Report.Rp_3_Pie3D.GetXML(list, "JavaApplets 支持 情况", "(" + statModel.StartTime.ToLongDateString() + "--" + statModel.EndTime.ToLongDateString() + ")", 0, "PV");
            this.LtrRp_JavaApplet.Text = BLL.StatCharts.RenderChart("../StatCharts/Pie3D.swf", "", strXML, "chartJava", "99", "300", false, false);
            Response.Flush();
        }
    }
}
