protected void Page_Load(object sender, EventArgs e)
        {
            String institutionName = Request.QueryString["i"] as String;
            if (institutionName == null) institutionName = "";
            String m = Request.QueryString["m"] as String;
            if (m == null) m = "False";
            if (m != "True" && m != "False") m = "False";
            bool showMonthly = (m == "True" ? true : false);

            Response.Clear();
            Response.AppendHeader("Content-Type", "application/vnd.ms-excel");
            Response.AppendHeader("Content-Disposition", "attachment; filename=BHLExpandedStats.xls");

            BHLProvider provider = new BHLProvider();

            gvProductionTitles.Columns[1].Visible = showMonthly;
            gvProductionTitles.Columns[2].Visible = showMonthly;
            gvProductionItems.Columns[1].Visible = showMonthly;
            gvProductionItems.Columns[2].Visible = showMonthly;
            gvScannedItems.Columns[1].Visible = showMonthly;
            gvScannedItems.Columns[2].Visible = showMonthly;
            gvProductionPages.Columns[1].Visible = showMonthly;
            gvProductionPages.Columns[2].Visible = showMonthly;
            gvProductionNames.Columns[1].Visible = showMonthly;
            gvProductionNames.Columns[2].Visible = showMonthly;

            gvProductionTitles.DataSource = provider.MonthlyStatsSelectByStatType("Titles Created", institutionName, showMonthly);
            gvProductionItems.DataSource = provider.MonthlyStatsSelectByStatType("Items Created", institutionName, showMonthly);
            gvScannedItems.DataSource = provider.MonthlyStatsSelectByStatType("Items Scanned", institutionName, showMonthly);
            gvProductionPages.DataSource = provider.MonthlyStatsSelectByStatType("Pages Created", institutionName, showMonthly);
            gvProductionNames.DataSource = provider.MonthlyStatsSelectByStatType("PageNames Created", institutionName, showMonthly);

            gvProductionTitles.DataBind();
            gvProductionItems.DataBind();
            gvScannedItems.DataBind();
            gvProductionPages.DataBind();
            gvProductionNames.DataBind();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string institutionName = String.Empty;
            bool showMonthly = false;
            BHLProvider provider = new BHLProvider();

            if (!this.IsPostBack)
            {
                CustomGenericList<Institution> institutions = provider.InstituationSelectAll();
                foreach (Institution institution in institutions)
                {
                    ddlInstitutions.Items.Add(new ListItem(institution.InstitutionName, institution.InstitutionName));
                }
            }

            institutionName = ddlInstitutions.SelectedValue;
            showMonthly = chkShowMonthly.Checked;

            if (showMonthly)
            {
                gvProductionTitlesByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Titles Created", institutionName, showMonthly);
                gvProductionItemsByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Items Created", institutionName, showMonthly);
                gvScannedItemsByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Items Scanned", institutionName, showMonthly);
                gvProductionPagesByMonth.DataSource = provider.MonthlyStatsSelectByStatType("Pages Created", institutionName, showMonthly);
                gvProductionNamesByMonth.DataSource = provider.MonthlyStatsSelectByStatType("PageNames Created", institutionName, showMonthly);
                gvProductionTitlesByMonth.DataBind();
                gvProductionItemsByMonth.DataBind();
                gvScannedItemsByMonth.DataBind();
                gvProductionPagesByMonth.DataBind();
                gvProductionNamesByMonth.DataBind();
            }
            else
            {
                gvProductionTitles.DataSource = provider.MonthlyStatsSelectByStatType("Titles Created", institutionName, showMonthly);
                gvProductionItems.DataSource = provider.MonthlyStatsSelectByStatType("Items Created", institutionName, showMonthly);
                gvScannedItems.DataSource = provider.MonthlyStatsSelectByStatType("Items Scanned", institutionName, showMonthly);
                gvProductionPages.DataSource = provider.MonthlyStatsSelectByStatType("Pages Created", institutionName, showMonthly);
                gvProductionNames.DataSource = provider.MonthlyStatsSelectByStatType("PageNames Created", institutionName, showMonthly);
                gvProductionTitles.DataBind();
                gvProductionItems.DataBind();
                gvScannedItems.DataBind();
                gvProductionPages.DataBind();
                gvProductionNames.DataBind();
            }
        }