ms commit

This commit is contained in:
SchreiberM 2020-03-17 16:27:53 +01:00
commit a66c2928f2
39 changed files with 742 additions and 214 deletions

View File

@ -58,6 +58,7 @@ Partial Class DocumentViewer
Me.statusLabel = 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.mainToolStrip.SuspendLayout() Me.mainToolStrip.SuspendLayout()
Me.statusbar.SuspendLayout() Me.statusbar.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
@ -195,7 +196,7 @@ Partial Class DocumentViewer
' '
Me.DefaultToolStripMenuItem.CheckOnClick = True Me.DefaultToolStripMenuItem.CheckOnClick = True
Me.DefaultToolStripMenuItem.Name = "DefaultToolStripMenuItem" Me.DefaultToolStripMenuItem.Name = "DefaultToolStripMenuItem"
Me.DefaultToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.DefaultToolStripMenuItem.Size = New System.Drawing.Size(151, 22)
Me.DefaultToolStripMenuItem.Text = "Default" Me.DefaultToolStripMenuItem.Text = "Default"
' '
'PanToolStripMenuItem 'PanToolStripMenuItem
@ -204,28 +205,28 @@ Partial Class DocumentViewer
Me.PanToolStripMenuItem.CheckOnClick = True Me.PanToolStripMenuItem.CheckOnClick = True
Me.PanToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked Me.PanToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked
Me.PanToolStripMenuItem.Name = "PanToolStripMenuItem" Me.PanToolStripMenuItem.Name = "PanToolStripMenuItem"
Me.PanToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.PanToolStripMenuItem.Size = New System.Drawing.Size(151, 22)
Me.PanToolStripMenuItem.Text = "Pan" Me.PanToolStripMenuItem.Text = "Pan"
' '
'AreaSelectionToolStripMenuItem 'AreaSelectionToolStripMenuItem
' '
Me.AreaSelectionToolStripMenuItem.CheckOnClick = True Me.AreaSelectionToolStripMenuItem.CheckOnClick = True
Me.AreaSelectionToolStripMenuItem.Name = "AreaSelectionToolStripMenuItem" Me.AreaSelectionToolStripMenuItem.Name = "AreaSelectionToolStripMenuItem"
Me.AreaSelectionToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.AreaSelectionToolStripMenuItem.Size = New System.Drawing.Size(151, 22)
Me.AreaSelectionToolStripMenuItem.Text = "Area selection" Me.AreaSelectionToolStripMenuItem.Text = "Area selection"
' '
'AreaZoomingToolStripMenuItem 'AreaZoomingToolStripMenuItem
' '
Me.AreaZoomingToolStripMenuItem.CheckOnClick = True Me.AreaZoomingToolStripMenuItem.CheckOnClick = True
Me.AreaZoomingToolStripMenuItem.Name = "AreaZoomingToolStripMenuItem" Me.AreaZoomingToolStripMenuItem.Name = "AreaZoomingToolStripMenuItem"
Me.AreaZoomingToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.AreaZoomingToolStripMenuItem.Size = New System.Drawing.Size(151, 22)
Me.AreaZoomingToolStripMenuItem.Text = "Area zooming" Me.AreaZoomingToolStripMenuItem.Text = "Area zooming"
' '
'MagnifierToolStripMenuItem 'MagnifierToolStripMenuItem
' '
Me.MagnifierToolStripMenuItem.CheckOnClick = True Me.MagnifierToolStripMenuItem.CheckOnClick = True
Me.MagnifierToolStripMenuItem.Name = "MagnifierToolStripMenuItem" Me.MagnifierToolStripMenuItem.Name = "MagnifierToolStripMenuItem"
Me.MagnifierToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.MagnifierToolStripMenuItem.Size = New System.Drawing.Size(151, 22)
Me.MagnifierToolStripMenuItem.Text = "Magnifier" Me.MagnifierToolStripMenuItem.Text = "Magnifier"
' '
'ToolStripSeparator6 'ToolStripSeparator6
@ -410,20 +411,31 @@ Partial Class DocumentViewer
' '
'RichEditControl1 'RichEditControl1
' '
Me.RichEditControl1.Location = New System.Drawing.Point(735, 313) Me.RichEditControl1.Location = New System.Drawing.Point(735, 377)
Me.RichEditControl1.Name = "RichEditControl1" Me.RichEditControl1.Name = "RichEditControl1"
Me.RichEditControl1.Options.HorizontalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden Me.RichEditControl1.Options.HorizontalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden
Me.RichEditControl1.Options.VerticalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden Me.RichEditControl1.Options.VerticalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden
Me.RichEditControl1.ReadOnly = True Me.RichEditControl1.ReadOnly = True
Me.RichEditControl1.Size = New System.Drawing.Size(249, 225) Me.RichEditControl1.Size = New System.Drawing.Size(249, 161)
Me.RichEditControl1.TabIndex = 8 Me.RichEditControl1.TabIndex = 8
Me.RichEditControl1.Text = "RichEditControl1" Me.RichEditControl1.Text = "RichEditControl1"
Me.RichEditControl1.Visible = False Me.RichEditControl1.Visible = False
' '
'SpreadsheetControl1
'
Me.SpreadsheetControl1.Location = New System.Drawing.Point(461, 377)
Me.SpreadsheetControl1.Name = "SpreadsheetControl1"
Me.SpreadsheetControl1.ReadOnly = True
Me.SpreadsheetControl1.Size = New System.Drawing.Size(268, 161)
Me.SpreadsheetControl1.TabIndex = 9
Me.SpreadsheetControl1.Text = "SpreadsheetControl1"
Me.SpreadsheetControl1.Visible = False
'
'DocumentViewer 'DocumentViewer
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
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.statusbar)
@ -474,4 +486,5 @@ Partial Class DocumentViewer
Friend WithEvents statusLabel 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
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
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFhSURBVEhLvVVBToRAEESNF/+kv+BIuPEAEgIXM4/wsnLQ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFgSURBVEhLvVVBToRAEESNF/+kv+DEgRsPICFwMfMGLwYv
kx9gvRkf4oVw4AWb3XAQZ+yanXaHQcLsrlhJZao73V3TuxCCKeR5LokKZ1EUg5OJmGna/CCEuKQByhdH evIDs0fjQ0wIB56w0XAQZ+yanXaHQcLsrlhJZao73V3TuxCiOZRlqYgaZ1VVo5OJmGnbwiCEOKcBOhQH
GyRJcr2sgRA3C2/wqDeQUuoB9snkGDjK4K5Yq3NoxhxA7u9RFH3hqej7Xt3mFXElUYzT1nbOjaHBtm31 G2RZdrmugRBXK2/wYDZQSpkB7snkGDjI4Kba6FNox+xB7q9JknzhqRiGQV+XknivUIzT1W7Oj6HBruvM
0xXH8WeWZS8w+Hn0/tLAzOy1ARMGXHgq+T9hLr2BHBh0XafEwys1VLp4b3bQds6NodHbNM20QVVVqq5r 05Wm6WdRFM8w+Hn0/tLAzhyMARMGXHgs+T9hrr2BGhn0fa/FnaQGaYp3Znvt5vwYGr1t284bSCl10zQK
iVtgVZy2tnNuDI3esizHBktysMGctnNuPKX/ZwMtDKCnbmTn3HhKY6BO2OQiX7hDWeNtxodlTYmRCeiL t8CqOF3t5vwYGr11XU8N1uRogyXt5vx4Tv/PBkZYQM/dyM358ZzGQJNwyUWh8IeyxtuMD8uGEhMTMBS/
33qJPXFlfpgxUMR4fvtQTw6RY+C2+EiZVj/YBnM422BuA9SGYXhlWv3gbuC+uRwDp26wMf2zSNN0Ry0X 9RIHYm1/mClQxHh6edOPHpFj4Lb4SNnWMLgGSzjZYGkD1MZxfGFbw+Bv4L+5HAPHbrC1/YvI8/yDWs52
+05P0K3Io9hgkxluifemzUEQfAOjsN87/RDFYwAAAABJRU5ErkJggg== nYGgW5FHtcUmC3wn3to2D1H0DRIt3n90sPmTAAAAAElFTkSuQmCC
</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
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHASURBVEhLnZM9LwRRGIU38VVp/AGNSqPQIDMjVH4AnaDS YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHBSURBVEhLnZM9LwRRGIU38VVp/AGJUqPQIDMjVH4AnYRK
iAhhZ0ShIDQSEZWKkiXB3I34KGhIiCyFWoKSjpAQrnvGu8nEPWtmPcmTm7nvPWd2Z3cypejpyVU4fr7X IyKEnRGFgtBIRBRKSpYEczcbHwUNCZGlUEtQ0hESwnXPeDeZuGfNrCd5cjP3vefM7uxOphx9fbkqx8/3
DVToZdV9Q//qhxcoPZe70lija7OPOc7hvESTaRndr3Oy6gxFv906vbX2IM4jJxV/Yz7VHivpnj/SsxuF u4EKvay6bxpY+/ACpedzVxprdG32Mcc5nJdoMm1j+w1OVp2h6Lfbp7fWHsR55KTib8ynKrCS3oUjPbdZ
aGVz5KSiNN6kclkYPr+9a4CVzSNNXqo4nh8u06AxDptHmrxUcZwJdUGDxjhsDpGXKo4zpp5YEMZhc4i8 jFY2R04qyuNNKZeF4fPbuwZY2TzS5KWK4/nhCg0a47B5pMlLFceZVBc0aIzD5hB5qeI44+qJBWEcNofI
VHG8PvXJgjAOm0eavFTZtE8fV9KQsXMqr69vn/SL+YGx4pqdg1Jn0zx4WcUCcbOr53S/aLtR6myKNzgo SxXH61efLAjjsHmkyUuVTefMcTUNGbun8/r69km/mB8YK67ZOSh1Nq1DlzUsEDe7dk73S3Yapc6mdIOD
PPzL/MVddBOps2HfAI+if/FE+2vnema9oOc3r6IV19hnj0rqbNI8ojRKnU3jdK6aBcpV6my6hvdqWKBc 4sO/zF/cRTeROhv2DfAoBpZOtL9+rmc3inph6ypacY199qikzibNI0qj1Nk0z+RqWaBSpc6mZ6RQxwKV
pc7m52+68sVC6V35kjrOX29yGhPfZCdQhyyYVuSliuP64RALphV5qeK0TezUtgbqkYWTRA55qSqN6+8O KnU2P3/T1S8WSu/ql9Rx/nqT05j4JjuBOmTBtCIvVRzXD4dZMK3ISxWnY3K3vj1QjyycJHLIS1V5XH9v
sIIkkZOKZFxfLbGSUuK8RNPjBuF408j2GyssijnOSaR8Oqby9U4QLpiyG+NrzBvsYy5HCZnMN/I6uJAB kBUkiZxUJOP6apmVlBPnJZoeNwgnWkZ33lhhScxxTiKV0zWdb3SCcNGU3RhfY95gH3M5SshkvgGoyriE
Y+kDAAAAAElFTkSuQmCC 9kg28AAAAABJRU5ErkJggg==
</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
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGjSURBVEhLxVRLS8NAEF7UnkVRPHr32oNCsgmI4FkkKIp4 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGjSURBVEhLxVTLSsNAFB3UrkVRXLp324VCMgmIfoBIURRx
69lXs1tEgg9Ef4In76LY7BYRPPgHREFR/4Pg8+ozk0502aY1KY1+MGQyj+/bGZIlWWC45Peh21oAMWVi 17WvZKaIxIKIfoIr96LYzBQRXPgDoqCo/yD43PrMTW90mKYxKa0euOTmPs6Ze0mGtAOjJX8A3dYCiCkT
m7oHzxgixOLyU7X+2d1XTCWGvSB6KBdbBhdPEQ+mCKFs7QMMgvBMI2CWjnpNJjaD3hedB0uaEwBiyuTG 29Q9eMYQIRaXn6oNzu++Yio17CXRR7nYMrh4ingwRQhl6x9gEIRnFgGzdNRvMrEZ9L7oPFjSnAAQUyY3
IBOPaq/qY2m6FZm80gXE1tz+g96nG7Ykm2Bo/ribuv6qwao7Vuvr+djaWCA8MZcrlPn3el1iAQioFglY hpl4VHtVH0uzrcjk1R4gthb2H/Q+3bAl3QQji8e91PXLBqvtWK1v5GNrskB4Yi7XKPPv9brUAhBQLRKw
XCxbi+U7PZ/UQnJAzSlGxTvsuCauvavxOB/pYwQa+Or7b/VI/wcCEMjCkP4fJhjg8i24Uy71eFpD+vj/ uFi1lit3ej6theSAulOMi3fYcV1ce1fjcT7Sxwgk+Or7b/VI/wcCEGiHIf0/TDDE5Vtwp1zq8ayG9PH/
YISddBpMjhlFcW7x9e/Tq3XRs56P9PECmCKOs9ceXL/jwY92odclFoCAanFXhe2ddti84qRZHbY2nqAG wRg76TaYnDAccW7x8vfp1bro2chH+ngBTJFCYa8zuH4ngx/tQq9LLQAB1eKuCts77bJ5tZBlddiaPEEd
ntcW3PsTxhII/awu6lV97EgpgICJTFdOmm75Su1VfSxNtqJ6yBfOcpYrpgzu3+g8WNLcBDrCj6Eop6kr PK8juPenjBUQ+lld1Kv62JFRAAETma6cNt3Kldqr+liabkWNkC+e5SxXzBjcv9F5sKS5CXSEH4MjZ6kr
rqPVYaq1yBd2cjYXM2bx8BZD2QBWV/UI+QIsdSyLN+9oxwAAAABJRU5ErkJggg== rqPVYaq1yBd3cjYXc6ZzeIuh9gBWV/MI+QJHJit3xg14HQAAAABJRU5ErkJggg==
</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 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHLSURBVEhLY6AZqK9ngrKoC4zTzrDalG0OsS3bdAIqRB1g
X7+fw7Z8U4pdxeYbQPwfhKFSlAH7/PUCduWbyy1KNz2zLW/6BzIYRIMwVAl5wKlqszTQxZ02RZveIBtK X7+fw7Z8U4pdxeYbQPwfhKFSlAH7/PUCduWbyy1KNz2zLW/4BzIYRIMwVAl5wKlqszTQxZ02RZveIBtK
sQU2FVvV7Mo2T7esWPsFFhS4MFQLMeA/o1XpBhOb8k0rtSo2/0F3KS42VDMeAExq9hVbXGzLN+yxdd/0 sQU2FVvV7Mo2T7esWPsFFhS4MFQLMeA/o1XpBhOb8k0rtSo2/0F3KS42VDMeAExq9hVbXGzLN+yxdd30
F9kAiiwIDV3FbFuxKdymdPMpO4/Nf0GayMFQ4xDAtXgnNzD9ptuVbryJzUXIfGRxXGyosQwMFoU7hIAp F9kAiiwIDV3FbFuxKdymdPMpO7fNf0GayMFQ4xDAtXgnNzD9ptuVbryJzUXIfGRxXGyosQwMFoU7hIAp
ohSIn+LTgMzHpQaZDTbctnxjg23BmnfEaEDmE6MebIFdxZY064rN9+0qmsGS1MRgC0DAI3cbu33Fplib ohSIn+LTgMzHpQaZDTbctnxjg23BmnfEaEDmE6MebIFdxZY064rN9+0qGsGS1MRgC0DAI3cbu33Fplib
sg2X8bkImY9LDTIbajwCAMsTFpvKTQHAjHQEpJBSDDUWO7Ar3eBoXb5xh3z8/N8wFyG7EEbjY0ONwg/s sg2X8bkImY9LDTIbajwCAMsTFpvKTQHAjHQEpJBSDDUWO7Ar3eBoXb5xh3z8/N8wFyG7EEbjY0ONwg/s
yjcY2pRtXGGbteknsgFUswAGgEWFum355qn6+eu/gwwhBkO1kgZsq7ZLgkpRu4qNb7G5GpkN1UIesKnY yjcY2pRtXGGbteknsgFUswAGgEWFum355qn6+eu/gwwhBkO1kgZsq7ZLgkpRu4qNb7G5GpkN1UIesKnY
ImhbtrESVA/QxAIYABUvoLxkV7LhLshwZAxVQh0ASuK2pZujgbXbWar6AAMAi3ig672sSzcdhIrQCvxn ImhbtrESVA/QxAIYABUvoLxkV7LhLshwZAxVQh0ASuK2pZujgbXbWar6AAMAi3ig672sSzcdhIrQCvxn
ZGBgYAAAFXGJG9oJLr4AAAAASUVORK5CYII= ZGBgYAAASTmIRRBkor0AAAAASUVORK5CYII=
</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+zmgUtQBtuVN/0AYZAmItijd9MyufHO5ff56AagSygC6BTC2TdGmN0AfdTpVbZaG FZv/Q/EN2/JNKfb1+zmgUtQBtuUN/0AYZAmItijd9MyufHO5ff56AagSygC6BTC2TdGmN0AfdTpVbZaG
KiUPQIMHJ7asWPvFrmzzdJuKrWpQLaQBXD5AZ2tVbP5jU75ppVXpBhMGhv+MUO2EAT5DkdlwMfdNf23L KiUPQIMHJ7asWPvFrmzzdJuKrWpQLaQBXD5AZ2tVbP5jU75ppVXpBhMGhv+MUO2EAT5DkdlwMddNf23L
N+yxr9jiQlQSB2kkC3ts/mtTuvmUbcWm8NDQVcxQ4zABuktxsZHF0Pl2pRtvAvNTumvxTm6osQiAVQOp N+yxr9jiQlQSB2kkC7tt/mtTuvmUbcWm8NDQVcxQ4zABuktxsZHF0Pl2pRtvAvNTumvxTm6osQiAVQOp
FsDZm54CcalF4Q4hqPHUtgDKLljzzrZ8YwPYApAAdXHzP+uKzfftKrakgS3A6Qo0NrIYOh/GtinbcNm+ FsDZm54CcalF4Q4hqPHUtgDKLljzzrZ8YwPYApAAdXHjP+uKzfftKrakgS3A6Qo0NrIYOh/GtinbcNm+
YlOsR+42drDhIACSpBiXbT5iU7kpAFiOsUCNRQB8LkJmI4uBsHz8/N/W5Rt32JVucIQahR3ANBBtQdam YlOsR+42drDhIACSpBiXbT5iU7kpAFiOsUCNRQB8LkJmI4uBsHz8/N/W5Rt32JVucIQahR3ANBBtQdam
nzZlG1fYlW8whBqBH4A0EoP189d/ty3fPBVYVKhDtRIH0F2Kyd74FlSq2lZtl4RqIQ1gN3Tzf1C9YFu2 nzZlG1fYlW8whBqBH4A0EoP189d/ty3fPBVYVKhDtRIH0F2Kyd74FlSq2lZtl4RqIQ1gN3Tzf1C9YFu2
sdKmYosgVCl5AGQYCi7ZcBeUhrFme3IA3NXlm8/alm6OxprUKAHWpZsOAl3uRcPWBQmVB0mAgQEAzT+J sdKmYosgVCl5AGQYCi7ZcBeUhrFme3IA3NXlm8/alm6OxprUKAHWpZsOAl3uRcPWBQmVB0mAgQEA6D+I
GzCOALMAAAAASUVORK5CYII= RTXTAxQAAAAASUVORK5CYII=
</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 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFxSURBVEhLY4ABp8qN4lAmbYBt2dqPtuWbOmlmkV3F5v8g
bF2x6YNtxaYO+6JNIlApooF8/PzfMHNgGCoF9EF50z+QAIiGsj/ZlG9qs6ncJgpVQhCALEA3ByqF1QIw bF2x6YNtxaYO+6JNIlApooF8/PzfMHNgGCoF9EF5wz+QAIiGsj/ZlG9qs6ncJgpVQhCALEA3ByqF1QIw
27x803vb8s0txFiE1wKQIF5csOYd2KKKLYJQLRiA1CDCYINo63JgHJVtbLQo3CEE1QoHZAURMhtZzLZ8 27x803vb8s0txFiE1wKQIF5csOYd2KKKLYJQLRiA1CDCYINo63JgHJVtbLQo3CEE1QoHZAURMhtZzLZ8
41vbis21yD6iLIhw4eINr+wqNlWDzKBKEMHE0PngOHLf9BddHGo8FSzAwYYaTwcLQIK0wFDjh4APgGXY 41vbis21yD6iLIhw4eINr+wqNlWDzKBKEMHE0PngOHLd9BddHGo8FSzAwYYaTwcLQIK0wFDjh4APgGXY
Ja2KzX/QxaHGk+uD5n/WpZvOWZdvDnQp381P7Yx2Hli8B4eGrmKGGkGdjAYKCvuKLaH29ftZoFrhgIKM Ja2KzX/QxaHGk+uDxn/WpZvOWZdvDnQp381P7Yx2Hli8B4eGrmKGGkGdjAYKCvuKLaH29ftZoFrhgIKM
BgyKkk2XgPVEOEN9PRNUCwYgK4hsyjZctinbHIHNxeiApCCyrth4za5sU5Rx2hlWqBKCgIggav5nW7bp BgyKkk2XgPVEOEN9PRNUCwYgK4hsyjZctinbHIHNxeiApCCyrth4za5sU5Rx2hlWqBKCgIggavxnW7bp
qm3p5mjkyCMW4PWBTen66/YVm2KN02YS7WKSAClBQTxgYAAA1qQsi7HTS0QAAAAASUVORK5CYII= qm3p5mjkyCMW4PWBTen66/YVm2KN02YS7WKSAClBQTxgYAAA96Urd2ptB70AAAAASUVORK5CYII=
</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>
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
</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,19 +307,19 @@
<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>
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
</value> </value>
</data> </data>
<metadata name="statusbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="statusbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@ -2,8 +2,10 @@
Imports System.Globalization Imports System.Globalization
Imports System.Text.RegularExpressions Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports Independentsoft.Msg
Imports DevExpress.Spreadsheet.DocumentFormat
Imports DevExpress.Spreadsheet
Imports GdPicture14 Imports GdPicture14
Imports Independentsoft
Public Class DocumentViewer Public Class DocumentViewer
Private Enum ZoomMode Private Enum ZoomMode
@ -17,14 +19,14 @@ Public Class DocumentViewer
ZoomFitHeight ZoomFitHeight
End Enum End Enum
Private _docPath As String
Private _currentSearchOccurence As Integer = 0 Private _currentSearchOccurence As Integer = 0
Private _toggleGamma As Boolean = True Private _toggleGamma As Boolean = True
Private _licenseKey As String = String.Empty Private _licenseKey As String = String.Empty
Private _licenseManager As New GdPicture14.LicenseManager() Private _licenseManager As New GdPicture14.LicenseManager()
Private _logConfig As LogConfig Private _logConfig As LogConfig
Private _logger As Logger Private _logger As Logger
Private _view_only As Boolean = False
Private _hide_file_info_from_user As Boolean = False
' List of all created temp files when converting msg files ' List of all created temp files when converting msg files
Private _TempFiles As New List(Of String) Private _TempFiles As New List(Of String)
@ -67,7 +69,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.Debug("(DocView)Called Done, removing temp files") _logger.Warn("Called Done, removing temp files")
DeleteTempFiles() DeleteTempFiles()
'Dispose() 'Dispose()
End Sub End Sub
@ -75,23 +77,19 @@ Public Class DocumentViewer
''' <summary> ''' <summary>
''' Load a file and display it ''' Load a file and display it
''' </summary> ''' </summary>
''' <param name="filepath"></param> ''' <param name="FilePath"></param>
Public Sub LoadFile(filepath As String) Public Sub LoadFile(FilePath As String)
If _licenseKey = String.Empty Then If _licenseKey = String.Empty Then
_logger.Warn("(DocView)License key was not provided. File {0} not loaded.", filepath) _logger.Warn("License key was not provided. File {0} not loaded.", FilePath)
Exit Sub Exit Sub
End If End If
GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer GdViewer.ZoomMode = ViewerZoomMode.ZoomModeWidthViewer
GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter GdViewer.DocumentAlignment = ViewerDocumentAlignment.DocumentAlignmentTopCenter
_logger.Info("(DocView)Loading File {0}", filepath) _logger.Info("Loading File {0}", FilePath)
DoLoadFile(filepath) DoLoadFile(FilePath)
If _view_only Then
statusLabel.Text = _docPath
End If
UpdateMainUi() UpdateMainUi()
End Sub End Sub
@ -104,9 +102,9 @@ Public Class DocumentViewer
Public Sub DeleteTempFiles() Public Sub DeleteTempFiles()
For Each oFile In _TempFiles For Each oFile In _TempFiles
Try Try
System.IO.File.Delete(oFile) IO.File.Delete(oFile)
Catch ex As Exception Catch ex As Exception
_logger.Warn("(DocView)Could not delete temp file {0}", oFile) _logger.Warn("Could not delete temp file {0}", oFile)
End Try End Try
Next Next
_TempFiles.Clear() _TempFiles.Clear()
@ -114,16 +112,24 @@ Public Class DocumentViewer
Private Sub DoLoadFile(FilePath As String) Private Sub DoLoadFile(FilePath As String)
Try Try
Dim oFileInfo = New System.IO.FileInfo(FilePath) Dim oFileInfo = New IO.FileInfo(FilePath)
Dim oExtension As String = oFileInfo.Extension.ToUpper Dim oExtension As String = oFileInfo.Extension.ToUpper
RichEditControl1.Visible = False
RichEditControl1.Dock = DockStyle.None
SpreadsheetControl1.Visible = False
SpreadsheetControl1.Dock = DockStyle.None
mainToolStrip.Visible = False
Select Case oExtension.ToUpper Select Case oExtension.ToUpper
Case ".MSG" Case ".MSG"
Dim oMsg As New Msg.Message(FilePath) Dim oMsg As New Message(FilePath)
' TODO: Improve Encoding, maybe convert based on encoding ' TODO: Improve Encoding, maybe convert based on encoding
oMsg.Encoding = System.Text.Encoding.UTF32 oMsg.Encoding = System.Text.Encoding.UTF32
Dim oMime = oMsg.ConvertToMimeMessage() Dim oMime = oMsg.ConvertToMimeMessage()
Dim oTempFileName = System.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, DevExpress.XtraRichEdit.DocumentFormat.Mht)
@ -132,21 +138,48 @@ Public Class DocumentViewer
RichEditControl1.Visible = True RichEditControl1.Visible = True
RichEditControl1.Dock = DockStyle.Fill RichEditControl1.Dock = DockStyle.Fill
Me.infoLabel.Text = "Type: " & "MSG Email File"
Case ".EML" Case ".EML"
RichEditControl1.LoadDocument(FilePath, DevExpress.XtraRichEdit.DocumentFormat.Mht) RichEditControl1.LoadDocument(FilePath, DevExpress.XtraRichEdit.DocumentFormat.Mht)
RichEditControl1.Visible = True RichEditControl1.Visible = True
RichEditControl1.Dock = DockStyle.Fill RichEditControl1.Dock = DockStyle.Fill
Case Else
_docPath = FilePath
_logger.Info("(DocView)Displaying file {0}", _docPath) Me.infoLabel.Text = "Type: " & "EML Email File"
Case ".XLSX", ".XLS", "CSV"
Dim oFormat As DevExpress.Spreadsheet.DocumentFormat = Undefined
GdViewer.DisplayFromFile(_docPath) Select Case oExtension.ToUpper
Case "XLSX" : oFormat = Xlsx
RichEditControl1.Visible = False Case "XLS" : oFormat = Xls
RichEditControl1.Dock = DockStyle.None Case "CSV" : oFormat = Csv
End Select End Select
SpreadsheetControl1.LoadDocument(FilePath, oFormat)
Dim oRange = SpreadsheetControl1.ActiveWorksheet.GetUsedRange()
oRange.AutoFitColumns()
SpreadsheetControl1.Visible = True
SpreadsheetControl1.Dock = DockStyle.Fill
Me.infoLabel.Text = "Type: " & "Excel/CSV File"
Case Else
_logger.Info("Displaying file {0}", FilePath)
mainToolStrip.Visible = True
GdViewer.DisplayFromFile(FilePath)
Me.infoLabel.Text = "Type: " & GetDocumentTypeLabel()
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
@ -183,14 +216,21 @@ Public Class DocumentViewer
Return result Return result
End Function End Function
Public Sub RightOnlyView(ValueRight As Boolean) ''' <summary>
If ValueRight Then ''' Configures the viewer to hide the file path to the end-user.
''' </summary>
''' <param name="ViewOnly">
''' True means that all file info should be hidden from the end-user
''' False means the end user may see the filepath or other info about the file
''' </param>
Public Sub RightOnlyView(ViewOnly As Boolean)
If ViewOnly Then
btnPrint.Visible = False btnPrint.Visible = False
Else Else
btnPrint.Visible = True btnPrint.Visible = True
End If End If
_view_only = ValueRight _hide_file_info_from_user = Not ViewOnly
End Sub End Sub
Private Sub UpdateMainUi() Private Sub UpdateMainUi()
Exit Sub Exit Sub
@ -459,24 +499,6 @@ Public Class DocumentViewer
btnLastPage.Enabled = True btnLastPage.Enabled = True
End If End If
cbZoom.Text = String.Format(CultureInfo.InvariantCulture, "{0:#0.##%}", GdViewer.Zoom) cbZoom.Text = String.Format(CultureInfo.InvariantCulture, "{0:#0.##%}", GdViewer.Zoom)
Dim widthInches, heightInches As Double
If GdViewer.GetDocumentType = DocumentType.DocumentTypePDF Then
widthInches = GdViewer.PdfGetPageWidth / 72
heightInches = GdViewer.PdfGetPageHeight / 72
Else
widthInches = GdViewer.PageWidth / GdViewer.HorizontalResolution
heightInches = GdViewer.PageHeight / GdViewer.VerticalResolution
End If
Me.infoLabel.Text = "Type: " + GetDocumentTypeLabel() + " - " +
"Pagesize (zoll): " + Trim(Str(Math.Round(widthInches, 2))) + " × " + Trim(Str(Math.Round(heightInches, 2))) + " - " +
"Pagesize (pixel): " + Trim(Str(GdViewer.PageWidth)) + " × " + Trim(Str(GdViewer.PageHeight)) + " - " +
"Horizontal resolution: " + Trim(Str(Math.Round(GdViewer.HorizontalResolution, 2))) + " DPI - " +
"Vertical resolution: " + Trim(Str(Math.Round(GdViewer.VerticalResolution, 2))) + " DPI"
End Sub End Sub
Private Sub btnFitWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFitWidth.Click Private Sub btnFitWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFitWidth.Click

View File

@ -48,23 +48,33 @@
<OptionInfer>On</OptionInfer> <OptionInfer>On</OptionInfer>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Charts.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.DataAccess.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.DataAccess.v19.2.UI, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Images.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.Images.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Office.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.Office.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.Printing.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.RichEdit.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.RichEdit.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Spreadsheet.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Utils.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.Utils.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Utils.v19.2.UI, 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.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraCharts.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" /> <Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> <Reference Include="DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraNavBar.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="DevExpress.XtraPrinting.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraSpreadsheet.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraTreeList.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="GdPicture.NET.14"> <Reference Include="GdPicture.NET.14">
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath> <HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
</Reference> </Reference>
<Reference Include="Independentsoft.Msg"> <Reference Include="Independentsoft.Msg, Version=2.0.570.21482, Culture=neutral, PublicKeyToken=76be97fe952f1ec7, processorArchitecture=MSIL">
<HintPath>P:\Projekte DIGITAL DATA\DIGITAL DATA - Entwicklung\DLL_Bibliotheken\Independentsoft.Msg.dll</HintPath> <HintPath>P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\22_11_19\Independentsoft.Msg.dll</HintPath>
</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">

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.0.1")>
<Assembly: AssemblyFileVersion("1.0.0.2")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -1 +1,2 @@
DevExpress.XtraSpreadsheet.SpreadsheetControl, DevExpress.XtraSpreadsheet.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraRichEdit.RichEditControl, DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraRichEdit.RichEditControl, DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@ -48,34 +48,27 @@
</Reference> </Reference>
<Reference Include="DevExpress.Office.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.Office.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.Printing.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.Printing.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.RichEdit.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.RichEdit.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.RichEdit.v19.2.Export, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.RichEdit.v19.2.Export, 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" /> <Reference Include="DevExpress.Utils.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" /> <Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.XtraGrid.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.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="DevExpress.XtraPrinting.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, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />

View File

@ -80,6 +80,7 @@ Public Class LookupControl2
Properties.Buttons.Item(0).Tag = TAG_DROPDOWN Properties.Buttons.Item(0).Tag = TAG_DROPDOWN
Properties.Buttons.AddRange({_LookupFormButton}) Properties.Buttons.AddRange({_LookupFormButton})
Properties.NullText = TEXT_NO_RECORDS
AddHandler ButtonClick, AddressOf HandleButtonClick AddHandler ButtonClick, AddressOf HandleButtonClick
AddHandler EditValueChanging, AddressOf HandleEditValueChanging AddHandler EditValueChanging, AddressOf HandleEditValueChanging

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.2.0")> <Assembly: AssemblyVersion("1.0.2.1")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -1 +1,3 @@
DevExpress.XtraEditors.GridLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@ -104,6 +104,10 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GUIs.Test.DocumentViewerTes
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEmailService", "DDEmailService\DDEmailService.vbproj", "{83ED2617-B398-4859-8F59-B38F8807E83E}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEmailService", "DDEmailService\DDEmailService.vbproj", "{83ED2617-B398-4859-8F59-B38F8807E83E}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebServices", "WebServices", "{D3BAE68E-406E-493D-A4E5-DB6EDDFFB371}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZUGFeRDRESTService", "WEBSERVICES\ZUGFeRDRESTService\ZUGFeRDRESTService.csproj", "{FD50590A-59C1-4798-AD90-419A588DCE76}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -270,6 +274,10 @@ Global
{83ED2617-B398-4859-8F59-B38F8807E83E}.Debug|Any CPU.Build.0 = Debug|Any CPU {83ED2617-B398-4859-8F59-B38F8807E83E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83ED2617-B398-4859-8F59-B38F8807E83E}.Release|Any CPU.ActiveCfg = Release|Any CPU {83ED2617-B398-4859-8F59-B38F8807E83E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83ED2617-B398-4859-8F59-B38F8807E83E}.Release|Any CPU.Build.0 = Release|Any CPU {83ED2617-B398-4859-8F59-B38F8807E83E}.Release|Any CPU.Build.0 = Release|Any CPU
{FD50590A-59C1-4798-AD90-419A588DCE76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD50590A-59C1-4798-AD90-419A588DCE76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD50590A-59C1-4798-AD90-419A588DCE76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD50590A-59C1-4798-AD90-419A588DCE76}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -315,6 +323,7 @@ Global
{609B09B4-AD1E-40F7-8899-A6685924621C} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A} {609B09B4-AD1E-40F7-8899-A6685924621C} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{F9CCEFCD-21B3-4319-9DB1-A0756DA5BA1C} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A} {F9CCEFCD-21B3-4319-9DB1-A0756DA5BA1C} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{83ED2617-B398-4859-8F59-B38F8807E83E} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {83ED2617-B398-4859-8F59-B38F8807E83E} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
{FD50590A-59C1-4798-AD90-419A588DCE76} = {D3BAE68E-406E-493D-A4E5-DB6EDDFFB371}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286}

View File

@ -32,11 +32,14 @@
<value>10</value> <value>10</value>
</setting> </setting>
<setting name="MSSQL_CONNECTIONSTRING" serializeAs="String"> <setting name="MSSQL_CONNECTIONSTRING" serializeAs="String">
<value /> <value/>
</setting> </setting>
<setting name="MSSQL_ENABLED" serializeAs="String"> <setting name="MSSQL_ENABLED" serializeAs="String">
<value>False</value> <value>False</value>
</setting> </setting>
<setting name="GDPICTURE_KEY" serializeAs="String">
<value>1234567890_EXAMPLE_KEY</value>
</setting>
</DDZUGFeRDService.My.MySettings> </DDZUGFeRDService.My.MySettings>
</applicationSettings> </applicationSettings>
<system.data> <system.data>

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

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase Inherits Global.System.Configuration.ApplicationSettingsBase
@ -134,6 +134,15 @@ Namespace My
Return CType(Me("MSSQL_ENABLED"),Boolean) Return CType(Me("MSSQL_ENABLED"),Boolean)
End Get End Get
End Property End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("1234567890_EXAMPLE_KEY")> _
Public ReadOnly Property GDPICTURE_KEY() As String
Get
Return CType(Me("GDPICTURE_KEY"),String)
End Get
End Property
End Class End Class
End Namespace End Namespace

View File

@ -29,5 +29,8 @@
<Setting Name="MSSQL_ENABLED" Type="System.Boolean" Scope="Application"> <Setting Name="MSSQL_ENABLED" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value> <Value Profile="(Default)">False</Value>
</Setting> </Setting>
<Setting Name="GDPICTURE_KEY" Type="System.String" Scope="Application">
<Value Profile="(Default)">1234567890_EXAMPLE_KEY</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -27,7 +27,7 @@ Public Class ThreadRunner
Private Const TIMER_INTERVAL_MS = 10_000 Private Const TIMER_INTERVAL_MS = 10_000
Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing) Public Sub New(LogConfig As LogConfig, GDPictureKey As String, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
_logConfig = LogConfig _logConfig = LogConfig
_logger = _logConfig.GetLogger() _logger = _logConfig.GetLogger()
_firebird = Firebird _firebird = Firebird
@ -113,25 +113,6 @@ Public Class ThreadRunner
Dim args As WorkerArgs = e.Argument Dim args As WorkerArgs = e.Argument
_logger.Debug("Background worker running..") _logger.Debug("Background worker running..")
' Use MSSQL Server if available
If Not IsNothing(_mssql) Then
'Checking if documents have bee´n rejected
Dim oSQL As String = "Select * from TBEDMI_DOC_REJECTED WHERE MD5_UPDATE = 0"
'Dim oDT As DataTable = _mssql.GetDatatable(oSQL)
'If Not IsNothing(oDT) Then
' For Each oRow As DataRow In oDT.Rows
' oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET REJECTED = TRUE WHERE MESSAGE_ID = '{oRow.Item("MESSAGE_ID")}'"
' If _firebird.ExecuteNonQuery(oSQL) = True Then
' oSQL = $"UPDATE TBEDMI_DOC_REJECTED SET MD5_UPDATE = 1 WHERE GUID = '{oRow.Item("GUID")}'"
' If _mssql.ExecuteNonQuery(oSQL) = True Then
' _logger.Debug($"Refreshed the Rejected Info for messageid [{oRow.Item("MESSAGE_ID")}]")
' End If
' End If
' Next
'Else
' _logger.Warn("oDTTBEDMI_DOC_REJECTED is nothing...")
'End If
End If
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, _mssql) Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
job.Start(args) job.Start(args)
Catch ex As Exception Catch ex As Exception

View File

@ -24,6 +24,7 @@ Public Class ZUGFeRDService
Dim oJobInterval As Integer = My.Settings.JOB_INTERVAL Dim oJobInterval As Integer = My.Settings.JOB_INTERVAL
Dim oMSSQLConnectionString As String = My.Settings.MSSQL_CONNECTIONSTRING Dim oMSSQLConnectionString As String = My.Settings.MSSQL_CONNECTIONSTRING
Dim oMSSQLEnabled As Boolean = My.Settings.MSSQL_ENABLED Dim oMSSQLEnabled As Boolean = My.Settings.MSSQL_ENABLED
Dim oGDPictureKey As String = My.Settings.GDPICTURE_KEY
_firebird = New Firebird(_logConfig, oDataSource, oDatabase, oUser, oPassword) _firebird = New Firebird(_logConfig, oDataSource, oDatabase, oUser, oPassword)
@ -37,7 +38,7 @@ Public Class ZUGFeRDService
End If End If
Try Try
_threadRunner = New ThreadRunner(_logConfig, _firebird, _mssql) _threadRunner = New ThreadRunner(_logConfig, oGDPictureKey, _firebird, _mssql)
_threadRunner.Start(oJobInterval) _threadRunner.Start(oJobInterval)
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)

View File

@ -50,9 +50,6 @@
<Reference Include="GdPicture.NET.14"> <Reference Include="GdPicture.NET.14">
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath> <HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
</Reference> </Reference>
<Reference Include="Independentsoft.Msg.2.0.570.21482">
<HintPath>P:\Visual Studio Projekte\Bibliotheken\MSG .NET\Bin\Independentsoft.Msg.2.0.570.21482.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.6.8\lib\net45\NLog.dll</HintPath>

View File

@ -32,6 +32,9 @@
<setting name="MD5Cheksum" serializeAs="String"> <setting name="MD5Cheksum" serializeAs="String">
<value /> <value />
</setting> </setting>
<setting name="MSSQL_CONNECTIONSTRING" serializeAs="String">
<value>Server=SDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM_TEST;User Id=sa;Password=dd</value>
</setting>
</ZUGFeRDTest.My.MySettings> </ZUGFeRDTest.My.MySettings>
</userSettings> </userSettings>
<runtime> <runtime>

View File

@ -32,6 +32,7 @@ Partial Class Form1
Me.Button5 = New System.Windows.Forms.Button() Me.Button5 = New System.Windows.Forms.Button()
Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.Button7 = New System.Windows.Forms.Button()
Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.GroupBox3 = New System.Windows.Forms.GroupBox()
Me.txtPropName = New System.Windows.Forms.TextBox() Me.txtPropName = New System.Windows.Forms.TextBox()
Me.GroupBox4 = New System.Windows.Forms.GroupBox() Me.GroupBox4 = New System.Windows.Forms.GroupBox()
@ -60,7 +61,7 @@ Partial Class Form1
Me.ListBox1.FormattingEnabled = True Me.ListBox1.FormattingEnabled = True
Me.ListBox1.Location = New System.Drawing.Point(378, 12) Me.ListBox1.Location = New System.Drawing.Point(378, 12)
Me.ListBox1.Name = "ListBox1" Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(526, 407) Me.ListBox1.Size = New System.Drawing.Size(526, 472)
Me.ListBox1.TabIndex = 1 Me.ListBox1.TabIndex = 1
' '
'Button2 'Button2
@ -122,19 +123,29 @@ Partial Class Form1
'GroupBox2 'GroupBox2
' '
Me.GroupBox2.Controls.Add(Me.Button2) Me.GroupBox2.Controls.Add(Me.Button2)
Me.GroupBox2.Controls.Add(Me.Button7)
Me.GroupBox2.Controls.Add(Me.Button3) Me.GroupBox2.Controls.Add(Me.Button3)
Me.GroupBox2.Location = New System.Drawing.Point(12, 110) Me.GroupBox2.Location = New System.Drawing.Point(12, 110)
Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(360, 90) Me.GroupBox2.Size = New System.Drawing.Size(360, 155)
Me.GroupBox2.TabIndex = 8 Me.GroupBox2.TabIndex = 8
Me.GroupBox2.TabStop = False Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Run Functions on a single file (needs Breakpoint)" Me.GroupBox2.Text = "Run Functions on a single file (needs Breakpoint)"
' '
'Button7
'
Me.Button7.Location = New System.Drawing.Point(6, 77)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(221, 23)
Me.Button7.TabIndex = 3
Me.Button7.Text = "Extract PDF Attachments"
Me.Button7.UseVisualStyleBackColor = True
'
'GroupBox3 'GroupBox3
' '
Me.GroupBox3.Controls.Add(Me.Button4) Me.GroupBox3.Controls.Add(Me.Button4)
Me.GroupBox3.Controls.Add(Me.txtMD5Checksum) Me.GroupBox3.Controls.Add(Me.txtMD5Checksum)
Me.GroupBox3.Location = New System.Drawing.Point(12, 206) Me.GroupBox3.Location = New System.Drawing.Point(12, 271)
Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(360, 85) Me.GroupBox3.Size = New System.Drawing.Size(360, 85)
Me.GroupBox3.TabIndex = 9 Me.GroupBox3.TabIndex = 9
@ -152,7 +163,7 @@ Partial Class Form1
' '
Me.GroupBox4.Controls.Add(Me.Button6) Me.GroupBox4.Controls.Add(Me.Button6)
Me.GroupBox4.Controls.Add(Me.txtPropName) Me.GroupBox4.Controls.Add(Me.txtPropName)
Me.GroupBox4.Location = New System.Drawing.Point(12, 297) Me.GroupBox4.Location = New System.Drawing.Point(12, 362)
Me.GroupBox4.Name = "GroupBox4" Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Size = New System.Drawing.Size(360, 122) Me.GroupBox4.Size = New System.Drawing.Size(360, 122)
Me.GroupBox4.TabIndex = 11 Me.GroupBox4.TabIndex = 11
@ -172,7 +183,7 @@ Partial Class Form1
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(916, 435) Me.ClientSize = New System.Drawing.Size(916, 492)
Me.Controls.Add(Me.GroupBox4) Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox2)
@ -204,4 +215,5 @@ Partial Class Form1
Friend WithEvents txtPropName As TextBox Friend WithEvents txtPropName As TextBox
Friend WithEvents GroupBox4 As GroupBox Friend WithEvents GroupBox4 As GroupBox
Friend WithEvents Button6 As Button Friend WithEvents Button6 As Button
Friend WithEvents Button7 As Button
End Class End Class

View File

@ -13,6 +13,7 @@ Imports DigitalData.Modules.Logging
Public Class Form1 Public Class Form1
Private _logConfig As LogConfig Private _logConfig As LogConfig
Private _firebird As Firebird Private _firebird As Firebird
Private _mssql As MSSQLServer
Private _zugferd As ZUGFeRDInterface Private _zugferd As ZUGFeRDInterface
Private PropertyMap As New Dictionary(Of String, XmlItemProperty) Private PropertyMap As New Dictionary(Of String, XmlItemProperty)
@ -22,6 +23,7 @@ Public Class Form1
_logConfig = New LogConfig(LogConfig.PathType.CurrentDirectory) _logConfig = New LogConfig(LogConfig.PathType.CurrentDirectory)
_logConfig.Debug = True _logConfig.Debug = True
_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)
_zugferd = New ZUGFeRDInterface(_logConfig) _zugferd = New ZUGFeRDInterface(_logConfig)
End Sub End Sub
@ -86,7 +88,7 @@ Public Class Form1
args = LoadFolderConfig(args) args = LoadFolderConfig(args)
args = LoadPropertyMapFor(args, "DEFAULT") args = LoadPropertyMapFor(args, "DEFAULT")
Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird) Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
job.Start(args) job.Start(args)
End Sub End Sub
@ -138,7 +140,7 @@ Public Class Form1
End Function End Function
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Process.Start("\\dd-sto01\DD-STO01-A2\SharedObjects\Public\Projekte\Test\Import\ZUGFerD\Email_in") Process.Start("\\dd-sto01\DD-DFSR01\SharedObjects\Public\Projekte\Test\Import\ZUGFerD\Email_in")
End Sub End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
@ -160,4 +162,13 @@ Public Class Form1
End Try End Try
End If End If
End Sub End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Dim oExtractor = New Jobs.PDFAttachments(_logConfig)
Dim oResult = OpenFileDialog1.ShowDialog()
If oResult = DialogResult.OK Then
oExtractor.Extract(OpenFileDialog1.FileName, AllowedExtensions:=New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"})
End If
End Sub
End Class End Class

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase Inherits Global.System.Configuration.ApplicationSettingsBase
@ -107,6 +107,18 @@ Namespace My
Me("MD5Cheksum") = value Me("MD5Cheksum") = value
End Set End Set
End Property End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("Server=SDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM_TEST;User Id=sa;Password=dd")> _
Public Property MSSQL_CONNECTIONSTRING() As String
Get
Return CType(Me("MSSQL_CONNECTIONSTRING"),String)
End Get
Set
Me("MSSQL_CONNECTIONSTRING") = value
End Set
End Property
End Class End Class
End Namespace End Namespace

View File

@ -17,5 +17,8 @@
<Setting Name="MD5Cheksum" Type="System.String" Scope="User"> <Setting Name="MD5Cheksum" Type="System.String" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="MSSQL_CONNECTIONSTRING" Type="System.String" Scope="User">
<Value Profile="(Default)">Server=SDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM_TEST;User Id=sa;Password=dd</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -161,11 +161,13 @@ Public Class File
Return True Return True
End Function End Function
<DebuggerStepThrough>
Public Sub MoveTo(FilePath As String, Directory As String) Public Sub MoveTo(FilePath As String, Directory As String)
Dim oFileInfo As New FileInfo(FilePath) Dim oFileInfo As New FileInfo(FilePath)
IO.File.Move(FilePath, Path.Combine(Directory, oFileInfo.Name)) IO.File.Move(FilePath, Path.Combine(Directory, oFileInfo.Name))
End Sub End Sub
<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) Dim oFileInfo As New FileInfo(FilePath)
IO.File.Move(FilePath, Path.Combine(Directory, NewFileName)) IO.File.Move(FilePath, Path.Combine(Directory, NewFileName))

View File

@ -13,6 +13,7 @@ Imports DigitalData.Modules.Interfaces.Exceptions
Imports DigitalData.Modules.Jobs.Exceptions Imports DigitalData.Modules.Jobs.Exceptions
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports FirebirdSql.Data.FirebirdClient Imports FirebirdSql.Data.FirebirdClient
Imports GdPicture14
Public Class ImportZUGFeRDFiles Public Class ImportZUGFeRDFiles
Implements IJob Implements IJob
@ -42,6 +43,9 @@ Public Class ImportZUGFeRDFiles
</ul></p> </ul></p>
""" """
' List of allowed extensions for PDF/A Attachments
Private AllowedExtensions = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
Private _logger As Logger Private _logger As Logger
Private _logConfig As LogConfig Private _logConfig As LogConfig
Private _zugferd As ZUGFeRDInterface Private _zugferd As ZUGFeRDInterface
@ -326,9 +330,27 @@ Public Class ImportZUGFeRDFiles
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)
Dim oAttachmentExtractor = New PDFAttachments(_logConfig)
_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)
@ -368,14 +390,15 @@ Public Class ImportZUGFeRDFiles
Dim oMoveDirectory As String = oArgs.SuccessDirectory Dim oMoveDirectory As String = oArgs.SuccessDirectory
' Create file lists ' Create file lists
Dim oFileGroupFiles As List(Of FileInfo) = oFileGroup.Value Dim oFileGroupFiles As List(Of FileInfo) = oFileGroup.Value
Dim oFileAttachmentFiles As New List(Of FileInfo) Dim oEmailAttachmentFiles As New List(Of FileInfo)
Dim oEmbeddedAttachmentFiles As New List(Of PDFAttachments.AttachmentResult)
Dim oFileGroupId As String = oFileGroup.Key Dim oMessageId As String = oFileGroup.Key
Dim oMissingProperties As New List(Of String) Dim oMissingProperties As New List(Of String)
Dim oMD5CheckSum As String = String.Empty Dim oMD5CheckSum As String = String.Empty
_logger.NewBlock($"Message Id {oFileGroupId}") _logger.NewBlock($"Message Id {oMessageId}")
_logger.Info("Start processing file group {0}", oFileGroupId) _logger.Info("Start processing file group {0}", oMessageId)
Try Try
For Each oFile In oFileGroupFiles For Each oFile In oFileGroupFiles
@ -389,7 +412,7 @@ Public Class ImportZUGFeRDFiles
' Only pdf files are allowed from here on ' Only pdf files are allowed from here on
If Not oFile.Name.EndsWith(".pdf") Then If Not oFile.Name.EndsWith(".pdf") Then
_logger.Debug("Skipping non-pdf file {0}", oFile.Name) _logger.Debug("Skipping non-pdf file {0}", oFile.Name)
oFileAttachmentFiles.Add(oFile) oEmailAttachmentFiles.Add(oFile)
Continue For Continue For
End If End If
@ -401,7 +424,7 @@ Public Class ImportZUGFeRDFiles
Select Case ex.ErrorType Select Case ex.ErrorType
Case ZUGFeRDInterface.ErrorType.NoZugferd Case ZUGFeRDInterface.ErrorType.NoZugferd
_logger.Warn("File is not a valid ZUGFeRD document! Skipping.") _logger.Warn("File is not a valid ZUGFeRD document! Skipping.")
oFileAttachmentFiles.Add(oFile) oEmailAttachmentFiles.Add(oFile)
Continue For Continue For
Case ZUGFeRDInterface.ErrorType.NoValidZugferd Case ZUGFeRDInterface.ErrorType.NoValidZugferd
@ -412,10 +435,16 @@ Public Class ImportZUGFeRDFiles
_logger.Warn("Unexpected Error occurred while extracting ZUGFeRD Information from file {0}", oFile.FullName) _logger.Warn("Unexpected Error occurred while extracting ZUGFeRD Information from file {0}", oFile.FullName)
Throw ex Throw ex
End Select End Select
End Try End Try
' Extract all attachments other than the zugferd-invoice.xml
Dim oAttachments = oAttachmentExtractor.Extract(oFile.FullName, AllowedExtensions)
If oAttachments Is Nothing Then
_logger.Warn("Attachments for file [{0}] could not be extracted", oFile.FullName)
Else
oEmbeddedAttachmentFiles.AddRange(oAttachments)
End If
oMD5CheckSum = CreateMD5(oFile.FullName) oMD5CheckSum = CreateMD5(oFile.FullName)
If oMD5CheckSum <> String.Empty Then If oMD5CheckSum <> String.Empty Then
Dim oCheckCommand = $"SELECT * FROM TBEDM_ZUGFERD_HISTORY_IN WHERE GUID = (SELECT MAX(GUID) FROM TBEDM_ZUGFERD_HISTORY_IN WHERE UPPER(MD5HASH) = UPPER('{oMD5CheckSum}'))" Dim oCheckCommand = $"SELECT * FROM TBEDM_ZUGFERD_HISTORY_IN WHERE GUID = (SELECT MAX(GUID) FROM TBEDM_ZUGFERD_HISTORY_IN WHERE UPPER(MD5HASH) = UPPER('{oMD5CheckSum}'))"
@ -453,9 +482,7 @@ Public Class ImportZUGFeRDFiles
' 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 As KeyValuePair(Of String, XmlItemProperty)) Where(Function(Item) Item.Value.IsGrouped = True).
Return Item.Value.IsGrouped = False
End Function).
ToDictionary(Function(Item) Item.Key, ToDictionary(Function(Item) Item.Key,
Function(Item) Item.Value) Function(Item) Item.Value)
@ -532,7 +559,7 @@ Public Class ImportZUGFeRDFiles
_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 ('{oFileGroupId}', '{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
@ -601,7 +628,7 @@ Public Class ImportZUGFeRDFiles
End If End If
Dim oTableName = Item.Value.TableName Dim oTableName = Item.Value.TableName
Dim oCommand = $"INSERT INTO {oTableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE) VALUES ('{oFileGroupId}', '{oPropertyDescription}', '{oPropertyValue}')" 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) _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
@ -629,12 +656,12 @@ Public Class ImportZUGFeRDFiles
'If no errors occurred... 'If no errors occurred...
'Log the History 'Log the History
If oMD5CheckSum <> String.Empty Then If oMD5CheckSum <> String.Empty Then
Dim oInsertCommand = $"INSERT INTO TBEDM_ZUGFERD_HISTORY_IN (MESSAGE_ID, MD5HASH) VALUES ('{oFileGroupId}', '{oMD5CheckSum}')" Dim oInsertCommand = $"INSERT INTO TBEDM_ZUGFERD_HISTORY_IN (MESSAGE_ID, MD5HASH) VALUES ('{oMessageId}', '{oMD5CheckSum}')"
_firebird.ExecuteNonQueryWithConnection(oInsertCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction) _firebird.ExecuteNonQueryWithConnection(oInsertCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
'commit the transaction 'commit the transaction
oTransaction.Commit() oTransaction.Commit()
Try Try
Dim oSQL = $"SELECT MAX(GUID) FROM TBEDM_ZUGFERD_HISTORY_IN WHERE MESSAGE_ID = '{oFileGroupId}'" Dim oSQL = $"SELECT MAX(GUID) FROM TBEDM_ZUGFERD_HISTORY_IN WHERE MESSAGE_ID = '{oMessageId}'"
HISTORY_ID = _firebird.GetScalarValue(oSQL) HISTORY_ID = _firebird.GetScalarValue(oSQL)
Catch ex As Exception Catch ex As Exception
HISTORY_ID = 0 HISTORY_ID = 0
@ -648,9 +675,9 @@ Public Class ImportZUGFeRDFiles
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = EMAIL_MD5_ERROR Dim oBody = EMAIL_MD5_ERROR
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oFileGroupId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oFileGroupId, oBody, oEmailData, "MD5HashException") AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MD5HashException")
AddRejectedState(oFileGroupId, "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)
@ -658,9 +685,9 @@ Public Class ImportZUGFeRDFiles
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 = EMAIL_INVALID_DOCUMENT
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oFileGroupId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oFileGroupId, oBody, oEmailData, "InvalidFerdException") AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "InvalidFerdException")
AddRejectedState(oFileGroupId, "InvalidFerdException", "Inkorrekte Formate", "") AddRejectedState(oMessageId, "InvalidFerdException", "Inkorrekte Formate", "")
Catch ex As TooMuchFerdsException Catch ex As TooMuchFerdsException
_logger.Error(ex) _logger.Error(ex)
@ -668,9 +695,9 @@ Public Class ImportZUGFeRDFiles
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 = EMAIL_TOO_MUCH_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oFileGroupId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oFileGroupId, oBody, oEmailData, "TooMuchFerdsException") AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "TooMuchFerdsException")
AddRejectedState(oFileGroupId, "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)
@ -678,9 +705,9 @@ Public Class ImportZUGFeRDFiles
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 = EMAIL_NO_FERDS
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oFileGroupId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oFileGroupId, oBody, oEmailData, "NoFerdsException") AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "NoFerdsException")
AddRejectedState(oFileGroupId, "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)
@ -693,9 +720,9 @@ Public Class ImportZUGFeRDFiles
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
Dim oBody = CreateBodyForMissingProperties(ex.File.Name, oMissingProperties) Dim oBody = CreateBodyForMissingProperties(ex.File.Name, oMissingProperties)
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oFileGroupId) Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
AddToEmailQueueMSSQL(oFileGroupId, oBody, oEmailData, "MissingValueException") AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "MissingValueException")
AddRejectedState(oFileGroupId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage) AddRejectedState(oMessageId, "MissingValueException", "Es fehlten ZugferdSpezifikationen", oMessage)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Unknown Error occurred: {0}", ex.Message) _logger.Warn("Unknown Error occurred: {0}", ex.Message)
@ -703,14 +730,14 @@ Public Class ImportZUGFeRDFiles
Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Unknown error occured' WHERE GUID = '{HISTORY_ID}'" Dim oSQL = $"UPDATE TBEDM_ZUGFERD_HISTORY_IN SET COMMENT = 'REJECTED - Unknown error occured' WHERE GUID = '{HISTORY_ID}'"
_firebird.ExecuteNonQuery(oSQL) _firebird.ExecuteNonQuery(oSQL)
oMoveDirectory = oArgs.ErrorDirectory oMoveDirectory = oArgs.ErrorDirectory
AddRejectedState(oFileGroupId, "UnexpectedException", "", ex.Message) AddRejectedState(oMessageId, "UnexpectedException", "", ex.Message)
Finally Finally
oConnection.Close() oConnection.Close()
' Move all files of the current group ' Move all files of the current group
Try Try
MoveFiles(oArgs, oFileGroupFiles, oFileAttachmentFiles, oMoveDirectory) MoveFiles(oArgs, oMessageId, oFileGroupFiles, oEmailAttachmentFiles, oEmbeddedAttachmentFiles, oMoveDirectory)
_logger.Info("Finished processing file group {0}", oFileGroupId) _logger.Info("Finished processing file group {0}", oMessageId)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Could not move files!") _logger.Warn("Could not move files!")
_logger.Error(ex) _logger.Error(ex)
@ -730,19 +757,30 @@ Public Class ImportZUGFeRDFiles
End Try End Try
End Sub End Sub
Private Sub MoveFiles(Args As WorkerArgs, Files As List(Of FileInfo), AttachmentFiles As List(Of FileInfo), MoveDirectory As String) Private Sub MoveFiles(Args As WorkerArgs, MessageId As String, Files As List(Of FileInfo), AttachmentFiles As List(Of FileInfo), EmbeddedAttachments As List(Of PDFAttachments.AttachmentResult), MoveDirectory As String)
Dim oFinalMoveDirectory As String = MoveDirectory
Dim oAttachmentDirectory As String = Path.Combine(MoveDirectory, Args.AttachmentsSubDirectory)
' Create directories if they don't exist
If Not Directory.Exists(oFinalMoveDirectory) Then
Try
Directory.CreateDirectory(oFinalMoveDirectory)
Catch ex As Exception
_logger.Error(ex)
End Try
End If
If Not Directory.Exists(oAttachmentDirectory) And AttachmentFiles.Count > 0 Then
Try
Directory.CreateDirectory(oAttachmentDirectory)
Catch ex As Exception
_logger.Error(ex)
End Try
End If
' Move PDF/A Files
For Each oFile In Files For Each oFile In Files
Try Try
Dim oFinalMoveDirectory As String = MoveDirectory
If AttachmentFiles.Contains(oFile) Then
oFinalMoveDirectory = Path.Combine(MoveDirectory, Args.AttachmentsSubDirectory)
If Not Directory.Exists(oFinalMoveDirectory) Then
Directory.CreateDirectory(oFinalMoveDirectory)
End If
End If
Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oFinalMoveDirectory, oFile.Name)) Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oFinalMoveDirectory, oFile.Name))
_filesystem.MoveTo(oFile.FullName, oFileName, oFinalMoveDirectory) _filesystem.MoveTo(oFile.FullName, oFileName, oFinalMoveDirectory)
@ -754,6 +792,36 @@ Public Class ImportZUGFeRDFiles
_logger.Error(ex) _logger.Error(ex)
End Try End Try
Next Next
' Move non-PDF/A Email Attachments/Files
For Each oFile In AttachmentFiles
Try
Dim oFileName = _filesystem.GetVersionedFilename(Path.Combine(oAttachmentDirectory, oFile.Name))
_filesystem.MoveTo(oFile.FullName, oFileName, oAttachmentDirectory)
_logger.Info("Finished processing file {0}", oFile.Name)
_logger.Info("Attachment moved to {0}", oFileName)
Catch ex As Exception
_logger.Warn("Could not move attachment {0}", oFile.FullName)
_logger.Error(ex)
End Try
Next
' Write Embedded Files to disk
For Each oResult In EmbeddedAttachments
Try
Dim oFileName As String = $"{MessageId}~{oResult.FileName}"
Dim oFilePath As String = Path.Combine(oAttachmentDirectory, oFileName)
Using oWriter As New FileStream(oFilePath, FileMode.Create)
oWriter.Write(oResult.FileContents, 0, oResult.FileContents.Length)
End Using
Catch ex As Exception
_logger.Warn("Could not save embedded attachment {0}", oResult.FileName)
_logger.Error(ex)
End Try
Next
End Sub End Sub

View File

@ -1,9 +1,100 @@
Public Class PDFAttachments Imports System.Collections.Generic
Public Sub New(GdPictureKey As String) 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 End Sub
Public Shared Function Extract(FileName As String) Public Function Extract(FileName As String, AllowedExtensions As List(Of String)) As List(Of AttachmentResult)
Using oGDPicturePDF As New GDPicturePDF 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 Function
End Class End Class

View File

@ -109,6 +109,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.6.8\lib\net45\NLog.dll</HintPath>

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

View File

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace ZUGFeRDRESTService.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ZugferdValidationController : ControllerBase
{
public static string RESPONSE_OK = "OK";
public static string RESPONSE_ERROR = "ERROR";
private readonly IZugferdValidationDataService _dataService;
public class ZugferdValidationResponse
{
public string status;
public string message;
public List<string> errors;
public ZugferdValidationResponse()
{
status = RESPONSE_OK;
message = String.Empty;
errors = new List<string>();
}
}
public ZugferdValidationController(IZugferdValidationDataService dataService)
{
_dataService = dataService;
}
/// <summary>
/// POST: api/ZugferdValidation
/// </summary>
/// <param name="files">This parameter's name needs to correspond to the html form's file-input name</param>
[HttpPost]
public async Task<ZugferdValidationResponse> Post(List<IFormFile> files)
{
var oFilePaths = new List<String>();
var oFileNames = new List<String>();
if (files.Count == 0) {
return new ZugferdValidationResponse()
{
status = RESPONSE_ERROR,
message = "No File received!"
};
}
foreach (var formFile in files)
{
var oFilePath = Path.GetTempFileName();
oFilePaths.Add(oFilePath);
oFileNames.Add(formFile.FileName);
using (var oStream = new FileStream(oFilePath, FileMode.Create))
{
await formFile.CopyToAsync(oStream);
}
}
var oResponse = new ZugferdValidationResponse
{
message = "You uploaded the following file: " + oFileNames.First()
};
return oResponse;
}
}
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace ZUGFeRDRESTService
{
public interface IZugferdValidationDataService
{
}
}

View File

@ -0,0 +1,16 @@
@page
@{
ViewData["Title"] = "UploadTest";
}
<h1>UploadTest</h1>
<form method="post" action="/api/zugferdvalidation" enctype="multipart/form-data" >
<p>
<span>PDF Datei:</span>
<input type="file" name="files" />
</p>
<button type="submit">Submit</button>
</form>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ZUGFeRDRESTService
{
public class UploadTestModel : PageModel
{
public void OnGet()
{
}
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace ZUGFeRDRESTService
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

View File

@ -0,0 +1,30 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52235",
"sslPort": 44388
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/zugferdvalidation",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"ZUGFeRDRESTService": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/zugferdvalidation",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace ZUGFeRDRESTService
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers().AddNewtonsoftJson();
services.AddRazorPages();
services.AddTransient<IZugferdValidationDataService, ZugferdValidationDataService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapRazorPages();
});
}
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace ZUGFeRDRESTService
{
public class ZugferdValidationDataService: IZugferdValidationDataService
{
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View File

@ -0,0 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}