Big update: MessageID replaced with Hash of MessageID

This commit is contained in:
Jonathan Jenne
2023-07-03 16:35:24 +02:00
parent 2b21650c53
commit aa5a268e14
14 changed files with 523 additions and 538 deletions

View File

@@ -0,0 +1,72 @@
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Base
Public Class ClassConfig
Public Class Config
Public Property PathError As String
Public Property PathAttachments As String
Public Property BodyFont As String
Public Property WindreamConnectionString As String
Public Property TimerInterval As Integer
Public Property WindreamDrive As String = "W"
End Class
Private ReadOnly Logger As Logger
Private ReadOnly Database As MSSQLServer
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
Logger = pLogConfig.GetLogger()
Database = pDatabase
End Sub
Private Function GetConfigTable() As DataTable
Dim oSQL As String = "SELECT * FROM TBEMLP_CONFIG"
Dim oTable As DataTable = Database.GetDatatable(oSQL)
Return oTable
End Function
Private Function GetBaseConfigTable() As DataTable
Dim oSQL As String = "SELECT * FROM TBDD_BASECONFIG"
Dim oTable As DataTable = Database.GetDatatable(oSQL)
Return oTable
End Function
Public Function GetConfig() As Config
Dim oConfigTable = GetConfigTable()
Dim oBaseTable = GetBaseConfigTable()
If oBaseTable Is Nothing Then
Logger.Warn("Config from TBDD_BASECONFIG could not be loaded!")
Return Nothing
End If
If oBaseTable.Rows.Count = 0 Then
Logger.Warn("Config from TBDD_BASECONFIG could not be loaded!")
Return Nothing
End If
If oConfigTable Is Nothing Then
Logger.Warn("Config from TBEMLP_CONFIG could not be loaded!")
Return Nothing
End If
If oConfigTable.Rows.Count = 0 Then
Logger.Warn("Config from TBEMLP_CONFIG is empty!")
Return Nothing
End If
Dim oRow As DataRow = oConfigTable.Rows.Item(0)
Dim oConfig As New Config With {
.PathAttachments = oRow.ItemEx("PATH_EMAIL_TEMP", ""),
.PathError = oRow.ItemEx("PATH_EMAIL_ERRORS", ""),
.BodyFont = oRow.ItemEx("FONT_BODY", "Arial"),
.TimerInterval = oRow.ItemEx("CHECK_INTERVALL_MINUTES", 5),
.WindreamConnectionString = oRow.ItemEx("WM_CON_STRING", ""),
.WindreamDrive = oRow.ItemEx("WM_DRIVE", "W")
}
Return oConfig
End Function
End Class