Jobs/ZUGFeRD: Fix logging of delete sqls

This commit is contained in:
Jonathan Jenne 2020-12-14 16:46:28 +01:00
parent 737320d886
commit 1c4b05d8d2

View File

@ -271,17 +271,24 @@ Public Class ImportZUGFeRDFiles
End If
Dim oDelSQL = $"DELETE FROM TBEDMI_ITEM_VALUE where REFERENCE_GUID = '{oMessageId}'"
Dim oStep As String
oStep = "Firebird TBEDMI_ITEM_VALUE Delete messageID Items"
Try
oStep = "Firebird TBEDMI_ITEM_VALUE Delete messageID Items"
_firebird.ExecuteNonQueryWithConnection(oDelSQL, oConnection, Firebird.TransactionMode.WithTransaction)
If oArgs.InsertIntoSQLServer = True Then
oStep = "MSSQL TBEDMI_ITEM_VALUE Delete messageID Items"
_mssql.ExecuteNonQuery(oDelSQL)
End If
Catch ex As Exception
_logger.Warn($"Delete Command [{oDelSQL}] was not successful.")
_logger.Error(ex)
_logger.Warn("Step [{0}] with SQL [{1}] was not successful.", oStep, oDelSQL)
End Try
If oArgs.InsertIntoSQLServer = True Then
oStep = "MSSQL TBEDMI_ITEM_VALUE Delete messageID Items"
Try
_mssql.ExecuteNonQuery(oDelSQL)
Catch ex As Exception
_logger.Warn("Step [{0}] with SQL [{1}] was not successful.", oStep, oDelSQL)
End Try
End If
For Each oProperty In oCheckResult.ValidProperties
Dim oGroupCounterValue = oProperty.GroupCounter