Example #1
0
        public void LoadApplicationDataSetFromDB(Data.ApplicationDataSet applicationDS)
        {
#if TRACE
            long startTicksTotal = PLLog.Trace("Start", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif

            try
            {
                long startTicks = 0;


                if (Config.ADSLoad_Servers)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill Servers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    // Intialize the TAManager and all the other TableAdapters by using the embedded ServersTableAdapter
                    // See the Get method on TaManager.
                    TaManager.ServersTableAdapter.Fill(applicationDS.Servers);
#if TRACE
                    PLLog.Trace2("End Fill Servers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_ServerInfo)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill ServerInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    ServerInfoTA.Fill(applicationDS.ServerInfo);
#if TRACE
                    PLLog.Trace2("End Fill ServerInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_Instances)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill Instances", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    InstancesTA.Fill(applicationDS.Instances);
#if TRACE
                    PLLog.Trace2("End Fill Instances", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_InstanceInfo)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill InstanceInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    InstanceInfoTA.Fill(applicationDS.InstanceInfo);
#if TRACE
                    PLLog.Trace2("End Fill InstanceInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_Jobs)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill Jobs", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    JobsTA.Fill(applicationDS.Jobs);
#if TRACE
                    PLLog.Trace2("End Fill Jobs", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_Logins)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill Logins", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    LoginsTA.Fill(applicationDS.Logins);
#if TRACE
                    PLLog.Trace2("End Fill Logins", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_ServerRoles)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill ServerRoles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    ServerRolesTA.Fill(applicationDS.ServerRoles);
#if TRACE
                    PLLog.Trace2("End Fill ServerRoles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_Databases)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill Databases", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DatabasesTA.Fill(applicationDS.Databases);
#if TRACE
                    PLLog.Trace2("End Fill Databases", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DatabaseInfo)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DatabaseInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DatabaseInfoTA.Fill(applicationDS.DatabaseInfo);
#if TRACE
                    PLLog.Trace2("End Fill DatabaseInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBDataFiles)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBDataFiles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBDataFilesTA.Fill(applicationDS.DBDataFiles);;
#if TRACE
                    PLLog.Trace2("End Fill DBDataFiles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }
                if (Config.ADSLoad_DBDataFileInfo)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBDataFileInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBDataFileInfoTA.Fill(applicationDS.DBDataFileInfo);
#if TRACE
                    PLLog.Trace2("End Fill DBDataFileInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBDdlTriggers)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBDdlTriggers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBDdlTriggersTA.Fill(applicationDS.DBDdlTriggers);
#if TRACE
                    PLLog.Trace2("End Fill DBDdlTriggers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBFileGroups)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBFileGroups", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBFileGroupsTA.Fill(applicationDS.DBFileGroups);
#if TRACE
                    PLLog.Trace2("End Fill DBFileGroups", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBLogFiles)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBLogFiles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBLogFilesTA.Fill(applicationDS.DBLogFiles);
#if TRACE
                    PLLog.Trace2("End Fill DBLogFiles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBLogFileInfo)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBLogFileInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBLogFileInfoTA.Fill(applicationDS.DBLogFileInfo);
#if TRACE
                    PLLog.Trace2("End Fill DBLogFileInfo", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBRoles)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBRoles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBRolesTA.Fill(applicationDS.DBRoles);
                }
#if TRACE
                PLLog.Trace2("End Fill DBRoles", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif

                if (Config.ADSLoad_DBStoredProcedures)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBStoredProcedures", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBStoredProceduresTA.Fill(applicationDS.DBStoredProcedures);

#if TRACE
                    PLLog.Trace2("End Fill DBStoredProcedures", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBTables)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBTables", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBTablesTA.Fill(applicationDS.DBTables);
#if TRACE
                    PLLog.Trace2("End Fill DBTables", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBUserDefinedFunctions)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBUserDefinedFunctions", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBUserDefinedFunctionsTA.Fill(applicationDS.DBUserDefinedFunctions);
#if TRACE
                    PLLog.Trace2("End Fill DBUserDefinedFunctions", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBUsers)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBUsers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBUsersTA.Fill(applicationDS.DBUsers);;
#if TRACE
                    PLLog.Trace2("End Fill DBUsers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_DBViews)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill DBViews", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    DBViewsTA.Fill(applicationDS.DBViews);
#if TRACE
                    PLLog.Trace2("End Fill DBViews", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_TBTriggers)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill TBTriggers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    TBTriggersTA.Fill(applicationDS.TBTriggers);;
#if TRACE
                    PLLog.Trace2("End Fill TBTriggers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

                if (Config.ADSLoad_VWTriggers)
                {
#if TRACE
                    startTicks = PLLog.Trace2("Fill VWTriggers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                    VWTriggersTA.Fill(applicationDS.VWTriggers);
#if TRACE
                    PLLog.Trace2("End Fill VWTriggers", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
                }

#if TRACE
                startTicks = PLLog.Trace2("Fill LKUP_ADDomains", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                LU_ADDomainsTA.Fill(applicationDS.LKUP_ADDomains);
#if TRACE
                PLLog.Trace2("End Fill LKUP_ADDomains", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif

#if TRACE
                startTicks = PLLog.Trace2("Fill LKUP_Environments", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                LU_EnvironmentsTA.Fill(applicationDS.LKUP_Environments);
#if TRACE
                PLLog.Trace2("End Fill LKUP_Environments", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif

#if TRACE
                startTicks = PLLog.Trace2("Fill LKUP_SQLServerVersions", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 0);
#endif
                LU_SQLServerVersionsTA.Fill(applicationDS.LKUP_SQLServerVersions);
#if TRACE
                PLLog.Trace2("End Fill LKUP_SQLServerVersions", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicks);
#endif
            }
            catch (Exception ex)
            {
                PLLog.Error(string.Format("ConnectionString:>{0}<", Config.SQLMonitorDBConnection), PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 1);
                PLLog.Error(ex, PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 1);
            }

#if TRACE
            PLLog.Trace("End", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2, startTicksTotal);
#endif
        }
Example #2
0
        /// <summary>
        /// Load the tables that contain jobserver information
        /// </summary>
        /// <param name="applicationDS"></param>
        private void LoadLKUPandSupportTables(ApplicationDataSet applicationDS)
        {
#if TRACE
            long startTicksTotal = VNC.AppLog.Trace("Start", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 3);
#endif
            long startTicks = 0;

#if TRACE
            startTicks = VNC.AppLog.Trace2("Fill LKUP_ADDomains", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 50);
#endif
            lock (_concurrencyLock)
            {
                LU_ADDomainsTA.Fill(applicationDS.LKUP_ADDomains);
            }
#if TRACE
            VNC.AppLog.Trace2("End Fill LKUP_ADDomains", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 51, startTicks);
#endif

#if TRACE
            startTicks = VNC.AppLog.Trace2("Fill LKUP_Environments", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 52);
#endif
            lock (_concurrencyLock)
            {
                LU_EnvironmentsTA.Fill(applicationDS.LKUP_Environments);
            }

#if TRACE
            VNC.AppLog.Trace2("End Fill LKUP_Environments", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 53, startTicks);
#endif

#if TRACE
            startTicks = VNC.AppLog.Trace2("Fill LKUP_SecurityZones", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 54);
#endif
            lock (_concurrencyLock)
            {
                LU_SecurityZonesTA.Fill(applicationDS.LKUP_SecurityZones);
            }

#if TRACE
            VNC.AppLog.Trace2("End Fill LKUP_SecurityZones", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 55, startTicks);
#endif

#if TRACE
            startTicks = VNC.AppLog.Trace2("Fill LKUP_SQLServerVersions", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 56);
#endif
            lock (_concurrencyLock)
            {
                LU_SQLServerVersionsTA.Fill(applicationDS.LKUP_SQLServerVersions);
            }

#if TRACE
            VNC.AppLog.Trace2("End Fill LKUP_SQLServerVersions", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 57, startTicks);
#endif

#if TRACE
            startTicks = VNC.AppLog.Trace2("Fill ApplicationUsage", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 58);
#endif
            lock (_concurrencyLock)
            {
                ApplicationUsageTA.Fill(applicationDS.ApplicationUsage);
            }

#if TRACE
            VNC.AppLog.Trace2("End Fill ApplicationUsage", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 59, startTicks);
#endif

#if TRACE
            startTicks = VNC.AppLog.Trace2("Fill CrawlerExpandSettings", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 58);
#endif
            lock (_concurrencyLock)
            {
                CrawlerExpandSettingsTA.Fill(applicationDS.CrawlerExpandSettings);
            }

#if TRACE
            VNC.AppLog.Trace2("End Fill CrawlerExpandSettings", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 59, startTicks);
#endif
#if TRACE
            VNC.AppLog.Trace("End", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 62, startTicksTotal);
#endif
        }