Listing the source code file Statistics.aspx.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using PxControls;
using PxFiles;
using System.Globalization;


public partial class Statistics : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //rutina na vypnutie BackButonu v Browsery
        this.Context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        this.Context.Response.Cache.SetAllowResponseInBrowserHistory(false);

        if (Request.Browser.MSDomVersion.Major == 0// Non IE Browser?)
            this.Context.Response.Cache.SetNoStore();

        PxCulture.CurrentCulture = new CultureInfo("en-US");

        if (/*(!IsPostBack)&&*/(wquStatistics.Active == false))
        {
            wquStatistics.ConnectString = AppConst.ConnectString;
            wquStatistics.SQLSelect = @"select CdTitul.IdZaner as idzaner,COUNT(*) as pocet,Zaner.Name as name from CdTitul, Zaner
                                       where CdTitul.IDZaner=Zaner.IdZaner
                                       group by CdTitul.IDZaner";

            //wquStatistics.ReadOnly = true;
            wquStatistics.Open();

            wquStatistics.AutomaticRefresh = true;
            wquStatistics.IntervalQueryRefresh = 30;

            wquStatistics.Columns["IdRecNum"].Caption = "Id";
            wquStatistics.Columns["Pocet"].Caption = "Number of genres";
            wquStatistics.Columns["name"].Caption = "Name the Genre";
            wquStatistics.Columns["idzaner"].Caption = "Number of genres II.";

            //wquStatistics.Columns["Pocet"].Caption = "Count genres";
            //wquStatistics.Columns["name"].Caption = "Name of genres";
            //wquStatistics.Columns["idzaner"].Caption = "Count genres II.";
        }
        else
        {

        }
        grdStatistics.VisibleFields = "IdRecNum;Pocet:70;name:120";
        grdStatistics.PxDataSource = wquStatistics;
        grdStatistics.DataBind();

        navStatistics.PxDataSource = wquStatistics;
        navStatistics.PxVisibleButtons = "FRNL";


        Chart1.PxDataSource = wquStatistics;
        Chart1.FieldName = "name";
        Chart1.FieldValue = "pocet";

        Chart1.Caption = "Statistics genres";
        Chart1.SubCaption = "Summary of genres for all CD titles";

        //Chart1.Caption = "Statistics of genres";
        //Chart1.SubCaption = "A summary of genres for all CD titles";

        //Chart.Width = 800;
        //Chart.Height = 800;

        Chart1.TypeChart = PxChart.PxChart.enumTypeCharts.tcColumn3D;
        Chart1.AddHeader("canvasBgColor""F6DFD9");
        Chart1.AddHeader("divlinecolor""F47E00");

        Chart2.PxDataSource = wquStatistics;
        Chart2.FieldName = "name";
        Chart2.FieldValue = "pocet;idzaner";

        Chart2.Caption = "Statistics genres";
        Chart2.SubCaption = "Summary of genres for all CD titles";

        //Chart2.Caption = "Statistics of genres";
        //Chart2.SubCaption = "A summary of genres for all CD titles";

        //Chart.Width = 800;
        //Chart.Height = 800;

        Chart2.TypeChart = PxChart.PxChart.enumTypeCharts.tcMSColumn3D;
        Chart2.AddHeader("canvasBgColor""F6DFD9");
        Chart2.AddHeader("divlinecolor""F47E00");

        Chart3.PxDataSource = wquStatistics;
        Chart3.FieldName = "name";
        Chart3.FieldValue = "pocet";

        Chart3.Caption = "Statistics genres";
        Chart3.SubCaption = "Summary of genres for all CD titles";

        //Chart3.Caption = "Statistics of genres";
        //Chart3.SubCaption = "A summary of genres for all CD titles";

        //Chart.Width = 800;
        //Chart.Height = 800;

        Chart3.TypeChart = PxChart.PxChart.enumTypeCharts.tcPie3D;
        Chart3.AddHeader("canvasBgColor""F6DFD9");
        Chart3.AddHeader("divlinecolor""F47E00");
    }

}

Return to original page