34 Commits

Author SHA1 Message Date
Jonathan Jenne
ae12ea21f2 rename EDMIAPI to EDMI.API, Rename IDBService to EDMIService 2020-04-06 13:23:11 +02:00
Jonathan Jenne
124cfde45e add EDMI.File 2020-04-06 13:22:39 +02:00
Jonathan Jenne
c23a608b6a update NLog to 4.7.0 2020-04-06 13:16:19 +02:00
Jonathan Jenne
2fabdb90a5 ZUFeRDRESTService: Dont copy appsettings dev into output directory 2020-03-25 16:09:17 +01:00
Jonathan Jenne
0b36700ba1 ZUGFERDRESTService: Prepare for deployment 2020-03-25 13:57:31 +01:00
Jonathan Jenne
4f75d7eb96 Merge branch 'master' into ZugferdService-Redesign 2020-03-25 13:45:49 +01:00
Jonathan Jenne
a8a9dd84eb LookupGrid: Version 1.0.2.2 2020-03-25 13:45:17 +01:00
Jonathan Jenne
40b8783af4 LookupGrid: Fix F2 not working for multiselect = true 2020-03-25 13:45:01 +01:00
Jonathan Jenne
acaa2e7ad6 zugferdrestapi: Fix missing properties 2020-03-25 13:22:32 +01:00
Jonathan Jenne
5ac28e2032 Interfaces: Version 1.0.1.0 2020-03-25 13:22:09 +01:00
Jonathan Jenne
0e592de288 Interfaces: Extract attachments from stream 2020-03-25 13:21:34 +01:00
Jonathan Jenne
9623ce8191 DocumentViewer: Version 1.0.2.0 2020-03-25 11:42:56 +01:00
Jonathan Jenne
a69712d94c DocumentViewer: Fit-To-Page for RichEditControl 2020-03-25 11:42:26 +01:00
Jonathan Jenne
52149cbeb8 more logging 2020-03-24 10:57:07 +01:00
Jonathan Jenne
c9fdf80936 ZUGFeRDRESTService: Improve Logging 2020-03-23 16:24:39 +01:00
Jonathan Jenne
b5feec77f7 Merge branch 'master' into ZugferdService-Redesign 2020-03-23 12:07:34 +01:00
Jonathan Jenne
8d91dcdb43 DocumentViewer: Version 1.0.1.0 2020-03-23 12:06:51 +01:00
Jonathan Jenne
84dab7f5a6 Merge remote-tracking branch 'origin/master' into ZugferdService-Redesign 2020-03-20 13:49:18 +01:00
Jonathan Jenne
3449b16d69 Modules.Logging: Version 2.0.0.0 2020-03-20 13:48:43 +01:00
Jonathan Jenne
7b3dc1bf89 first working version of zugferd rest service 2020-03-20 13:48:09 +01:00
Jonathan Jenne
3d3a491744 big refactor, move most zugferd processing into Modules.Interfaces 2020-03-20 13:47:36 +01:00
Jonathan Jenne
322ca23f33 clean up 2020-03-20 13:45:56 +01:00
Jonathan Jenne
6ec458ccdf Merge branch 'master' into ZugferdService-Redesign 2020-03-18 16:28:18 +01:00
Jonathan Jenne
a437359114 Jobs: Version 1.1.0.2 2020-03-18 16:24:08 +01:00
Jonathan Jenne
b6b29e5de8 fix grouping 2020-03-18 16:23:38 +01:00
Jonathan Jenne
51c1f9f3f7 Merge branch 'master' into ZugferdService-Redesign 2020-03-18 10:19:21 +01:00
Jonathan Jenne
28d2e4241d Jobs: Version 1.1.0.1 2020-03-18 10:18:49 +01:00
Jonathan Jenne
edf7c37cb5 Jobs: Version 1.1.0.1 2020-03-17 17:12:26 +01:00
Jonathan Jenne
c8291116a3 Merge branch 'master' of http://dd-vmp07-com04:3000/AppStd/Monorepo 2020-03-17 17:06:23 +01:00
Jonathan Jenne
7977b926f1 ZUGFeRD Service: Version 1.1.0.1 2020-03-17 17:06:12 +01:00
Jonathan Jenne
a46809ae24 ZUGFeRD Interface: Fix moving attachments to success folder instead of attachments 2020-03-17 17:05:41 +01:00
Jonathan Jenne
33937a41d3 start redesign for zugferd rest api 2020-03-17 16:56:39 +01:00
a66c2928f2 ms commit 2020-03-17 16:27:53 +01:00
dff085ced2 ms 2020-03-17 16:27:04 +01:00
121 changed files with 3013 additions and 1045 deletions

View File

@@ -53,14 +53,11 @@ Partial Class DocumentViewer
Me.btnFlipY = New System.Windows.Forms.ToolStripButton() Me.btnFlipY = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator() Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator()
Me.btnSettings = New System.Windows.Forms.ToolStripButton() Me.btnSettings = New System.Windows.Forms.ToolStripButton()
Me.statusbar = New System.Windows.Forms.StatusStrip()
Me.infoLabel = New System.Windows.Forms.ToolStripStatusLabel()
Me.statusLabel = New System.Windows.Forms.ToolStripStatusLabel()
Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog() Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog()
Me.RichEditControl1 = New DevExpress.XtraRichEdit.RichEditControl() Me.RichEditControl1 = New DevExpress.XtraRichEdit.RichEditControl()
Me.SpreadsheetControl1 = New DevExpress.XtraSpreadsheet.SpreadsheetControl() Me.SpreadsheetControl1 = New DevExpress.XtraSpreadsheet.SpreadsheetControl()
Me.PrintDocument1 = New System.Drawing.Printing.PrintDocument()
Me.mainToolStrip.SuspendLayout() Me.mainToolStrip.SuspendLayout()
Me.statusbar.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'GdViewer 'GdViewer
@@ -126,7 +123,7 @@ Partial Class DocumentViewer
Me.GdViewer.ScrollLargeChange = CType(50, Short) Me.GdViewer.ScrollLargeChange = CType(50, Short)
Me.GdViewer.ScrollSmallChange = CType(1, Short) Me.GdViewer.ScrollSmallChange = CType(1, Short)
Me.GdViewer.SilentMode = True Me.GdViewer.SilentMode = True
Me.GdViewer.Size = New System.Drawing.Size(1015, 537) Me.GdViewer.Size = New System.Drawing.Size(1015, 559)
Me.GdViewer.TabIndex = 0 Me.GdViewer.TabIndex = 0
Me.GdViewer.ViewRotation = System.Drawing.RotateFlipType.RotateNoneFlipNone Me.GdViewer.ViewRotation = System.Drawing.RotateFlipType.RotateNoneFlipNone
Me.GdViewer.Zoom = 1.0R Me.GdViewer.Zoom = 1.0R
@@ -383,28 +380,6 @@ Partial Class DocumentViewer
Me.btnSettings.Size = New System.Drawing.Size(28, 28) Me.btnSettings.Size = New System.Drawing.Size(28, 28)
Me.btnSettings.Text = "Viewer settings" Me.btnSettings.Text = "Viewer settings"
' '
'statusbar
'
Me.statusbar.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.infoLabel, Me.statusLabel})
Me.statusbar.Location = New System.Drawing.Point(0, 568)
Me.statusbar.Name = "statusbar"
Me.statusbar.Size = New System.Drawing.Size(1015, 22)
Me.statusbar.SizingGrip = False
Me.statusbar.TabIndex = 7
Me.statusbar.Text = "StatusStrip1"
'
'infoLabel
'
Me.infoLabel.Name = "infoLabel"
Me.infoLabel.Size = New System.Drawing.Size(56, 17)
Me.infoLabel.Text = "infoLabel"
'
'statusLabel
'
Me.statusLabel.Name = "statusLabel"
Me.statusLabel.Size = New System.Drawing.Size(66, 17)
Me.statusLabel.Text = "statusLabel"
'
'OpenFileDialog 'OpenFileDialog
' '
Me.OpenFileDialog.FileName = "OpenFileDialog1" Me.OpenFileDialog.FileName = "OpenFileDialog1"
@@ -438,14 +413,11 @@ Partial Class DocumentViewer
Me.Controls.Add(Me.SpreadsheetControl1) Me.Controls.Add(Me.SpreadsheetControl1)
Me.Controls.Add(Me.RichEditControl1) Me.Controls.Add(Me.RichEditControl1)
Me.Controls.Add(Me.GdViewer) Me.Controls.Add(Me.GdViewer)
Me.Controls.Add(Me.statusbar)
Me.Controls.Add(Me.mainToolStrip) Me.Controls.Add(Me.mainToolStrip)
Me.Name = "DocumentViewer" Me.Name = "DocumentViewer"
Me.Size = New System.Drawing.Size(1015, 590) Me.Size = New System.Drawing.Size(1015, 590)
Me.mainToolStrip.ResumeLayout(False) Me.mainToolStrip.ResumeLayout(False)
Me.mainToolStrip.PerformLayout() Me.mainToolStrip.PerformLayout()
Me.statusbar.ResumeLayout(False)
Me.statusbar.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@@ -481,10 +453,8 @@ Partial Class DocumentViewer
Friend WithEvents btnFlipY As ToolStripButton Friend WithEvents btnFlipY As ToolStripButton
Friend WithEvents ToolStripSeparator4 As ToolStripSeparator Friend WithEvents ToolStripSeparator4 As ToolStripSeparator
Friend WithEvents btnSettings As ToolStripButton Friend WithEvents btnSettings As ToolStripButton
Friend WithEvents statusbar As StatusStrip
Friend WithEvents infoLabel As ToolStripStatusLabel
Friend WithEvents statusLabel As ToolStripStatusLabel
Friend WithEvents OpenFileDialog As OpenFileDialog Friend WithEvents OpenFileDialog As OpenFileDialog
Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl
Friend WithEvents SpreadsheetControl1 As DevExpress.XtraSpreadsheet.SpreadsheetControl Friend WithEvents SpreadsheetControl1 As DevExpress.XtraSpreadsheet.SpreadsheetControl
Friend WithEvents PrintDocument1 As Printing.PrintDocument
End Class End Class

View File

@@ -124,13 +124,13 @@
<data name="btnPrint.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnPrint.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFgSURBVEhLvVVBToRAEESNF/+kv+DEgRsPICFwMfMGLwYv YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFhSURBVEhLvVWxToRAEEWNjf+kf0FBRccHkBBozH6CjSHa
evIDs0fjQ0wIB56w0XAQZ+yanXaHQcLsrlhJZao73V3TuxCiOZRlqYgaZ1VVo5OJmGnbwiCEOKcBOhQH aGVvuNL4IRIKvuFyFwpx13l7O96ySNi7E1/ysm8mM/N27iAEU8jzXBIVzqIoBicTMdO0+UEIcU4DlC8O
G2RZdrmugRBXK2/wYDZQSpkB7snkGDjI4Kba6FNox+xB7q9JknzhqRiGQV+XknivUIzT1W7Oj6HBruvM NkiS5HJZAyGuFt7gUW8gpdQD7JPJMXCQwU2xUqfQjNmD3N+jKPrCU9H3vbrOK+K9RDFOW9s5N4YG27bV
05Wm6WdRFM8w+Hn0/tLAzhyMARMGXHgs+T9hrr2BGhn0fa/FnaQGaYp3Znvt5vwYGr1t284bSCl10zQK T1ccx59Zlr3A4OfR+0sDM7PXBkwYcOGx5P+EufQGcmDQdZ0Sd6/UUOnindle2zk3hkZv0zTTBlVVqbqu
t8CqOF3t5vwYGr11XU8N1uRogyXt5vx4Tv/PBkZYQM/dyM358ZzGQJNwyUWh8IeyxtuMD8uGEhMTMBS/ JW6BVXHa2s65MTR6y7IcGyzJwQZz2s658ZT+nw20MICeupGdc+MpjYE6YZOLfOEOZY23GR+WFSVGJqAv
9RIHYm1/mClQxHh6edOPHpFj4Lb4SNnWMLgGSzjZYGkD1MZxfGFbw+Bv4L+5HAPHbrC1/YvI8/yDWs52 fusl9sQH88OMgSLG89uHenKIHAO3xUfKtPrBNpjDyQZzG6A2DMML0+oHdwP3zeUYOHaDtemfRZqmW2o5
nYGgW5FHtcUmC3wn3to2D1H0DRIt3n90sPmTAAAAAElFTkSuQmCC 23V6gm5FHsUam8xwQ7w1bQ6C4BuAm93DSGjZ/gAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="btnFitWidth.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnFitWidth.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -154,87 +154,87 @@
<data name="btnMouseMode.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnMouseMode.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHBSURBVEhLnZM9LwRRGIU38VVp/AGJUqPQIDMjVH4AnYRK YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHASURBVEhLnZM9LwRRGIU38VVp/AFqjUKDzIxQ+QE0IqHS
IyKEnRGFgtBIRBRKSpYEczcbHwUNCZGlUEtQ0hESwnXPeDeZuGfNrCd5cjP3vefM7uxOphx9fbkqx8/3 iAhhZ0ShIDQSEVFTsiSYuxEfBQ0JkaVQS1DSERLCdc94N5m4Z82sJ3lyM/e958zu7E6mFD09uQrHz/e5
u4EKvay6bxpY+/ACpedzVxprdG32Mcc5nJdoMm1j+w1OVp2h6Lfbp7fWHsR55KTib8ynKrCS3oUjPbdZ gQq9rLpv6F/98AKl53JXGmt0bfYxxzmcl2gyLaP7dU5WnaHot1unt9YexHnkpOJvzKfaYyXd80d6dqMQ
jFY2R04qyuNNKZeF4fPbuwZY2TzS5KWK4/nhCg0a47B5pMlLFceZVBc0aIzD5hB5qeI44+qJBWEcNofI rWyOnFSUxptULgvD57d3DbCyeaTJSxXH88NlGjTGYfNIk5cqjjOhLmjQGIfNIfJSxXHG1BMLwjhsDpGX
SxXH61efLAjjsHmkyUuVTefMcTUNGbun8/r69km/mB8YK67ZOSh1Nq1DlzUsEDe7dk73S3Yapc6mdIOD Ko7Xqz5ZEMZh80iTlyqb9unjShoydk7l9fXtk34xPzBWXLNzUOpsmgcvq1ggbnb1nO4XbTdKnU3xBgeF
4sO/zF/cRTeROhv2DfAoBpZOtL9+rmc3inph6ypacY199qikzibNI0qj1Nk0z+RqWaBSpc6mZ6RQxwKV h3+Zv7iLbiJ1Nuwb4FH0L55of+1cz6wX9PzmVbTiGvvsUUmdTZpHlEaps2mczlWzQLlKnU3X8F4NC5Sr
KnU2P3/T1S8WSu/ql9Rx/nqT05j4JjuBOmTBtCIvVRzXD4dZMK3ISxWnY3K3vj1QjyycJHLIS1V5XH9v 1Nn8/E1XvlgovStfUsf5601OY+Kb7ATqkAXTirxUcVw/HGLBtCIvVZy2iZ3a1kA9snCSyCEvVaVx/d0B
kBUkiZxUJOP6apmVlBPnJZoeNwgnWkZ33lhhScxxTiKV0zWdb3SCcNGU3RhfY95gH3M5SshkvgGoyriE VpAkclKRjOurJVZSSpyXaHrcIBxvGtl+Y4VFMcc5iZRPx1S+3gnCBVN2Y3yNeYN9zOUoIZP5Bl9auHhV
9kg28AAAAABJRU5ErkJggg== DRJiAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="btnFirstPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnFirstPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGjSURBVEhLxVTLSsNAFB3UrkVRXLp324VCMgmIfoBIURRx YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGgSURBVEhLxVRLS8NAEF7UnkVRPHr32oNCsgmof0CkKIp4
17WvZKaIxIKIfoIr96LYzBQRXPgDoqCo/yD43PrMTW90mKYxKa0euOTmPs6Ze0mGtAOjJX8A3dYCiCkT 69lXs1tEgiCiP8GTd1FsdksRPPgHREFR/4Pg8+oz005w2KY1Ka1+MGQyj+/bGZJlncB4MRhCt70AYi7U
29Q9eMYQIRaXn6oNzu++Yio17CXRR7nYMrh4ingwRQhl6x9gEIRnFgGzdNRvMrEZ9L7oPFjSnAAQUyY3 LveOXjDEmCP1F7Xhxf03TCWGu6IGuFQ7llTPEQ+mGOPC/wSDIDzTCNjFyqAt1HbY+2ryYElrAkDMhd4a
hpl4VHtVH0uzrcjk1R4gthb2H/Q+3bAl3QQji8e91PXLBqvtWK1v5GNrskB4Yi7XKPPv9brUAhBQLRKw FeqJ9lIfS9OtyJblPiB2lg4fzT7TsCXZBGPLJ/3cCzYtUdsxrW/kY2tzgeqJpd7gIngw6xILQIBaJOBI
uFi1lit3ej6theSAulOMi3fYcV1ce1fjcT7Sxwgk+Or7b/VI/wcCEGiHIf0/TDDE5Vtwp1zq8ayG9PH/ te6slu7NfFKrkgPqTjGhPmDHdXHjncbjfKSPEWji0/ff6pH+DwQg0AlD+n+YYETq9/BOuTLjaQ3p4/+D
wRg76TaYnDAccW7x8vfp1bro2chH+ngBTJFCYa8zuH4ngx/tQq9LLQAB1eKuCts77bJ5tZBlddiaPEEd SXHaawk9ZRXUhSN/Tk/romcjH+njBTDFcrmD7vD6nQ5/tEuzLrEABKjFXRWuf9bjynIuzeqwtfkEdfD9
PK8juPenjBUQ+lld1Kv62JFRAAETma6cNt3Kldqr+liabkWNkC+e5SxXzBjcv9F5sKS5CXSEH4MjZ6kr rvDen7HWQKjWR3upjx0pBRAwke3pWdsrXdNe6mNpshU1QjZ/nnE8NWfJ4NbkwZLWJjBR/RgKep576iZa
rqPVYaq1yBd3cjYXc6ZzeIuh9gBWV/MI+QJHJit3xg14HQAAAABJRU5ErkJggg== Habai2x+L+NKtWAXju8w1BnA6moeY9/IuSrpVj3aVAAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="btnPreviousPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnPreviousPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHLSURBVEhLY6AZqK9ngrKoC4zTzrDalG0OsS3bdAIqRB1g YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHKSURBVEhLY6AZqK9ngrKoC4zTzrDalG0OsS3bdAIqRB1g
X7+fw7Z8U4pdxeYbQPwfhKFSlAH7/PUCduWbyy1KNz2zLW/4BzIYRIMwVAl5wKlqszTQxZ02RZveIBtK X7+fw7Z8U4pdxeYbQPwfhKFSlAH7/PUCduWbyy1KNz2zLa//BzIYRIMwVAl5wKlqszTQxZ02RZveIBtK
sQU2FVvV7Mo2T7esWPsFFhS4MFQLMeA/o1XpBhOb8k0rtSo2/0F3KS42VDMeAExq9hVbXGzLN+yxdd30 sQU2FVvV7Mo2T7esWPsFFhS4MFQLMeA/o1XpBhOb8k0rtSo2/0F3KS42VDMeAExq9hVbXGzLN+yxdd70
F9kAiiwIDV3FbFuxKdymdPMpO7fNf0GayMFQ4xDAtXgnNzD9ptuVbryJzUXIfGRxXGyosQwMFoU7hIAp F9kAiiwIDV3FbFuxKdymdPMpO5fNf0GayMFQ4xDAtXgnNzD9ptuVbryJzUXIfGRxXGyosQwMFoU7hIAp
ohSIn+LTgMzHpQaZDTbctnxjg23BmnfEaEDmE6MebIFdxZY064rN9+0qGsGS1MRgC0DAI3cbu33Fplib ohSIn+LTgMzHpQaZDTbctnxjg23BmnfEaEDmE6MebIFdxZY064rN9+0qIJLUxGALQMAjdxu7fcWmWJuy
sg2X8bkImY9LDTIbajwCAMsTFpvKTQHAjHQEpJBSDDUWO7Ar3eBoXb5xh3z8/N8wFyG7EEbjY0ONwg/s DZfxuQiZj0sNMhtqPAIAyxMWm8pNAcCMdASkkFIMNRY7sCvd4GhdvnGHfPz83zAXIbsQRuNjQ43CD+zK
yjcY2pRtXGGbteknsgFUswAGgEWFum355qn6+eu/gwwhBkO1kgZsq7ZLgkpRu4qNb7G5GpkN1UIesKnY NxjalG1cYZu16SeyAVSzAAaARYW6bfnmqfr567+DDCEGQ7WSBmyrtkuCSlG7io1vsbkamQ3VQh6wqdgi
ImhbtrESVA/QxAIYABUvoLxkV7LhLshwZAxVQh0ASuK2pZujgbXbWar6AAMAi3ig672sSzcdhIrQCvxn aFu2sRJUD9DEAhgAFS+gvGRXsuEuyHBkDFVCHQBK4ralm6OBtdtZqvoAAwCLeKDrvaxLNx2EitAK/Gdk
ZGBgYAAASTmIRRBkor0AAAAASUVORK5CYII= YGBgAABSZ4fXERBsXgAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="btnNextPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnNextPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHCSURBVEhLYwCD+nomCINGwLZs0wmbss0hxmlnWKFC1AV2 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHCSURBVEhLYwCD+nomCINGwLZs0wmbss0hxmlnWKFC1AV2
FZv/Q/EN2/JNKfb1+zmgUtQBtuUN/0AYZAmItijd9MyufHO5ff56AagSygC6BTC2TdGmN0AfdTpVbZaG FZv/Q/EN2/JNKfb1+zmgUtQBtuX1/0AYZAmItijd9MyufHO5ff56AagSygC6BTC2TdGmN0AfdTpVbZaG
KiUPQIMHJ7asWPvFrmzzdJuKrWpQLaQBXD5AZ2tVbP5jU75ppVXpBhMGhv+MUO2EAT5DkdlwMddNf23L KiUPQIMHJ7asWPvFrmzzdJuKrWpQLaQBXD5AZ2tVbP5jU75ppVXpBhMGhv+MUO2EAT5DkdlwMedNf23L
N+yxr9jiQlQSB2kkC7tt/mtTuvmUbcWm8NDQVcxQ4zABuktxsZHF0Pl2pRtvAvNTumvxTm6osQiAVQOp N+yxr9jiQlQSB2kkC7ts/mtTuvmUbcWm8NDQVcxQ4zABuktxsZHF0Pl2pRtvAvNTumvxTm6osQiAVQOp
FsDZm54CcalF4Q4hqPHUtgDKLljzzrZ8YwPYApAAdXHjP+uKzfftKrakgS3A6Qo0NrIYOh/GtinbcNm+ FsDZm54CcalF4Q4hqPHUtgDKLljzzrZ8YwPYApAAdXH9P+uKzfftKrakgS3A6Qo0NrIYOh/GtinbcNm+
YlOsR+42drDhIACSpBiXbT5iU7kpAFiOsUCNRQB8LkJmI4uBsHz8/N/W5Rt32JVucIQahR3ANBBtQdam YlOsR+42drDhIACSpBiXbT5iU7kpAFiOsUCNRQB8LkJmI4uBsHz8/N/W5Rt32JVucIQahR3ANBBtQdam
nzZlG1fYlW8whBqBH4A0EoP189d/ty3fPBVYVKhDtRIH0F2Kyd74FlSq2lZtl4RqIQ1gN3Tzf1C9YFu2 nzZlG1fYlW8whBqBH4A0EoP189d/ty3fPBVYVKhDtRIH0F2Kyd74FlSq2lZtl4RqIQ1gN3Tzf1C9YFu2
sdKmYosgVCl5AGQYCi7ZcBeUhrFme3IA3NXlm8/alm6OxprUKAHWpZsOAl3uRcPWBQmVB0mAgQEA6D+I sdKmYosgVCl5AGQYCi7ZcBeUhrFme3IA3NXlm8/alm6OxprUKAHWpZsOAl3uRcPWBQmVB0mAgQEA5X2H
RTXTAxQAAAAASUVORK5CYII= 142IlcMAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="btnLastPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnLastPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFxSURBVEhLY4ABp8qN4lAmbYBt2dqPtuWbOmlmkV3F5v8g YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFwSURBVEhLY4ABp8qN4lAmbYBt2dqPtuWbOmlmkV3F5v8g
bF2x6YNtxaYO+6JNIlApooF8/PzfMHNgGCoF9EF5wz+QAIiGsj/ZlG9qs6ncJgpVQhCALEA3ByqF1QIw bF2x6YNtxaYO+6JNIlApooF8/PzfMHNgGCoF9EF5/T+QAIiGsj/ZlG9qs6ncJgpVQhCALEA3ByqF1QIw
27x803vb8s0txFiE1wKQIF5csOYd2KKKLYJQLRiA1CDCYINo63JgHJVtbLQo3CEE1QoHZAURMhtZzLZ8 27x803vb8s0txFiE1wKQIF5csOYd2KKKLYJQLRiA1CDCYINo63JgHJVtbLQo3CEE1QoHZAURMhtZzLZ8
41vbis21yD6iLIhw4eINr+wqNlWDzKBKEMHE0PngOHLd9BddHGo8FSzAwYYaTwcLQIK0wFDjh4APgGXY 41vbis21yD6iLIhw4eINr+wqNlWDzKBKEMHE0PngOHLe9BddHGo8FSzAwYYaTwcLQIK0wFDjh4APgGXY
Ja2KzX/QxaHGk+uDxn/WpZvOWZdvDnQp381P7Yx2Hli8B4eGrmKGGkGdjAYKCvuKLaH29ftZoFrhgIKM Ja2KzX/QxaHGk+uD+n/WpZvOWZdvDnQp381P7Yx2Hli8B4eGrmKGGkGdjAYKCvuKLaH29ftZoFrhgIKM
BgyKkk2XgPVEOEN9PRNUCwYgK4hsyjZctinbHIHNxeiApCCyrth4za5sU5Rx2hlWqBKCgIggavxnW7bp BgyKkk2XgPVEOEN9PRNUCwYgK4hsyjZctinbHIHNxeiApCCyrth4za5sU5Rx2hlWqBKCgIggAtpatumq
qm3p5mjkyCMW4PWBTen66/YVm2KN02YS7WKSAClBQTxgYAAA96Urd2ptB70AAAAASUVORK5CYII= benmaOTIIxbg9YFN6frr9hWbYo3TZhLtYpIAKUFBPGBgAAB8byrpVSoE5AAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="btnZoomOut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnZoomOut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMESURBVEhLtVXfS5NRGA6KLuqiKCSCqIsi6Da69qL+Bm/S YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMESURBVEhLtVVdS1RRFA2KHuqhKCSCqIci6DV69qF+gy9p
kLmpc2obzoGW22cJgWFhUrJCrbQyqIt+EEqUJUEgOEextDY3bUaUWKlJLbPv9Lz73vN5PqeoSQ+8vufH iDrqfDiNOA5oOXMtQTAsTEos1Eorg3rog1CiLAkC0TGKSaeZUaaMKLFSk5psuqe15+5zPXdGUZMWbPf5
c57nfY9+x3VLweVy7SkqKvIVFhY+Qo4VFxePYxxHPMa8xuFw7Gfq6mCz2bIgcCU3NzcFUZ3C6XQKNXPM WGetvY/e47ql4HQ695SUlPiKi4sfIkdLS0snMR5DPMK8xmaz7Wfq6lBQUJAFgcu5ubkJiOoUdrtdqJlj
Im7CaBcfXR4QPgSR9yS00igoKPiMfJgllgZaP4hqpmSFdJjzjKadGT13sXmsvr7xI80XcqhbFHeEpTJh HnEDRrv46PKA8CGIvCOhlUZhYeFn5MMssTTQ+kFUMyMrpMOc5zStPn72QstEQ0PTR5qnc6hbFHeEpTJR
t9u3gZiQByjKysomnvf2fooND+tCwcjIqB55MyjcbvdPlY8Yh8lulrQCxEYiy/D5fB8ikcgcCSaTSYuB VFS0DcRxeYCirKxs6ll//6e3kYguFIyNjeuhNyPC4/H8VPmISZjsZkkrQGwisgyfz/chFAolSTAej1sM
nMfjcT0YDP5RzyFus+Q8ysvLs+CebptIpaWlkyROQstFIpHQNU0zrys/P/93SUnJAZY2gA0Ht5gm3evq 5Dwajeqtra1/1HOIWyy5ALfbnQX3VNtEcrlc0yROQstFLBbTNU0zrys/P/+3w+E4wNIGsGHjFlOkuz29
HqfD6XIBdUyQc5mjsWGzA9LANWksbQAL7ZIA91/T32csossZ6PhZe+q0aQK9pyxtAIsvZQcVFdUTdDC7 k3Q4VS6gjglyLnMkGjM7IA1ck8bSBrDQKQlw/zX7fc4iupyBjp+1p06bJtB7wtIGsPhCdlBRUT1FB7Or
6oHIrnqIoKyO1TVjTvy26zfMDhBjLG0Ajq+kAe5zgqrKFFvagNB5975q8I2lDWDjhTSoPnFy+l86aL3W 7ovsqgcIyupYXTPmxO+4dt3sADHB0gbg+Eoa4D6nqKpMsaUNCN137qkG31jaADaeS4PqEydn/6WD9qud
bhrge0qytAFstNAmBd6fucmpacu9q2OCnMus45fgD2jp8xxPWNoAFo7KDojQ1d29KoPBoSFTnDRw5TUs pgG+p/csbQAbbbRJgfcnOT0za7l3dUyQc5l1/BL8AS11nuMxSxvAwlHZARF6entXZTAyOmqKkwauvIal
bQALW7D5RZI8Hs9cKBRakUEqlRJ1dXWmAWIWt7CPpecB54DsgLLf79fD4fCiH5eMaDSqNzU1mZVz7mBJ DWBhCza/SFJ5eXlycHBwRQaJRELU1dWZBoh53MI+ll4AnAOyA8p+v18PBoOLflwywuGw3tzcbFbOuYsl
K9DFJvprkmQKr9crenqeibfvopYO4vh6+0MDIhAImOLSAL/gPrwE21nWCmzuBYleS7VlcdztFvVnG8Sl rUAXm+ivSZIpvF6v6Ot7iisIWzqI4usdCg6LQCBgiksD/IIH8BJsZ1krsLkXJHot1ZbFcY9HNJxpFBcv
yy2i4fwF4a2spA/SwlEDhfbT48myVpAJdSIrUquTIdcW48gxdAboHxfLWpGXl7cZpFoQvi48rIqgyh/I tYnGc+eFt7KSPkgLRw0UOkSPJ8taQSbUiaxIrU6GXFuMI8fQGaZ/XCxrRV5e3maQakH4mn5YFUGVP5Bb
zRC7s3CPx2FwdrBsJvDebwXxGIhtyPScRJD70GEnxi4I7yReTk7ORqzfItFF4nVabK2AyXqYdiAyrosp IHY7fY/HL8HZwbKZwHu/FcRjIHYg03MSQh5Ah90YOyG8k3g5OTkbsX6TRBeJ1ymxtQIm62Hahci4Lqas
awfesQ3o7up/MyCwSev8FTnFX18SJqV3nndbAAAAAElFTkSuQmCC HXjHNqC7K//NgMAm7QtXZBd/AWaMJXnjHFh9AAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="btnZoomIn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnZoomIn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -307,25 +307,25 @@
<data name="btnSettings.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnSettings.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALCSURBVEhLpVY9aFNRFA6ig4sOijqpU5QK/clLcClmUVwc YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALDSURBVEhLpVY9aFNRFA6ig4sOijqpU5QI/XsNLsUsiouD
BF2MYrdWSfLevfcFdRCCDjqJYAURBylaoZKX91LRVVzs4mCrg0Ohi7i4qNAKteZ5vptz4zWvqSH94HDP oEP8wW6tkuS9e+8L6lAIOugkghVEHKRohUpe3ktFV3Gxi4OtDg6FLuLiokIr1Jjn+W7Ojdf81JB+cLjn
+e453zn33hdIyiDj1U6yq5GToX9g7PEv4i8z1T8ct/bUEUHsqGgG8bAMhnIqisENiGBNJ20GI8VnPyC4 fPec75x77wskYTDilU+yq5GWoX9g/PEv4q8w1T8ct/zUEUHsqGgO8ZAMBtMqisGlRFDTSZvBcO7ZDwh2
nmVl9IjT+sdRt7EX00IQa6YcfGz7IpjktM3BNBguzwzo+OrzneBafFjOV19v1Yn9wHFn90N8QEUrTGnQ slEZPeK0/nHUre7FtBDEOlIIPjZ9EUxz2uZgGgwV5lI6vvZ8J7gGHxYypddbdWI/cNz5/RBPqWiNKQ16
m7wHbywrouO81TscGU78nTSKM279FPicaBxp8WGcVQ26qjAe8aNj2PNdNyeEiJVSMa03wHUFTblkN8Ca k/fgjY2K6Dhv9Q5HhpN/J43iEbdyCnxaVI80+DAeVVW6qjAe9qNj2PNdNy2EiJVSMa03wHUFTbliN8Ca
FtPLLT+Mc17wMq+eTI2K6Vt59XA3aqTnTVgNXmihbnBU44Q+vqpP0bd/H34rpvdQ0QJyrqjSmpTyjS4g FLOrDT+M017wMqOezIyJ2VsZ9XA3aqTnTVoNXmihbnBU9YQ+vqrM0Ld/H34jpvdQ0RJyrqp8TUr5RhcQ
kHAEcVipVPrKNPhz4Ch3iKkk8BvAKdAgJ2qvlCgtKyVjqSeWa1gxfaFQ+A0x+HyaOcuPPc87xJJJ4MeF SDiCOCyfz39lGvw5cJQ7yFQ78BvAKdAgLcqvlMivKiVjqSeWNayYPpvN/oYYfD7NguXHnucdYsl24MeF
Bo4Xzl0S18Z8amAL0oRNE2Mlrmn5aPCZpdbHoKqnB/1gD4cpEpw3kxkRE2O1mjcRF4vFXVzaG3BFEOiw Bo4XLlwW18d9amAL0oR1E2Mlrm75aPCZpTpjQFWSA36wh8MECS6ayYyIibFazeuIc7ncLi7tDbgiCLTY
SRK7Q+tqBx9z2caQ0r1AAnfJ5lFkTblarVa3cJqG67rfTA5OQP5begNB/CinJIGCLpb47okrduS0jVOS NIndoXW9hY+5bGNI6V4kgbtkiyiyplwvlUpbOE3Ddd1vJgcnIP8tvYEgfoxT2oGCLtb23ROXa8lpGqe0
wCam4YnsE1Q4pQ2a9qLJsfK0cUoS9LBnqPA2HXPBbkAP+IVT2iChTyYHorgyslmqv84p3YH7RrFtJLLo A5uYhieyT1DklCZo2ksmx8rTxintoIc9Q4W36ZhLdgN6wC+c0gQJfTI5EMWVkc1T/RSndAfuG8W2kciy
+/5Z8k/TIB8692mv/QX2BJrkJyZDsZnSxFg7ruU7l/UGKmgYYbMas2Pjowmd6iaXb4xyubwDhZatdMRd 7/tnyT9Ng3xo3ae95hfYE2iSn5gMxWZKE2NtuZbvXNYbqKBqhM1qzI6NjyZ0qptcvjEKhcIOFFq21hJ3
jZpsZ5mNQclpFNA1PUBcqVT20ZSLmBQ8rUu0dxB75L9j/p8/EP/F+Pj4NnY1SAQ/QN2AxO8xrUHcYXb7 NWqynWU2BiUnUUDX9ABxsVjcR1MuY1LwtK7Q3kHskf+O+X/+QPwXExMT29jVIBH8AHUDEr/HtAZxh9nt
Bx2/AHG280yvg1TqD2SNZIrdoGvMAAAAAElFTkSuQmCC H3T88xBnu8B0ByQSfwCqJWQA7REYAQAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="statusbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>128, 20</value>
</metadata>
<metadata name="OpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="OpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>233, 25</value> <value>233, 25</value>
</metadata> </metadata>
<metadata name="PrintDocument1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>368, 25</value>
</metadata>
</root> </root>

View File

@@ -3,9 +3,10 @@ Imports System.Globalization
Imports System.Text.RegularExpressions Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports Independentsoft.Msg Imports Independentsoft.Msg
Imports DevExpress.Spreadsheet.DocumentFormat
Imports DevExpress.Spreadsheet Imports DevExpress.Spreadsheet
Imports GdPicture14 Imports GdPicture14
Imports DevExpress
Imports DevExpress.Office.Utils
Public Class DocumentViewer Public Class DocumentViewer
Private Enum ZoomMode Private Enum ZoomMode
@@ -69,9 +70,7 @@ Public Class DocumentViewer
''' Terminate Viewer, freeing up resources and deleting temp files ''' Terminate Viewer, freeing up resources and deleting temp files
''' </summary> ''' </summary>
Public Sub Done() Public Sub Done()
_logger.Warn("Called Done, removing temp files")
DeleteTempFiles() DeleteTempFiles()
'Dispose()
End Sub End Sub
''' <summary> ''' <summary>
@@ -132,28 +131,37 @@ Public Class DocumentViewer
Dim oTempFileName = IO.Path.GetTempFileName() Dim oTempFileName = IO.Path.GetTempFileName()
oMime.Save(oTempFileName, True) oMime.Save(oTempFileName, True)
RichEditControl1.LoadDocument(oTempFileName, DevExpress.XtraRichEdit.DocumentFormat.Mht) RichEditControl1.LoadDocument(oTempFileName, XtraRichEdit.DocumentFormat.Mht)
_TempFiles.Add(oTempFileName) _TempFiles.Add(oTempFileName)
RichEditControl1.Visible = True RichEditControl1.Visible = True
RichEditControl1.Dock = DockStyle.Fill RichEditControl1.Dock = DockStyle.Fill
Me.infoLabel.Text = "Type: " & "MSG Email File" Case ".EML", ".DOC", ".DOCX", ".ODT", ".RTF", ".TXT"
Case ".EML" Dim oFormat As XtraRichEdit.DocumentFormat = XtraRichEdit.DocumentFormat.Undefined
RichEditControl1.LoadDocument(FilePath, DevExpress.XtraRichEdit.DocumentFormat.Mht)
Select Case oExtension.ToUpper
Case ".EML" : oFormat = XtraRichEdit.DocumentFormat.Mht
Case ".DOC" : oFormat = XtraRichEdit.DocumentFormat.Doc
Case ".DOCX" : oFormat = XtraRichEdit.DocumentFormat.OpenXml
Case ".ODT" : oFormat = XtraRichEdit.DocumentFormat.OpenDocument
Case ".RTF" : oFormat = XtraRichEdit.DocumentFormat.Rtf
Case ".TXT" : oFormat = XtraRichEdit.DocumentFormat.PlainText
End Select
RichEditControl1.LoadDocument(FilePath, oFormat)
RichEditControl1.Visible = True RichEditControl1.Visible = True
RichEditControl1.Dock = DockStyle.Fill RichEditControl1.Dock = DockStyle.Fill
Me.infoLabel.Text = "Type: " & "EML Email File"
Case ".XLSX", ".XLS", "CSV" Case ".XLSX", ".XLS", "CSV"
Dim oFormat As DevExpress.Spreadsheet.DocumentFormat = Undefined Dim oFormat As Spreadsheet.DocumentFormat = Spreadsheet.DocumentFormat.Undefined
Select Case oExtension.ToUpper Select Case oExtension.ToUpper
Case "XLSX" : oFormat = Xlsx Case "XLSX" : oFormat = Spreadsheet.DocumentFormat.Xlsx
Case "XLS" : oFormat = Xls Case "XLS" : oFormat = Spreadsheet.DocumentFormat.Xls
Case "CSV" : oFormat = Csv Case "CSV" : oFormat = Spreadsheet.DocumentFormat.Csv
End Select End Select
SpreadsheetControl1.LoadDocument(FilePath, oFormat) SpreadsheetControl1.LoadDocument(FilePath, oFormat)
@@ -164,22 +172,11 @@ Public Class DocumentViewer
SpreadsheetControl1.Visible = True SpreadsheetControl1.Visible = True
SpreadsheetControl1.Dock = DockStyle.Fill SpreadsheetControl1.Dock = DockStyle.Fill
Me.infoLabel.Text = "Type: " & "Excel/CSV File"
Case Else Case Else
_logger.Info("Displaying file {0}", FilePath)
mainToolStrip.Visible = True mainToolStrip.Visible = True
GdViewer.DisplayFromFile(FilePath) GdViewer.DisplayFromFile(FilePath)
Me.infoLabel.Text = "Type: " & GetDocumentTypeLabel()
End Select End Select
If _hide_file_info_from_user Then
statusLabel.Text = String.Empty
Else
statusLabel.Text = "Path: " & FilePath
End If
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)
End Try End Try
@@ -197,25 +194,6 @@ Public Class DocumentViewer
UpdateMainUi() UpdateMainUi()
End Sub End Sub
Private Function GetDocumentTypeLabel() As String
Dim result As String = ""
Select Case GdViewer.GetDocumentType()
Case DocumentType.DocumentTypeBitmap
result = "Imagefile"
Case DocumentType.DocumentTypeMetaFile
result = "Metafile"
Case DocumentType.DocumentTypePDF
result = "PDF"
Case DocumentType.DocumentTypeSVG
result = "SVG"
Case DocumentType.DocumentTypeTXT
result = "textfile"
Case DocumentType.DocumentTypeUnknown
result = "Unknown"
End Select
Return result
End Function
''' <summary> ''' <summary>
''' Configures the viewer to hide the file path to the end-user. ''' Configures the viewer to hide the file path to the end-user.
''' </summary> ''' </summary>
@@ -559,8 +537,9 @@ Public Class DocumentViewer
GdViewer.Focus() GdViewer.Focus()
End Sub End Sub
'Private Sub DocumentViewer_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed Private Sub RichEditControl1_SizeChanged(sender As Object, e As EventArgs) Handles RichEditControl1.SizeChanged
' _logger.Warn("Disposing GDViewer") Dim oControlWidth = RichEditControl1.Width - 100
' GdViewer.Dispose() Dim oPageWidth = Units.DocumentsToPixelsF(RichEditControl1.Document.Sections(0).Page.Width, RichEditControl1.DpiX)
'End Sub RichEditControl1.Views.PrintLayoutView.ZoomFactor = oControlWidth / oPageWidth
End Sub
End Class End Class

View File

@@ -78,7 +78,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />

View File

@@ -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.0.0.1")> <Assembly: AssemblyVersion("1.0.2.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -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.0.2.1")> <Assembly: AssemblyVersion("1.0.2.2")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -157,9 +157,19 @@ Public Class frmLookupGrid
End Sub End Sub
Private Sub gridLookup_KeyUp(sender As Object, e As KeyEventArgs) Handles gridLookup.KeyUp Private Sub gridLookup_KeyUp(sender As Object, e As KeyEventArgs) Handles gridLookup.KeyUp
HandleCustomKeys(e)
End Sub
Private Sub gridLookup_EditorKeyUp(sender As Object, e As KeyEventArgs) Handles gridLookup.EditorKeyUp
HandleCustomKeys(e)
End Sub
Private Sub HandleCustomKeys(e As KeyEventArgs)
If e.KeyCode = Keys.Escape Then If e.KeyCode = Keys.Escape Then
Close() Close()
ElseIf e.KeyCode = Keys.F2 Then ElseIf e.KeyCode = Keys.F2 Then
' Make sure the currently focused row's state is saved
viewLookup.PostEditor()
SaveSelectedValues() SaveSelectedValues()
DialogResult = DialogResult.OK DialogResult = DialogResult.OK

View File

@@ -52,7 +52,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -49,7 +49,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
@@ -125,9 +125,7 @@
<CustomToolNamespace>My</CustomToolNamespace> <CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput> <LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None> </None>
<None Include="packages.config"> <None Include="packages.config" />
<SubType>Designer</SubType>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Modules.Database\Database.vbproj"> <ProjectReference Include="..\Modules.Database\Database.vbproj">

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -52,7 +52,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -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.1.0.0")> <Assembly: AssemblyVersion("1.1.0.1")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -27,11 +27,10 @@ Public Class ThreadRunner
Private Const TIMER_INTERVAL_MS = 10_000 Private Const TIMER_INTERVAL_MS = 10_000
Public Sub New(LogConfig As LogConfig, GDPictureKey As String, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing) Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
_logConfig = LogConfig _logConfig = LogConfig
_logger = _logConfig.GetLogger() _logger = _logConfig.GetLogger()
_firebird = Firebird _firebird = Firebird
_zugferd = New ZUGFeRDInterface(_logConfig)
_mssql = MSSQL _mssql = MSSQL
Dim args As New WorkerArgs() Dim args As New WorkerArgs()

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

11
EDMI.File/Archive.vb Normal file
View File

@@ -0,0 +1,11 @@
Imports DigitalData.Modules.Logging
Public Class Archive
Private _LogConfig As LogConfig
Private _Logger As Logger
Public Sub New(LogConfig As LogConfig)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
End Sub
End Class

120
EDMI.File/EDMI.File.vbproj Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1477032D-7A02-4C5F-B026-A7117DA4BC6B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DigitalData.Modules.EDMI.File</RootNamespace>
<AssemblyName>DigitalData.Modules.EDMI.File</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DigitalData.Modules.EDMI.File.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DigitalData.Modules.EDMI.File.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Archive.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules.Logging\Logging.vbproj">
<Project>{903B2D7D-3B80-4BE9-8713-7447B704E1B0}</Project>
<Name>Logging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' Allgemeine Informationen über eine Assembly werden über die folgenden
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
' die einer Assembly zugeordnet sind.
' Werte der Assemblyattribute überprüfen
<Assembly: AssemblyTitle("EDMI.File")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("EDMI.File")>
<Assembly: AssemblyCopyright("Copyright © 2020")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird.
<Assembly: Guid("2a4f6a80-e6e0-4764-ba6e-91484bda887f")>
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'
' Hauptversion
' Nebenversion
' Buildnummer
' Revision
'
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Modules.EDMI.File.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
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.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "Automatische My.Settings-Speicherfunktion"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.DigitalData.Modules.EDMI.File.My.MySettings
Get
Return Global.DigitalData.Modules.EDMI.File.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.7.0" targetFramework="net472" />
</packages>

View File

@@ -89,7 +89,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="ScintillaNET, Version=3.6.3.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ScintillaNET, Version=3.6.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll</HintPath> <HintPath>..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll</HintPath>
@@ -496,9 +496,9 @@
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project> <Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
<Name>Config</Name> <Name>Config</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Modules.EDMIAPI\EDMIAPI.vbproj"> <ProjectReference Include="..\Modules.EDMIAPI\EDMI.API.vbproj">
<Project>{5b1171dc-fffe-4813-a20d-786aae47b320}</Project> <Project>{5b1171dc-fffe-4813-a20d-786aae47b320}</Project>
<Name>EDMIAPI</Name> <Name>EDMI.API</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Modules.Language\Language.vbproj"> <ProjectReference Include="..\Modules.Language\Language.vbproj">
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project> <Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
@@ -512,9 +512,9 @@
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project> <Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
<Name>Logging</Name> <Name>Logging</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\SERVICES\DDEDM_NetworkService\IDBService.vbproj"> <ProjectReference Include="..\SERVICES\DDEDM_NetworkService\EDMIService.vbproj">
<Project>{A8C3F298-76AB-4359-AB3C-986E313B4336}</Project> <Project>{A8C3F298-76AB-4359-AB3C-986E313B4336}</Project>
<Name>IDBService</Name> <Name>EDMIService</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -3,6 +3,6 @@
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="FirebirdSql.EntityFrameworkCore.Firebird" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.EntityFrameworkCore.Firebird" version="6.4.0" targetFramework="net461" />
<package id="jacobslusser.ScintillaNET" version="3.6.3" targetFramework="net461" /> <package id="jacobslusser.ScintillaNET" version="3.6.3" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net461" /> <package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -45,20 +45,17 @@
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.Utils.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.Utils.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -62,7 +62,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -49,7 +49,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -4,6 +4,18 @@ Imports GdPicture14
Public Class Form1 Public Class Form1
Private oSubform As Form3 Private oSubform As Form3
Private LogConfig As LogConfig
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim oLogConfig As New LogConfig(LogConfig.PathType.CustomPath,
Application.StartupPath,
Nothing,
My.Application.Info.CompanyName,
My.Application.Info.ProductName)
LogConfig = oLogConfig
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oResult = OpenFileDialog1.ShowDialog() Dim oResult = OpenFileDialog1.ShowDialog()
@@ -14,8 +26,7 @@ Public Class Form1
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Try Try
Dim oKey = "0467389434974657969312056" Dim oKey = "0467389434974657969312056"
Dim oLogConfig As New LogConfig(LogConfig.PathType.CurrentDirectory) Dim oSubform As New Form3(LogConfig, oKey)
Dim oSubform As New Form3(oLogConfig, oKey)
oSubform.FilePath = TextBox1.Text oSubform.FilePath = TextBox1.Text
oSubform.Show() oSubform.Show()
@@ -27,8 +38,7 @@ Public Class Form1
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Try Try
Dim oKey = "0467389434974657969312056" Dim oKey = "0467389434974657969312056"
Dim oLogConfig As New LogConfig(LogConfig.PathType.CurrentDirectory) Dim oSubform As New Form4(LogConfig, oKey)
Dim oSubform As New Form4(oLogConfig, oKey)
oSubform.FilePath = TextBox1.Text oSubform.FilePath = TextBox1.Text
oSubform.Show() oSubform.Show()
@@ -76,4 +86,6 @@ Public Class Form1
End If End If
End Using End Using
End Sub End Sub
End Class End Class

View File

@@ -52,7 +52,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -52,7 +52,7 @@
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -25,7 +25,7 @@ Public Class Form1
_firebird = New Firebird(_logConfig, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PASS) _firebird = New Firebird(_logConfig, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PASS)
_mssql = New MSSQLServer(_logConfig, My.Settings.MSSQL_CONNECTIONSTRING) _mssql = New MSSQLServer(_logConfig, My.Settings.MSSQL_CONNECTIONSTRING)
_zugferd = New ZUGFeRDInterface(_logConfig) _zugferd = New ZUGFeRDInterface(_logConfig, "")
End Sub End Sub
Private Function LoadFolderConfig(args As WorkerArgs) Private Function LoadFolderConfig(args As WorkerArgs)
@@ -164,7 +164,7 @@ Public Class Form1
End Sub End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Dim oExtractor = New Jobs.PDFAttachments(_logConfig) Dim oExtractor = New PDFAttachments(_logConfig)
Dim oResult = OpenFileDialog1.ShowDialog() Dim oResult = OpenFileDialog1.ShowDialog()
If oResult = DialogResult.OK Then If oResult = DialogResult.OK Then

View File

@@ -52,7 +52,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -55,7 +55,7 @@
<Reference Include="DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPrinting.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.XtraPrinting.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -59,7 +59,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="Oracle.ManagedDataAccess"> <Reference Include="Oracle.ManagedDataAccess">
<HintPath>P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll</HintPath> <HintPath>P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll</HintPath>

View File

@@ -3,5 +3,5 @@
<package id="EntityFramework" version="6.2.0" targetFramework="net461" /> <package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="EntityFramework.Firebird" version="6.4.0" targetFramework="net461" /> <package id="EntityFramework.Firebird" version="6.4.0" targetFramework="net461" />
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="DocumentResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.IDBServiceReference.DocumentResult</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="DocumentResult2" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.IDBServiceReference.DocumentResult2</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="IndexResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.IDBServiceReference.IndexResult</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="NonQueryResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.IDBServiceReference.NonQueryResult</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ScalarResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.IDBServiceReference.ScalarResult</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="TableResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.IDBServiceReference.TableResult</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5B1171DC-FFFE-4813-A20D-786AAE47B320}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DigitalData.Modules.EDMI.API</RootNamespace>
<AssemblyName>DigitalData.Modules.EDMI.API</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DigitalData.Modules.EDMI.API.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DigitalData.Modules.EDMI.API.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Channel.vb" />
<Compile Include="Connected Services\IDBServiceReference\Reference.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="Constants.vb" />
<Compile Include="Document.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.EDMI.API.IDBServiceReference.DocumentResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.EDMI.API.IDBServiceReference.DocumentResult2.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.EDMI.API.IDBServiceReference.IndexResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.EDMI.API.IDBServiceReference.NonQueryResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.EDMI.API.IDBServiceReference.ScalarResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.EDMI.API.IDBServiceReference.TableResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Modules.Filesystem.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Services.IDBService.wsdl" />
<None Include="Connected Services\IDBServiceReference\DigitalData.Services.IDBService.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\IDBServiceReference\DigitalData.Services.IDBService1.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\IDBServiceReference\service.wsdl" />
<None Include="Connected Services\IDBServiceReference\service.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\IDBServiceReference\System.Data.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\IDBServiceReference\System.IO.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\IDBServiceReference\System.xsd">
<SubType>Designer</SubType>
</None>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules.Logging\Logging.vbproj">
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
<Name>Logging</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadataStorage Include="Connected Services\IDBServiceReference\" />
</ItemGroup>
<ItemGroup>
<None Include="Connected Services\IDBServiceReference\configuration91.svcinfo" />
</ItemGroup>
<ItemGroup>
<None Include="Connected Services\IDBServiceReference\configuration.svcinfo" />
</ItemGroup>
<ItemGroup>
<None Include="Connected Services\IDBServiceReference\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.vb</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@@ -169,7 +169,6 @@ Public Class File
<DebuggerStepThrough> <DebuggerStepThrough>
Public Sub MoveTo(FilePath As String, NewFileName As String, Directory As String) Public Sub MoveTo(FilePath As String, NewFileName As String, Directory As String)
Dim oFileInfo As New FileInfo(FilePath)
IO.File.Move(FilePath, Path.Combine(Directory, NewFileName)) IO.File.Move(FilePath, Path.Combine(Directory, NewFileName))
End Sub End Sub

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL"> <Reference Include="protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
<HintPath>..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll</HintPath> <HintPath>..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll</HintPath>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
<package id="protobuf-net" version="2.4.0" targetFramework="net461" /> <package id="protobuf-net" version="2.4.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -43,12 +43,15 @@
<OptionInfer>On</OptionInfer> <OptionInfer>On</OptionInfer>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="GdPicture.NET.14">
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
@@ -108,6 +111,10 @@
</Compile> </Compile>
<Compile Include="ZUGFeRDInterface\CrossIndustryDocumentType.vb" /> <Compile Include="ZUGFeRDInterface\CrossIndustryDocumentType.vb" />
<Compile Include="ZUGFeRDInterface.vb" /> <Compile Include="ZUGFeRDInterface.vb" />
<Compile Include="ZUGFeRDInterface\FileGroups.vb" />
<Compile Include="ZUGFeRDInterface\PDFAttachments.vb" />
<Compile Include="ZUGFeRDInterface\PropertyValues.vb" />
<Compile Include="ZUGFeRDInterface\XmlItemProperty.vb" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx"> <EmbeddedResource Include="My Project\Resources.resx">
@@ -128,7 +135,7 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput> <LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None> </None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="ZUGFeRDInterface\pdf_zugferd_lib.lib"> <None Include="ZUGFeRDInterface\pdf_zugferd_lib\pdf_zugferd_lib.lib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
@@ -143,10 +150,10 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="ZUGFeRDInterface\pdf_zugferd_lib.dll"> <Content Include="ZUGFeRDInterface\pdf_zugferd_lib\pdf_zugferd_lib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="ZUGFeRDInterface\pdf_zugferd_test.exe"> <Content Include="ZUGFeRDInterface\pdf_zugferd_lib\pdf_zugferd_test.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>

View File

@@ -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.0.0.0")> <Assembly: AssemblyVersion("1.0.1.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -1,28 +1,46 @@
Imports System.Xml Imports System.IO
Imports System.Xml
Imports System.Xml.Serialization Imports System.Xml.Serialization
Imports System.Xml.XPath Imports System.Xml.XPath
Imports System.Xml.Xsl Imports System.Xml.Xsl
Imports DigitalData.Modules.Interfaces.Exceptions Imports DigitalData.Modules.Interfaces.Exceptions
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports GdPicture14
Public Class ZUGFeRDInterface Public Class ZUGFeRDInterface
Private _logConfig As LogConfig Private _logConfig As LogConfig
Private _logger As Logger Private _logger As Logger
Private Const ZUGFERD_CONVERTER_EXE = "ZUGFeRDInterface\pdf_zugferd_test.exe" Private Const ZUGFERD_CONVERTER_EXE = "ZUGFeRDInterface\pdf_zugferd_lib\pdf_zugferd_test.exe"
Private Const ZUGFERD_CONVERTER_SUCCESS_MESSAGE = "Document contains ZUGFeRD data." Private Const ZUGFERD_CONVERTER_SUCCESS_MESSAGE = "Document contains ZUGFeRD data."
Public Enum ErrorType Public Enum ErrorType
NoValidFile NoValidFile
NoZugferd NoZugferd
NoValidZugferd NoValidZugferd
MissingProperties
End Enum End Enum
Public Sub New(LogConfig As LogConfig) Public ReadOnly Property FileGroup As FileGroups
Public ReadOnly Property PropertyValues As PropertyValues
Public Sub New(LogConfig As LogConfig, GDPictureKey As String)
_logConfig = LogConfig _logConfig = LogConfig
_logger = _logConfig.GetLogger() _logger = _logConfig.GetLogger()
FileGroup = New FileGroups(_logConfig)
PropertyValues = New PropertyValues(_logConfig)
Try
Dim oLicenseManager As New LicenseManager
oLicenseManager.RegisterKEY(GDPictureKey)
Catch ex As Exception
_logger.Warn("GDPicture License could not be registered!")
_logger.Error(ex)
End Try
End Sub End Sub
''' <summary> ''' <summary>
''' Validates a ZUGFeRD File and extracts the XML Document from it ''' Validates a ZUGFeRD File and extracts the XML Document from it
''' </summary> ''' </summary>
@@ -30,7 +48,6 @@ Public Class ZUGFeRDInterface
''' <exception cref="ZUGFeRDExecption"></exception> ''' <exception cref="ZUGFeRDExecption"></exception>
''' <returns></returns> ''' <returns></returns>
Public Function ExtractZUGFeRDFile(Path As String) As CrossIndustryDocumentType Public Function ExtractZUGFeRDFile(Path As String) As CrossIndustryDocumentType
Dim oException As New Exception
Dim oXmlDocument = ValidateZUGFeRDFile(Path) Dim oXmlDocument = ValidateZUGFeRDFile(Path)
If IsNothing(oXmlDocument) Then If IsNothing(oXmlDocument) Then
@@ -40,6 +57,25 @@ Public Class ZUGFeRDInterface
Return SerializeZUGFeRDDocument(oXmlDocument) Return SerializeZUGFeRDDocument(oXmlDocument)
End Function End Function
Public Function ExtractZUGFeRDFileWithGDPicture(Path As String) As CrossIndustryDocumentType
Dim oXmlDocument = ValidateZUGFeRDFileWithGDPicture(Path)
If IsNothing(oXmlDocument) Then
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
End If
Return SerializeZUGFeRDDocument(oXmlDocument)
End Function
Public Function ExtractZUGFeRDFileWithGDPicture(Stream As Stream) As CrossIndustryDocumentType
Dim oXmlDocument = ValidateZUGFeRDFileWithGDPicture(Stream)
If IsNothing(oXmlDocument) Then
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
End If
Return SerializeZUGFeRDDocument(oXmlDocument)
End Function
Public Function ValidateZUGFeRDFile(Path As String) As XPathDocument Public Function ValidateZUGFeRDFile(Path As String) As XPathDocument
Dim oProcessOutput, oProcessError As String Dim oProcessOutput, oProcessError As String
@@ -85,6 +121,69 @@ Public Class ZUGFeRDInterface
Return oXmlDocument Return oXmlDocument
End Function End Function
Public Function ValidateZUGFeRDFileWithGDPicture(Stream As Stream) As XPathDocument
Dim oAttachmentExtractor = New PDFAttachments(_logConfig)
Dim oAllowedExtensions = New List(Of String) From {"xml"}
Try
Dim oResults = oAttachmentExtractor.Extract(Stream, oAllowedExtensions)
Return HandleAttachments(oResults)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Public Function ValidateZUGFeRDFileWithGDPicture(Path As String) As XPathDocument
Dim oAttachmentExtractor = New PDFAttachments(_logConfig)
Dim oAllowedExtensions = New List(Of String) From {"xml"}
Try
Dim oResults = oAttachmentExtractor.Extract(Path, oAllowedExtensions)
Return HandleAttachments(oResults)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Private Function HandleAttachments(Results As List(Of PDFAttachments.AttachmentResult)) As XPathDocument
Dim oXmlDocument As XPathDocument
If Results Is Nothing Then
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
End If
If Results.Count = 0 Then
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
End If
Dim oFound As Boolean = False
Dim oFoundResult As PDFAttachments.AttachmentResult = Nothing
For Each oResult In Results
If oResult.FileName.ToUpper() = PDFAttachments.ZUGFERD_XML_FILENAME.ToUpper() Then
oFound = True
oFoundResult = oResult
End If
Next
If Not oFound Then
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei.")
End If
Try
Using oStream As New MemoryStream(oFoundResult.FileContents)
oXmlDocument = New XPathDocument(oStream)
End Using
Return oXmlDocument
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Public Function SerializeZUGFeRDDocument(Document As XPathDocument) As CrossIndustryDocumentType Public Function SerializeZUGFeRDDocument(Document As XPathDocument) As CrossIndustryDocumentType
Try Try
Dim oNavigator As XPathNavigator = Document.CreateNavigator() Dim oNavigator As XPathNavigator = Document.CreateNavigator()

View File

@@ -0,0 +1,82 @@
Imports System.IO
Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Logging
Public Class FileGroups
Private _logger As Logger
Public Sub New(LogConfig As LogConfig)
_logger = LogConfig.GetLogger()
End Sub
''' <summary>
''' Group files by message id. Message id is extracted from filename.
''' Filename is expected to be in the form: 1234@subdomain.company.com
''' <param name="Files">The list of files to process</param>
''' </summary>
Public Function GroupFiles(Files As List(Of FileInfo)) As Dictionary(Of String, List(Of FileInfo))
Dim oGrouped As New Dictionary(Of String, List(Of FileInfo))
If Files.Count = 0 Then
Return oGrouped
End If
For Each oFile In Files
Dim oMessageId = GetMessageIdFromFileName(oFile.Name)
If oMessageId Is Nothing Then
_logger.Warn("File {0} did not have the required filename-format!", oMessageId)
Continue For
End If
If oGrouped.ContainsKey(oMessageId) Then
oGrouped.Item(oMessageId).Add(oFile)
Else
oGrouped.Add(oMessageId, New List(Of FileInfo) From {oFile})
End If
Next
Return oGrouped
End Function
''' <summary>
''' Group files by message id. Message id is created from `FakeMessageIdDomain` and a random string
''' </summary>
''' <param name="Files">The list of files to process</param>
''' <param name="FakeMessageIdDomain">Arbitrary domain for message id generation. Example: sub.company.com</param>
''' <returns></returns>
Public Function GroupFiles(Files As List(Of FileInfo), FakeMessageIdDomain As String) As Dictionary(Of String, List(Of FileInfo))
Dim oGrouped As New Dictionary(Of String, List(Of FileInfo))
If Files.Count = 0 Then
Return oGrouped
End If
For Each oFile In Files
Dim oIdentifier = Guid.NewGuid().ToString()
Dim oMessageId = $"{oIdentifier}@{FakeMessageIdDomain}"
If oGrouped.ContainsKey(oMessageId) Then
oGrouped.Item(oMessageId).Add(oFile)
Else
oGrouped.Add(oMessageId, New List(Of FileInfo) From {oFile})
End If
Next
Return oGrouped
End Function
Private Function GetMessageIdFromFileName(Filename As String) As String
' Regex to find MessageId
' See also: https://stackoverflow.com/questions/3968500/regex-to-validate-a-message-id-as-per-rfc2822
Dim oRegex = "(((([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)|(""(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21\x23-\x5B\x5D-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*""))@(([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)|(\[(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21-\x5A\x5E-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*\]))))~.+"
Dim oMatch = Regex.Match(Filename, oRegex, RegexOptions.IgnoreCase)
If oMatch.Success Then
Dim oMessageId = oMatch.Groups(1).Value
Return oMessageId
Else
Return Nothing
End If
End Function
End Class

View File

@@ -0,0 +1,136 @@
Imports System.Collections.Generic
Imports System.IO
Imports DigitalData.Modules.Logging
Imports GdPicture14
Public Class PDFAttachments
Private ReadOnly Logger As Logger
Public Const ZUGFERD_XML_FILENAME = "ZUGFeRD-invoice.xml"
Public Class AttachmentResult
Public FileName As String
Public FileContents As Byte()
End Class
Public Sub New(LogConfig As LogConfig)
Logger = LogConfig.GetLogger
End Sub
''' <summary>
''' Extracts all embedded files from a PDF file.
''' Note: This does NOT filter out `ZUGFeRD-invoice.xml` anymore to allow for a more generic use.
''' </summary>
''' <param name="FilePath">Filepath of the pdf</param>
''' <param name="AllowedExtensions">List of allowed extensions to be extracted</param>
Public Function Extract(FilePath As String, AllowedExtensions As List(Of String)) As List(Of AttachmentResult)
Dim oResults As New List(Of AttachmentResult)
Dim oExtensions = AllowedExtensions.ConvertAll(New Converter(Of String, String)(Function(ext) ext.ToUpper))
Logger.Debug("Extracting embedded files from [{0}]", FilePath)
Try
Using oGDPicturePDF As New GdPicturePDF()
If oGDPicturePDF.LoadFromFile(FilePath, False) = GdPictureStatus.OK Then
oResults = DoExtract(oGDPicturePDF, oExtensions)
Else
Dim oMessage = String.Format("The file [{0}] can't be loaded. Status: [{1}]", FilePath, oGDPicturePDF.GetStat().ToString())
Throw New ApplicationException(oMessage)
End If
End Using
Return oResults
Catch ex As Exception
Logger.Warn("Unexpected Error while Extracting attachments from File [{0}]", FilePath)
Logger.Error(ex)
Return Nothing
End Try
End Function
''' <summary>
''' Extracts all embedded files from a PDF file.
''' Note: This does NOT filter out `ZUGFeRD-invoice.xml` anymore to allow for a more generic use.
''' </summary>
''' <param name="Stream">Filestream of the pdf</param>
''' <param name="AllowedExtensions">List of allowed extensions to be extracted</param>
Public Function Extract(Stream As Stream, AllowedExtensions As List(Of String)) As List(Of AttachmentResult)
Dim oResults As New List(Of AttachmentResult)
Dim oExtensions = AllowedExtensions.ConvertAll(New Converter(Of String, String)(Function(ext) ext.ToUpper))
Logger.Debug("Extracting embedded files from stream")
Try
Using oGDPicturePDF As New GdPicturePDF()
If oGDPicturePDF.LoadFromStream(Stream, False) = GdPictureStatus.OK Then
oResults = DoExtract(oGDPicturePDF, oExtensions)
Else
Dim oMessage = String.Format("The filestream can't be loaded. Status: [{0}]", oGDPicturePDF.GetStat().ToString())
Throw New ApplicationException(oMessage)
End If
End Using
Return oResults
Catch ex As Exception
Logger.Warn("Unexpected Error while Extracting attachments from Filestream")
Logger.Error(ex)
Return Nothing
End Try
End Function
Private Function DoExtract(GDPicturePDF As GdPicturePDF, Extensions As List(Of String)) As List(Of AttachmentResult)
Dim oResults As New List(Of AttachmentResult)
Dim oEmbeddedFileCount As Integer = GDPicturePDF.GetEmbeddedFileCount()
If GDPicturePDF.GetStat() = GdPictureStatus.OK Then
Logger.Debug("Embedded file count is: [{0}]", oEmbeddedFileCount)
If oEmbeddedFileCount > 0 Then
For oIndex = 0 To oEmbeddedFileCount - 1
Dim oFileName As String = GDPicturePDF.GetEmbeddedFileName(oIndex)
If GDPicturePDF.GetStat() = GdPictureStatus.OK Then
Logger.Debug("Extracting embedded file [{0}]", oFileName)
Dim oExtension = New FileInfo(oFileName).Extension.ToUpper.Substring(1)
If Extensions.Contains(oExtension) Then
Dim oFileSize As Integer = GDPicturePDF.GetEmbeddedFileSize(oIndex)
If GDPicturePDF.GetStat() = GdPictureStatus.OK Then
Logger.Debug("Filesize of embedded file is [{0}]", oFileSize)
Dim oFileData As Byte() = New Byte(oFileSize) {}
Dim oStatus As GdPictureStatus = GDPicturePDF.ExtractEmbeddedFile(oIndex, oFileData)
If oStatus = GdPictureStatus.OK Then
Logger.Debug("Embedded file [{0}] extracted sucessfully!", oFileName)
oResults.Add(New AttachmentResult() With {
.FileContents = oFileData,
.FileName = oFileName
})
Else
Logger.Error("The embedded file [{0}] has failed to extract. Status: {1}", oFileName, GDPicturePDF.GetStat().ToString())
Continue For
End If
Else
Logger.Error("An error occurred getting the file size for [{0}]. Status: {1}", oFileName, GDPicturePDF.GetStat().ToString())
Continue For
End If
Else
Logger.Warn("File [{0}] was skipped because its extension [{1}] is not allowed.", oFileName, oExtension)
Continue For
End If
Else
Logger.Error("An error occurred getting the file name for [{0}]. Status: {1}", oFileName, GDPicturePDF.GetStat().ToString())
Continue For
End If
Next
End If
Return oResults
Else
Dim oMessage = String.Format("An error occurred getting the number of embedded files. Status: {0}", GDPicturePDF.GetStat().ToString())
Throw New ApplicationException(oMessage)
End If
End Function
End Class

View File

@@ -0,0 +1,313 @@
Imports System.Reflection
Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Logging
Public Class PropertyValues
Private _logger As Logger
Private _logConfig As LogConfig
Private _indexPattern = "\((\d+)\)"
Private _indexRegex As New Regex(_indexPattern)
Public Sub New(LogConfig As LogConfig)
_logConfig = LogConfig
_logger = LogConfig.GetLogger()
End Sub
Public Class CheckPropertyValuesResult
Public MissingProperties As New List(Of String)
Public ValidProperties As New List(Of ValidProperty)
End Class
Public Class ValidProperty
Public MessageId As String
Public TableName As String
Public GroupCounter As Integer = -1
Public Description As String
Public Value As String
End Class
Public Function CheckPropertyValues(Document As CrossIndustryDocumentType, PropertyMap As Dictionary(Of String, XmlItemProperty), MessageId As String) As CheckPropertyValuesResult
Dim oGlobalGroupCounter = 0
Dim oMissingProperties As New List(Of String)
Dim oResult As New CheckPropertyValuesResult()
' PropertyMap items with `IsGrouped = False` are handled normally
Dim oDefaultProperties As Dictionary(Of String, XmlItemProperty) = PropertyMap.
Where(Function(Item) Item.Value.IsGrouped = False).
ToDictionary(Function(Item) Item.Key,
Function(Item) Item.Value)
_logger.Debug("Found {0} default properties.", oDefaultProperties.Count)
' PropertyMap items with `IsGrouped = True` are grouped by group scope
Dim oGroupedProperties = PropertyMap.
Where(Function(Item) Item.Value.IsGrouped = True).
ToLookup(Function(Item) Item.Value.GroupScope, ' Lookup key is group scope
Function(Item) Item)
_logger.Debug("Found {0} properties grouped in {1} group(s)", PropertyMap.Count - oDefaultProperties.Count, oGroupedProperties.Count)
' Iterate through groups to get group scope and group items
For Each oGroup In oGroupedProperties
Dim oGroupScope As String = oGroup.Key
Dim oPropertyList As New Dictionary(Of XmlItemProperty, List(Of Object))
Dim oRowCount = 0
_logger.Debug("Fetching Property values for group {0}.", oGroupScope)
' get properties as a nested object, see `oPropertyList`
For Each oProperty As KeyValuePair(Of String, XmlItemProperty) In oGroup
Dim oPropertyValues As List(Of Object)
Try
oPropertyValues = GetPropValue(Document, oProperty.Key)
Catch ex As Exception
_logger.Warn("Unknown error occurred while fetching property [{0}] in group [{1}]:", oProperty.Value.Description, oGroupScope)
_logger.Error(ex)
oPropertyValues = New List(Of Object)
End Try
' Flatten result value
oPropertyValues = GetFinalPropValue(oPropertyValues)
' Add to list
oPropertyList.Add(oProperty.Value, oPropertyValues)
' check the first batch of values to determine the row count
If oRowCount = 0 Then
oRowCount = oPropertyValues.Count
End If
Next
' Structure of oPropertyList
' [ # Propertyname # Row 1 # Row 2
' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...],
' PositionsSteuersatz: [ApplicablePercent1, ApplicablePercent2, ...],
' ...
' ]
For oRowIndex = 0 To oRowCount - 1
_logger.Debug("Processing row {0}", oRowIndex)
For Each oColumn As KeyValuePair(Of XmlItemProperty, List(Of Object)) In oPropertyList
Dim oTableName As String = oColumn.Key.TableName
Dim oPropertyDescription As String = oColumn.Key.Description
Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1
' Returns nothing if oColumn.Value contains an empty list
Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex)
_logger.Debug("Processing property {0}.", oPropertyDescription)
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
If oColumn.Key.IsRequired Then
_logger.Warn("Property [{0}] is empty or not found but is required. Continuing with Empty String.", oPropertyDescription)
oResult.MissingProperties.Add(oPropertyDescription)
Else
_logger.Debug("Property [{0}] is empty or not found. Continuing with Empty String.", oPropertyDescription)
End If
oPropertyValue = String.Empty
End If
_logger.Debug("Property {0} has value '{1}'", oPropertyDescription, oPropertyValue)
oResult.ValidProperties.Add(New ValidProperty() With {
.MessageId = MessageId,
.Description = oPropertyDescription,
.Value = oPropertyValue,
.GroupCounter = oRowCounter,
.TableName = oTableName
})
Next
Next
oGlobalGroupCounter += oRowCount
Next
' Iterate through default properties
For Each oItem As KeyValuePair(Of String, XmlItemProperty) In oDefaultProperties
Dim oPropertyValueList As List(Of Object)
Dim oPropertyDescription As String = oItem.Value.Description
Dim oPropertyValue As Object = Nothing
Dim oTableName = oItem.Value.TableName
Try
oPropertyValueList = GetPropValue(Document, oItem.Key)
Catch ex As Exception
_logger.Warn("Unknown error occurred while fetching property {0} in group {1}:", oPropertyDescription, oItem.Value.GroupScope)
_logger.Error(ex)
oPropertyValueList = New List(Of Object)
End Try
Try
If IsNothing(oPropertyValueList) Then
oPropertyValue = Nothing
ElseIf TypeOf oPropertyValueList Is List(Of Object) Then
Select Case oPropertyValueList.Count
Case 0
oPropertyValue = Nothing
Case Else
Dim oList As List(Of Object) = DirectCast(oPropertyValueList, List(Of Object))
oPropertyValue = oList.Item(0)
' This should hopefully show config errors
If TypeOf oPropertyValue Is List(Of Object) Then
_logger.Warn("Property with Description {0} may be configured incorrectly", oPropertyDescription)
oPropertyValue = Nothing
End If
End Select
End If
Catch ex As Exception
_logger.Warn("Unknown error occurred while processing property {0}:", oPropertyDescription)
_logger.Error(ex)
oPropertyValue = Nothing
End Try
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
If oItem.Value.IsRequired Then
_logger.Warn("Property {0} is empty but marked as required! Skipping.", oPropertyDescription)
oResult.MissingProperties.Add(oPropertyDescription)
Continue For
Else
_logger.Debug("Property [{0}] is empty or not found. Skipping.", oPropertyDescription)
Continue For
End If
End If
oResult.ValidProperties.Add(New ValidProperty() With {
.MessageId = MessageId,
.Description = oPropertyDescription,
.Value = oPropertyValue,
.TableName = oTableName
})
Next
Return oResult
End Function
Public Function GetPropValue(Obj As Object, PropertyName As String) As List(Of Object)
Dim oNameParts As String() = PropertyName.Split("."c)
If IsNothing(Obj) Then
_logger.Debug("`Obj` is Nothing. Exiting.")
Return New List(Of Object)
End If
If oNameParts.Length = 1 Then
Dim oPropInfo As PropertyInfo = Obj.GetType().GetProperty(PropertyName)
If IsNothing(oPropInfo) Then
_logger.Debug("Property {0} does not exist.", PropertyName)
Return New List(Of Object)
Else
Dim oPropValue = oPropInfo.GetValue(Obj, Nothing)
Return New List(Of Object) From {oPropValue}
End If
End If
For Each oPart As String In oNameParts
Dim oType As Type = Obj.GetType()
Dim oPartName = oPart
Dim oIndex As Integer = Nothing
Dim oHasIndex As Boolean = HasIndex(oPartName)
If oHasIndex Then
oPartName = StripIndex(oPart)
oIndex = GetIndex(oPart)
End If
Dim oInfo As PropertyInfo = oType.GetProperty(oPartName)
If IsNothing(oInfo) OrElse IsNothing(oInfo.GetValue(Obj, Nothing)) Then
_logger.Debug("Property {0} does not exist.", oPartName)
Return New List(Of Object)
End If
Obj = oInfo.GetValue(Obj, Nothing)
If oHasIndex Then
Obj = Obj(0)
End If
If IsArray(Obj) And Not oHasIndex Then
Dim oCurrentPart As String = oPart
Dim oSplitString As String() = New String() {oCurrentPart & "."}
Dim oPathFragments = PropertyName.Split(oSplitString, StringSplitOptions.None)
Dim oResults As New List(Of Object)
' if path has no more subitems, return an empty list
If oPathFragments.Length = 1 Then
Return oResults
End If
For Each oArrayItem In Obj
Dim oResult As List(Of Object) = GetPropValue(oArrayItem, oPathFragments(1))
If Not IsNothing(oResult) Then
oResults.Add(oResult)
End If
Next
Return oResults
End If
Next
Return New List(Of Object) From {Obj}
End Function
Public Function GetFinalPropValue(List As List(Of Object)) As List(Of Object)
Dim oResult As New List(Of Object)
For Each Item In List
Dim oItemValue = DoGetFinalPropValue(Item)
If Not IsNothing(oItemValue) Then
oResult.Add(oItemValue)
End If
Next
Return oResult
End Function
Private Function DoGetFinalPropValue(Value As Object) As String
If TypeOf Value Is List(Of Object) Then
Dim oList = DirectCast(Value, List(Of Object))
Dim oCount = oList.Count
Select Case oCount
Case 0
Return Nothing
Case Else
Return DoGetFinalPropValue(oList.First())
End Select
Return DoGetFinalPropValue(Value)
Else
Return Value.ToString
End If
End Function
Private Function GetIndex(Prop As String) As Integer
If Regex.IsMatch(Prop, _indexPattern) Then
Dim oMatch = _indexRegex.Match(Prop)
Dim oGroup = oMatch.Groups.Item(1)
Dim oValue = oGroup.Value
Return Integer.Parse(oValue)
End If
Return Nothing
End Function
Private Function StripIndex(Prop As String) As String
Return Regex.Replace(Prop, _indexPattern, "")
End Function
Private Function HasIndex(Prop As String) As Boolean
Return Regex.IsMatch(Prop, _indexPattern)
End Function
End Class

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -0,0 +1,197 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Database
Imports System.Data
Imports System.IO
Public Class EmailFunctions
Private ReadOnly _logConfig As LogConfig
Private ReadOnly _logger As Logger
Private ReadOnly _mssql As MSSQLServer
Private ReadOnly _firebird As Firebird
Public Sub New(LogConfig As LogConfig, MSSQL As MSSQLServer, Firebird As Firebird)
_logConfig = LogConfig
_logger = _logConfig.GetLogger()
_mssql = MSSQL
_firebird = Firebird
End Sub
Public Sub AddToEmailQueueFB(MessageId As String, BodyText As String, EmailData As EmailData)
If EmailData Is Nothing Then
_logger.Warn("EmailData is empty. Email will not be sent!")
Exit Sub
End If
Try
Dim oJobId = RandomValue(1, 10000)
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = EmailStrings.EMAIL_SUBJECT
Dim oAccountId = 1
Dim oCreatedWho = "ZUGFeRD Service"
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, BodyText)
Dim oEmailAddress = EmailData.From
Dim oAttachment = EmailData.Attachment
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
_logger.Warn("Could not find email-address for MessageId {0}", MessageId)
oEmailTo = String.Empty
Else
oEmailTo = oEmailAddress
End If
_logger.Debug("Generated Email:")
_logger.Debug("To: {0}", oEmailTo)
_logger.Debug("Subject: {0}", oSubject)
_logger.Debug("Body {0}", oFinalBodyText)
Dim osql = $"select * from TBEDM_EMAIL_QUEUE where REFERENCE1 = '{oReference} and EMAIL_TO = ''{oEmailTo}' and EMAIL_SUBJ = '{oSubject}'"
Dim oDTResult As DataTable = _firebird.GetDatatable(osql)
If oDTResult.Rows.Count = 0 Then
Dim oSQLInsert = $"INSERT INTO TBEDM_EMAIL_QUEUE "
oSQLInsert &= "(JOB_ID, REFERENCE1, EMAIL_ACCOUNT_ID, EMAIL_TO, EMAIL_SUBJ, EMAIL_BODY, CREATEDWHO, EMAIL_ATTMT1) VALUES "
oSQLInsert &= $"({oJobId}, '{oReference}', {oAccountId}, '{oEmailTo}', '{oSubject}', '{oFinalBodyText.Replace("'", "''")}', '{oCreatedWho}', '{oAttachment}')"
_firebird.ExecuteNonQuery(oSQLInsert)
_logger.Debug("Email Queue updated for MessageId {0}.", MessageId, oEmailTo)
Else
_logger.Debug("Email has already been sent!!")
End If
Catch ex As Exception
_logger.Error(ex)
End Try
End Sub
Public Sub AddToEmailQueueMSSQL(MessageId As String, BodyText As String, pEmailData As EmailData, SourceProcedure As String)
If pEmailData Is Nothing Then
_logger.Warn("EmailData is empty. Email will not be sent!")
Exit Sub
End If
Try
Dim oJobId = RandomValue(1, 10000)
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = EmailStrings.EMAIL_SUBJECT
Dim oAccountId = 1
Dim oCreatedWho = "ZUGFeRD Service"
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, BodyText)
Dim oEmailAddress = pEmailData.From
Dim oAttachment = pEmailData.Attachment
If oAttachment <> String.Empty Then
_logger.Debug($"Attachment_String [{oAttachment}]!")
If IO.File.Exists(oAttachment) = False Then
_logger.Info($"Attachment.File [{oAttachment}] is not existing!!!")
End If
End If
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
_logger.Warn("Could not find email-address for MessageId {0}", MessageId)
oEmailTo = String.Empty
Else
oEmailTo = oEmailAddress
End If
_logger.Debug("Generated Email:")
_logger.Debug("To: {0}", oEmailTo)
_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)
'osql = $"select * from TBEMLP_EMAIL_OUT where REFERENCE_ID = {oHistoryID} and EMAIL_ADRESS = '{oEmailTo}' and EMAIL_SUBJ = '{oSubject}'"
'Dim oDTResult As DataTable = _mssql.GetDatatable(osql)
If IsNumeric(oHistoryID) Then
Dim oInsert = $"INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] (
[REMINDER_TYPE_ID]
,[SENDING_PROFILE]
,[REFERENCE_ID]
,[REFERENCE_STRING]
,[WF_ID]
,[EMAIL_ADRESS]
,[EMAIL_SUBJ]
,[EMAIL_BODY]
,[COMMENT]
,[ADDED_WHO]
,EMAIL_ATTMT1)
VALUES
(77
,{oAccountId}
,{oHistoryID}
,'{MessageId}'
,77
,'{oEmailTo}'
,'{oSubject}'
,'{oFinalBodyText}'
,'{SourceProcedure}'
,'{oCreatedWho}'
,'{oAttachment}')"
_mssql.ExecuteNonQuery(oInsert)
Else
'If oDTResult.Rows.Count = 0 Then
' _logger.Debug("Email has already been sent!!")
'Else
_logger.Warn("Could not get oHistoryID in AddToEmailQueueMSSQL!!")
' End If
End If
Catch ex As Exception
_logger.Error(ex)
End Try
End Sub
Public Function GetEmailDataForMessageId(MessageId As String) As EmailData
Dim oSQL = $"SELECT EMAIL_FROM, EMAIL_SUBJECT, EMAIL_ATTMT1 FROM TBEDM_EMAIL_PROFILER_HISTORY WHERE EMAIL_MSGID = '{MessageId}'"
Try
Dim oDatatable = _firebird.GetDatatable(oSQL)
Dim oRow As DataRow
If oDatatable.Rows.Count = 0 Then
_logger.Warn("Got no results for MessageId {0}", MessageId)
Return Nothing
ElseIf oDatatable.Rows.Count > 1 Then
_logger.Warn("Got too many results for MessageId {0}. Using last row.", MessageId)
End If
_logger.Debug("Got Email Data for FileId {0}", MessageId)
oRow = oDatatable.Rows.Item(oDatatable.Rows.Count - 1)
Return New EmailData() With {
.From = oRow.Item("EMAIL_FROM"),
.Attachment = oRow.Item("EMAIL_ATTMT1"),
.Subject = oRow.Item("EMAIL_SUBJECT")
}
Catch ex As Exception
_logger.Warn("Could not fetch Email Data for FileId {0}", MessageId)
Return Nothing
End Try
End Function
Public Function GetOriginalEmailPath(OriginalEmailDirectory As String, MessageId As String) As String
Dim oAttachmentDirectory = OriginalEmailDirectory
Dim oAttachmentFile = MessageId & ".eml"
Dim oAttachmentPath = Path.Combine(oAttachmentDirectory, oAttachmentFile)
If IO.File.Exists(oAttachmentPath) Then
Return oAttachmentPath
Else
Return String.Empty
End If
End Function
Public Function GetEmailPathWithSubjectAsName(RejectedEmailDirectory As String, UncleanedSubject As String) As String
Dim oCleanSubject = String.Join("", UncleanedSubject.Split(Path.GetInvalidPathChars()))
Dim oAttachmentDirectory = RejectedEmailDirectory
Dim oAttachmentFile = oCleanSubject & ".eml"
Dim oAttachmentPath = Path.Combine(oAttachmentDirectory, oAttachmentFile)
Return oAttachmentPath
End Function
Private Function RandomValue(lowerBound As Integer, upperBound As Integer) As Integer
Dim oRandomValue = CInt(Math.Floor((upperBound - lowerBound + 1) * Rnd())) + lowerBound
Return oRandomValue
End Function
End Class

View File

@@ -0,0 +1,18 @@
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_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>
<li>Betrags-Werte weisen ungültiges Format auf (25,01 anstatt 25.01)</li>
</ul></p>
"""
End Class

View File

@@ -26,106 +26,47 @@ Public Class ImportZUGFeRDFiles
Public Const ZUGFERD_ATTACHMENTS = "ZUGFeRD Attachments" Public Const ZUGFERD_ATTACHMENTS = "ZUGFeRD Attachments"
Public HISTORY_ID As Integer Public HISTORY_ID As Integer
Private 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>"
Private Const EMAIL_SUBJECT = "WISAG ZUGFeRD Portal: Beleg abgelehnt"
Private Const EMAIL_MISSINGPROPERTIES_1 = "<p>Die angehängte Datei entspricht nicht dem WISAG ZUGFeRD-Format: {0}</p>"
Private Const EMAIL_MISSINGPROPERTIES_2 = "<p>Die folgenden Eigenschaften wurden als ERFORDERLICH eingestuft, wurden aber nicht gefunden:<p/>"
Private Const EMAIL_MD5_ERROR = "<p>Die von Ihnen gesendete Rechnung wurde bereits von unserem System verarbeitet.</p>"
Private Const EMAIL_TOO_MUCH_FERDS = "<p>Ihre Email enthielt mehr als ein ZUGFeRD-Dokument.</p>"
Private Const EMAIL_NO_FERDS = "<p>Ihre Email enthielt keine ZUGFeRD-Dokumente.</p>"
Private 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>
<li>Betrags-Werte weisen ungültiges Format auf (25,01 anstatt 25.01)</li>
</ul></p>
"""
' List of allowed extensions for PDF/A Attachments ' List of allowed extensions for PDF/A Attachments
Private AllowedExtensions = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"} Private ReadOnly AllowedExtensions As List(Of String) = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
Private _logger As Logger Private ReadOnly _logger As Logger
Private _logConfig As LogConfig Private ReadOnly _logConfig As LogConfig
Private _zugferd As ZUGFeRDInterface Private ReadOnly _zugferd As ZUGFeRDInterface
Private _firebird As Firebird Private ReadOnly _firebird As Firebird
Private _filesystem As Filesystem.File Private ReadOnly _filesystem As Filesystem.File
Private _mssql As MSSQLServer Private ReadOnly _mssql As MSSQLServer
Private ReadOnly _email As EmailFunctions
Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing) Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
_logConfig = LogConfig _logConfig = LogConfig
_logger = LogConfig.GetLogger() _logger = LogConfig.GetLogger()
_firebird = Firebird _firebird = Firebird
_filesystem = New Filesystem.File(_logConfig) _filesystem = New Filesystem.File(_logConfig)
_zugferd = New ZUGFeRDInterface(_logConfig)
_mssql = MSSQL _mssql = MSSQL
_email = New EmailFunctions(LogConfig, _mssql, _firebird)
_logger.Debug("Registering GDPicture License")
If _mssql IsNot Nothing Then
Dim oSQL = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'"
Dim oLicenseKey As String = _mssql.GetScalarValue(oSQL)
_zugferd = New ZUGFeRDInterface(_logConfig, oLicenseKey)
Else
_logger.Warn("GDPicture License could not be registered! MSSQL is not enabled!")
Throw New ArgumentNullException("MSSQL")
End If
End Sub End Sub
Private Function RandomValue(lowerBound As Integer, upperBound As Integer) As Integer
Dim oRandomValue = CInt(Math.Floor((upperBound - lowerBound + 1) * Rnd())) + lowerBound
Return oRandomValue
End Function
Private Function GetEmailDataForMessageId(MessageId As String) As EmailData
Dim oSQL = $"SELECT EMAIL_FROM, EMAIL_SUBJECT, EMAIL_ATTMT1 FROM TBEDM_EMAIL_PROFILER_HISTORY WHERE EMAIL_MSGID = '{MessageId}'"
Try
Dim oDatatable = _firebird.GetDatatable(oSQL)
Dim oRow As DataRow
If oDatatable.Rows.Count = 0 Then
_logger.Warn("Got no results for MessageId {0}", MessageId)
Return Nothing
ElseIf oDatatable.Rows.Count > 1 Then
_logger.Warn("Got too many results for MessageId {0}. Using last row.", MessageId)
End If
_logger.Debug("Got Email Data for FileId {0}", MessageId)
oRow = oDatatable.Rows.Item(oDatatable.Rows.Count - 1)
Return New EmailData() With {
.From = oRow.Item("EMAIL_FROM"),
.Attachment = oRow.Item("EMAIL_ATTMT1"),
.Subject = oRow.Item("EMAIL_SUBJECT")
}
Catch ex As Exception
_logger.Warn("Could not fetch Email Data for FileId {0}", MessageId)
Return Nothing
End Try
End Function
Private Function GetOriginalEmailPath(OriginalEmailDirectory As String, MessageId As String) As String
Dim oAttachmentDirectory = OriginalEmailDirectory
Dim oAttachmentFile = MessageId & ".eml"
Dim oAttachmentPath = Path.Combine(oAttachmentDirectory, oAttachmentFile)
If IO.File.Exists(oAttachmentPath) Then
Return oAttachmentPath
Else
Return String.Empty
End If
End Function
Private Function GetEmailPathWithSubjectAsName(RejectedEmailDirectory As String, UncleanedSubject As String) As String
Dim oCleanSubject = String.Join("", UncleanedSubject.Split(Path.GetInvalidPathChars()))
Dim oAttachmentDirectory = RejectedEmailDirectory
Dim oAttachmentFile = oCleanSubject & ".eml"
Dim oAttachmentPath = Path.Combine(oAttachmentDirectory, oAttachmentFile)
Return oAttachmentPath
End Function
Private Function MoveAndRenameEmailToRejected(Args As WorkerArgs, MessageId As String) As EmailData Private Function MoveAndRenameEmailToRejected(Args As WorkerArgs, MessageId As String) As EmailData
Dim oEmailData = GetEmailDataForMessageId(MessageId) Dim oEmailData = _email.GetEmailDataForMessageId(MessageId)
Dim oSource = GetOriginalEmailPath(Args.OriginalEmailDirectory, MessageId) Dim oSource = _email.GetOriginalEmailPath(Args.OriginalEmailDirectory, MessageId)
Dim oDestination As String Dim oDestination As String
' If oEmailData is Nothing, TBEDM_EMAIL_PROFILER_HISTORY for MessageId was not found. ' If oEmailData is Nothing, TBEDM_EMAIL_PROFILER_HISTORY for MessageId was not found.
' This only should happen when testing and db-tables are deleted frequently ' This only should happen when testing and db-tables are deleted frequently
If oEmailData Is Nothing Then If oEmailData Is Nothing Then
oDestination = GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, MessageId) oDestination = _email.GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, MessageId)
Else Else
oDestination = GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, oEmailData.Subject) oDestination = _email.GetEmailPathWithSubjectAsName(Args.RejectedEmailDirectory, oEmailData.Subject)
End If End If
_logger.Debug("Destination for eml file is {0}", oDestination) _logger.Debug("Destination for eml file is {0}", oDestination)
@@ -154,179 +95,14 @@ Public Class ImportZUGFeRDFiles
Private Sub AddRejectedState(oMessageID As String, oTitle As String, oTitle1 As String, oComment As String) Private Sub AddRejectedState(oMessageID As String, oTitle As String, oTitle1 As String, oComment As String)
Try Try
'PRCUST_ADD_HISTORY_STATE: @MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250)
Dim oSQL = $"EXEC PRCUST_ADD_HISTORY_STATE '{oMessageID}','{oTitle}','{oTitle1}','{oComment}'" Dim oSQL = $"EXEC PRCUST_ADD_HISTORY_STATE '{oMessageID}','{oTitle}','{oTitle1}','{oComment}'"
_mssql.NewExecutenonQuery(oSQL) _mssql.NewExecutenonQuery(oSQL)
'@MessageID VARCHAR(250), @TITLE1 VARCHAR(250), @TITLE2 VARCHAR(250)
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)
End Try End Try
End Sub End Sub
Private Sub AddToEmailQueueFB(MessageId As String, BodyText As String, EmailData As EmailData)
If EmailData Is Nothing Then
_logger.Warn("EmailData is empty. Email will not be sent!")
Exit Sub
End If
Try
Dim oJobId = RandomValue(1, 10000)
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = EMAIL_SUBJECT
Dim oAccountId = 1
Dim oCreatedWho = "ZUGFeRD Service"
Dim oFinalBodyText = String.Format(EMAIL_WRAPPING_TEXT, BodyText)
Dim oEmailAddress = EmailData.From
Dim oAttachment = EmailData.Attachment
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
_logger.Warn("Could not find email-address for MessageId {0}", MessageId)
oEmailTo = String.Empty
Else
oEmailTo = oEmailAddress
End If
_logger.Debug("Generated Email:")
_logger.Debug("To: {0}", oEmailTo)
_logger.Debug("Subject: {0}", oSubject)
_logger.Debug("Body {0}", oFinalBodyText)
Dim osql = $"select * from TBEDM_EMAIL_QUEUE where REFERENCE1 = '{oReference} and EMAIL_TO = ''{oEmailTo}' and EMAIL_SUBJ = '{oSubject}'"
Dim oDTResult As DataTable = _firebird.GetDatatable(osql)
If oDTResult.Rows.Count = 0 Then
Dim oSQLInsert = $"INSERT INTO TBEDM_EMAIL_QUEUE "
oSQLInsert &= "(JOB_ID, REFERENCE1, EMAIL_ACCOUNT_ID, EMAIL_TO, EMAIL_SUBJ, EMAIL_BODY, CREATEDWHO, EMAIL_ATTMT1) VALUES "
oSQLInsert &= $"({oJobId}, '{oReference}', {oAccountId}, '{oEmailTo}', '{oSubject}', '{oFinalBodyText.Replace("'", "''")}', '{oCreatedWho}', '{oAttachment}')"
_firebird.ExecuteNonQuery(oSQLInsert)
_logger.Debug("Email Queue updated for MessageId {0}.", MessageId, oEmailTo)
Else
_logger.Debug("Email has already been sent!!")
End If
Catch ex As Exception
_logger.Error(ex)
End Try
End Sub
Private Sub AddToEmailQueueMSSQL(MessageId As String, BodyText As String, pEmailData As EmailData, SourceProcedure As String)
If pEmailData Is Nothing Then
_logger.Warn("EmailData is empty. Email will not be sent!")
Exit Sub
End If
Try
Dim oJobId = RandomValue(1, 10000)
Dim oReference = MessageId
Dim oEmailTo = ""
Dim oSubject = EMAIL_SUBJECT
Dim oAccountId = 1
Dim oCreatedWho = "ZUGFeRD Service"
Dim oFinalBodyText = String.Format(EMAIL_WRAPPING_TEXT, BodyText)
Dim oEmailAddress = pEmailData.From
Dim oAttachment = pEmailData.Attachment
If oAttachment <> String.Empty Then
_logger.Debug($"Attachment_String [{oAttachment}]!")
If IO.File.Exists(oAttachment) = False Then
_logger.Info($"Attachment.File [{oAttachment}] is not existing!!!")
End If
End If
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
_logger.Warn("Could not find email-address for MessageId {0}", MessageId)
oEmailTo = String.Empty
Else
oEmailTo = oEmailAddress
End If
_logger.Debug("Generated Email:")
_logger.Debug("To: {0}", oEmailTo)
_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)
'osql = $"select * from TBEMLP_EMAIL_OUT where REFERENCE_ID = {oHistoryID} and EMAIL_ADRESS = '{oEmailTo}' and EMAIL_SUBJ = '{oSubject}'"
'Dim oDTResult As DataTable = _mssql.GetDatatable(osql)
If IsNumeric(oHistoryID) Then
Dim oInsert = $"INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] (
[REMINDER_TYPE_ID]
,[SENDING_PROFILE]
,[REFERENCE_ID]
,[REFERENCE_STRING]
,[WF_ID]
,[EMAIL_ADRESS]
,[EMAIL_SUBJ]
,[EMAIL_BODY]
,[COMMENT]
,[ADDED_WHO]
,EMAIL_ATTMT1)
VALUES
(77
,{oAccountId}
,{oHistoryID}
,'{MessageId}'
,77
,'{oEmailTo}'
,'{oSubject}'
,'{oFinalBodyText}'
,'{SourceProcedure}'
,'{oCreatedWho}'
,'{oAttachment}')"
_mssql.ExecuteNonQuery(oInsert)
Else
'If oDTResult.Rows.Count = 0 Then
' _logger.Debug("Email has already been sent!!")
'Else
_logger.Warn("Could not get oHistoryID in AddToEmailQueueMSSQL!!")
' End If
End If
Catch ex As Exception
_logger.Error(ex)
End Try
End Sub
Private Function GetMessageIdFromFileName(Filename As String) As String
' Regex to find MessageId
' See also: https://stackoverflow.com/questions/3968500/regex-to-validate-a-message-id-as-per-rfc2822
Dim oRegex = "(((([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)|(""(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21\x23-\x5B\x5D-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*""))@(([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)|(\[(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21-\x5A\x5E-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*\]))))~.+"
Dim oMatch = Regex.Match(Filename, oRegex, RegexOptions.IgnoreCase)
If oMatch.Success Then
Dim oMessageId = oMatch.Groups(1).Value
Return oMessageId
Else
Return Nothing
End If
End Function
Private Function GroupFiles(Files As List(Of FileInfo)) As Dictionary(Of String, List(Of FileInfo))
Dim oGrouped As New Dictionary(Of String, List(Of FileInfo))
If Files.Count = 0 Then
Return oGrouped
End If
For Each oFile In Files
Dim oMessageId = GetMessageIdFromFileName(oFile.Name)
If oMessageId Is Nothing Then
_logger.Warn("File {0} did not have the required filename-format!", oMessageId)
Continue For
End If
If oGrouped.ContainsKey(oMessageId) Then
oGrouped.Item(oMessageId).Add(oFile)
Else
oGrouped.Add(oMessageId, New List(Of FileInfo) From {oFile})
End If
Next
Return oGrouped
End Function
Public Sub Start(Arguments As Object) Implements IJob.Start Public Sub Start(Arguments As Object) Implements IJob.Start
Dim oArgs As WorkerArgs = Arguments Dim oArgs As WorkerArgs = Arguments
Dim oPropertyExtractor = New PropertyValues(_logConfig) Dim oPropertyExtractor = New PropertyValues(_logConfig)
@@ -334,23 +110,6 @@ Public Class ImportZUGFeRDFiles
_logger.Debug("Starting Job {0}", [GetType].Name) _logger.Debug("Starting Job {0}", [GetType].Name)
_logger.Debug("Registering GDPicture License")
If _mssql IsNot Nothing Then
Try
Dim oSQL = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'"
Dim oLicenseKey As String = _mssql.GetScalarValue(oSQL)
Dim oLicenseManager As New LicenseManager
oLicenseManager.RegisterKEY(oLicenseKey)
Catch ex As Exception
_logger.Error(ex)
_logger.Warn("GDPicture License could not be retrieved! Query failed! Exiting job.")
Exit Sub
End Try
Else
_logger.Warn("GDPicture License could not be retrieved! MSSQL is not enabled! Exiting job.")
Exit Sub
End If
Try Try
For Each oPath As String In oArgs.WatchDirectories For Each oPath As String In oArgs.WatchDirectories
Dim oDirInfo As New DirectoryInfo(oPath) Dim oDirInfo As New DirectoryInfo(oPath)
@@ -374,7 +133,7 @@ Public Class ImportZUGFeRDFiles
End If End If
' Group files by messageId ' Group files by messageId
Dim oGrouped As Dictionary(Of String, List(Of FileInfo)) = GroupFiles(oFiles) Dim oGrouped As Dictionary(Of String, List(Of FileInfo)) = _zugferd.FileGroup.GroupFiles(oFiles)
_logger.Info("Found {0} file groups", oGrouped.Count) _logger.Info("Found {0} file groups", oGrouped.Count)
@@ -437,7 +196,8 @@ Public Class ImportZUGFeRDFiles
End Select End Select
End Try End Try
' Extract all attachments other than the zugferd-invoice.xml ' Extract all attachments with the extensions specified in `AllowedExtensions`.
' If you need to extract and use embedded xml files, you need to filter out the zugferd-invoice.xml yourself.
Dim oAttachments = oAttachmentExtractor.Extract(oFile.FullName, AllowedExtensions) Dim oAttachments = oAttachmentExtractor.Extract(oFile.FullName, AllowedExtensions)
If oAttachments Is Nothing Then If oAttachments Is Nothing Then
_logger.Warn("Attachments for file [{0}] could not be extracted", oFile.FullName) _logger.Warn("Attachments for file [{0}] could not be extracted", oFile.FullName)
@@ -479,157 +239,192 @@ Public Class ImportZUGFeRDFiles
' Since extraction went well, increase the amount of ZUGFeRD files ' Since extraction went well, increase the amount of ZUGFeRD files
oZUGFeRDCount += 1 oZUGFeRDCount += 1
#Region "Check Property Values"
' --- BEGIN Check Property Values
' PropertyMap items with `IsGrouped = False` are handled normally '' PropertyMap items with `IsGrouped = False` are handled normally
Dim oDefaultProperties As Dictionary(Of String, XmlItemProperty) = oArgs.PropertyMap. 'Dim oDefaultProperties As Dictionary(Of String, XmlItemProperty) = oArgs.PropertyMap.
Where(Function(Item) Item.Value.IsGrouped = True). ' Where(Function(Item) Item.Value.IsGrouped = True).
ToDictionary(Function(Item) Item.Key, ' ToDictionary(Function(Item) Item.Key,
Function(Item) Item.Value) ' Function(Item) Item.Value)
_logger.Debug("Found {0} default properties.", oDefaultProperties.Count) '_logger.Debug("Found {0} default properties.", oDefaultProperties.Count)
' PropertyMap items with `IsGrouped = True` are grouped by group scope '' PropertyMap items with `IsGrouped = True` are grouped by group scope
Dim oGroupedProperties = oArgs.PropertyMap. 'Dim oGroupedProperties = oArgs.PropertyMap.
Where(Function(Item) Item.Value.IsGrouped = True). ' Where(Function(Item) Item.Value.IsGrouped = True).
ToLookup(Function(Item) Item.Value.GroupScope, ' Lookup key is group scope ' ToLookup(Function(Item) Item.Value.GroupScope, ' Lookup key is group scope
Function(Item) Item) ' Function(Item) Item)
_logger.Debug("Found {0} properties grouped in {1} group(s)", oArgs.PropertyMap.Count - oDefaultProperties.Count, oGroupedProperties.Count) '_logger.Debug("Found {0} properties grouped in {1} group(s)", oArgs.PropertyMap.Count - oDefaultProperties.Count, oGroupedProperties.Count)
' Iterate through groups to get group scope and group items '' Iterate through groups to get group scope and group items
For Each oGroup In oGroupedProperties 'For Each oGroup In oGroupedProperties
Dim oGroupScope As String = oGroup.Key ' Dim oGroupScope As String = oGroup.Key
Dim oPropertyList As New Dictionary(Of XmlItemProperty, List(Of Object)) ' Dim oPropertyList As New Dictionary(Of XmlItemProperty, List(Of Object))
Dim oRowCount = 0 ' Dim oRowCount = 0
_logger.Debug("Fetching Property values for group {0}.", oGroupScope) ' _logger.Debug("Fetching Property values for group {0}.", oGroupScope)
' get properties as a nested object, see `oPropertyList` ' ' get properties as a nested object, see `oPropertyList`
For Each oProperty As KeyValuePair(Of String, XmlItemProperty) In oGroup ' For Each oProperty As KeyValuePair(Of String, XmlItemProperty) In oGroup
Dim oPropertyValues As List(Of Object) ' Dim oPropertyValues As List(Of Object)
Try ' Try
oPropertyValues = oPropertyExtractor.GetPropValue(oDocument, oProperty.Key) ' oPropertyValues = oPropertyExtractor.GetPropValue(oDocument, oProperty.Key)
Catch ex As Exception ' Catch ex As Exception
_logger.Warn("Unknown error occurred while fetching property [{0}] in group [{1}]:", oProperty.Value.Description, oGroupScope) ' _logger.Warn("Unknown error occurred while fetching property [{0}] in group [{1}]:", oProperty.Value.Description, oGroupScope)
_logger.Error(ex) ' _logger.Error(ex)
oPropertyValues = New List(Of Object) ' oPropertyValues = New List(Of Object)
End Try ' End Try
' Flatten result value ' ' Flatten result value
oPropertyValues = oPropertyExtractor.GetFinalPropValue(oPropertyValues) ' oPropertyValues = oPropertyExtractor.GetFinalPropValue(oPropertyValues)
' Add to list ' ' Add to list
oPropertyList.Add(oProperty.Value, oPropertyValues) ' oPropertyList.Add(oProperty.Value, oPropertyValues)
' check the first batch of values to determine the row count ' ' check the first batch of values to determine the row count
If oRowCount = 0 Then ' If oRowCount = 0 Then
oRowCount = oPropertyValues.Count ' oRowCount = oPropertyValues.Count
End If ' End If
Next ' Next
' Structure of oPropertyList ' ' Structure of oPropertyList
' [ # Propertyname # Row 1 # Row 2 ' ' [ # Propertyname # Row 1 # Row 2
' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...], ' ' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...],
' PositionsSteuersatz: [ApplicablePercent1, ApplicablePercent2, ...], ' ' PositionsSteuersatz: [ApplicablePercent1, ApplicablePercent2, ...],
' ... ' ' ...
' ] ' ' ]
For oRowIndex = 0 To oRowCount - 1 ' For oRowIndex = 0 To oRowCount - 1
_logger.Debug("Processing row {0}", oRowIndex) ' _logger.Debug("Processing row {0}", oRowIndex)
For Each oColumn As KeyValuePair(Of XmlItemProperty, List(Of Object)) In oPropertyList ' For Each oColumn As KeyValuePair(Of XmlItemProperty, List(Of Object)) In oPropertyList
Dim oTableName As String = oColumn.Key.TableName ' Dim oTableName As String = oColumn.Key.TableName
Dim oPropertyDescription As String = oColumn.Key.Description ' Dim oPropertyDescription As String = oColumn.Key.Description
Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1 ' Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1
' Returns nothing if oColumn.Value contains an empty list ' ' Returns nothing if oColumn.Value contains an empty list
Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex) ' Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex)
_logger.Debug("Processing property {0}.", oPropertyDescription) ' _logger.Debug("Processing property {0}.", oPropertyDescription)
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then ' If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
If oColumn.Key.IsRequired Then ' If oColumn.Key.IsRequired Then
_logger.Warn("Property [{0}] is empty or not found but is required. Continuing with Empty String.", oPropertyDescription) ' _logger.Warn("Property [{0}] is empty or not found but is required. Continuing with Empty String.", oPropertyDescription)
oMissingProperties.Add(oPropertyDescription) ' oMissingProperties.Add(oPropertyDescription)
Else ' Else
_logger.Debug("Property [{0}] is empty or not found. Continuing with Empty String.", oPropertyDescription) ' _logger.Debug("Property [{0}] is empty or not found. Continuing with Empty String.", oPropertyDescription)
End If ' End If
oPropertyValue = String.Empty ' oPropertyValue = String.Empty
End If ' End If
_logger.Debug("Property {0} has value '{1}'", oPropertyDescription, oPropertyValue) ' _logger.Debug("Property {0} has value '{1}'", oPropertyDescription, oPropertyValue)
Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, GROUP_COUNTER) VALUES ('{oMessageId}', '{oPropertyDescription}', '{oPropertyValue}', {oRowCounter})" ' Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, GROUP_COUNTER) VALUES ('{oMessageId}', '{oPropertyDescription}', '{oPropertyValue}', {oRowCounter})"
_logger.Debug("Mapping Property {0} to value {1}. Will be inserted into table {2} with RowCounter {3}", oPropertyDescription, oPropertyValue, oTableName, oRowCounter) ' _logger.Debug("Mapping Property {0} to value {1}. Will be inserted into table {2} with RowCounter {3}", oPropertyDescription, oPropertyValue, oTableName, oRowCounter)
' Insert into SQL Server ' ' Insert into SQL Server
If oArgs.InsertIntoSQLServer = True Then ' If oArgs.InsertIntoSQLServer = True Then
Dim oResult = _mssql.NewExecutenonQuery(oCommand) ' Dim oResult = _mssql.NewExecutenonQuery(oCommand)
If oResult = False Then ' If oResult = False Then
_logger.Warn("SQL Command was not successful. Check the log.") ' _logger.Warn("SQL Command was not successful. Check the log.")
End If ' End If
End If ' End If
' Insert into Firebird ' ' Insert into Firebird
_firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction) ' _firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
Next ' Next
Next ' Next
oGlobalGroupCounter += oRowCount ' oGlobalGroupCounter += oRowCount
Next 'Next
' Iterate through default properties '' Iterate through default properties
For Each Item As KeyValuePair(Of String, XmlItemProperty) In oDefaultProperties 'For Each Item As KeyValuePair(Of String, XmlItemProperty) In oDefaultProperties
Dim oPropertyValueList As List(Of Object) ' Dim oPropertyValueList As List(Of Object)
Dim oPropertyDescription As String = Item.Value.Description ' Dim oPropertyDescription As String = Item.Value.Description
Dim oPropertyValue As Object = Nothing ' Dim oPropertyValue As Object = Nothing
Try ' Try
oPropertyValueList = oPropertyExtractor.GetPropValue(oDocument, Item.Key) ' oPropertyValueList = oPropertyExtractor.GetPropValue(oDocument, Item.Key)
Catch ex As Exception ' Catch ex As Exception
_logger.Warn("Unknown error occurred while fetching property {0} in group {1}:", oPropertyDescription, Item.Value.GroupScope) ' _logger.Warn("Unknown error occurred while fetching property {0} in group {1}:", oPropertyDescription, Item.Value.GroupScope)
_logger.Error(ex) ' _logger.Error(ex)
oPropertyValueList = New List(Of Object) ' oPropertyValueList = New List(Of Object)
End Try ' End Try
Try ' Try
If IsNothing(oPropertyValueList) Then ' If IsNothing(oPropertyValueList) Then
oPropertyValue = Nothing ' oPropertyValue = Nothing
ElseIf TypeOf oPropertyValueList Is List(Of Object) Then ' ElseIf TypeOf oPropertyValueList Is List(Of Object) Then
Select Case oPropertyValueList.Count ' Select Case oPropertyValueList.Count
Case 0 ' Case 0
oPropertyValue = Nothing ' oPropertyValue = Nothing
Case Else ' Case Else
Dim oList As List(Of Object) = DirectCast(oPropertyValueList, List(Of Object)) ' Dim oList As List(Of Object) = DirectCast(oPropertyValueList, List(Of Object))
oPropertyValue = oList.Item(0) ' oPropertyValue = oList.Item(0)
' This should hopefully show config errors ' ' This should hopefully show config errors
If TypeOf oPropertyValue Is List(Of Object) Then ' If TypeOf oPropertyValue Is List(Of Object) Then
_logger.Warn("Property with Description {0} may be configured incorrectly", oPropertyDescription) ' _logger.Warn("Property with Description {0} may be configured incorrectly", oPropertyDescription)
oPropertyValue = Nothing ' oPropertyValue = Nothing
End If ' End If
End Select ' End Select
End If ' End If
Catch ex As Exception ' Catch ex As Exception
_logger.Warn("Unknown error occurred while processing property {0}:", oPropertyDescription) ' _logger.Warn("Unknown error occurred while processing property {0}:", oPropertyDescription)
_logger.Error(ex) ' _logger.Error(ex)
oPropertyValue = Nothing ' oPropertyValue = Nothing
End Try ' End Try
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then ' If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
If Item.Value.IsRequired Then ' If Item.Value.IsRequired Then
_logger.Warn("Property {0} is empty but marked as required! Skipping.", oPropertyDescription) ' _logger.Warn("Property {0} is empty but marked as required! Skipping.", oPropertyDescription)
oMissingProperties.Add(oPropertyDescription) ' oMissingProperties.Add(oPropertyDescription)
Continue For ' Continue For
Else ' Else
_logger.Debug("Property [{0}] is empty or not found. Skipping.", oPropertyDescription) ' _logger.Debug("Property [{0}] is empty or not found. Skipping.", oPropertyDescription)
Continue For ' Continue For
End If ' End If
' End If
' Dim oTableName = Item.Value.TableName
' Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE) VALUES ('{oMessageId}', '{oPropertyDescription}', '{oPropertyValue}')"
' _logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oPropertyDescription, oPropertyValue, oTableName)
' ' Insert into SQL Server
' If oArgs.InsertIntoSQLServer = True Then
' Dim oResult = _mssql.NewExecutenonQuery(oCommand)
' If oResult = False Then
' _logger.Warn("SQL Command was not successful. Check the log.")
' End If
' End If
' ' Insert into Firebird
' _firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
'Next
'--- END Check Property Values
#End Region
' Check the document against the configured property map and return:
' - a List of valid properties
' - a List of missing properties
Dim oCheckResult = _zugferd.PropertyValues.CheckPropertyValues(oDocument, oArgs.PropertyMap, oMessageId)
If oCheckResult.MissingProperties.Count > 0 Then
Throw New MissingValueException(oFile)
End If
For Each oProperty In oCheckResult.ValidProperties
Dim oGroupCounterValue = Nothing
If oProperty.GroupCounter > -1 Then
oGroupCounterValue = oProperty.GroupCounter
End If End If
Dim oTableName = Item.Value.TableName Dim oCommand = $"INSERT INTO {oProperty.TableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, GROUP_COUNTER) VALUES ('{oMessageId}', '{oProperty.Description}', '{oProperty.Value}', {oGroupCounterValue})"
Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE) VALUES ('{oMessageId}', '{oPropertyDescription}', '{oPropertyValue}')" _logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oProperty.Description, oProperty.Value, oProperty.TableName)
_logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oPropertyDescription, oPropertyValue, oTableName)
' Insert into SQL Server ' Insert into SQL Server
If oArgs.InsertIntoSQLServer = True Then If oArgs.InsertIntoSQLServer = True Then
@@ -642,10 +437,6 @@ Public Class ImportZUGFeRDFiles
' Insert into Firebird ' Insert into Firebird
_firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction) _firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
Next Next
If oMissingProperties.Count > 0 Then
Throw New MissingValueException(oFile)
End If
Next Next
'Check if there are no ZUGFeRD files 'Check if there are no ZUGFeRD files
@@ -674,9 +465,9 @@ Public Class ImportZUGFeRDFiles
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Already processed (MD5Hash)' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Already processed (MD5Hash)' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EMAIL_MD5_ERROR Dim oBody = EmailStrings.EMAIL_MD5_ERROR
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException") _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException")
AddRejectedState(oMessageId, "MD5HashException", "Die gesendete Rechnung wurde bereits verarbeitet!", "") AddRejectedState(oMessageId, "MD5HashException", "Die gesendete Rechnung wurde bereits verarbeitet!", "")
Catch ex As InvalidFerdException Catch ex As InvalidFerdException
_logger.Error(ex) _logger.Error(ex)
@@ -684,9 +475,9 @@ Public Class ImportZUGFeRDFiles
oMoveDirectory = oArgs.ErrorDirectory oMoveDirectory = oArgs.ErrorDirectory
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - ZUGFeRD yes but incorrect format' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - ZUGFeRD yes but incorrect format' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EMAIL_INVALID_DOCUMENT Dim oBody = EmailStrings.EMAIL_INVALID_DOCUMENT
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException") _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException")
AddRejectedState(oMessageId, "InvalidFerdException", "Inkorrekte Formate", "") AddRejectedState(oMessageId, "InvalidFerdException", "Inkorrekte Formate", "")
Catch ex As TooMuchFerdsException Catch ex As TooMuchFerdsException
_logger.Error(ex) _logger.Error(ex)
@@ -694,9 +485,9 @@ Public Class ImportZUGFeRDFiles
oMoveDirectory = oArgs.ErrorDirectory oMoveDirectory = oArgs.ErrorDirectory
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - More than one ZUGFeRD-document in email' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - More than one ZUGFeRD-document in email' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EMAIL_TOO_MUCH_FERDS Dim oBody = EmailStrings.EMAIL_TOO_MUCH_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException") _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException")
AddRejectedState(oMessageId, "TooMuchFerdsException", "Email enthielt mehr als ein ZUGFeRD-Dokument", "") AddRejectedState(oMessageId, "TooMuchFerdsException", "Email enthielt mehr als ein ZUGFeRD-Dokument", "")
Catch ex As NoFerdsException Catch ex As NoFerdsException
_logger.Error(ex) _logger.Error(ex)
@@ -704,9 +495,9 @@ Public Class ImportZUGFeRDFiles
oMoveDirectory = oArgs.ErrorDirectory oMoveDirectory = oArgs.ErrorDirectory
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - no ZUGFeRD-Document in email' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - no ZUGFeRD-Document in email' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EMAIL_NO_FERDS Dim oBody = EmailStrings.EMAIL_NO_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException") _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException")
AddRejectedState(oMessageId, "NoFerdsException", " Email enthielt keine ZUGFeRD-Dokumente", "") AddRejectedState(oMessageId, "NoFerdsException", " Email enthielt keine ZUGFeRD-Dokumente", "")
Catch ex As MissingValueException Catch ex As MissingValueException
_logger.Error(ex) _logger.Error(ex)
@@ -721,7 +512,7 @@ Public Class ImportZUGFeRDFiles
Dim oBody = CreateBodyForMissingProperties(ex.File.Name, oMissingProperties) Dim oBody = CreateBodyForMissingProperties(ex.File.Name, oMissingProperties)
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException") _email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException")
AddRejectedState(oMessageId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage) AddRejectedState(oMessageId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage)
Catch ex As Exception Catch ex As Exception
@@ -778,8 +569,11 @@ Public Class ImportZUGFeRDFiles
End Try End Try
End If End If
' Filter out Attachments from `Files`
Dim oInvoiceFiles As List(Of FileInfo) = Files.Except(AttachmentFiles).ToList()
' Move PDF/A Files ' Move PDF/A Files
For Each oFile In Files For Each oFile In oInvoiceFiles
Try Try
Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oFinalMoveDirectory, oFile.Name)) Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oFinalMoveDirectory, oFile.Name))
@@ -826,11 +620,11 @@ Public Class ImportZUGFeRDFiles
Private Function CreateBodyForMissingProperties(OriginalFilename As String, MissingProperties As List(Of String)) Private Function CreateBodyForMissingProperties(OriginalFilename As String, MissingProperties As List(Of String))
Dim oBody = String.Format(EMAIL_MISSINGPROPERTIES_1, OriginalFilename) Dim oBody = String.Format(EmailStrings.EMAIL_MISSINGPROPERTIES_1, OriginalFilename)
If MissingProperties.Count > 0 Then If MissingProperties.Count > 0 Then
oBody &= $"{vbNewLine}{vbNewLine}" oBody &= $"{vbNewLine}{vbNewLine}"
oBody &= EMAIL_MISSINGPROPERTIES_2 oBody &= EmailStrings.EMAIL_MISSINGPROPERTIES_2
oBody &= $"{vbNewLine}{vbNewLine}" oBody &= $"{vbNewLine}{vbNewLine}"
For Each prop In MissingProperties For Each prop In MissingProperties

View File

@@ -1,100 +0,0 @@
Imports System.Collections.Generic
Imports System.IO
Imports DigitalData.Modules.Logging
Imports GdPicture14
Public Class PDFAttachments
Private Logger As Logger
Private Const ZUGFERD_XML_FILENAME = "ZUGFeRD-invoice.xml"
Public Class AttachmentResult
Public FileName As String
Public FileContents As Byte()
End Class
Public Sub New(LogConfig As LogConfig)
Logger = LogConfig.GetLogger
End Sub
Public Function Extract(FileName As String, AllowedExtensions As List(Of String)) As List(Of AttachmentResult)
Dim oResults As New List(Of AttachmentResult)
Dim oExtensions = AllowedExtensions.ConvertAll(Of String)(New Converter(Of String, String)(Function(ext) ext.ToUpper))
Try
Using oGDPicturePDF As New GdPicturePDF()
If oGDPicturePDF.LoadFromFile(FileName, False) = GdPictureStatus.OK Then
Dim oEmbeddedFileCount As Integer = oGDPicturePDF.GetEmbeddedFileCount()
If oGDPicturePDF.GetStat() = GdPictureStatus.OK Then
If oEmbeddedFileCount > 1 Then
For index = 0 To oEmbeddedFileCount - 1
Dim oFileName As String = oGDPicturePDF.GetEmbeddedFileName(index)
If oGDPicturePDF.GetStat() = GdPictureStatus.OK Then
Dim oExtension = New FileInfo(oFileName).Extension.ToUpper.Substring(1)
If oFileName.ToUpper <> ZUGFERD_XML_FILENAME.ToUpper Then
If oExtensions.Contains(oExtension) Then
Dim FileSize As Integer = oGDPicturePDF.GetEmbeddedFileSize(index)
If oGDPicturePDF.GetStat() = GdPictureStatus.OK Then
Dim oFileData As Byte() = New Byte(FileSize) {}
Dim status As GdPictureStatus = oGDPicturePDF.ExtractEmbeddedFile(index, oFileData)
If status = GdPictureStatus.OK Then
oResults.Add(New AttachmentResult() With {
.FileContents = oFileData,
.FileName = oFileName
})
Else
Logger.Error("The embedded file [{0}] has failed to extract. Status: {1}", oFileName, oGDPicturePDF.GetStat().ToString())
Continue For
End If
'If status = GdPictureStatus.OK Then
' Dim oVersionedName = Filesystem.GetVersionedFilename(oFileName)
' Dim oTempName As String = Path.Combine(Path.GetTempPath(), oVersionedName)
' Using oFileStream As New FileStream(oTempName, FileMode.OpenOrCreate)
' oFileStream.Write(oFileData, 0, oFileData.Length)
' End Using
' oResults.Add(New FileInfo(oTempName))
'Else
' Logger.Error("The embedded file [{0}] has failed to extract. Status: {1}", oFileName, oGDPicturePDF.GetStat().ToString())
' Continue For
'End If
Else
Logger.Error("An error occurred getting the file size for [{0}]. Status: {1}", oFileName, oGDPicturePDF.GetStat().ToString())
Continue For
End If
Else
Logger.Warn("File [{0}] was skipped because its extension [{1}] is not allowed.", oFileName, oExtension)
Continue For
End If
Else
Logger.Debug("File [{0}] was skipped because its name indicates the invoice data file.", oFileName)
Continue For
End If
Else
Logger.Error("An error occurred getting the file name for [{0}]. Status: {1}", oFileName, oGDPicturePDF.GetStat().ToString())
Continue For
End If
Next
End If
Else
Logger.Error("An error occurred getting the number of embedded files. Status: {0}", oGDPicturePDF.GetStat().ToString())
Return Nothing
End If
Else
Logger.Error("The file [{0}] can't be loaded.", FileName)
Return Nothing
End If
End Using
Return oResults
Catch ex As Exception
Logger.Warn("Unexpected Error while Extracting attachments from File [{0}]", FileName)
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

@@ -1,138 +0,0 @@
Imports System.Collections.Generic
Imports System.Linq
Imports System.Reflection
Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Logging
Public Class PropertyValues
Private _indexPattern = "\((\d+)\)"
Private _indexRegex As New Regex(_indexPattern)
Private _Logger As Logger
Public Sub New(LogConfig As LogConfig)
_Logger = LogConfig.GetLogger()
End Sub
Public Function GetPropValue(Obj As Object, PropertyName As String) As List(Of Object)
Dim oNameParts As String() = PropertyName.Split("."c)
If IsNothing(Obj) Then
_Logger.Debug("`Obj` is Nothing. Exiting.")
Return New List(Of Object)
End If
If oNameParts.Length = 1 Then
Dim oPropInfo As PropertyInfo = Obj.GetType().GetProperty(PropertyName)
If IsNothing(oPropInfo) Then
_Logger.Debug("Property {0} does not exist.", PropertyName)
Return New List(Of Object)
Else
Dim oPropValue = oPropInfo.GetValue(Obj, Nothing)
Return New List(Of Object) From {oPropValue}
End If
End If
For Each oPart As String In oNameParts
Dim oType As Type = Obj.GetType()
Dim oPartName = oPart
Dim oIndex As Integer = Nothing
Dim oHasIndex As Boolean = HasIndex(oPartName)
If oHasIndex Then
oPartName = StripIndex(oPart)
oIndex = GetIndex(oPart)
End If
Dim oInfo As PropertyInfo = oType.GetProperty(oPartName)
If IsNothing(oInfo) OrElse IsNothing(oInfo.GetValue(Obj, Nothing)) Then
_Logger.Debug("Property {0} does not exist.", oPartName)
Return New List(Of Object)
End If
Obj = oInfo.GetValue(Obj, Nothing)
If oHasIndex Then
Obj = Obj(0)
End If
If IsArray(Obj) And Not oHasIndex Then
Dim oCurrentPart As String = oPart
Dim oSplitString As String() = New String() {oCurrentPart & "."}
Dim oPathFragments = PropertyName.Split(oSplitString, StringSplitOptions.None)
Dim oResults As New List(Of Object)
' if path has no more subitems, return an empty list
If oPathFragments.Length = 1 Then
Return oResults
End If
For Each oArrayItem In Obj
Dim oResult As List(Of Object) = GetPropValue(oArrayItem, oPathFragments(1))
If Not IsNothing(oResult) Then
oResults.Add(oResult)
End If
Next
Return oResults
End If
Next
Return New List(Of Object) From {Obj}
End Function
Public Function GetFinalPropValue(List As List(Of Object)) As List(Of Object)
Dim oResult As New List(Of Object)
For Each Item In List
Dim oItemValue = DoGetFinalPropValue(Item)
If Not IsNothing(oItemValue) Then
oResult.Add(oItemValue)
End If
Next
Return oResult
End Function
Private Function DoGetFinalPropValue(Value As Object) As String
If TypeOf Value Is List(Of Object) Then
Dim oList = DirectCast(Value, List(Of Object))
Dim oCount = oList.Count
Select Case oCount
Case 0
Return Nothing
Case Else
Return DoGetFinalPropValue(oList.First())
End Select
Return DoGetFinalPropValue(Value)
Else
Return Value.ToString
End If
End Function
Private Function GetIndex(Prop As String) As Integer
If Regex.IsMatch(Prop, _indexPattern) Then
Dim oMatch = _indexRegex.Match(Prop)
Dim oGroup = oMatch.Groups.Item(1)
Dim oValue = oGroup.Value
Return Integer.Parse(oValue)
End If
Return Nothing
End Function
Private Function StripIndex(Prop As String) As String
Return Regex.Replace(Prop, _indexPattern, "")
End Function
Private Function HasIndex(Prop As String) As Boolean
Return Regex.IsMatch(Prop, _indexPattern)
End Function
End Class

View File

@@ -1,4 +1,5 @@
Imports System.Collections.Generic Imports System.Collections.Generic
Imports DigitalData.Modules.Interfaces
Public Class WorkerArgs Public Class WorkerArgs
Public WatchDirectories As List(Of String) Public WatchDirectories As List(Of String)

View File

@@ -87,11 +87,10 @@
<Compile Include="EDMI\GraphQL\GraphQLArgs.vb" /> <Compile Include="EDMI\GraphQL\GraphQLArgs.vb" />
<Compile Include="EDMI\GraphQL\GraphQLJob.vb" /> <Compile Include="EDMI\GraphQL\GraphQLJob.vb" />
<Compile Include="EDMI\ZUGFeRD\EmailData.vb" /> <Compile Include="EDMI\ZUGFeRD\EmailData.vb" />
<Compile Include="EDMI\ZUGFeRD\EmailFunctions.vb" />
<Compile Include="EDMI\ZUGFeRD\EmailStrings.vb" />
<Compile Include="EDMI\ZUGFeRD\ImportZUGFeRDFiles.vb" /> <Compile Include="EDMI\ZUGFeRD\ImportZUGFeRDFiles.vb" />
<Compile Include="EDMI\ZUGFeRD\PDFAttachments.vb" />
<Compile Include="EDMI\ZUGFeRD\PropertyValues.vb" />
<Compile Include="EDMI\ZUGFeRD\WorkerArgs.vb" /> <Compile Include="EDMI\ZUGFeRD\WorkerArgs.vb" />
<Compile Include="EDMI\ZUGFeRD\XmlItemProperty.vb" />
<Compile Include="Exceptions.vb" /> <Compile Include="Exceptions.vb" />
<Compile Include="JobInterface.vb" /> <Compile Include="JobInterface.vb" />
<Compile Include="JobBase.vb" /> <Compile Include="JobBase.vb" />
@@ -109,12 +108,9 @@
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=6.4.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL"> <Reference Include="FirebirdSql.Data.FirebirdClient, Version=6.4.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.6.4.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath> <HintPath>..\packages\FirebirdSql.Data.FirebirdClient.6.4.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
</Reference> </Reference>
<Reference Include="GdPicture.NET.14">
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

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

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" /> <package id="FirebirdSql.Data.FirebirdClient" version="6.4.0" targetFramework="net461" />
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -1,4 +1,5 @@
Imports System.IO Imports System.IO
Imports System.Reflection
Imports NLog Imports NLog
Imports NLog.Config Imports NLog.Config
Imports NLog.Targets Imports NLog.Targets
@@ -14,33 +15,6 @@ Imports NLog.Targets
''' <dependencies> ''' <dependencies>
''' NLog, >= 4.5.8 ''' NLog, >= 4.5.8
''' </dependencies> ''' </dependencies>
''' <params>
''' logPath, PathType
''' The basepath to write logs to. Can be AppData, CurrentDirectory or CustomPath.
'''
''' - AppData: writes to local application data directory
''' - CurrentDirectory: writes to `Log` directory relative to the current directory
''' - CustomPath: writes to custom path specified in `customLogPath`
'''
''' customLogPath, String (optional)
''' If `logPath` is set to custom, this defines the custom logPath.
'''
''' suffix, String (optional)
''' If set to anything other than Nothing, extends the logfile name with this suffix.
''' </params>
''' <props>
''' LogFile, String (readonly)
''' Returns the full path of the default log file.
'''
''' LogPath, String (readonly)
''' Returns the path to the log directory.
'''
''' LogFactory, NLog.LogFactory (readonly)
''' Returns the LogFactory that is used to create the Logger object
'''
''' Debug, Boolean
''' Determines if the debug log should be written.
''' </props>
''' <example> ''' <example>
''' Imports DigitalData.Modules.Logging ''' Imports DigitalData.Modules.Logging
''' '''
@@ -81,6 +55,7 @@ Imports NLog.Targets
''' - NLOG_INTERNAL_LOG_FILE: ex. C:\Temp\Nlog_Internal.log ''' - NLOG_INTERNAL_LOG_FILE: ex. C:\Temp\Nlog_Internal.log
''' </remarks> ''' </remarks>
Public Class LogConfig Public Class LogConfig
#Region "Private Properties"
Private Const KEEP_FILES_OPEN As Boolean = False Private Const KEEP_FILES_OPEN As Boolean = False
' MAX_ARCHIVES_FILES works like this (in version 4.5.8): ' MAX_ARCHIVES_FILES works like this (in version 4.5.8):
' 0 = keep ALL archives files ' 0 = keep ALL archives files
@@ -113,15 +88,16 @@ Public Class LogConfig
Private Const LOG_FORMAT_DEBUG As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}" Private Const LOG_FORMAT_DEBUG As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}"
Private Const LOG_FORMAT_MEMORY As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}${newline}${exception:format=Message}${newline}${exception:format=StackTrace}" Private Const LOG_FORMAT_MEMORY As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}${newline}${exception:format=Message}${newline}${exception:format=StackTrace}"
Private Const FOLDER_NAME_LOG = "Log"
Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt" Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt"
Private Const FOLDER_NAME_LOG = "Log"
Private ReadOnly failSafePath As String = Path.GetTempPath() Private ReadOnly failSafePath As String = Path.GetTempPath()
Private ReadOnly basePath As String = failSafePath Private ReadOnly basePath As String = failSafePath
Private config As LoggingConfiguration Private config As LoggingConfiguration
Private isDebug As Boolean = False Private isDebug As Boolean = False
#End Region
#Region "Public Properties"
Public Enum PathType As Integer Public Enum PathType As Integer
AppData = 0 AppData = 0
CurrentDirectory = 1 CurrentDirectory = 1
@@ -173,24 +149,41 @@ Public Class LogConfig
End Get End Get
End Property End Property
Public ReadOnly Property NLogConfig As LoggingConfiguration
Get
Return config
End Get
End Property
#End Region
''' <summary> ''' <summary>
''' Initializes a new LogConfig object with a logpath and optinally a filename-suffix. ''' Initializes a new LogConfig object with a logpath and optinally a filename-suffix.
''' </summary> ''' </summary>
''' <param name="logPath">The basepath to write logs to. Can be AppData, CurrentDirectory or CustomPath.</param> ''' <param name="LogPath">The basepath to write logs to. Can be AppData, CurrentDirectory or CustomPath.</param>
''' <param name="customLogPath">If `logPath` is set to custom, this defines the custom logPath.</param> ''' <param name="CustomLogPath">If `logPath` is set to custom, this defines the custom logPath.</param>
''' <param name="suffix">If set to anything other than Nothing, extends the logfile name with this suffix.</param> ''' <param name="Suffix">If set to anything other than Nothing, extends the logfile name with this suffix.</param>
Public Sub New(logPath As PathType, Optional customLogPath As String = Nothing, Optional suffix As String = Nothing) ''' <param name="CompanyName">CompanyName is used to construct log-path in when LogPath is set to PathType:AppData</param>
Dim productName As String = My.Application.Info.ProductName ''' <param name="ProductName">ProductName is used to construct log-path in when LogPath is set to PathType:AppData</param>
Dim companyName As String = My.Application.Info.CompanyName Public Sub New(LogPath As PathType,
Optional CustomLogPath As String = Nothing,
Optional Suffix As String = Nothing,
Optional CompanyName As String = Nothing,
Optional ProductName As String = Nothing)
If logPath = PathType.AppData Then If LogPath = PathType.AppData And (ProductName Is Nothing Or CompanyName Is Nothing) Then
Throw New ArgumentException("Modules.Logging: PathType is AppData and either CompanyName or ProductName was not supplied!")
End If
If LogPath = PathType.CurrentDirectory Then
Throw New ArgumentException("Modules.Logging: LogPath.CurrentDirectory is deprecated. Please use LogPath.CustomPath!")
End If
If LogPath = PathType.AppData Then
Dim appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) Dim appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
basePath = Path.Combine(appDataDir, companyName, productName, FOLDER_NAME_LOG) basePath = Path.Combine(appDataDir, CompanyName, ProductName, FOLDER_NAME_LOG)
ElseIf logPath = PathType.CurrentDirectory Then
Dim currentDirectory As String = My.Application.Info.DirectoryPath
basePath = Path.Combine(currentDirectory, FOLDER_NAME_LOG)
Else 'Custom Path Else 'Custom Path
basePath = customLogPath basePath = CustomLogPath
End If End If
' If directory does not exist, try to create it! ' If directory does not exist, try to create it!
@@ -219,12 +212,12 @@ Public Class LogConfig
' Set the suffix to the given string if it exists ' Set the suffix to the given string if it exists
Dim logFileSuffix As String = String.Empty Dim logFileSuffix As String = String.Empty
If suffix IsNot Nothing AndAlso suffix.Count > 0 Then If Suffix IsNot Nothing AndAlso Suffix.Count > 0 Then
logFileSuffix = $"-{suffix}" logFileSuffix = $"-{Suffix}"
End If End If
' Create config object and initalize it ' Create config object and initalize it
config = GetConfig(productName, logFileSuffix) config = GetConfig(ProductName, logFileSuffix)
' Save config ' Save config
LogFactory = New LogFactory With { LogFactory = New LogFactory With {
@@ -236,10 +229,24 @@ Public Class LogConfig
LogFile = GetCurrentLogFilePath() LogFile = GetCurrentLogFilePath()
End Sub End Sub
Private Sub CheckMyApplication()
Dim oAssembly = Assembly.GetEntryAssembly()
Dim oMyApp = Nothing
For Each oType As Type In oAssembly.DefinedTypes
If oType.Name = "MyApplication" Then
oMyApp = oType
Exit For
End If
Next
oMyApp.GetType().GetProperty("")
End Sub
''' <summary> ''' <summary>
''' Returns the Logger for the calling class ''' Returns the Logger for the calling class
''' </summary> ''' </summary>
''' <returns>An object of Logging.Logger</returns> ''' <returns>An object of Logging.Logger</returns>
<DebuggerStepThrough()>
Public Function GetLogger() As Logger Public Function GetLogger() As Logger
Dim oClassName As String = GetClassFullName() Dim oClassName As String = GetClassFullName()
Return LogFactory.GetLogger(Of Logger)(oClassName) Return LogFactory.GetLogger(Of Logger)(oClassName)
@@ -250,6 +257,7 @@ Public Class LogConfig
''' </summary> ''' </summary>
''' <param name="ClassName">The name of the class the logger belongs to</param> ''' <param name="ClassName">The name of the class the logger belongs to</param>
''' <returns>An object of Logging.Logger</returns> ''' <returns>An object of Logging.Logger</returns>
<DebuggerStepThrough()>
Public Function GetLogger(ClassName As String) As Logger Public Function GetLogger(ClassName As String) As Logger
Return LogFactory.GetLogger(Of Logger)(ClassName) Return LogFactory.GetLogger(Of Logger)(ClassName)
End Function End Function
@@ -268,6 +276,7 @@ Public Class LogConfig
''' </summary> ''' </summary>
''' <returns>The fully qualified class name</returns> ''' <returns>The fully qualified class name</returns>
''' <remarks>This method is very resource-intensive!</remarks> ''' <remarks>This method is very resource-intensive!</remarks>
<DebuggerStepThrough()>
Public Shared Function GetClassFullName() As String Public Shared Function GetClassFullName() As String
Dim oFramesToSkip As Integer = 2 Dim oFramesToSkip As Integer = 2
Dim oClassName As String = String.Empty Dim oClassName As String = String.Empty
@@ -437,7 +446,5 @@ Public Class LogConfig
Return memoryLog Return memoryLog
End Function End Function
#End Region #End Region
End Class End Class

View File

@@ -2,11 +2,13 @@
Public Class Logger Public Class Logger
Inherits NLog.Logger Inherits NLog.Logger
Implements ILogger
''' <summary> ''' <summary>
''' Prints a preformatted Block including a block identifier ''' Prints a preformatted Block including a block identifier
''' </summary> ''' </summary>
''' <param name="blockId">A unique Identifier for this block, eg. DocId, FullPath, ..</param> ''' <param name="blockId">A unique Identifier for this block, eg. DocId, FullPath, ..</param>
<DebuggerStepThrough()>
Public Sub NewBlock(blockId As String) Public Sub NewBlock(blockId As String)
Dim message As String = $"-----> Start of Block {blockId}" Dim message As String = $"-----> Start of Block {blockId}"
Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message) Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message)
@@ -15,6 +17,7 @@ Public Class Logger
Log(WrapperType, logEventInfo) Log(WrapperType, logEventInfo)
End Sub End Sub
<DebuggerStepThrough()>
Public Sub EndBlock() Public Sub EndBlock()
Dim message As String = $"<----- End of Block" Dim message As String = $"<----- End of Block"
Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message) Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message)

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -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("0.0.1.1")> <Assembly: AssemblyVersion("2.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -48,7 +48,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="S22.Imap, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="S22.Imap, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\S22.Imap.3.6.0.0\lib\net40\S22.Imap.dll</HintPath> <HintPath>..\packages\S22.Imap.3.6.0.0\lib\net40\S22.Imap.dll</HintPath>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
<package id="S22.Imap" version="3.6.0.0" targetFramework="net461" /> <package id="S22.Imap" version="3.6.0.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -65,7 +65,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -45,7 +45,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
</packages> </packages>

View File

@@ -0,0 +1,341 @@
Imports System.ServiceModel
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Filesystem
Imports DigitalData.Services.EDMIService
Imports System.IO
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
Public Class EDMIService
Implements IEDMIService
Public Shared LogConfig As LogConfig
Public Shared Database As Firebird
Public Shared AppConfig As AppConfig
Private ReadOnly _logger As Logger
Private _request As Request = Nothing
Private _debug As Boolean = False
Private _username As String
Public Sub New()
Dim oOperationContext As OperationContext = OperationContext.Current
Dim oInstanceContext As InstanceContext = oOperationContext.InstanceContext
Dim oUsername = oOperationContext.ServiceSecurityContext.WindowsIdentity.Name
_username = oUsername
_logger = LogConfig.GetLogger()
End Sub
#Region "Auth"
Private Function TestUserAuth() As Boolean
Try
'Dim oSQL As String = $"SELECT FNIDB_AUTH_USER('{_username}') FROM RDB$DATABASE;"
'Dim oResult As Boolean = Database.GetScalarValue(oSQL)
'Return oResult
Return True
Catch ex As Exception
_logger.Error(ex)
Return False
End Try
End Function
#End Region
#Region "Heartbeat"
Public Function Heartbeat() As Boolean Implements IEDMIService.Heartbeat
Return True
End Function
#End Region
#Region "Request"
Public Sub CreateRequest(Name As String, Optional Debug As Boolean = False)
_request = New Request(Name, _username, Database, Debug)
_debug = Debug
_logger.Info("Creating request {0}/{1}", _request.Name, _request.RequestId)
End Sub
Public Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String Implements IEDMIService.CreateDatabaseRequest
CreateRequest(Name, Debug)
Return _request.Name
End Function
Public Sub CloseDatabaseRequest() Implements IEDMIService.CloseDatabaseRequest
If IsNothing(_request) Then
Exit Sub
End If
_logger.Info("Closing request {0}", _request.ToString)
_request.Connection.Close()
_request = Nothing
End Sub
#End Region
#Region "Database"
Private Sub TestRequestCreated()
If IsNothing(_request) Then
Throw New Exceptions.NoRequestException()
End If
End Sub
Public Function ReturnDatatable(SQL As String) As TableResult Implements IEDMIService.ReturnDatatable
Try
TestRequestCreated()
_logger.Info($"ReturnDatatable, SQL: {SQL}")
_request.LogDebug($"ReturnDatatable, SQL: {SQL}")
Dim oResult As DataTable = Database.GetDatatableWithConnection(SQL, _request.Connection)
Return New TableResult(oResult)
Catch ex As Exception
_logger.Error(ex)
_request.LogError(ex.Message)
Return New TableResult(ex.Message)
End Try
End Function
Public Function ReturnScalar(SQL As String) As ScalarResult Implements IEDMIService.ReturnScalar
Try
TestRequestCreated()
_logger.Info($"ReturnScalar, SQL: {SQL}")
_request.LogDebug($"ReturnScalar, SQL: {SQL}")
Dim oResult As Object = Database.GetScalarValueWithConnection(SQL, _request.Connection)
Return New ScalarResult(oResult)
Catch ex As Exception
_logger.Error(ex)
_request.LogError(ex.Message)
Return New ScalarResult(ex.Message)
End Try
End Function
Public Function ExecuteNonQuery(SQL As String) As NonQueryResult Implements IEDMIService.ExecuteNonQuery
Try
TestRequestCreated()
_logger.Info($"ExecuteNonQuery, SQL: {SQL}")
_request.LogDebug($"ExecuteNonQuery, SQL: {SQL}")
Dim oResult As Boolean = Database.ExecuteNonQueryWithConnection(SQL, _request.Connection)
Return New NonQueryResult()
Catch ex As Exception
_logger.Error(ex)
_request.LogError(ex.Message)
Return New NonQueryResult(ex.Message)
End Try
End Function
#End Region
#Region "Document (with FileContainer)"
'Public Function NewFile(FileName As String, Contents() As Byte) As DocumentResult Implements IEDMIService.NewFile
' Try
' Dim oContainer As FileContainer
' Dim oContainerId As String
' If Not TestUserAuth() Then
' Throw New Exception($"User {_username} not authorized.")
' End If
' oContainer = FileContainer.Create(LogConfig, AppConfig.ContainerPassword)
' oContainerId = oContainer.ContainerId
' _logger.Debug("Container created with id {0}", oContainerId)
' Dim oExtension As String = Path.GetExtension(FileName).Substring(1)
' _logger.Debug("File extension of file {0} is {1}", FileName, oExtension)
' Dim oSQL = $"SELECT FNICM_NEW_DOC('010', '{oContainerId}', '{GetContainerName(oContainerId)}', '{FileName}', '{oExtension}', '{_username}') FROM RDB$DATABASE;"
' Dim oDocId As Int64 = Database.GetScalarValue(oSQL)
' If oDocId = -1 Then
' _logger.Warn("Database returned -1 while creating Document Entry. File was not saved!")
' Return Nothing
' End If
' _logger.Debug("Database Entry created with DocId {0}", oDocId)
' oContainer.SetFile(Contents, FileName)
' oContainer.SaveAs(GetContainerPath(oContainerId))
' _logger.Debug("File saved in Container!", FileName)
' Dim oDocument = New DocumentObject(oContainerId, oDocId, FileName)
' Return New DocumentResult(oDocument)
' Catch ex As Exception
' _logger.Error(ex)
' Return New DocumentResult(ex.Message)
' End Try
'End Function
'Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResult Implements IEDMIService.UpdateFile
' Try
' TestFileExists(DocObject.ContainerId)
' ' TODO: update db
' Dim oFilePath = GetContainerPath(DocObject.ContainerId)
' Dim oFileContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oFilePath)
' oFileContainer.SetFile(Contents, oFileContainer.GetFile.FileName)
' oFileContainer.Save()
' Return New DocumentResult(DocObject)
' Catch ex As Exception
' _logger.Error(ex)
' Return Nothing
' End Try
'End Function
'Public Function GetFile(DocObject As DocumentObject) As DocumentResult Implements IEDMIService.GetFile
' Try
' TestFileExists(DocObject.ContainerId)
' Dim oContainerPath = GetContainerPath(DocObject.ContainerId)
' Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath)
' Dim oContents As Byte() = oContainer.GetFile().Contents
' Return New DocumentResult(DocObject, oContents)
' Catch ex As Exception
' _logger.Error(ex)
' Return New DocumentResult(ex.Message)
' End Try
'End Function
'Public Function DeleteFile(DocObject As DocumentObject) As Boolean Implements IEDMIService.DeleteFile
' Try
' TestFileExists(DocObject.ContainerId)
' Dim oFilePath = GetContainerPath(DocObject.ContainerId)
' IO.File.Delete(oFilePath)
' 'TODO: Delete doc from db
' Return True
' Catch ex As Exception
' _logger.Error(ex)
' Return False
' End Try
'End Function
'Private Function GetContainerPath(ContainerId As String) As String
' Return Path.Combine(AppConfig.ContainerPath, GetContainerName(ContainerId))
'End Function
'Private Function GetContainerName(ContainerId As String) As String
' Return ContainerId & ".enc"
'End Function
'Private Sub TestFileExists(ContainerId)
' Dim oContainerPath = GetContainerPath(ContainerId)
' If Not IO.File.Exists(oContainerPath) Then
' Throw New FileNotFoundException("Container existiert nicht", oContainerPath)
' End If
'End Sub
'Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResult Implements IEDMIService.GetDocumentByDocumentId
' Try
' Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE GUID = {DocumentId}"
' Dim oTable = Database.GetDatatable(oSQL)
' If oTable.Rows.Count = 0 Then
' Return New DocumentResult("Document not found")
' End If
' Dim oRow As DataRow = oTable.Rows.Item(0)
' Dim oDocument As New DocumentObject(
' oRow.Item("CONTAINER_ID"),
' oRow.Item("GUID"),
' oRow.Item("ORIGINAL_FILENAME")
' )
' TestFileExists(oDocument.ContainerId)
' Dim oContainerPath = GetContainerPath(oDocument.ContainerId)
' Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath)
' Dim oContents As Byte() = oContainer.GetFile().Contents
' Return New DocumentResult(oDocument, oContents)
' Catch ex As Exception
' Return New DocumentResult(ex.Message)
' End Try
'End Function
'Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResult Implements IEDMIService.GetDocumentByContainerId
' Try
' Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE CONTAINER_ID = '{ContainerId}'"
' Dim oTable = Database.GetDatatable(oSQL)
' If oTable.Rows.Count = 0 Then
' Return New DocumentResult("Document not found")
' End If
' Dim oRow As DataRow = oTable.Rows.Item(0)
' Dim oDocument As New DocumentObject(
' oRow.Item("CONTAINER_ID"),
' oRow.Item("GUID"),
' oRow.Item("ORIGINAL_FILENAME")
' )
' TestFileExists(oDocument.ContainerId)
' Dim oContainerPath = GetContainerPath(oDocument.ContainerId)
' Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath)
' Dim oContents As Byte() = oContainer.GetFile().Contents
' Return New DocumentResult(oDocument, oContents)
' Catch ex As Exception
' Return New DocumentResult(ex.Message)
' End Try
'End Function
#End Region
#Region "Document"
Public Function ImportFile(FileInfo As FileInfo, Contents() As Byte, [Readonly] As Boolean, RetentionPeriod As Integer) As DocumentResult2 Implements IEDMIService.ImportFile
Dim oFilePath = Path.Combine(AppConfig.ContainerPath, FileInfo.Name)
Dim oDocument = New DocumentResult2.DocumentObject() With {.FileName = FileInfo.Name}
Try
_logger.Info("Saving file [{0}] to path [{1}]", FileInfo.Name, oFilePath)
Using oStream = New FileStream(oFilePath, FileMode.CreateNew)
oStream.Write(Contents, 0, Contents.Length)
oStream.Flush(True)
oStream.Close()
End Using
Dim oAttributes = IO.File.GetAttributes(oFilePath) Or FileAttributes.ReadOnly
If RetentionPeriod Then
_logger.Info("Setting LastAccessTime")
IO.File.SetLastAccessTime(oFilePath, Date.Now.AddYears(30))
End If
If [Readonly] Then
_logger.Info("Setting ReadOnly Attribute")
IO.File.SetAttributes(oFilePath, oAttributes)
End If
Return New DocumentResult2(oDocument)
Catch ex As Exception
_logger.Error(ex)
Return New DocumentResult2(ex.Message)
End Try
End Function
#End Region
#Region "Index"
Public Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult Implements IEDMIService.NewFileIndex
Try
Dim oSQL = $"SELECT FNIDB_NEW_DOC_VALUE({DocObject.DocumentId},'{Syskey}','{LanguageCode}','{Value}','{_username}') FROM RDB$DATABASE;"
Dim oIndexId As Int64 = Database.GetScalarValue(oSQL)
Return New IndexResult(oIndexId)
Catch ex As Exception
_logger.Error(ex)
Return New IndexResult(ex.Message)
End Try
End Function
#End Region
End Class

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A8C3F298-76AB-4359-AB3C-986E313B4336}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>DigitalData.Services.EDMIService.WindowsService</StartupObject>
<RootNamespace>DigitalData.Services.EDMIService</RootNamespace>
<AssemblyName>EDMIService</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Console</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>EDMIService.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>EDMIService.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=6.4.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>..\..\packages\FirebirdSql.Data.FirebirdClient.6.4.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppConfig.vb" />
<Compile Include="Results\BaseResult.vb" />
<Compile Include="Results\ContainerResult.vb" />
<Compile Include="Results\DocumentResult.vb" />
<Compile Include="Exceptions.vb" />
<Compile Include="Results\DatabaseResult.vb" />
<Compile Include="EDMIService.vb" />
<Compile Include="Results\DocumentResult2.vb" />
<Compile Include="Results\IndexResult.vb" />
<Compile Include="WindowsService.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="IEDMIService.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ProjectInstaller.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="Request.vb" />
<Compile Include="SettingsModule.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ProjectInstaller.resx">
<DependentUpon>ProjectInstaller.vb</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Modules.Database\Database.vbproj">
<Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project>
<Name>Database</Name>
</ProjectReference>
<ProjectReference Include="..\..\Modules.EDMIAPI\EDMI.API.vbproj">
<Project>{5B1171DC-FFFE-4813-A20D-786AAE47B320}</Project>
<Name>EDMI.API</Name>
</ProjectReference>
<ProjectReference Include="..\..\Modules.Filesystem\Filesystem.vbproj">
<Project>{991D0231-4623-496D-8BD0-9CA906029CBC}</Project>
<Name>Filesystem</Name>
</ProjectReference>
<ProjectReference Include="..\..\Modules.Logging\Logging.vbproj">
<Project>{903B2D7D-3B80-4BE9-8713-7447B704E1B0}</Project>
<Name>Logging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@@ -0,0 +1,61 @@
Imports System.IO
Imports System.ServiceModel
Imports DigitalData.Modules.Filesystem
<ServiceContract([Namespace]:="http://DigitalData.Services.EDMIService")>
Interface IEDMIService
#Region "Heartbeat"
<OperationContract>
Function Heartbeat() As Boolean
#End Region
#Region "Database"
<OperationContract>
Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String
<OperationContract>
Sub CloseDatabaseRequest()
<OperationContract>
Function ReturnDatatable(SQL As String) As TableResult
<OperationContract>
Function ReturnScalar(SQL As String) As ScalarResult
<OperationContract>
Function ExecuteNonQuery(SQL As String) As NonQueryResult
#End Region
#Region "Document (with FileContainer)"
'<OperationContract>
'Function NewFile(FileName As String, Contents As Byte()) As DocumentResult
'<OperationContract>
'Function UpdateFile(DocObject As DocumentObject, Contents As Byte()) As DocumentResult
'<OperationContract>
'Function GetFile(DocObject As DocumentObject) As DocumentResult
'<OperationContract>
'Function DeleteFile(DocObject As DocumentObject) As Boolean
'<OperationContract>
'Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResult
'<OperationContract>
'Function GetDocumentByContainerId(ContainerId As String) As DocumentResult
#End Region
#Region "Document (New)"
<OperationContract>
Function ImportFile(FileInfo As FileInfo, Contents As Byte(), [ReadOnly] As Boolean, RetentionTime As Integer) As DocumentResult2
#End Region
#Region "Index"
<OperationContract>
Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult
#End Region
End Interface

View File

@@ -52,7 +52,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="Quartz, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL"> <Reference Include="Quartz, Version=3.0.7.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.3.0.7\lib\net452\Quartz.dll</HintPath> <HintPath>..\packages\Quartz.3.0.7\lib\net452\Quartz.dll</HintPath>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.6.8" targetFramework="net461" /> <package id="NLog" version="4.7.0" targetFramework="net461" />
<package id="Quartz" version="3.0.7" targetFramework="net461" /> <package id="Quartz" version="3.0.7" targetFramework="net461" />
</packages> </packages>

Some files were not shown because too many files have changed in this diff Show More