/// <summary>
        /// Gets the data update job data
        /// </summary>
        /// <returns>Excel Spreadsheet</returns>
        public bool GetDataUpdateJob()
        {
            SqlRunner sqlRunner = new SqlRunner();

            // create a work book and add the duj data into their own seperate sheets
            ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
            using (ExcelPackage pck = new ExcelPackage(new FileInfo(dc.Export + ExportName)))
            {
                pck.Workbook.Worksheets.Add("Status").Cells["A1"].LoadFromDataTable(sqlRunner.RunSQLDataTable("DataUpdateJobStatus"), true, tableStyle).AutoFitColumns();
                pck.Workbook.Worksheets.Add("Error Log").Cells["A1"].LoadFromDataTable(sqlRunner.RunSQLDataTable("DataUpdateJobErrorLog"), true, tableStyle).AutoFitColumns();
                pck.Workbook.Worksheets.Add("Error Severe").Cells["A1"].LoadFromDataTable(sqlRunner.RunSQLDataTable("DataUpdateJobErrorSevere"), true, tableStyle).AutoFitColumns();
                pck.Workbook.Worksheets.Add("Parallel Step").Cells["A1"].LoadFromDataTable(sqlRunner.RunSQLDataTable("DataUpdateJobParallel"), true, tableStyle).AutoFitColumns();

                TabColor(pck, "RowCount", wsName: "Status");
                TabColor(pck, "RowCount", wsName: "Error Log");
                TabColor(pck, "RowCount", wsName: "Error Severe");
                TabColor(pck, "RowCount", wsName: "Parallel Step");

                pck.Save();
            }

            if (File.Exists(dc.Export + ExportName))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public DataTable IsUpdateRequired()
        {
            XmlDocument doc = new XmlDocument();
            DataTable   dt  = new DataTable();
            SqlRunner   sql = new SqlRunner();

            var o = GetDataFromAPI().Content;

            doc.LoadXml(o);

            dt.Columns.Add("Type");
            dt.Columns.Add("Current Version");
            dt.Columns.Add("Latest Version");
            dt.Columns.Add("Update Required");

            foreach (XmlNode appNode in doc.DocumentElement.ChildNodes)
            {
                if (appNode.InnerText.Contains("Snow License Manager 9"))
                {
                    foreach (XmlNode versionNode in appNode.ChildNodes)
                    {
                        if (versionNode.Name == "Version")
                        {
                            DataRow dr = dt.NewRow();
                            string  SVRLicenseManagerVersion = sql.RunSQLString("LicenseManagerVersion");
                            dr["Type"]            = "Snow License Manager";
                            dr["Current Version"] = SVRLicenseManagerVersion;
                            dr["Latest Version"]  = versionNode.InnerText;
                            dr["Update Required"] = VersionCheck(SVRLicenseManagerVersion, versionNode.InnerText);
                            dt.Rows.Add(dr);
                        }
                    }
                }

                if (appNode.InnerText.Contains("Snow Inventory Server 6"))
                {
                    foreach (XmlNode versionNode in appNode.ChildNodes)
                    {
                        if (versionNode.Name == "Version")
                        {
                            DataRow dr = dt.NewRow();
                            string  SVRInventoryServerVersion = sql.RunSQLString("InventoryServerVersion");
                            dr["Type"]            = "Snow Inventory Server";
                            dr["Current Version"] = SVRInventoryServerVersion;
                            dr["Latest Version"]  = versionNode.InnerText;
                            dr["Update Required"] = VersionCheck(SVRInventoryServerVersion, versionNode.InnerText);
                            dt.Rows.Add(dr);
                        }
                    }
                }
            }

            return(dt);
        }
        public DataTable ReportedYesterday()
        {
            SqlRunner sqlRunner = new SqlRunner();

            return(sqlRunner.RunSQLDataTable("LicenseManagerReportedToday"));
        }
        public string SRSImportDate()
        {
            SqlRunner sqlRunner = new SqlRunner();

            return(sqlRunner.RunSQLString("SRSUpdateDate"));
        }
        public DataTable AdobeImport()
        {
            SqlRunner sqlRunner = new SqlRunner();

            return(sqlRunner.RunSQLDataTable("AdobeImport"));
        }
        public DataTable Office365Import()
        {
            SqlRunner sqlRunner = new SqlRunner();

            return(sqlRunner.RunSQLDataTable("Office365Import"));
        }
Beispiel #7
0
        public DataTable ReportedToday()
        {
            SqlRunner sqlRunner = new SqlRunner();

            return(sqlRunner.RunSQLDataTable("InventoryReportedToday"));
        }