ZUGFeRDTest: Update

This commit is contained in:
Jonathan Jenne 2023-01-12 14:31:10 +01:00
parent 72956dff7f
commit b313f7f15b
8 changed files with 122 additions and 97 deletions

9
.gitignore vendored
View File

@ -259,3 +259,12 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
/GUIs.Test.ZUGFeRDTest/Form1.vb
/GUIs.Test.ZUGFeRDTest/Form1.resx
/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb
/GUIs.Test.ZUGFeRDTest/Form1.vb
/GUIs.Test.ZUGFeRDTest/Form1.resx
/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb
/GUIs.Test.ZUGFeRDTest/Form1.vb
/GUIs.Test.ZUGFeRDTest/Form1.resx
/GUIs.Test.ZUGFeRDTest/Form1.Designer.vb

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -9,7 +9,7 @@
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<applicationSettings>
<ZUGFeRDTest.My.MySettings>

View File

@ -59,8 +59,8 @@ Public Class Form1
Return args
End Function
Private Function LoadPropertyMapFor(Args As WorkerArgs, Specification As String)
Dim oSQL As String = $"SELECT * FROM TBEDM_XML_ITEMS WHERE SPECIFICATION = '{Specification}' AND ACTIVE = True ORDER BY XML_PATH"
Private Function LoadPropertyMapFor(Args As WorkerArgs)
Dim oSQL As String = $"SELECT * FROM TBEDM_XML_ITEMS WHERE ACTIVE = True ORDER BY XML_PATH"
Dim oResult As DataTable = _firebird.GetDatatable(oSQL)
For Each oRow As DataRow In oResult.Rows
@ -71,6 +71,7 @@ Public Class Form1
Dim isRequired = oRow.Item("IS_REQUIRED")
Dim isGrouped = oRow.Item("IS_GROUPED")
Dim groupScope = oRow.Item("GROUP_SCOPE")
Dim specification = oRow.Item("SPECIFICATION")
Args.PropertyMap.Add(xmlPath, New XmlItemProperty() With {
.Description = description,
@ -78,7 +79,8 @@ Public Class Form1
.TableColumn = tableColumn,
.IsRequired = isRequired,
.IsGrouped = isGrouped,
.GroupScope = groupScope
.GroupScope = groupScope,
.Specification = specification
})
Next
@ -92,10 +94,10 @@ Public Class Form1
.NamePortal = "TEST FROM FORM"
}
args = LoadFolderConfig(args)
args = LoadPropertyMapFor(args, "DEFAULT")
args = LoadPropertyMapFor(args)
args.InsertIntoSQLServer = True
Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird, 1, "TEST", _mssql)
Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
job.Start(args)
End Sub
@ -115,17 +117,29 @@ Public Class Form1
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim oResult = OpenFileDialog1.ShowDialog()
Dim oArgs As New WorkerArgs()
oArgs = LoadPropertyMapFor(oArgs, "DEFAULT")
Public Sub WriteLog(pMessage As String, ParamArray pParams As String())
ListBox1.Items.Add(String.Format(pMessage, pParams))
End Sub
If oResult = DialogResult.OK Then
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim oDialogResult = OpenFileDialog1.ShowDialog()
Dim oArgs As New WorkerArgs()
oArgs = LoadPropertyMapFor(oArgs)
If oDialogResult = DialogResult.OK Then
Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName)
Dim oZUGFERD = _zugferd.SerializeZUGFeRDDocument(oDoc)
Dim oResult = _zugferd.SerializeZUGFeRDDocument(oDoc)
Console.WriteLine()
Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oZUGFERD, oArgs.PropertyMap, "test")
Dim oPropertyMap = oArgs.PropertyMap.
Where(Function(kv) kv.Value.Specification = oResult.Specification).
ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value)
Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oResult.SchemaObject, oPropertyMap, "test")
For Each Prop In oResult2.MissingProperties
WriteLog("Missing Property: [{0}]", Prop)
Next
Console.WriteLine()
End If

View File

@ -1,10 +1,10 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
@ -14,10 +14,10 @@ Option Explicit On
Namespace My
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
'HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten
' oder in dieser Datei Buildfehler auftreten, wechseln Sie zum Projekt-Designer.
' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
'
Partial Friend Class MyApplication

View File

@ -1,27 +1,28 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' Ä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
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'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>
''' A strongly-typed resource class, for looking up localized strings, etc.
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
@ -32,7 +33,7 @@ Namespace My.Resources
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
''' 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
@ -46,15 +47,15 @@ Namespace My.Resources
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
''' Ü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(ByVal value As Global.System.Globalization.CultureInfo)
Set
resourceCulture = value
End Set
End Property

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase

View File

@ -11,8 +11,9 @@
<AssemblyName>ZUGFeRDTest</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -47,7 +48,7 @@
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="DigitalData.Modules.Database, Version=2.2.7.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="DigitalData.Modules.Database, Version=2.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference>
@ -67,15 +68,14 @@
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.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.10\lib\net45\NLog.dll</HintPath>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.1.0\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
@ -111,6 +111,7 @@
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>

View File

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