示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4200;
            MasterPage.IsSecure           = true;
            if (!IsPostBack)
            {
                MasterPage.PageTitle = string.Format("{0}", "Physical Prizes Report");

                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4200;
            MasterPage.IsSecure           = true;
            MasterPage.PageTitle          = "Program By Branch Report";
            AlertPanel.Visible            = !string.IsNullOrEmpty(AlertMessage.Text);

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4200;
            MasterPage.IsSecure           = true;

            if (!IsPostBack)
            {
                MasterPage.PageTitle = string.Format("{0}", "At-a-glance Report - Items Earned by Patrons");
                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());
                var tenant = GRA.SRP.Core.Utilities.Tenant.FetchObject((int)CRTenantID);
                OrganizationName.Text = tenant.LandingName;
            }

            UpdateReport();
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.PageTitle          = string.Format("{0} Report", ReportName);
            MasterPage.RequiredPermission = 4200;
            MasterPage.IsSecure           = true;
            AlertPanel.Visible            = false;

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());
                ReportPanel.Visible = false;
            }
            else
            {
                ReportPanel.Visible = EventRepeater.Items.Count > 0;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.PageTitle          = "Event Codes Report";
            MasterPage.RequiredPermission = 4200;
            MasterPage.IsSecure           = true;
            AlertPanel.Visible            = false;

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());
                ReportPanel.Visible = false;
            }
            else
            {
                if (EventRepeater.Items.Count == 0)
                {
                    ReportPanel.Visible = false;
                }
                else
                {
                    ReportPanel.Visible = true;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MasterPage.IsSecure  = true;
                MasterPage.PageTitle = string.Format("{0}", "Statistics Dashboard");

                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());

                var ds = SqlHelper.ExecuteDataset(conn, CommandType.StoredProcedure, "rpt_DashboardStats");

                GetRegByProg(ds.Tables[0]);
                GetFinisherByProg(ds.Tables[1]);

                GetRegAgeByProgLabels(ds.Tables[2]);
                GetRegAgeByProg(ds.Tables[3]);

                GetFinisherAgeByProgLabels(ds.Tables[4]);
                GetFinisherAgeByProg(ds.Tables[5]);

                GetRegGenderByProg(ds.Tables[6]);
                GetFinisherGenderByProg(ds.Tables[7]);
            }
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4200;
            MasterPage.IsSecure           = true;
            AlertPanel.Visible            = false;

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.ReportsRibbon());
            }

            string tenantName = "Summary";

            var tenant = GRA.SRP.Core.Utilities.Tenant.FetchObject((int)CRTenantID);

            if (tenant != null)
            {
                tenantName = tenant.LandingName;
            }

            var ds = SqlHelper.ExecuteDataset(conn,
                                              CommandType.StoredProcedure,
                                              "rpt_ProgramByBranch",
                                              new SqlParameter[]
            {
                new SqlParameter("@TenID", CRTenantID == null ? -1 : CRTenantID)
            }
                                              );

            // fix table names
            if (ds.Tables != null && ds.Tables.Count >= 1 && ds.Tables[0].Rows.Count != 0)
            {
                ds.Tables[0].TableName = tenantName;
                int count = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (ds.Tables.Count > count - 1 && ds.Tables[count] != null)
                    {
                        ds.Tables[count].TableName = row["Program"].ToString();
                    }
                    count++;
                }

                // add total rows
                count = 0;
                foreach (DataTable table in ds.Tables)
                {
                    var signupTotal   = table.Compute("Sum(Signups)", "");
                    var achieverTotal = table.Compute("Sum(Achievers)", "");
                    var totalRow      = table.NewRow();
                    int field         = 0;
                    totalRow[field] = "Total";
                    if (count > 0)
                    {
                        field++;
                    }
                    totalRow[++field] = signupTotal;
                    totalRow[++field] = achieverTotal;
                    table.Rows.Add(totalRow);

                    string completionRate = string.Empty;
                    if ((long)signupTotal > 0)
                    {
                        completionRate = string.Format("{0:N2}%",
                                                       Convert.ToDouble(achieverTotal) * 100 / Convert.ToDouble(signupTotal));
                    }
                    var completionRow = table.NewRow();
                    completionRow[0] = string.Format("Completion rate: {0}", completionRate);
                    table.Rows.Add(completionRow);

                    count++;
                }

                CreateExcelFile.CreateExcelDocument(
                    ds,
                    string.Format("{0}-ProgramByBranch.xlsx", DateTime.Now.ToString("yyyyMMdd")),
                    Response);
            }
            else
            {
                AlertPanel.Visible = true;
                AlertMessage.Text  = "Could not find any report data.";
            }
        }