Update attachment filename to fix length and character errors in windream
This commit is contained in:
@@ -21,52 +21,69 @@ Public Class ClassConfig
|
||||
End Sub
|
||||
|
||||
Private Function GetConfigTable() As DataTable
|
||||
Dim oSQL As String = "SELECT * FROM TBEMLP_CONFIG"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
Return oTable
|
||||
Try
|
||||
Logger.Debug("Getting Config Table..")
|
||||
Dim oSQL As String = "SELECT * FROM TBEMLP_CONFIG"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
Return oTable
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetBaseConfigTable() As DataTable
|
||||
Dim oSQL As String = "SELECT * FROM TBDD_BASECONFIG"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
Return oTable
|
||||
Try
|
||||
Logger.Debug("Getting Base Config Table..")
|
||||
Dim oSQL As String = "SELECT * FROM TBDD_BASECONFIG"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
Return oTable
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetConfig() As Config
|
||||
Dim oConfigTable = GetConfigTable()
|
||||
Dim oBaseTable = GetBaseConfigTable()
|
||||
Try
|
||||
Dim oConfigTable = GetConfigTable()
|
||||
Dim oBaseTable = GetBaseConfigTable()
|
||||
|
||||
If oBaseTable Is Nothing Then
|
||||
Logger.Warn("Config from TBDD_BASECONFIG could not be loaded!")
|
||||
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
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
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 Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user