Exemplo n.º 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
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load the tables that contain details inside a database.  These are needed for the hierarchy explorers.
        /// </summary>
        /// <param name="applicationDS"></param>
        private void LoadDBContentTables(ApplicationDataSet applicationDS)
        {
#if TRACE
            long startTicksTotal = VNC.AppLog.Trace("Start", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 3);
#endif
            long startTicks = 0;

            if (Config.ADSLoad_DBDdlTriggers)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBDdlTriggers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 26);
#endif
                lock (_concurrencyLock)
                {
                    DBDdlTriggersTA.Fill(applicationDS.DBDdlTriggers);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBDdlTriggers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 27, startTicks);
#endif
            }


            if (Config.ADSLoad_DBRoles)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBRoles", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 34);
#endif
                lock (_concurrencyLock)
                {
                    DBRolesTA.Fill(applicationDS.DBRoles);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBRoles", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 35, startTicks);
#endif
            }


            if (Config.ADSLoad_DBStoredProcedures)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBStoredProcedures", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 36);
#endif
                lock (_concurrencyLock)
                {
                    DBStoredProceduresTA.Fill(applicationDS.DBStoredProcedures);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBStoredProcedures", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 37, startTicks);
#endif
            }

            if (Config.ADSLoad_DBTables)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBTables", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 38);
#endif
                lock (_concurrencyLock)
                {
                    DBTablesTA.Fill(applicationDS.DBTables);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBTables", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 39, startTicks);
#endif
            }

            if (Config.ADSLoad_DBUserDefinedFunctions)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBUserDefinedFunctions", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 40);
#endif
                lock (_concurrencyLock)
                {
                    DBUserDefinedFunctionsTA.Fill(applicationDS.DBUserDefinedFunctions);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBUserDefinedFunctions", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 41, startTicks);
#endif
            }

            if (Config.ADSLoad_DBUsers)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBUsers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 42);
#endif
                lock (_concurrencyLock)
                {
                    DBUsersTA.Fill(applicationDS.DBUsers);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBUsers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 43, startTicks);
#endif
            }

            if (Config.ADSLoad_DBViews)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill DBViews", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 44);
#endif
                lock (_concurrencyLock)
                {
                    DBViewsTA.Fill(applicationDS.DBViews);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill DBViews", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 45, startTicks);
#endif
            }

            if (Config.ADSLoad_TBColumns)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill TBColumns", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 46);
#endif
                lock (_concurrencyLock)
                {
                    TBColumnsTA.Fill(applicationDS.TBColumns);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill TBColumns", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 47, startTicks);
#endif
            }

            if (Config.ADSLoad_TBTriggers)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill TBTriggers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 46);
#endif
                lock (_concurrencyLock)
                {
                    TBTriggersTA.Fill(applicationDS.TBTriggers);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill TBTriggers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 47, startTicks);
#endif
            }

            if (Config.ADSLoad_VWColumns)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill VWColumns", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 46);
#endif
                lock (_concurrencyLock)
                {
                    VWColumnsTA.Fill(applicationDS.VWColumns);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill VWColumns", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 47, startTicks);
#endif
            }

            if (Config.ADSLoad_VWTriggers)
            {
#if TRACE
                startTicks = VNC.AppLog.Trace2("Fill VWTriggers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 48);
#endif
                lock (_concurrencyLock)
                {
                    VWTriggersTA.Fill(applicationDS.VWTriggers);
                }
#if TRACE
                VNC.AppLog.Trace2("End Fill VWTriggers", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 49, startTicks);
#endif
            }
#if TRACE
            VNC.AppLog.Trace("End", LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 62, startTicksTotal);
#endif
        }