From 07c44d69c4ebd46f749d25fffe37459f24c8f1e6 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 21 Mar 2019 16:19:37 +0100 Subject: [PATCH] ZUGFeRDTest: Add direct validation --- ZUGFeRDTest/App.config | 74 +++++++++++++++++++++++++++++++++-- ZUGFeRDTest/Form1.Designer.vb | 16 +++++++- ZUGFeRDTest/Form1.vb | 11 ++++++ 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/ZUGFeRDTest/App.config b/ZUGFeRDTest/App.config index 203b80fb..700c492e 100644 --- a/ZUGFeRDTest/App.config +++ b/ZUGFeRDTest/App.config @@ -1,10 +1,10 @@ - + - +
- +
@@ -31,4 +31,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ZUGFeRDTest/Form1.Designer.vb b/ZUGFeRDTest/Form1.Designer.vb index 2fa7fdf1..83a12ffd 100644 --- a/ZUGFeRDTest/Form1.Designer.vb +++ b/ZUGFeRDTest/Form1.Designer.vb @@ -25,6 +25,7 @@ Partial Class Form1 Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog() Me.Button1 = New System.Windows.Forms.Button() Me.ListBox1 = New System.Windows.Forms.ListBox() + Me.Button2 = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'OpenFileDialog1 @@ -35,9 +36,9 @@ Partial Class Form1 ' Me.Button1.Location = New System.Drawing.Point(12, 12) Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.Size = New System.Drawing.Size(221, 23) Me.Button1.TabIndex = 0 - Me.Button1.Text = "Button1" + Me.Button1.Text = "Run Job" Me.Button1.UseVisualStyleBackColor = True ' 'ListBox1 @@ -48,11 +49,21 @@ Partial Class Form1 Me.ListBox1.Size = New System.Drawing.Size(526, 407) Me.ListBox1.TabIndex = 1 ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(12, 41) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(221, 23) + Me.Button2.TabIndex = 2 + Me.Button2.Text = "Validate Single File" + Me.Button2.UseVisualStyleBackColor = True + ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(916, 435) + Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.Button1) Me.Name = "Form1" @@ -64,4 +75,5 @@ Partial Class Form1 Friend WithEvents OpenFileDialog1 As OpenFileDialog Friend WithEvents Button1 As Button Friend WithEvents ListBox1 As ListBox + Friend WithEvents Button2 As Button End Class diff --git a/ZUGFeRDTest/Form1.vb b/ZUGFeRDTest/Form1.vb index 99bd4c75..982ac191 100644 --- a/ZUGFeRDTest/Form1.vb +++ b/ZUGFeRDTest/Form1.vb @@ -11,6 +11,7 @@ Imports DigitalData.Modules.Logging Public Class Form1 Private _logConfig As LogConfig Private _firebird As Firebird + Private _zugferd As ZUGFeRDInterface Private PropertyMap As New Dictionary(Of String, XmlItemProperty) @@ -19,6 +20,8 @@ Public Class Form1 _logConfig = New LogConfig(LogConfig.PathType.CurrentDirectory) _logConfig.Debug = True _firebird = New Firebird(_logConfig, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PASS) + + _zugferd = New ZUGFeRDInterface(_logConfig) End Sub Private Function LoadFolderConfig(args As WorkerArgs) @@ -78,4 +81,12 @@ Public Class Form1 job.Start(args) End Sub + + Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click + Dim oResult = OpenFileDialog1.ShowDialog() + + If oResult = DialogResult.OK Then + _zugferd.ValidateZUGFeRDFile(OpenFileDialog1.FileName) + End If + End Sub End Class