Ejemplo n.º 1
0
        //Get Data Queue Statistics report of  API Usages
        public ActionResult OIAPIUsageStatisticsGrid(bool IsDownload = false)
        {
            OIDashboardFacade fac = new OIDashboardFacade(this.CurrentClient.ApplicationDBConnectionString);
            DataSet           ds  = fac.GetDashboardQueueCount();
            DataTable         dt  = new DataTable();

            if (ds != null && ds.Tables.Count > 0)
            {
                dt = ds.Tables[0];
                if (dt != null && dt.Rows != null && dt.Rows.Count != 0)
                {
                    if (dt.Rows[0]["Importdate"] == DBNull.Value)
                    {
                        dt.Rows[0]["Importdate"] = DateTime.Now;
                    }
                    DataRow firstRow = (dt.Rows[0] as DataRow).Copy();
                    dt.Rows.Add(firstRow.ItemArray);
                    dt.Rows.RemoveAt(0);
                }
            }
            if (dt != null && IsDownload)
            {
                string fileName  = "OI Data Queue Statistics_" + DateTime.Now.Ticks.ToString() + ".xlsx";
                string SheetName = "OI Data Queue Statistics";
                byte[] response  = CommonExportMethods.ExportExcelFile(dt, fileName, SheetName);
                return(File(response, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName));
            }
            else
            {
                ViewBag.DownloadErrormessage = CommonMessagesLang.msgCommanErrorMessage;
            }
            return(View("~/Views/OI/OIHome/OIAPIUsageStatisticsGrid.cshtml", dt));
        }
Ejemplo n.º 2
0
        public OIDashboard GetOIDashboard()
        {
            //Set Data Queue count
            OIDashboard       oIDashboard = new OIDashboard();
            OIDashboardFacade fac         = new OIDashboardFacade(this.CurrentClient.ApplicationDBConnectionString);
            DataSet           ds          = fac.GetDashboardQueueCount();

            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                if (dt != null && dt.Rows != null && dt.Rows.Count > 0)
                {
                    oIDashboard.ImportProcess                       = dt.Rows[0]["ImportProcess"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["ImportProcess"]);
                    oIDashboard.AllCount                            = dt.Rows[0]["TotalRecordCount"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["TotalRecordCount"]);
                    oIDashboard.InputRecordCount                    = dt.Rows[0]["InputRecordCount"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["InputRecordCount"]);
                    oIDashboard.UnMatchRecordCount                  = dt.Rows[0]["UnMatchedRecordCount"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["UnMatchedRecordCount"]);
                    oIDashboard.MatchedOutputQueueCount             = dt.Rows[0]["MatchedOutputQueueCount"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["MatchedOutputQueueCount"]);
                    oIDashboard.ArchivalQueueCount                  = dt.Rows[0]["ArchivalQueueCount"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["ArchivalQueueCount"]);
                    oIDashboard.FirmographicsExportQueueCount       = dt.Rows[0]["FirmographicsExportQueueCount"] is DBNull ? "" : Convert.ToString(dt.Rows[0]["FirmographicsExportQueueCount"]);
                    oIDashboard.FormatAllCount                      = CommonMethod.FormatNumber(oIDashboard.AllCount);
                    oIDashboard.FormatUnMatchRecordCount            = CommonMethod.FormatNumber(oIDashboard.UnMatchRecordCount);
                    oIDashboard.FormatMatchedOutputQueueCount       = CommonMethod.FormatNumber(oIDashboard.MatchedOutputQueueCount);
                    oIDashboard.FormatArchivalQueueCount            = CommonMethod.FormatNumber(oIDashboard.ArchivalQueueCount);
                    oIDashboard.FormatFirmographicsExportQueueCount = CommonMethod.FormatNumber(oIDashboard.FirmographicsExportQueueCount);
                    oIDashboard.FormatInputRecordCount              = CommonMethod.FormatNumber(oIDashboard.InputRecordCount);
                }
                else
                {
                    oIDashboard.ImportProcess                       = "0";
                    oIDashboard.InputRecordCount                    = "0";
                    oIDashboard.AllCount                            = "0";
                    oIDashboard.UnMatchRecordCount                  = "0";
                    oIDashboard.MatchedOutputQueueCount             = "0";
                    oIDashboard.ArchivalQueueCount                  = "0";
                    oIDashboard.FirmographicsExportQueueCount       = "0";
                    oIDashboard.FormatAllCount                      = "0";
                    oIDashboard.FormatUnMatchRecordCount            = "0";
                    oIDashboard.FormatMatchedOutputQueueCount       = "0";
                    oIDashboard.FormatArchivalQueueCount            = "0";
                    oIDashboard.FormatFirmographicsExportQueueCount = "0";
                    oIDashboard.FormatInputRecordCount              = "0";
                }
                if (ds.Tables.Count > 1)
                {
                    DataTable dt2 = ds.Tables[1];
                    if (dt2 != null && dt2.Rows != null && dt2.Rows.Count > 0)
                    {
                        oIDashboard.CorporateTreeExportQueueCount       = dt2.Rows[0]["CorporateTreeExportQueueCount"] is DBNull ? "" : Convert.ToString(dt2.Rows[0]["CorporateTreeExportQueueCount"]);
                        oIDashboard.FormatCorporateTreeExportQueueCount = CommonMethod.FormatNumber(oIDashboard.CorporateTreeExportQueueCount);
                    }
                }
            }
            return(oIDashboard);
        }