Exemplo n.º 1
0
        public CustomGenericList <PDFStats> PDFStatsSelectExpanded(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFStatsSelectExpanded", connection, transaction))
            {
                CustomGenericList <CustomDataRow> list        = CustomSqlHelper.ExecuteReaderAndReturnRows(command);
                CustomGenericList <PDFStats>      listOfStats = new CustomGenericList <PDFStats>();
                foreach (CustomDataRow row in list)
                {
                    PDFStats stats = new PDFStats();
                    stats.Year                    = (int)row["Year"].Value;
                    stats.Week                    = (int)row["Week"].Value;
                    stats.PdfStatusID             = (int)row["PdfStatusID"].Value;
                    stats.PdfStatusName           = row["PdfStatusName"].Value.ToString();
                    stats.NumberofPdfs            = (int)row["NumberOfPDFs"].Value;
                    stats.PdfsWithOcr             = (int)row["PDFsWithOCR"].Value;
                    stats.PdfsWithArticleMetadata = (int)row["PDFsWithArticleMetadata"].Value;
                    stats.PdfsWithMissingImages   = (int)row["PDFsWithMissingImages"].Value;
                    stats.PdfsWithMissingOcr      = (int)row["PDFsWithMissingOCR"].Value;
                    stats.TotalMissingImages      = (int)row["TotalMissingImages"].Value;
                    stats.TotalMissingOcr         = (int)row["TotalMissingOCR"].Value;
                    stats.TotalMinutesToGenerate  = (int?)row["TotalMinutesToGenerate"].Value;
                    stats.AveMinutesToGenerate    = Convert.ToDouble(row["AvgMinutesToGenerate"].Value);
                    listOfStats.Add(stats);
                }

                return(listOfStats);
            }
        }
Exemplo n.º 2
0
 protected void gv_SummaryRowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         PDFStats stats = (PDFStats)e.Row.DataItem;
         _totalSummaryPdfs                += stats.NumberofPdfs;
         _totalSummaryPdfsWithOcr         += stats.PdfsWithOcr;
         _totalSummaryPdfsWithArticleInfo += stats.PdfsWithArticleMetadata;
         _totalSummaryPdfsMissingImages   += stats.PdfsWithMissingImages;
         _totalSummaryPdfsMissingOcr      += stats.PdfsWithMissingOcr;
     }
     else if (e.Row.RowType == DataControlRowType.Footer)
     {
         e.Row.Cells[0].Text = "Total";
         e.Row.Cells[1].Text = _totalSummaryPdfs.ToString();
         e.Row.Cells[2].Text = _totalSummaryPdfsWithOcr.ToString();
         e.Row.Cells[3].Text = _totalSummaryPdfsWithArticleInfo.ToString();
         e.Row.Cells[4].Text = _totalSummaryPdfsMissingImages.ToString();
         e.Row.Cells[5].Text = _totalSummaryPdfsMissingOcr.ToString();
     }
 }
Exemplo n.º 3
0
        protected void gv_ExpandedRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                PDFStats stats = (PDFStats)e.Row.DataItem;
                _totalExpandedPdfs                += stats.NumberofPdfs;
                _totalExpandedPdfsWithOcr         += stats.PdfsWithOcr;
                _totalExpandedPdfsWithArticleInfo += stats.PdfsWithArticleMetadata;
                _totalExpandedPdfsMissingImages   += stats.PdfsWithMissingImages;
                _totalExpandedPdfsMissingOcr      += stats.PdfsWithMissingOcr;
                _totalExpandedMissingImages       += stats.TotalMissingImages;
                _totalExpandedMissingOcr          += stats.TotalMissingOcr;
                _totalExpandedMinutes             += (stats.TotalMinutesToGenerate == null ? 0 : stats.TotalMinutesToGenerate);

                if (stats.PdfStatusID == 40)
                {
                    e.Row.BackColor = System.Drawing.Color.MistyRose;
                }
                //if (stats.PdfsWithMissingImages > 0) e.Row.Cells[6].BackColor = System.Drawing.Color.MistyRose;
                //if (stats.PdfsWithMissingOcr > 0) e.Row.Cells[7].BackColor = System.Drawing.Color.MistyRose;
                //if (stats.TotalMissingImages > 0) e.Row.Cells[8].BackColor = System.Drawing.Color.MistyRose;
                //if (stats.TotalMissingOcr > 0) e.Row.Cells[9].BackColor = System.Drawing.Color.MistyRose;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[0].Text  = "Total";
                e.Row.Cells[3].Text  = _totalExpandedPdfs.ToString();
                e.Row.Cells[4].Text  = _totalExpandedPdfsWithOcr.ToString();
                e.Row.Cells[5].Text  = _totalExpandedPdfsWithArticleInfo.ToString();
                e.Row.Cells[6].Text  = _totalExpandedPdfsMissingImages.ToString();
                e.Row.Cells[7].Text  = _totalExpandedPdfsMissingOcr.ToString();
                e.Row.Cells[8].Text  = _totalExpandedMissingImages.ToString();
                e.Row.Cells[9].Text  = _totalExpandedMissingOcr.ToString();
                e.Row.Cells[10].Text = ((double)_totalExpandedMinutes / (double)_totalExpandedPdfs).ToString("#.00");
            }
        }