Zooflow: Fix wrong image on dragdrop, prepare removal of manual database config
This commit is contained in:
@@ -37,7 +37,7 @@ Public Class ClassInit
|
||||
|
||||
' === Init Schritte definieren
|
||||
_Loader.AddStep("Initializing Base", AddressOf InitializeBase, True)
|
||||
_Loader.AddStep("Initializing Database (1/2)", AddressOf InitializeDatabase, True)
|
||||
'_Loader.AddStep("Initializing Database (1/2)", AddressOf InitializeDatabase, True)
|
||||
_Loader.AddStep("Initializing EDMI Service", AddressOf InitializeService, True)
|
||||
_Loader.AddStep("Initializing Database (2/2)", AddressOf InitializeDatabaseWithFallback, True)
|
||||
_Loader.AddStep("Initializing User", AddressOf InitializeUser, True)
|
||||
@@ -59,55 +59,55 @@ Public Class ClassInit
|
||||
End Sub
|
||||
|
||||
Private Sub InitializeDatabase(MyApplication As My.MyApplication)
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(My.SystemConfig.ConnectionString)
|
||||
My.DatabaseECM = New MSSQLServer(My.LogConfig, oConnectionString)
|
||||
'Dim oConnectionString = MSSQLServer.DecryptConnectionString(My.SystemConfig.ConnectionString)
|
||||
'My.DatabaseECM = New MSSQLServer(My.LogConfig, oConnectionString)
|
||||
|
||||
If My.DatabaseECM.DBInitialized = False Then
|
||||
Logger.Warn("Could not initialize DD_ECM-Database!")
|
||||
Throw New InitException("Could not initialize ECM-Database!")
|
||||
'If My.DatabaseECM.DBInitialized = False Then
|
||||
' Logger.Warn("Could not initialize DD_ECM-Database!")
|
||||
' Throw New InitException("Could not initialize ECM-Database!")
|
||||
|
||||
Else
|
||||
Dim oSQl = "SELECT * FROM TBDD_CONNECTION WHERE BEZEICHNUNG = 'IDB' AND AKTIV = 1"
|
||||
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl)
|
||||
'Else
|
||||
' Dim oSQl = "SELECT * FROM TBDD_CONNECTION WHERE BEZEICHNUNG = 'IDB' AND AKTIV = 1"
|
||||
' Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl)
|
||||
|
||||
If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then
|
||||
' If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then
|
||||
|
||||
Dim oForm As New frmSQLConfig(My.LogConfig) With {.FormTitle = "IDB Datenbank"}
|
||||
Dim oResult = oForm.ShowDialog()
|
||||
' Dim oForm As New frmSQLConfig(My.LogConfig) With {.FormTitle = "IDB Datenbank"}
|
||||
' Dim oResult = oForm.ShowDialog()
|
||||
|
||||
If oResult = DialogResult.OK Then
|
||||
Dim oConnectionStringSaved = SaveConnectionString(oForm.ConnectionString)
|
||||
' If oResult = DialogResult.OK Then
|
||||
' Dim oConnectionStringSaved = SaveConnectionString(oForm.ConnectionString)
|
||||
|
||||
If oConnectionStringSaved = False Then
|
||||
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||
End If
|
||||
' If oConnectionStringSaved = False Then
|
||||
' Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||
' End If
|
||||
|
||||
oDatatable = My.Database.GetDatatableECM(oSQl)
|
||||
End If
|
||||
' oDatatable = My.Database.GetDatatableECM(oSQl)
|
||||
' End If
|
||||
|
||||
End If
|
||||
' End If
|
||||
|
||||
If oDatatable.Rows.Count > 1 Then
|
||||
Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!")
|
||||
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||
End If
|
||||
' If oDatatable.Rows.Count > 1 Then
|
||||
' Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!")
|
||||
' Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||
' End If
|
||||
|
||||
Dim oDataRow As DataRow = oDatatable.Rows.Item(0)
|
||||
Dim oConString = My.DatabaseECM.GetConnectionString(
|
||||
oDataRow.Item("SERVER").ToString,
|
||||
oDataRow.Item("DATENBANK").ToString,
|
||||
oDataRow.Item("USERNAME").ToString,
|
||||
oDataRow.Item("PASSWORD").ToString
|
||||
)
|
||||
' Dim oDataRow As DataRow = oDatatable.Rows.Item(0)
|
||||
' Dim oConString = My.DatabaseECM.GetConnectionString(
|
||||
' oDataRow.Item("SERVER").ToString,
|
||||
' oDataRow.Item("DATENBANK").ToString,
|
||||
' oDataRow.Item("USERNAME").ToString,
|
||||
' oDataRow.Item("PASSWORD").ToString
|
||||
' )
|
||||
|
||||
Dim oDecryptedConnectionString = MSSQLServer.DecryptConnectionString(oConString)
|
||||
My.DatabaseIDB = New MSSQLServer(My.LogConfig, oDecryptedConnectionString)
|
||||
End If
|
||||
' Dim oDecryptedConnectionString = MSSQLServer.DecryptConnectionString(oConString)
|
||||
' My.DatabaseIDB = New MSSQLServer(My.LogConfig, oDecryptedConnectionString)
|
||||
'End If
|
||||
|
||||
If My.DatabaseIDB.DBInitialized = False Then
|
||||
Logger.Warn("Could not initialize IDB-Database!")
|
||||
Throw New InitException("Could not initialize IDB-Database!")
|
||||
End If
|
||||
'If My.DatabaseIDB.DBInitialized = False Then
|
||||
' Logger.Warn("Could not initialize IDB-Database!")
|
||||
' Throw New InitException("Could not initialize IDB-Database!")
|
||||
'End If
|
||||
End Sub
|
||||
Private Sub InitializeService(MyApplication As My.MyApplication)
|
||||
Try
|
||||
@@ -137,6 +137,12 @@ Public Class ClassInit
|
||||
End Sub
|
||||
Private Sub InitializeDatabaseWithFallback(MyApplication As My.MyApplication)
|
||||
Try
|
||||
Dim oECMConnectionString = MyApplication.Service.Client.ClientConfig.ConnectionStringECM
|
||||
My.DatabaseECM = New MSSQLServer(My.LogConfig, oECMConnectionString)
|
||||
|
||||
Dim oIDBConnectionString = MyApplication.Service.Client.ClientConfig.ConnectionStringIDB
|
||||
My.DatabaseIDB = New MSSQLServer(My.LogConfig, oIDBConnectionString)
|
||||
|
||||
My.Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
@@ -262,23 +268,23 @@ Public Class ClassInit
|
||||
#End Region
|
||||
|
||||
Private Function SetupDatabase() As Boolean
|
||||
If My.SystemConfig.ConnectionString = String.Empty Then
|
||||
Dim oConnectionString = My.SystemConfig.ConnectionString
|
||||
Dim oForm As New frmSQLConfig(My.LogConfig) With {
|
||||
.ConnectionString = oConnectionString,
|
||||
.FormTitle = "ECM Datenbank"
|
||||
}
|
||||
Dim oResult = oForm.ShowDialog()
|
||||
'If My.SystemConfig.ConnectionString = String.Empty Then
|
||||
' Dim oConnectionString = My.SystemConfig.ConnectionString
|
||||
' Dim oForm As New frmSQLConfig(My.LogConfig) With {
|
||||
' .ConnectionString = oConnectionString,
|
||||
' .FormTitle = "ECM Datenbank"
|
||||
' }
|
||||
' Dim oResult = oForm.ShowDialog()
|
||||
|
||||
If oResult = DialogResult.OK Then
|
||||
My.SystemConfig.ConnectionString = oForm.ConnectionString
|
||||
My.SystemConfigManager.Save()
|
||||
' If oResult = DialogResult.OK Then
|
||||
' My.SystemConfig.ConnectionString = oForm.ConnectionString
|
||||
' My.SystemConfigManager.Save()
|
||||
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
' Return True
|
||||
' Else
|
||||
' Return False
|
||||
' End If
|
||||
'End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user