This commit is contained in:
Developer01 2024-09-05 15:30:30 +02:00
commit 72da437201
5 changed files with 22 additions and 25 deletions

View File

@ -1,13 +1,9 @@
Imports System.IO Imports System.IO
Imports System.Reflection
Imports System.Security.Cryptography Imports System.Security.Cryptography
Imports System.Text.RegularExpressions
Imports System.Xml
Imports DigitalData.Modules Imports DigitalData.Modules
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Interfaces Imports DigitalData.Modules.Interfaces
Imports DigitalData.Modules.Jobs Imports DigitalData.Modules.Jobs
Imports DigitalData.Modules.Jobs.ImportZUGFeRDFiles
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Public Class Form1 Public Class Form1
@ -36,7 +32,7 @@ Public Class Form1
Dim oResult As DataTable = _mssql.GetDatatable(oSQL) Dim oResult As DataTable = _mssql.GetDatatable(oSQL)
For Each oRow As DataRow In oResult.Rows For Each oRow As DataRow In oResult.Rows
Dim xmlPath = oRow.Item("XML_PATH") Dim xmlPath As String = oRow.Item("XML_PATH")
Dim tableName = oRow.Item("TABLE_NAME") Dim tableName = oRow.Item("TABLE_NAME")
Dim tableColumn = oRow.Item("TABLE_COLUMN") Dim tableColumn = oRow.Item("TABLE_COLUMN")
Dim description = oRow.Item("DESCRIPTION") Dim description = oRow.Item("DESCRIPTION")
@ -52,7 +48,8 @@ Public Class Form1
.IsRequired = isRequired, .IsRequired = isRequired,
.IsGrouped = isGrouped, .IsGrouped = isGrouped,
.GroupScope = groupScope, .GroupScope = groupScope,
.Specification = specification .Specification = specification,
.XMLPath = xmlPath.Replace(".Value", "")
}) })
Next Next
@ -86,7 +83,8 @@ Public Class Form1
.OriginalEmailDirectory = "E:\TestFiles\ZUGFERDService\Result\Original_eml", .OriginalEmailDirectory = "E:\TestFiles\ZUGFERDService\Result\Original_eml",
.RejectedEmailDirectory = "E:\TestFiles\ZUGFERDService\Result\Rejected_eml", .RejectedEmailDirectory = "E:\TestFiles\ZUGFERDService\Result\Rejected_eml",
.AttachmentsSubDirectory = "Attachments", .AttachmentsSubDirectory = "Attachments",
.RejectionTemplateId = 1 .RejectionTemplateId = 1,
.MinFileAgeInMinutes = 1
} }
args = LoadPropertyMapFor(args) args = LoadPropertyMapFor(args)
@ -154,7 +152,7 @@ Public Class Form1
WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count) WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count)
For Each Prop In oResult2.MissingProperties For Each Prop In oResult2.MissingProperties
WriteLog("Missing Property: [{0}]", Prop) WriteLog("Missing Property: [{0}]", Prop.Description)
Next Next
WriteLog("--------------------------------") WriteLog("--------------------------------")

View File

@ -26,8 +26,6 @@ Public Class EmailService
Private _MailSender As Mail.MailSender Private _MailSender As Mail.MailSender
Private _AttachmentByteData As Byte() Private _AttachmentByteData As Byte()
Private _RecentAttachmentByteData As Byte() Private _RecentAttachmentByteData As Byte()
Private ReadOnly _messageSend As Boolean = False
Private Enum DatabaseType Private Enum DatabaseType
Firebird Firebird
@ -453,7 +451,7 @@ Public Class EmailService
Dim oMessageSent = _MailSender.SendMail(oAddresses, oAccount.Sender, oSubject, oBody, oAddedWhen, oAttachments, False) Dim oMessageSent = _MailSender.SendMail(oAddresses, oAccount.Sender, oSubject, oBody, oAddedWhen, oAttachments, False)
If oMessageSent Then If oMessageSent = True Then
oTotalSent.Add(oEmailTo) oTotalSent.Add(oEmailTo)
oSuccessfulSent.Add(oEmailTo) oSuccessfulSent.Add(oEmailTo)
@ -473,14 +471,14 @@ Public Class EmailService
Select Case Database Select Case Database
Case DatabaseType.MSSQL Case DatabaseType.MSSQL
oSQL = $"UPDATE TBEMLP_EMAIL_OUT SET ERROR_TIMESTAMP = GETDATE(),ERROR_MSG = '{_limilab.ErrorMessage}' WHERE GUID = {oGuid} " Dim oErrorMessage As String
MSSQLInstance.ExecuteNonQuery(oSQL) If String.IsNullOrEmpty(_limilab.ErrorMessage) = False Then
oErrorMessage = _limilab.ErrorMessage
If _messageSend = True Then Else
oSQL = GetSQLUpdateString(oComment, oGuid) oErrorMessage = $"Could not sent email to email adress. Check log!"
MSSQLInstance.ExecuteNonQuery(oSQL)
_Logger.Info($"EmailID [{oGuid.ToString}] has been send to: {oEmailTo} - although there was an error in connection close!")
End If End If
oSQL = $"UPDATE TBEMLP_EMAIL_OUT SET EMAIL_SENT = GETDATE(), ERROR_TIMESTAMP = GETDATE(), ERROR_MSG = '{oErrorMessage}' WHERE GUID = {oGuid} "
MSSQLInstance.ExecuteNonQuery(oSQL)
End Select End Select
End If End If

View File

@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("")> <Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("DDEmailService")> <Assembly: AssemblyProduct("DDEmailService")>
<Assembly: AssemblyCopyright("Copyright © 2024")> <Assembly: AssemblyCopyright("Copyright © 2024")>
<Assembly: AssemblyTrademark("1.7.2.0")> <Assembly: AssemblyTrademark("1.7.3.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.7.2.0")> <Assembly: AssemblyVersion("1.7.3.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")> <Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("DDZUGFeRDService")> <Assembly: AssemblyProduct("DDZUGFeRDService")>
<Assembly: AssemblyCopyright("Copyright © 2024")> <Assembly: AssemblyCopyright("Copyright © 2024")>
<Assembly: AssemblyTrademark("2.8.5.0")> <Assembly: AssemblyTrademark("2.8.6.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.8.5.0")> <Assembly: AssemblyVersion("2.8.6.0")>
<Assembly: AssemblyFileVersion("2.8.5.0")> <Assembly: AssemblyFileVersion("2.8.6.0")>

View File

@ -173,7 +173,7 @@ Public Class ThreadRunner
Dim oResult As DataTable = _mssql.GetDatatable(oSQL) Dim oResult As DataTable = _mssql.GetDatatable(oSQL)
For Each oRow As DataRow In oResult.Rows For Each oRow As DataRow In oResult.Rows
Dim oXmlPath = oRow.Item("XML_PATH") Dim oXmlPath As String = oRow.Item("XML_PATH")
Dim oTableName = oRow.Item("TABLE_NAME") Dim oTableName = oRow.Item("TABLE_NAME")
Dim oTableColumn = oRow.Item("TABLE_COLUMN") Dim oTableColumn = oRow.Item("TABLE_COLUMN")
Dim oDescription = oRow.Item("DESCRIPTION") Dim oDescription = oRow.Item("DESCRIPTION")
@ -189,7 +189,8 @@ Public Class ThreadRunner
.IsRequired = oIsRequired, .IsRequired = oIsRequired,
.IsGrouped = oIsGrouped, .IsGrouped = oIsGrouped,
.GroupScope = oGroupScope, .GroupScope = oGroupScope,
.Specification = oSpecification .Specification = oSpecification,
.XMLPath = oXmlPath.Replace(".Value", "")
}) })
Next Next