Compare commits
4 Commits
3658326547
...
cf543e7ee9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf543e7ee9 | ||
|
|
942421e051 | ||
|
|
914a3464d7 | ||
|
|
55e484308c |
@@ -146,7 +146,12 @@ Public Class MSSQLServer
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Get_ConnectionStringforID(pConnectionId As Integer) As String
|
Public Function Get_ConnectionStringforID(pConnectionId As Integer) As String
|
||||||
Dim oConnectionString As String = ""
|
Dim oConnectionString As String = String.Empty
|
||||||
|
|
||||||
|
If pConnectionId = 0 Then
|
||||||
|
_Logger.Warn("ConnectionId was 0. Falling back to default connection.")
|
||||||
|
Return String.Empty
|
||||||
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oTable As DataTable = GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {pConnectionId}")
|
Dim oTable As DataTable = GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {pConnectionId}")
|
||||||
@@ -174,17 +179,17 @@ Public Class MSSQLServer
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
_Logger.Warn("Provider {0} nicht unterstützt!", oProvider)
|
_Logger.Warn("Provider [{0}] not supported!", oProvider)
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
Else
|
Else
|
||||||
_Logger.Info("No entry for Connection-ID: " & pConnectionId.ToString)
|
_Logger.Warn("No entry for Connection-ID: [{0}] ", pConnectionId.ToString)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
_Logger.Info("Error in bei Get_ConnectionStringforID")
|
_Logger.Warn("Error in Get_ConnectionStringforID")
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return DecryptConnectionString(oConnectionString)
|
Return DecryptConnectionString(oConnectionString)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyCompany("Digital Data")>
|
<Assembly: AssemblyCompany("Digital Data")>
|
||||||
<Assembly: AssemblyProduct("Modules.Database")>
|
<Assembly: AssemblyProduct("Modules.Database")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("2.2.7.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.2.6.0")>
|
<Assembly: AssemblyVersion("2.2.7.0")>
|
||||||
<Assembly: AssemblyFileVersion("2.2.6.0")>
|
<Assembly: AssemblyFileVersion("2.2.7.0")>
|
||||||
|
|||||||
@@ -345,7 +345,11 @@ Public Class DatabaseWithFallback
|
|||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
Dim oConnectionString = _DatabaseECM.Get_ConnectionStringforID(pConnectionId)
|
Dim oConnectionString = _DatabaseECM.Get_ConnectionStringforID(pConnectionId)
|
||||||
|
If oConnectionString = String.Empty Then
|
||||||
|
Return _DatabaseECM.GetDatatable(pSQLCommand)
|
||||||
|
Else
|
||||||
Return _DatabaseECM.GetDatatableWithConnection(pSQLCommand, oConnectionString)
|
Return _DatabaseECM.GetDatatableWithConnection(pSQLCommand, oConnectionString)
|
||||||
|
End If
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -401,8 +405,11 @@ Public Class DatabaseWithFallback
|
|||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
Dim oConnectionString = _DatabaseECM.Get_ConnectionStringforID(pConnectionId)
|
Dim oConnectionString = _DatabaseECM.Get_ConnectionStringforID(pConnectionId)
|
||||||
|
If oConnectionString = String.Empty Then
|
||||||
|
Return _DatabaseECM.GetScalarValue(pSQLCommand)
|
||||||
|
Else
|
||||||
Return _DatabaseECM.GetScalarValueWithConnection(pSQLCommand, oConnectionString)
|
Return _DatabaseECM.GetScalarValueWithConnection(pSQLCommand, oConnectionString)
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
@@ -456,7 +463,11 @@ Public Class DatabaseWithFallback
|
|||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
Dim oConnectionString = _DatabaseECM.Get_ConnectionStringforID(pConnectionId)
|
Dim oConnectionString = _DatabaseECM.Get_ConnectionStringforID(pConnectionId)
|
||||||
|
If oConnectionString = String.Empty Then
|
||||||
|
Return _DatabaseECM.ExecuteNonQuery(pSQLCommand)
|
||||||
|
Else
|
||||||
Return _DatabaseECM.ExecuteNonQueryWithConnection(pSQLCommand, oConnectionString)
|
Return _DatabaseECM.ExecuteNonQueryWithConnection(pSQLCommand, oConnectionString)
|
||||||
|
End If
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyCompany("Digital Data")>
|
<Assembly: AssemblyCompany("Digital Data")>
|
||||||
<Assembly: AssemblyProduct("EDMIAPI")>
|
<Assembly: AssemblyProduct("EDMIAPI")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("1.5.3.0")>
|
<Assembly: AssemblyTrademark("1.5.4.0")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.5.3.0")>
|
<Assembly: AssemblyVersion("1.5.4.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.5.3.0")>
|
<Assembly: AssemblyFileVersion("1.5.4.0")>
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
''' there's no size limit.
|
''' there's no size limit.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Property MaxAttachmentSizeInMegaBytes As Integer = -1
|
Public Property MaxAttachmentSizeInMegaBytes As Integer = -1
|
||||||
|
|
||||||
|
|
||||||
|
Public Property RejectionTransferTimeUnit As String = "HOUR"
|
||||||
|
Public Property RejectionTransferTimeValue As Integer = 12
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class FirebirdConfig
|
Public Class FirebirdConfig
|
||||||
|
|||||||
@@ -142,12 +142,12 @@ Public Class ThreadRunner
|
|||||||
|
|
||||||
Private Sub MaybeUpdateRejected()
|
Private Sub MaybeUpdateRejected()
|
||||||
Try
|
Try
|
||||||
Dim oTimeUnit = "HOUR"
|
Dim oTimeUnit = _config.Config.Custom.RejectionTransferTimeUnit
|
||||||
Dim oTimeValue = 12
|
Dim oTimeValue = _config.Config.Custom.RejectionTransferTimeValue
|
||||||
|
|
||||||
Dim oDifference As TimeSpan = Now - RejectedLastRun
|
Dim oDifference As TimeSpan = Now - RejectedLastRun
|
||||||
If oDifference.TotalMinutes < RejectedMaxDifferenceInMinutes Then
|
If oDifference.TotalMinutes < RejectedMaxDifferenceInMinutes Then
|
||||||
_logger.Info("Updating rejected files: Waiting for next run.")
|
_logger.Debug("Updating rejected files: Waiting for next run.")
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -156,20 +156,27 @@ Public Class ThreadRunner
|
|||||||
Dim oSQL = $"
|
Dim oSQL = $"
|
||||||
SELECT [EMAIL_MSGID]
|
SELECT [EMAIL_MSGID]
|
||||||
FROM TBEMLP_HISTORY
|
FROM TBEMLP_HISTORY
|
||||||
WHERE (STATUS = 'REJECTED' OR CUST_REJECTED = 1)
|
WHERE (STATUS = 'REJECTED' OR CUST_REJECTED = 1) AND FB_UPDATED = 0
|
||||||
AND DATEDIFF({oTimeUnit}, CHANGED_WHEN, GETDATE()) <= {oTimeValue}
|
AND DATEDIFF({oTimeUnit}, CHANGED_WHEN, GETDATE()) <= {oTimeValue}
|
||||||
ORDER BY GUID DESC"
|
ORDER BY GUID DESC"
|
||||||
Dim oDT As DataTable = _mssql.GetDatatable(oSQL)
|
Dim oTable As DataTable = _mssql.GetDatatable(oSQL)
|
||||||
If Not IsNothing(oDT) Then
|
If Not IsNothing(oTable) Then
|
||||||
For Each oROW As DataRow In oDT.Rows
|
For Each oROW As DataRow In oTable.Rows
|
||||||
Dim oUpdate = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET REJECTED = True WHERE MESSAGE_ID = '{oROW.Item(0)}' and REJECTED = false"
|
Dim oUpdate = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET REJECTED = True WHERE MESSAGE_ID = '{oROW.Item(0)}' and REJECTED = false"
|
||||||
_firebird.ExecuteNonQuery(oUpdate)
|
If _firebird.ExecuteNonQuery(oUpdate) = True Then
|
||||||
|
Dim oUpdateSQL = $"
|
||||||
|
UPDATE TBEMLP_HISTORY
|
||||||
|
SET FB_UPDATED = 1
|
||||||
|
WHERE [EMAIL_MSGID] = '{oROW.Item(0)}' AND FB_UPDATED = 0"
|
||||||
|
|
||||||
|
_mssql.ExecuteNonQuery(oUpdateSQL)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
RejectedLastRun = Now
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Warn("Error while Updating REJECTED State: " & ex.Message)
|
_logger.Warn("Error while Updating REJECTED State: " & ex.Message)
|
||||||
Finally
|
|
||||||
RejectedLastRun = Now
|
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user