11 Commits

Author SHA1 Message Date
Jonathan Jenne
104b3d6b8b Common: Version 1.7.6 2021-05-10 14:52:33 +02:00
Jonathan Jenne
b9e6dea453 Common/DocumentResultList: Log errors in LoadFile_AsByteArray 2021-05-10 14:51:55 +02:00
Jonathan Jenne
ec2916cebd ZooFlow: Admin 2021-05-10 14:50:21 +02:00
Jonathan Jenne
1decc85753 Monitor: Add Firebird dll 2021-05-10 14:50:04 +02:00
Jonathan Jenne
b3c8d828f4 Jobs: Version 1.6.0.0 2021-05-10 14:49:41 +02:00
Jonathan Jenne
bdd7867f96 ZUGFeRDService: 1.3.0.0 2021-05-10 14:48:55 +02:00
Jonathan Jenne
e53f22ce31 ZUGFeRDService: Load ExceptionEmailAddress from Config 2021-05-10 14:48:10 +02:00
Jonathan Jenne
fcd21faa01 Jobs/ZUGFeRD: Use ExceptionEmailAddress from Config 2021-05-10 14:47:33 +02:00
Jonathan Jenne
0771d5af28 Jobs/ZUGFeRD: Handle Errors while moving files, send mail when unhandled exceptions occur. 2021-05-10 14:30:05 +02:00
Jonathan Jenne
2ae4c9a555 ZUGFeRDService: Integrate with Config Module, Remove My.Settings 2021-05-10 14:27:09 +02:00
Jonathan Jenne
a4b7cfd9ef Database: Update EntityFramework to 6.4.0 2021-05-10 14:24:02 +02:00
32 changed files with 390 additions and 363 deletions

View File

@@ -314,7 +314,8 @@ Public Class frmDocumentResultList
End If
Catch ex As Exception
_Logger.Error(ex)
Return DocumentInfo
End Try
End Function

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.7.5.0")>
<Assembly: AssemblyFileVersion("1.7.5.0")>
<Assembly: AssemblyVersion("1.7.6.0")>
<Assembly: AssemblyFileVersion("1.7.6.0")>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System">
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
@@ -16,26 +16,34 @@
</DevExpress.LookAndFeel.Design.AppSettings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<add name="FileLog" />
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" />
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -20,6 +20,7 @@ Public Class ClassDetailPages
Public Event AnyControl_Changed As EventHandler(Of DetailPageEventArgs)
Public Event CurrentPage_Changed As EventHandler(Of DetailPageEventArgs)
Private RaiseChangedEvents As Boolean = True
Private CurrentPage As DetailPage
Public Property Current As DetailPage
@@ -94,7 +95,9 @@ Public Class ClassDetailPages
Items.Add(Page.TabPage.Name, Page)
AddHandler Page.BindingSource.AddingNew, Sub(sender As Object, e As EventArgs)
RaiseChangedEvents = False
Page.AddedWhoEdit.EditValue = Environment.UserName
RaiseChangedEvents = True
End Sub
End Sub
@@ -122,6 +125,27 @@ Public Class ClassDetailPages
End Try
End Function
Public Function PrepareLoad() As Boolean
Dim oItem = Items.
Where(Function(Item) Item.Value.IsPrimary).
FirstOrDefault()
Dim oPage = oItem.Value
If oPage Is Nothing Then
Return False
End If
If oPage.IsInsert Then
RaiseChangedEvents = False
oPage.BindingSource.AddNew()
RaiseChangedEvents = True
End If
CurrentPage = oPage
Return True
End Function
''' <summary>
''' Saves the pending changes to the binding source
''' </summary>
@@ -137,12 +161,17 @@ Public Class ClassDetailPages
oPage.BindingSource.EndEdit()
If oPage.DataTable.GetChanges() IsNot Nothing Then
RaiseChangedEvents = False
HostForm.HasChanges = True
If oPage.IsInsert Then
oPage.AddedWhoEdit.EditValue = My.Application.User.UserName
Else
oPage.ChangedWhoEdit.EditValue = My.Application.User.UserName
End If
RaiseChangedEvents = True
oPage.BindingSource.EndEdit()
Return True
Else
@@ -241,6 +270,10 @@ Public Class ClassDetailPages
Private Sub Handle_EditValueChanged(sender As BaseEdit, e As EventArgs)
Dim oControl As BaseEdit = sender
If RaiseChangedEvents = False Then
Exit Sub
End If
' Get the Layout Control containing the Edit Contol
If TypeOf oControl.Parent Is LayoutControl Then
Dim oLayoutControl As LayoutControl = oControl.Parent

View File

@@ -125,6 +125,8 @@ Public Class frmAdmin_ClipboardWatcher
}
})
Pages.PrepareLoad()
AddHandler Pages.CurrentPage_Changed, AddressOf CurrentPage_Changed
Catch ex As Exception
ShowErrorMessage(ex)
@@ -156,22 +158,28 @@ Public Class frmAdmin_ClipboardWatcher
ResetMessages()
If Pages.PrepareSave() = True Then
Dim oPage = Pages.Current
Try
Dim oPage = Pages.Current
Select Case oPage.TabPage.Name
Case PageProfile.Name
TBCW_PROFILESTableAdapter.Update(oPage.DataTable)
Select Case oPage.TabPage.Name
Case PageProfile.Name
TBCW_PROFILESTableAdapter.Update(oPage.DataTable)
Case PageDocumentSearch.Name
TBCW_PROF_DOC_SEARCHTableAdapter.Update(oPage.DataTable)
Case PageDocumentSearch.Name
TBCW_PROF_DOC_SEARCHTableAdapter.Update(oPage.DataTable)
Case PageDataSearch.Name
TBCW_PROF_DATA_SEARCHTableAdapter.Update(oPage.DataTable)
End Select
Case PageDataSearch.Name
TBCW_PROF_DATA_SEARCHTableAdapter.Update(oPage.DataTable)
End Select
oPage.IsInsert = False
oPage.IsInsert = False
ShowStatus($"{oPage.Name} gespeichert!")
ShowStatus($"{oPage.Name} gespeichert!")
Catch ex As Exception
ShowErrorMessage(ex)
End Try
Else
ShowStatus("Keine Änderungen!")
End If
End Sub

View File

@@ -139,7 +139,7 @@ Partial Class frmAdmin_Start
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.ShowToolbarCustomizeItem = False
Me.RibbonControl1.Size = New System.Drawing.Size(1077, 159)
Me.RibbonControl1.Size = New System.Drawing.Size(1077, 158)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
Me.RibbonControl1.Toolbar.ShowCustomizeItem = False
'
@@ -381,10 +381,10 @@ Partial Class frmAdmin_Start
'
Me.RibbonStatusBar1.ItemLinks.Add(Me.labelStatus)
Me.RibbonStatusBar1.ItemLinks.Add(Me.labelError)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 654)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 652)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1077, 22)
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1077, 24)
'
'RibbonPage2
'
@@ -419,7 +419,7 @@ Partial Class frmAdmin_Start
Me.TreeListMenu.OptionsView.ShowIndicator = False
Me.TreeListMenu.OptionsView.ShowVertLines = False
Me.TreeListMenu.SelectImageList = Me.MainTreeImages
Me.TreeListMenu.Size = New System.Drawing.Size(193, 446)
Me.TreeListMenu.Size = New System.Drawing.Size(193, 465)
Me.TreeListMenu.TabIndex = 8
'
'TreeListColumn1
@@ -450,18 +450,18 @@ Partial Class frmAdmin_Start
Me.DockPanel1.Controls.Add(Me.DockPanel1_Container)
Me.DockPanel1.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left
Me.DockPanel1.ID = New System.Guid("ce81b5b5-eff5-4006-8018-548aa8413799")
Me.DockPanel1.Location = New System.Drawing.Point(0, 159)
Me.DockPanel1.Location = New System.Drawing.Point(0, 158)
Me.DockPanel1.Name = "DockPanel1"
Me.DockPanel1.OriginalSize = New System.Drawing.Size(200, 200)
Me.DockPanel1.Size = New System.Drawing.Size(200, 495)
Me.DockPanel1.Size = New System.Drawing.Size(200, 494)
Me.DockPanel1.Text = "Übersicht"
'
'DockPanel1_Container
'
Me.DockPanel1_Container.Controls.Add(Me.TreeListMenu)
Me.DockPanel1_Container.Location = New System.Drawing.Point(3, 46)
Me.DockPanel1_Container.Location = New System.Drawing.Point(3, 26)
Me.DockPanel1_Container.Name = "DockPanel1_Container"
Me.DockPanel1_Container.Size = New System.Drawing.Size(193, 446)
Me.DockPanel1_Container.Size = New System.Drawing.Size(193, 465)
Me.DockPanel1_Container.TabIndex = 0
'
'TBIDB_ATTRIBUTEBindingSource
@@ -511,9 +511,9 @@ Partial Class frmAdmin_Start
'
Me.Panel1.Controls.Add(Me.labelTitle)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel1.Location = New System.Drawing.Point(200, 159)
Me.Panel1.Location = New System.Drawing.Point(200, 158)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(877, 9)
Me.Panel1.Size = New System.Drawing.Size(877, 40)
Me.Panel1.TabIndex = 8
Me.Panel1.TabStop = True
'
@@ -524,7 +524,7 @@ Partial Class frmAdmin_Start
Me.labelTitle.Location = New System.Drawing.Point(0, 0)
Me.labelTitle.Name = "labelTitle"
Me.labelTitle.Padding = New System.Windows.Forms.Padding(5, 0, 0, 0)
Me.labelTitle.Size = New System.Drawing.Size(877, 9)
Me.labelTitle.Size = New System.Drawing.Size(877, 40)
Me.labelTitle.TabIndex = 0
Me.labelTitle.Text = "labelTitle"
Me.labelTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
@@ -714,11 +714,11 @@ Partial Class frmAdmin_Start
'GridControl1
'
Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.GridControl1.Location = New System.Drawing.Point(200, 168)
Me.GridControl1.Location = New System.Drawing.Point(200, 198)
Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.MenuManager = Me.RibbonControl1
Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(877, 486)
Me.GridControl1.Size = New System.Drawing.Size(877, 454)
Me.GridControl1.TabIndex = 12
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
'
@@ -785,7 +785,7 @@ Partial Class frmAdmin_Start
Me.Controls.Add(Me.DockPanel1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.SvgImage = CType(resources.GetObject("frmAdmin_Start.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.IconOptions.SvgImage = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources.actions_options
Me.Name = "frmAdmin_Start"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1

View File

@@ -257,29 +257,6 @@
<metadata name="DockManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>396, 17</value>
</metadata>
<data name="frmAdmin_Start.IconOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAALoDAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJs
YWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJLkdyZWVue2ZpbGw6IzAzOUMy
Mzt9CgkuWWVsbG93e2ZpbGw6I0ZGQjExNTt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh
Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQo8L3N0eWxl
Pg0KICA8ZyBpZD0iUGFnZVNldHVwIj4NCiAgICA8cGF0aCBkPSJNMTkuMiwyNkg4VjZoMTB2NWMwLDAu
NiwwLjQsMSwxLDFoNXY5LjJsMiwyVjExbC03LTdIN0M2LjQsNCw2LDQuNCw2LDV2MjJjMCwwLjYsMC40
LDEsMSwxaDE0LjJMMTkuMiwyNnoiIGNsYXNzPSJCbGFjayIgLz4NCiAgICA8cGF0aCBkPSJNMjcuNiwy
Ny42bC02LjItNi4yYzAuNC0wLjcsMC42LTEuNSwwLjYtMi40YzAtMi44LTIuMi01LTUtNWMtMC44LDAt
MS41LDAuMi0yLjEsMC41bDIuNywyLjcgICBjMC42LDAuNiwwLjYsMS43LDAsMi40cy0xLjcsMC42LTIu
NCwwbC0yLjctMi43QzEyLjIsMTcuNSwxMiwxOC4yLDEyLDE5YzAsMi44LDIuMiw1LDUsNWMwLjksMCwx
LjctMC4yLDIuNC0wLjZsNi4yLDYuMiAgIGMwLjYsMC42LDEuNCwwLjYsMiwwbDAsMEMyOC4xLDI5LDI4
LjEsMjguMSwyNy42LDI3LjZ6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPC9nPg0KPC9zdmc+Cw==
</value>
</data>
<metadata name="TBIDB_ATTRIBUTEBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>691, 17</value>
</metadata>

View File

@@ -15,6 +15,15 @@ Public Class frmAdmin_Start
Private DetailForm As ClassDetailForm
Public Sub New()
MyBase.New(My.LogConfig)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
DetailForm = New ClassDetailForm(My.LogConfig)
AddHandler DetailForm.DetailFormClosed, AddressOf DetailForm_Closed
@@ -200,6 +209,8 @@ Public Class frmAdmin_Start
If oPrimaryKey IsNot Nothing Then
DetailForm.Handle_OpenDetail(oPrimaryKey, CurrentPage, False)
Else
Throw New ArgumentNullException("PrimaryKey")
End If
End If
Catch ex As Exception
@@ -239,7 +250,7 @@ Public Class frmAdmin_Start
Try
DetailForm.Handle_OpenDetail(Nothing, CurrentPage, True)
Catch ex As Exception
Logger.Error(ex)
ShowErrorMessage(ex)
End Try
End Sub

View File

@@ -480,6 +480,16 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property actions_options() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("actions_options", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
@@ -530,6 +540,16 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property bo_attention() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("bo_attention", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>

View File

@@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="actions_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="save5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save5.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -142,9 +145,6 @@
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="definednameuseinformula3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\definednameuseinformula3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="editquery" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\editquery.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -160,6 +160,9 @@
<data name="action_add_16xLG" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\action_add_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="actions_options" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_options.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="about1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\about1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -169,12 +172,12 @@
<data name="about2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\about2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="2_ZOO_FLOW_Abo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\2_ZOO_FLOW_Abo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StatusAnnotations_Stop_16xLG_color" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\StatusAnnotations_Stop_16xLG_color.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="actions_addcircled4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_addcircled4.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="DD_Icons_ICO_PMANAGER_128px" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DD_Icons_ICO_PMANAGER_128px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -334,8 +337,8 @@
<data name="del4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\del4.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="2_ZOO_FLOW_Abo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\2_ZOO_FLOW_Abo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="actions_addcircled4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_addcircled4.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="bo_document" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bo_document.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@@ -355,8 +358,8 @@
<data name="actions_deletecircled4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_deletecircled4.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
<data name="definednameuseinformula3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\definednameuseinformula3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="1_LOGO_ZOO_FLOW1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\1_LOGO_ZOO_FLOW1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -385,14 +388,17 @@
<data name="crossdatasourcefiltering" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\crossdatasourcefiltering.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="Flow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Flow.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="4_GLOBIX_AKTIV_ZOO" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\4_GLOBIX_AKTIV_ZOO.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="actions_deletecircled6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_deletecircled6.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="Flow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Flow.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="actions_check4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_check5.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="3_PERSON_INAKTIV_ZOO" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\3_PERSON_INAKTIV_ZOO.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -421,7 +427,7 @@
<data name="GLOBIX_short" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GLOBIX_short.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="actions_check4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_check5.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
<data name="bo_attention" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bo_attention.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
</root>

View File

@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Blue{fill:#1177D7;}
.Yellow{fill:#FFB115;}
.Black{fill:#727272;}
.Green{fill:#039C23;}
.Red{fill:#D11C1C;}
.st0{opacity:0.75;}
.st1{opacity:0.5;}
</style>
<g id="Options_1_">
<path d="M27.3,23.8l-8.2-8.2c0.6-1.1,0.9-2.3,0.9-3.7c0-4.4-3.6-8-8-8c-1.3,0-2.5,0.3-3.6,0.9l4.9,4.9 c1,1,1,2.6,0,3.6c-1,1-2.6,1-3.6,0L4.9,8.4C4.3,9.5,4,10.7,4,12c0,4.4,3.6,8,8,8c1.3,0,2.6-0.3,3.7-0.9l8.2,8.2 c0.9,0.9,2.5,0.9,3.4,0C28.2,26.3,28.2,24.8,27.3,23.8z" class="Blue" />
</g>
</svg>

View File

@@ -0,0 +1,26 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Blue{fill:#1177D7;}
.Yellow{fill:#FFB115;}
.Red{fill:#D11C1C;}
.Green{fill:#039C23;}
.Black{fill:#727272;}
.White{fill:#FFFFFF;}
.st0{opacity:0.5;}
.st1{opacity:0.75;}
.st2{display:none;}
.st3{display:inline;fill:#FFB115;}
.st4{display:inline;}
.st5{display:inline;opacity:0.75;}
.st6{display:inline;opacity:0.5;}
.st7{display:inline;fill:#039C23;}
.st8{display:inline;fill:#D11C1C;}
.st9{display:inline;fill:#1177D7;}
.st10{display:inline;fill:#FFFFFF;}
</style>
<g id="Attention">
<path d="M15.1,2.5L2.1,26.5C1.8,27.2,2.3,28,3.1,28h25.9c0.8,0,1.3-0.8,0.9-1.5L16.9,2.5 C16.5,1.8,15.5,1.8,15.1,2.5z" class="Yellow" />
<path d="M16,20c1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S14.9,20,16,20z M14,10h4v8h-4V10z" class="Black" />
</g>
</svg>

View File

@@ -813,6 +813,9 @@
<ItemGroup>
<None Include="Resources\actions_check5.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\actions_options.svg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="EntityFramework.Firebird.FbConnectionFactory, EntityFramework.Firebird" />

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -46,13 +47,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.Firebird, Version=6.4.0.0, Culture=neutral, PublicKeyToken=42d22d092898e5f8, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.Firebird.6.4.0\lib\net452\EntityFramework.Firebird.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=7.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
@@ -143,4 +144,12 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
</Target>
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
</Project>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="EntityFramework" version="6.4.4" targetFramework="net461" />
<package id="EntityFramework.Firebird" version="6.4.0" targetFramework="net461" />
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net461" />
<package id="NLog" version="4.7.5" targetFramework="net461" />

View File

@@ -1,5 +1,5 @@
Public Class EmailData
Public Attachment As String
Public Attachment As String = ""
Public Subject As String
Public From As String
End Class

View File

@@ -27,7 +27,7 @@ Public Class EmailFunctions
Dim oJobId = RandomValue(1, 10000)
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = EmailStrings.EMAIL_SUBJECT
Dim oSubject = EmailStrings.EMAIL_SUBJECT_REJECTED
Dim oAccountId = 1
Dim oCreatedWho = "ZUGFeRD Service"
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, BodyText)
@@ -63,7 +63,7 @@ Public Class EmailFunctions
_logger.Error(ex)
End Try
End Sub
Public Sub AddToEmailQueueMSSQL(MessageId As String, BodyText As String, pEmailData As EmailData, SourceProcedure As String, pEmailAccountId As Integer, Transaction As SqlTransaction)
Public Sub AddToEmailQueueMSSQL(MessageId As String, BodyText As String, pEmailData As EmailData, SourceProcedure As String, pEmailAccountId As Integer)
If pEmailData Is Nothing Then
_logger.Warn("EmailData is empty. Email will not be sent!")
Exit Sub
@@ -73,7 +73,7 @@ Public Class EmailFunctions
Dim oJobId = RandomValue(1, 10000)
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = EmailStrings.EMAIL_SUBJECT
Dim oSubject = EmailStrings.EMAIL_SUBJECT_REJECTED
Dim oCreatedWho = "ZUGFeRD Service"
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, BodyText)
@@ -98,7 +98,7 @@ Public Class EmailFunctions
_logger.Debug("Subject: {0}", oSubject)
_logger.Debug("Body {0}", oFinalBodyText)
Dim osql = $"Select MAX(GUID) FROM TBEMLP_HISTORY WHERE EMAIL_MSGID = '{MessageId}'"
Dim oHistoryID = _mssql.GetScalarValue(osql, Transaction)
Dim oHistoryID = _mssql.GetScalarValue(osql)
'osql = $"select * from TBEMLP_EMAIL_OUT where REFERENCE_ID = {oHistoryID} and EMAIL_ADRESS = '{oEmailTo}' and EMAIL_SUBJ = '{oSubject}'"
@@ -129,7 +129,7 @@ Public Class EmailFunctions
,'{SourceProcedure}'
,'{oCreatedWho}'
,'{oAttachment}')"
_mssql.ExecuteNonQuery(oInsert, Transaction)
_mssql.ExecuteNonQuery(oInsert)
Else
'If oDTResult.Rows.Count = 0 Then
' _logger.Debug("Email has already been sent!!")

View File

@@ -1,14 +1,28 @@
Public Class EmailStrings
Public Const EMAIL_WRAPPING_TEXT = "<html><body style=''font-family:""Arial"";font-size:10.0pt''>Sehr geehrte Damen und Herren,<br>
das WISAG-Portal zur Verarbeitung der Eingangsrechnungen im ZUGFeRD-Format konnte die von Ihnen gesandte Rechnung
leider nicht verarbeiten! <br><br> Grund: {0}<p>Bitte prüfen Sie die Datei und nehmen Sie bei Bedarf mit uns Kontakt auf.<p>
Vielen Dank für Ihr Verständnis.<br>Mit freundlichen Grüßen<br>Ihre IT-Abteilung</body></html>"
Public Const EMAIL_SUBJECT = "WISAG ZUGFeRD Portal: Beleg abgelehnt"
Public Const EMAIL_SUBJECT_REJECTED = "WISAG ZUGFeRD Portal: Beleg abgelehnt"
Public Const EMAIL_SUBJECT_EXCEPTION = "WISAG ZUGFeRD Portal: Unbehandelte Ausnahme"
Public Const EMAIL_UNHANDLED_EXCEPTION = """
<p>Beim Verarbeiten der Datei mit der Message ID '{0}' ist ein schwerer Fehler aufgetreten.</p>
<p>Fehlerbeschreibung: {1}</p>
<pre>{2}</pre>
"""
Public Const EMAIL_MISSINGPROPERTIES_1 = "<p>Die angehängte Datei entspricht nicht dem WISAG ZUGFeRD-Format: {0}</p>"
Public Const EMAIL_MISSINGPROPERTIES_2 = "<p>Die folgenden Eigenschaften wurden als ERFORDERLICH eingestuft, wurden aber nicht gefunden:<p/>"
Public Const EMAIL_MD5_ERROR = "<p>Die von Ihnen gesendete Rechnung wurde bereits von unserem System verarbeitet.</p>"
Public Const EMAIL_TOO_MUCH_FERDS = "<p>Ihre Email enthielt mehr als ein ZUGFeRD-Dokument.</p>"
Public Const EMAIL_NO_FERDS = "<p>Ihre Email enthielt keine ZUGFeRD-Dokumente.</p>"
Public Const EMAIL_INVALID_DOCUMENT = """
<p>Ihre Email enthielt ein ZUGFeRD Dokument, welches aber inkorrekt formatiert wurde.</p>
<p>Mögliche Gründe für ein inkorrektes Format:<ul>

View File

@@ -24,6 +24,7 @@ Public Class ImportZUGFeRDFiles
Private Const DIRECTORY_DONT_MOVE = "DIRECTORY_DONT_MOVE"
' List of allowed extensions for PDF/A Attachments
' This list should not contain xml so the zugferd xml file will be filtered out
Private ReadOnly AllowedExtensions As List(Of String) = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
@@ -159,7 +160,12 @@ Public Class ImportZUGFeRDFiles
Dim oFBTransaction As FbTransaction = oFBConnection.BeginTransaction()
Dim oSQLConnection As SqlConnection = _mssql.GetConnection()
Dim oSQLTransaction As SqlTransaction = oSQLConnection.BeginTransaction()
Dim oSQLTransaction As SqlTransaction = oSQLConnection?.BeginTransaction()
If oSQLConnection Is Nothing Then
_logger.Warn("SQL Connection was not set. No INSERTs for MSSQL Server will be performed!")
oArgs.InsertIntoSQLServer = False
End If
' Count the amount of ZUGFeRD files
Dim oZUGFeRDCount As Integer = 0
@@ -352,7 +358,7 @@ Public Class ImportZUGFeRDFiles
Dim oBody = EmailStrings.EMAIL_MD5_ERROR
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException", _EmailOutAccountId, oSQLTransaction)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException", _EmailOutAccountId)
AddRejectedState(oMessageId, "MD5HashException", "Die gesendete Rechnung wurde bereits verarbeitet!", "", oSQLTransaction)
Catch ex As InvalidFerdException
@@ -364,7 +370,7 @@ Public Class ImportZUGFeRDFiles
Dim oBody = EmailStrings.EMAIL_INVALID_DOCUMENT
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException", _EmailOutAccountId, oSQLTransaction)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException", _EmailOutAccountId)
AddRejectedState(oMessageId, "InvalidFerdException", "Inkorrekte Formate", "", oSQLTransaction)
Catch ex As TooMuchFerdsException
@@ -376,7 +382,7 @@ Public Class ImportZUGFeRDFiles
Dim oBody = EmailStrings.EMAIL_TOO_MUCH_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException", _EmailOutAccountId, oSQLTransaction)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException", _EmailOutAccountId)
AddRejectedState(oMessageId, "TooMuchFerdsException", "Email enthielt mehr als ein ZUGFeRD-Dokument", "", oSQLTransaction)
Catch ex As NoFerdsException
@@ -388,7 +394,7 @@ Public Class ImportZUGFeRDFiles
Dim oBody = EmailStrings.EMAIL_NO_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException", _EmailOutAccountId, oSQLTransaction)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException", _EmailOutAccountId)
AddRejectedState(oMessageId, "NoFerdsException", " Email enthielt keine ZUGFeRD-Dokumente", "", oSQLTransaction)
Catch ex As MissingValueException
@@ -404,13 +410,21 @@ Public Class ImportZUGFeRDFiles
Dim oBody = CreateBodyForMissingProperties(ex.File.Name, oMissingProperties)
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException", _EmailOutAccountId, oSQLTransaction)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException", _EmailOutAccountId)
AddRejectedState(oMessageId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage, oSQLTransaction)
Catch ex As OutOfMemoryException
_logger.Warn("OutOfMemory Error occurred: {0}", ex.Message)
_logger.Error(ex)
' Send Email to Digital Data
Dim oBody = CreateBodyForUnhandledException(oMessageId, ex)
Dim oEmailData As New EmailData With {
.From = oArgs.ExceptionEmailAddress,
.Subject = $"OutOfMemoryException im ZUGFeRD-Parser @ {oMessageId}"
}
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "OutOfMemoryException", _EmailOutAccountId)
' Rollback Firebird
oFBTransaction.Rollback()
@@ -423,6 +437,14 @@ Public Class ImportZUGFeRDFiles
_logger.Warn("Unknown Error occurred: {0}", ex.Message)
_logger.Error(ex)
' Send Email to Digital Data
Dim oBody = CreateBodyForUnhandledException(oMessageId, ex)
Dim oEmailData As New EmailData With {
.From = oArgs.ExceptionEmailAddress,
.Subject = $"UnhandledException im ZUGFeRD-Parser @ {oMessageId}"
}
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "UnhandledException", _EmailOutAccountId)
' Rollback Firebird
oFBTransaction.Rollback()
@@ -432,6 +454,31 @@ Public Class ImportZUGFeRDFiles
oMoveDirectory = DIRECTORY_DONT_MOVE
Finally
Try
' If an application error occurred, dont move files so they will be processed again later
If oMoveDirectory = DIRECTORY_DONT_MOVE Then
_logger.Info("Application Error occurred. Files for message Id {0} will not be moved.", oMessageId)
Else
' Move all files of the current group
MoveFiles(oArgs, oMessageId, oFileGroupFiles, oEmailAttachmentFiles, oEmbeddedAttachmentFiles, oMoveDirectory, oIsSuccess)
End If
_logger.Info("Finished processing file group {0}", oMessageId)
Catch ex As Exception
' Send Email to Digital Data
Dim oBody = CreateBodyForUnhandledException(oMessageId, ex)
Dim oEmailData As New EmailData With {
.From = oArgs.ExceptionEmailAddress,
.Subject = $"FileMoveException im ZUGFeRD-Parser @ {oMessageId}"
}
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "FileMoveException", _EmailOutAccountId)
_logger.Warn("Could not move files!")
_logger.Error(ex)
Throw ex
Finally
_logger.EndBlock()
End Try
Try
' If everything went OK, finally commit all changes to the Database
' ==================================================================
@@ -454,23 +501,6 @@ Public Class ImportZUGFeRDFiles
_logger.Error(ex)
_logger.Warn("Database Connections were not closed successfully.")
End Try
Try
' If an application error occurred, dont move files so they will be processed again later
If oMoveDirectory = DIRECTORY_DONT_MOVE Then
_logger.Info("Application Error occurred. Files for message Id {0} will not be moved.", oMessageId)
Else
' Move all files of the current group
MoveFiles(oArgs, oMessageId, oFileGroupFiles, oEmailAttachmentFiles, oEmbeddedAttachmentFiles, oMoveDirectory, oIsSuccess)
End If
_logger.Info("Finished processing file group {0}", oMessageId)
Catch ex As Exception
_logger.Warn("Could not move files!")
_logger.Error(ex)
Throw ex
Finally
_logger.EndBlock()
End Try
End Try
Next
End If
@@ -524,12 +554,11 @@ Public Class ImportZUGFeRDFiles
' Move PDF/A Files
For Each oFile In oInvoiceFiles
Try
Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oFinalMoveDirectory, oFile.Name))
Dim oFilePath = _filesystem.GetVersionedFilename(Path.Combine(oFinalMoveDirectory, oFile.Name))
_filesystem.MoveTo(oFile.FullName, oFileName, oFinalMoveDirectory)
_filesystem.MoveTo(oFile.FullName, oFilePath, oFinalMoveDirectory)
_logger.Info("Finished processing file {0}", oFile.Name)
_logger.Info("File moved to {0}", oFileName)
_logger.Info("File moved to {0}", oFilePath)
Catch ex As Exception
_logger.Warn("Could not move file {0}", oFile.FullName)
_logger.Error(ex)
@@ -539,12 +568,10 @@ Public Class ImportZUGFeRDFiles
' Move non-PDF/A Email Attachments/Files
For Each oFile In AttachmentFiles
Try
Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oAttachmentDirectory, oFile.Name))
Dim oFilePath = _filesystem.GetVersionedFilename(Path.Combine(oAttachmentDirectory, oFile.Name))
_filesystem.MoveTo(oFile.FullName, oFileName, oAttachmentDirectory)
_logger.Info("Finished processing file {0}", oFile.Name)
_logger.Info("Attachment moved to {0}", oFileName)
_filesystem.MoveTo(oFile.FullName, oFilePath, oAttachmentDirectory)
_logger.Info("Attachment moved to {0}", oFilePath)
Catch ex As Exception
_logger.Warn("Could not move attachment {0}", oFile.FullName)
_logger.Error(ex)
@@ -557,18 +584,25 @@ Public Class ImportZUGFeRDFiles
Dim oFileName As String = $"{MessageId}~{oResult.FileName}"
Dim oFilePath As String = Path.Combine(oAttachmentDirectory, oFileName)
If Not File.Exists(oAttachmentDirectory) Then
Directory.CreateDirectory(oAttachmentDirectory)
End If
Using oWriter As New FileStream(oFilePath, FileMode.Create)
oWriter.Write(oResult.FileContents, 0, oResult.FileContents.Length)
_logger.Info("Embedded Attachment moved to {0}", oFilePath)
End Using
Catch ex As Exception
_logger.Warn("Could not save embedded attachment {0}", oResult.FileName)
_logger.Error(ex)
End Try
Next
_logger.Info("Finished moving files")
End Sub
Private Function CreateBodyForMissingProperties(OriginalFilename As String, MissingProperties As List(Of String))
Private Function CreateBodyForMissingProperties(OriginalFilename As String, MissingProperties As List(Of String)) As String
Dim oBody = String.Format(EmailStrings.EMAIL_MISSINGPROPERTIES_1, OriginalFilename)
If MissingProperties.Count > 0 Then
@@ -583,6 +617,13 @@ Public Class ImportZUGFeRDFiles
Return oBody
End Function
Private Function CreateBodyForUnhandledException(MessageId As String, Exception As Exception) As String
Dim oBody = String.Format(EmailStrings.EMAIL_UNHANDLED_EXCEPTION, MessageId, Exception.Message, Exception.StackTrace)
Return oBody
End Function
Private Function CreateMD5(ByVal Filename As String) As String
Try
Dim oMD5 As New MD5CryptoServiceProvider

View File

@@ -7,6 +7,7 @@ Public Class WorkerArgs
Public ErrorDirectory As String
Public OriginalEmailDirectory As String
Public RejectedEmailDirectory As String
Public ExceptionEmailAddress As String
Public AttachmentsSubDirectory As String
Public PropertyMap As Dictionary(Of String, XmlItemProperty)
Public InsertIntoSQLServer As Boolean
@@ -18,6 +19,7 @@ Public Class WorkerArgs
OriginalEmailDirectory = Nothing
RejectedEmailDirectory = Nothing
AttachmentsSubDirectory = Nothing
ExceptionEmailAddress = Nothing
PropertyMap = New Dictionary(Of String, XmlItemProperty)
InsertIntoSQLServer = False
End Sub

View File

@@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
' übernehmen, indem Sie "*" eingeben:
<Assembly: AssemblyVersion("1.5.1.0")>
<Assembly: AssemblyFileVersion("1.5.1.0")>
<Assembly: AssemblyVersion("1.6.0.0")>
<Assembly: AssemblyFileVersion("1.6.0.0")>

View File

@@ -1,53 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DDZUGFeRDService.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<applicationSettings>
<DDZUGFeRDService.My.MySettings>
<setting name="SERVICE_NAME" serializeAs="String">
<value>DDZUGFeRDService</value>
</setting>
<setting name="SERVICE_DISPLAY_NAME" serializeAs="String">
<value>DD ZUGFeRD Service</value>
</setting>
<setting name="DB_DATASOURCE" serializeAs="String">
<value>172.24.12.41</value>
</setting>
<setting name="DB_DATABASE" serializeAs="String">
<value>172.24.12.41:E:\DB\Firebird\Databases\EDMI_TEMPLATE\EDMI_MASTER.FDB</value>
</setting>
<setting name="DB_USER" serializeAs="String">
<value>sysdba</value>
</setting>
<setting name="DB_PASSWORD" serializeAs="String">
<value>dd</value>
</setting>
<setting name="JOB_INTERVAL" serializeAs="String">
<value>10</value>
</setting>
<setting name="MSSQL_CONNECTIONSTRING" serializeAs="String">
<value />
</setting>
<setting name="MSSQL_ENABLED" serializeAs="String">
<value>False</value>
</setting>
<setting name="GDPICTURE_KEY" serializeAs="String">
<value>1234567890_EXAMPLE_KEY</value>
</setting>
<setting name="MSSQLEmailOutAccountID" serializeAs="String">
<value>1</value>
</setting>
<setting name="DEBUG" serializeAs="String">
<value>False</value>
</setting>
</DDZUGFeRDService.My.MySettings>
</applicationSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>

View File

@@ -0,0 +1,20 @@
Public Class Config
Public Property Firebird As FirebirdConfig
Public Property MSSQLConnectionString As String = ""
Public Property MSSQLEnabled As Boolean = False
Public Property MSSQLEmailOutAccountID As String = 1
Public Property JobInterval As Integer = 10
Public Property GDPictureKey As String = "1234567890_EXAMPLE_KEY"
Public Property ExceptionEmailAddress As String = "wisag-flow@digitaldata.works"
Public Property Debug As Boolean = False
Public Class FirebirdConfig
Public Property DataSource As String = "172.24.12.41"
Public Property Database As String = "172.24.12.41:E:\DB\Firebird\Databases\EDMI_TEMPLATE\EDMI_MASTER.FDB"
Public Property User As String = "sysdba"
Public Property Password As String = "dd"
End Class
End Class

View File

@@ -0,0 +1,4 @@
Public Class Constants
Public Const SERVICE_NAME = "DDZUGFeRDService"
Public Const SERVICE_DISPLAY_NAME = "DigitalData ZUGFeRD Service"
End Class

View File

@@ -82,6 +82,8 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.vb" />
<Compile Include="Constants.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
@@ -133,6 +135,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules.Config\Config.vbproj">
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Database\Database.vbproj">
<Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project>
<Name>Database</Name>

View File

@@ -10,9 +10,9 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyTitle("DDZUGFeRDService")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("DDZUGFeRDService")>
<Assembly: AssemblyCopyright("Copyright © 2018")>
<Assembly: AssemblyCopyright("Copyright © 2021")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.2.5.1")>
<Assembly: AssemblyVersion("1.3.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -15,7 +15,7 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0"), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
@@ -53,114 +53,6 @@ Namespace My
Return defaultInstance
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("DDZUGFeRDService")> _
Public ReadOnly Property SERVICE_NAME() As String
Get
Return CType(Me("SERVICE_NAME"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("DD ZUGFeRD Service")> _
Public ReadOnly Property SERVICE_DISPLAY_NAME() As String
Get
Return CType(Me("SERVICE_DISPLAY_NAME"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("172.24.12.41")> _
Public ReadOnly Property DB_DATASOURCE() As String
Get
Return CType(Me("DB_DATASOURCE"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("172.24.12.41:E:\DB\Firebird\Databases\EDMI_TEMPLATE\EDMI_MASTER.FDB")> _
Public ReadOnly Property DB_DATABASE() As String
Get
Return CType(Me("DB_DATABASE"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("sysdba")> _
Public ReadOnly Property DB_USER() As String
Get
Return CType(Me("DB_USER"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("dd")> _
Public ReadOnly Property DB_PASSWORD() As String
Get
Return CType(Me("DB_PASSWORD"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("10")> _
Public ReadOnly Property JOB_INTERVAL() As Integer
Get
Return CType(Me("JOB_INTERVAL"),Integer)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property MSSQL_CONNECTIONSTRING() As String
Get
Return CType(Me("MSSQL_CONNECTIONSTRING"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
Public ReadOnly Property MSSQL_ENABLED() As Boolean
Get
Return CType(Me("MSSQL_ENABLED"),Boolean)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("1234567890_EXAMPLE_KEY")> _
Public ReadOnly Property GDPICTURE_KEY() As String
Get
Return CType(Me("GDPICTURE_KEY"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("1")> _
Public ReadOnly Property MSSQLEmailOutAccountID() As Integer
Get
Return CType(Me("MSSQLEmailOutAccountID"),Integer)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
Public ReadOnly Property DEBUG() As Boolean
Get
Return CType(Me("DEBUG"),Boolean)
End Get
End Property
End Class
End Namespace

View File

@@ -1,42 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles />
<Settings>
<Setting Name="SERVICE_NAME" Type="System.String" Scope="Application">
<Value Profile="(Default)">DDZUGFeRDService</Value>
</Setting>
<Setting Name="SERVICE_DISPLAY_NAME" Type="System.String" Scope="Application">
<Value Profile="(Default)">DD ZUGFeRD Service</Value>
</Setting>
<Setting Name="DB_DATASOURCE" Type="System.String" Scope="Application">
<Value Profile="(Default)">172.24.12.41</Value>
</Setting>
<Setting Name="DB_DATABASE" Type="System.String" Scope="Application">
<Value Profile="(Default)">172.24.12.41:E:\DB\Firebird\Databases\EDMI_TEMPLATE\EDMI_MASTER.FDB</Value>
</Setting>
<Setting Name="DB_USER" Type="System.String" Scope="Application">
<Value Profile="(Default)">sysdba</Value>
</Setting>
<Setting Name="DB_PASSWORD" Type="System.String" Scope="Application">
<Value Profile="(Default)">dd</Value>
</Setting>
<Setting Name="JOB_INTERVAL" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">10</Value>
</Setting>
<Setting Name="MSSQL_CONNECTIONSTRING" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="MSSQL_ENABLED" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="GDPICTURE_KEY" Type="System.String" Scope="Application">
<Value Profile="(Default)">1234567890_EXAMPLE_KEY</Value>
</Setting>
<Setting Name="MSSQLEmailOutAccountID" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">1</Value>
</Setting>
<Setting Name="DEBUG" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
<Settings />
</SettingsFile>

View File

@@ -15,8 +15,8 @@ Public Class ProjectInstaller
.Account = ServiceAccount.LocalSystem
}
service = New ServiceInstaller With {
.ServiceName = My.Settings.SERVICE_NAME,
.DisplayName = My.Settings.SERVICE_DISPLAY_NAME
.ServiceName = Constants.SERVICE_NAME,
.DisplayName = Constants.SERVICE_DISPLAY_NAME
}
Installers.Add(process)
Installers.Add(service)

View File

@@ -2,6 +2,7 @@
Imports System.IO
Imports System.Timers
Imports System.Xml.XPath
Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Interfaces
Imports DigitalData.Modules.Jobs
@@ -13,6 +14,7 @@ Public Class ThreadRunner
Private WithEvents _workerThread As BackgroundWorker
Private WithEvents _workerTimer As Timer
Private _config As ConfigManager(Of Config)
Private _logConfig As LogConfig
Private _logger As Logger
Private _firebird As Firebird
@@ -25,11 +27,11 @@ Public Class ThreadRunner
Private _jobArguments As WorkerArgs
Private _mssql As MSSQLServer
Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
Public Sub New(LogConfig As LogConfig, ConfigManager As ConfigManager(Of Config), Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
_logConfig = LogConfig
_logger = _logConfig.GetLogger()
_logConfig.Debug = My.Settings.DEBUG
_firebird = Firebird
_config = ConfigManager
_mssql = MSSQL
Try
Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory)
@@ -46,39 +48,47 @@ Public Class ThreadRunner
Catch ex As Exception
End Try
Dim args As New WorkerArgs()
args = LoadFolderConfig(args)
args = LoadPropertyMapFor(args, "DEFAULT")
Dim oArgs As New WorkerArgs With {
.ExceptionEmailAddress = _config.Config.ExceptionEmailAddress
}
oArgs = LoadFolderConfig(oArgs)
oArgs = LoadPropertyMapFor(oArgs, "DEFAULT")
' Use MSSQL Server if available
If Not IsNothing(_mssql) Then
_logger.Debug("Data will also be inserted into MSSQL Server.")
args.InsertIntoSQLServer = True
oArgs.InsertIntoSQLServer = True
End If
_jobArguments = args
_jobArguments = oArgs
_logger.Debug("Checking SuccessDirectory {0}", args.SuccessDirectory)
If Not Directory.Exists(args.SuccessDirectory) Then
_logger.Warn("SuccessDirectory {0} does not exist!", args.SuccessDirectory)
_logger.Debug("Checking SuccessDirectory {0}", oArgs.SuccessDirectory)
If Not Directory.Exists(oArgs.SuccessDirectory) Then
_logger.Warn("SuccessDirectory {0} does not exist!", oArgs.SuccessDirectory)
End If
_logger.Debug("Checking ErrorDirectory {0}", args.ErrorDirectory)
If Not Directory.Exists(args.ErrorDirectory) Then
_logger.Warn("ErrorDirectory {0} does not exist!", args.ErrorDirectory)
_logger.Debug("Checking ErrorDirectory {0}", oArgs.ErrorDirectory)
If Not Directory.Exists(oArgs.ErrorDirectory) Then
_logger.Warn("ErrorDirectory {0} does not exist!", oArgs.ErrorDirectory)
End If
_logger.Debug("Checking Original Email Directory {0}", args.OriginalEmailDirectory)
If Not Directory.Exists(args.OriginalEmailDirectory) Then
_logger.Warn("OriginalEmailDirectory {0} does not exist!", args.OriginalEmailDirectory)
_logger.Debug("Checking Original Email Directory {0}", oArgs.OriginalEmailDirectory)
If Not Directory.Exists(oArgs.OriginalEmailDirectory) Then
_logger.Warn("OriginalEmailDirectory {0} does not exist!", oArgs.OriginalEmailDirectory)
End If
_logger.Debug("Checking Rejected Email Directory {0}", args.RejectedEmailDirectory)
If Not Directory.Exists(args.RejectedEmailDirectory) Then
_logger.Warn("RejectedEmailDirectory {0} does not exist!", args.RejectedEmailDirectory)
_logger.Debug("Checking Rejected Email Directory {0}", oArgs.RejectedEmailDirectory)
If Not Directory.Exists(oArgs.RejectedEmailDirectory) Then
_logger.Warn("RejectedEmailDirectory {0} does not exist!", oArgs.RejectedEmailDirectory)
End If
For Each oDirectory In args.WatchDirectories
_logger.Debug("Checking Exception Email Adress {0}", oArgs.ExceptionEmailAddress)
If oArgs.ExceptionEmailAddress = String.Empty Then
_logger.Warn("ExceptionEmailAddress {0} is not set!", oArgs.ExceptionEmailAddress)
End If
For Each oDirectory In oArgs.WatchDirectories
_logger.Debug("Checking WatchDirectory {0}", oDirectory)
If Not Directory.Exists(oDirectory) Then
_logger.Warn("WatchDirectory {0} does not exist!", oDirectory)
@@ -138,7 +148,7 @@ Public Class ThreadRunner
Dim args As WorkerArgs = e.Argument
_logger.Debug("Background worker running..")
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, My.Settings.MSSQLEmailOutAccountID, _mssql)
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, _config.Config.MSSQLEmailOutAccountID, _mssql)
job.Start(args)
Catch ex As Exception
_logger.Warn("Background worker failed!")
@@ -150,7 +160,7 @@ Public Class ThreadRunner
_logger.Debug("Background worker completed!")
End Sub
Private Function LoadFolderConfig(args As WorkerArgs)
Private Function LoadFolderConfig(pArgs As WorkerArgs) As WorkerArgs
Dim oSQL As String = "SELECT T1.FOLDER_TYPE, T.FOLDER_PATH FROM TBEDM_FOLDER T, TBEDM_FOLDER_TYPE T1 WHERE T.FOLDER_TYPE_ID = T1.GUID AND T1.""ACTIVE"" = True AND T.""ACTIVE"" = True"
Dim oResult As DataTable = _firebird.GetDatatable(oSQL)
@@ -159,31 +169,31 @@ Public Class ThreadRunner
Select Case oFolderType
Case ZUGFERD_IN
args.WatchDirectories.Add(row.Item("FOLDER_PATH"))
pArgs.WatchDirectories.Add(row.Item("FOLDER_PATH"))
Case ZUGFERD_SUCCESS
args.SuccessDirectory = row.Item("FOLDER_PATH")
pArgs.SuccessDirectory = row.Item("FOLDER_PATH")
Case ZUGFERD_ERROR
args.ErrorDirectory = row.Item("FOLDER_PATH")
pArgs.ErrorDirectory = row.Item("FOLDER_PATH")
Case ZUGFERD_EML
args.OriginalEmailDirectory = row.Item("FOLDER_PATH")
pArgs.OriginalEmailDirectory = row.Item("FOLDER_PATH")
Case ZUGFERD_REJECTED_EML
args.RejectedEmailDirectory = row.Item("FOLDER_PATH")
pArgs.RejectedEmailDirectory = row.Item("FOLDER_PATH")
Case ZUGFERD_ATTACHMENTS
args.AttachmentsSubDirectory = row.Item("FOLDER_PATH")
pArgs.AttachmentsSubDirectory = row.Item("FOLDER_PATH")
End Select
Next
Return args
Return pArgs
End Function
Private Function LoadPropertyMapFor(args As WorkerArgs, specification As String)
Dim oSQL As String = $"SELECT * FROM TBEDM_XML_ITEMS WHERE SPECIFICATION = '{specification}' AND ACTIVE = True ORDER BY XML_PATH"
Private Function LoadPropertyMapFor(pArgs As WorkerArgs, pSpecification As String) As WorkerArgs
Dim oSQL As String = $"SELECT * FROM TBEDM_XML_ITEMS WHERE SPECIFICATION = '{pSpecification}' AND ACTIVE = True ORDER BY XML_PATH"
Dim oResult As DataTable = _firebird.GetDatatable(oSQL)
For Each row As DataRow In oResult.Rows
@@ -195,7 +205,7 @@ Public Class ThreadRunner
Dim oIsGrouped = row.Item("IS_GROUPED")
Dim oGroupScope = row.Item("GROUP_SCOPE")
args.PropertyMap.Add(oXmlPath, New XmlItemProperty() With {
pArgs.PropertyMap.Add(oXmlPath, New XmlItemProperty() With {
.Description = oDescription,
.TableName = oTableName,
.TableColumn = oTableColumn,
@@ -205,6 +215,6 @@ Public Class ThreadRunner
})
Next
Return args
Return pArgs
End Function
End Class

View File

@@ -1,9 +1,11 @@
Imports System.IO
Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Logging.LogConfig
Public Class ZUGFeRDService
Private _config As ConfigManager(Of Config)
Private _logConfig As LogConfig
Private _logger As Logger
Private _firebird As Firebird
@@ -11,9 +13,10 @@ Public Class ZUGFeRDService
Private _threadRunner As ThreadRunner
Protected Overrides Sub OnStart(ByVal args() As String)
Protected Overrides Sub OnStart(args() As String)
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, "Digital Data", "DDZUGFeRDService")
_logConfig.Debug = My.Settings.DEBUG
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
_logConfig.Debug = _config.Config.Debug
_logger = _logConfig.GetLogger()
Try
Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory)
@@ -24,22 +27,20 @@ Public Class ZUGFeRDService
Else
Exit For
End If
Next
Catch ex As Exception
End Try
_logger.Info($"{My.Settings.SERVICE_NAME} is starting.")
_logger.Info($"{Constants.SERVICE_NAME} is starting.")
Dim oDataSource As String = My.Settings.DB_DATASOURCE
Dim oDatabase As String = My.Settings.DB_DATABASE
Dim oUser As String = My.Settings.DB_USER
Dim oPassword As String = My.Settings.DB_PASSWORD
Dim oJobInterval As Integer = My.Settings.JOB_INTERVAL
Dim oMSSQLConnectionString As String = My.Settings.MSSQL_CONNECTIONSTRING
Dim oMSSQLEnabled As Boolean = My.Settings.MSSQL_ENABLED
Dim oGDPictureKey As String = My.Settings.GDPICTURE_KEY
Dim oDataSource As String = _config.Config.Firebird.DataSource
Dim oDatabase As String = _config.Config.Firebird.Database
Dim oUser As String = _config.Config.Firebird.User
Dim oPassword As String = _config.Config.Firebird.Password
Dim oJobInterval As Integer = _config.Config.JobInterval
Dim oMSSQLConnectionString As String = _config.Config.MSSQLConnectionString
Dim oMSSQLEnabled As Boolean = _config.Config.MSSQLEnabled
Dim oGDPictureKey As String = _config.Config.GDPictureKey
_firebird = New Firebird(_logConfig, oDataSource, oDatabase, oUser, oPassword)
@@ -53,7 +54,7 @@ Public Class ZUGFeRDService
End If
Try
_threadRunner = New ThreadRunner(_logConfig, _firebird, _mssql)
_threadRunner = New ThreadRunner(_logConfig, _config, _firebird, _mssql)
_threadRunner.Start(oJobInterval)
Catch ex As Exception
_logger.Error(ex)
@@ -61,7 +62,7 @@ Public Class ZUGFeRDService
End Sub
Protected Overrides Sub OnStop()
_logger.Info($"{My.Settings.SERVICE_NAME} is stopping.")
_logger.Info($"{Constants.SERVICE_NAME} is stopping.")
_threadRunner.Stop()
End Sub