This commit is contained in:
2021-09-07 16:35:17 +02:00
parent d5aeb55704
commit 1f392ca41b
51 changed files with 6881 additions and 1404 deletions

View File

@@ -6,6 +6,7 @@ Imports DigitalData.Modules.Config
Imports System.Threading
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.Database
Public Class ClassInit
Public _lizenzManager As ClassLicenseManager
@@ -74,19 +75,19 @@ Public Class ClassInit
If CONFIG.Config.ConnectionStringTest <> String.Empty And CONFIG.Config.TestMode = True Then
LOGGER.Debug("Test Connection String loaded")
CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionStringTest)
CONNECTION_STRING_ECM = DecryptConnectionString(CONFIG.Config.ConnectionStringTest)
Else
LOGGER.Debug("Connection String loaded")
CONNECTION_STRING = DecryptConnectionString(CONFIG.Config.ConnectionString)
CONNECTION_STRING_ECM = DecryptConnectionString(CONFIG.Config.ConnectionString)
End If
If CONFIG.Config.ConnectionStringAppServer <> String.Empty Then
LOGGER.Debug("ConnectionStringAppServer will be used")
CONNECTION_STRING_APP_SERVER = DecryptConnectionString(CONFIG.Config.ConnectionStringAppServer)
CONNECTION_STRING_READ = CONNECTION_STRING_APP_SERVER
Else
CONNECTION_STRING_READ = CONNECTION_STRING
End If
'If CONFIG.Config.ConnectionStringAppServer <> String.Empty Then
' LOGGER.Debug("ConnectionStringAppServer will be used")
' CONNECTION_STRING_APP_SERVER = DecryptConnectionString(CONFIG.Config.ConnectionStringAppServer)
' CONNECTION_STRING_READ = CONNECTION_STRING_APP_SERVER
'Else
' CONNECTION_STRING_READ = CONNECTION_STRING_ECM
'End If
If CONFIG.Config.EDMIAppServer <> String.Empty Then
@@ -116,8 +117,12 @@ Public Class ClassInit
USER_MANAGER_PATH = CONFIG.Config.UserManagerPath
LOG_ERRORS_ONLY = CONFIG.Config.LogErrorsOnly
LOGCONFIG.Debug = Not LOG_ERRORS_ONLY
USER_CONFIG_DEBUG = CONFIG.Config.DEBUG
If USER_CONFIG_DEBUG = True Then
DEBUG = True
LOGCONFIG.Debug = True
End If
TEST_MODE = CONFIG.Config.TestMode
Catch ex As Exception
LOGGER.Error(ex)
@@ -153,22 +158,36 @@ Public Class ClassInit
Public Function InitDatabase()
Dim dbResult As Boolean
If CONNECTION_STRING <> String.Empty Then
dbResult = ClassDatabase.Init()
Else
If CONNECTION_STRING_ECM = String.Empty Then
MsgBox("No Databaseconnection configured. (First Start or Appdata not accessible)" & vbNewLine & "Basic-Config will be loaded.", MsgBoxStyle.Information)
ERROR_STATE = "NO DB-CONNECTION"
frmKonfig.ShowDialog()
dbResult = ClassDatabase.Init()
End If
If CONNECTION_STRING_APP_SERVER <> String.Empty Then
If ClassDatabase.Init(CONNECTION_STRING_APP_SERVER) = False Then
MsgBox("ApplicationServer can not be reached! Check Your configuration.", MsgBoxStyle.Information)
If dbResult = True Then
CONNECTION_STRING_READ = CONNECTION_STRING
End If
Database_ECM = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_ECM)
If Database_ECM.DBInitialized = True Then
ClassDatabase.Init(CONNECTION_STRING_ECM)
dbResult = True
Else
dbResult = False
End If
If CONNECTION_STRING_IDB <> String.Empty Then
Database_IDB = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_ECM)
If Database_IDB.DBInitialized = True Then
IDB_ACTIVE = True
LOGGER.Info("IDB is active via Config")
End If
End If
'If CONNECTION_STRING_APP_SERVER <> String.Empty Then
' Database_APPSERVER = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_APP_SERVER)
' If Database_APPSERVER.DBInitialized = False Then
' MsgBox("ApplicationServer can not be reached! Check Your configuration.", MsgBoxStyle.Information)
' If dbResult = True Then
' CONNECTION_STRING_READ = CONNECTION_STRING_ECM
' End If
' End If
'End If