Compare commits
4 Commits
5ea99469d2
...
374b1961e2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
374b1961e2 | ||
|
|
36326ba644 | ||
|
|
ac336ce94d | ||
|
|
a4e46d6817 |
@@ -1,2 +1,3 @@
|
||||
DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.GridLookUpEdit, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
@@ -96,8 +96,10 @@ Public Class frmLookupGrid
|
||||
_View.BestFitColumns()
|
||||
|
||||
' Datenspalte zusätzlich in der Breite anpassen
|
||||
Dim oDataColumn As GridColumn = _View.Columns.Item(_DataColumn)
|
||||
oDataColumn.BestFit()
|
||||
If _View.Columns.Count = 0 Then
|
||||
Dim oDataColumn As GridColumn = _View.Columns.Item(_DataColumn)
|
||||
oDataColumn.BestFit()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub frmLookupGrid_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
BringToFront()
|
||||
|
||||
@@ -126,37 +126,43 @@ Public Class Form1
|
||||
Dim oArgs As New WorkerArgs()
|
||||
oArgs = LoadPropertyMapFor(oArgs)
|
||||
|
||||
If oDialogResult = DialogResult.OK Then
|
||||
Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName)
|
||||
Dim oResult = _zugferd.SerializeZUGFeRDDocument(oDoc)
|
||||
Try
|
||||
If oDialogResult = DialogResult.OK Then
|
||||
Dim oDoc = _zugferd.ValidateZUGFeRDFileWithGDPicture(OpenFileDialog1.FileName)
|
||||
Dim oResult = _zugferd.ValidateZUGFeRDDocument(oDoc)
|
||||
oResult = _zugferd.SerializeZUGFeRDDocument(oDoc)
|
||||
|
||||
WriteLog("Specification: " & oResult.Specification)
|
||||
WriteLog("Embedded File Name: " & oResult.DataFileName)
|
||||
WriteLog("Specification: " & oResult.Specification)
|
||||
WriteLog("Embedded File Name: " & oResult.DataFileName)
|
||||
|
||||
Dim oSpecification = oResult.Specification
|
||||
Dim oSpecification = oResult.Specification
|
||||
|
||||
If oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_10 Then
|
||||
oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_DEFAULT
|
||||
If oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_10 Then
|
||||
oSpecification = ZUGFeRDInterface.ZUGFERD_SPEC_DEFAULT
|
||||
End If
|
||||
|
||||
Dim oPropertyMap = oArgs.PropertyMap.
|
||||
Where(Function(kv) kv.Value.Specification = oSpecification).
|
||||
ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value)
|
||||
|
||||
Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oResult.SchemaObject, oPropertyMap, "test")
|
||||
|
||||
WriteLog("Valid Properties: [{0}]", oResult2.ValidProperties.Count)
|
||||
For Each Prop In oResult2.ValidProperties
|
||||
WriteLog("Property: [{0}] = [{1}]", Prop.Description, Prop.Value)
|
||||
Next
|
||||
|
||||
WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count)
|
||||
For Each Prop In oResult2.MissingProperties
|
||||
WriteLog("Missing Property: [{0}]", Prop)
|
||||
Next
|
||||
|
||||
WriteLog("--------------------------------")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
Dim oPropertyMap = oArgs.PropertyMap.
|
||||
Where(Function(kv) kv.Value.Specification = oSpecification).
|
||||
ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value)
|
||||
|
||||
Dim oResult2 = _zugferd.PropertyValues.CheckPropertyValues(oResult.SchemaObject, oPropertyMap, "test")
|
||||
|
||||
WriteLog("Valid Properties: [{0}]", oResult2.ValidProperties.Count)
|
||||
For Each Prop In oResult2.ValidProperties
|
||||
WriteLog("Property: [{0}] = [{1}]", Prop.Description, Prop.Value)
|
||||
Next
|
||||
|
||||
WriteLog("Missing Properties: [{0}]", oResult2.MissingProperties.Count)
|
||||
For Each Prop In oResult2.MissingProperties
|
||||
WriteLog("Missing Property: [{0}]", Prop)
|
||||
Next
|
||||
|
||||
WriteLog("--------------------------------")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
|
||||
@@ -10,6 +10,7 @@ using static DigitalData.Modules.Interfaces.ZUGFeRDInterface;
|
||||
using static DigitalData.Modules.Interfaces.PropertyValues;
|
||||
using System.Data.SqlClient;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using FirebirdSql.Data.FirebirdClient;
|
||||
|
||||
namespace ZUGFeRDRESTService.Controllers
|
||||
{
|
||||
@@ -132,7 +133,7 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
{
|
||||
_logger.Info("Start processing request to ValidationController");
|
||||
|
||||
ZugferdResult oZugferdResult;
|
||||
ZugferdResult oZugferdResult = null;
|
||||
CheckPropertyValuesResult oPropertyResult = new CheckPropertyValuesResult();
|
||||
|
||||
try
|
||||
@@ -153,6 +154,8 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
|
||||
oZugferdResult = _zugferd.ExtractZUGFeRDFileWithGDPicture(oStream);
|
||||
|
||||
|
||||
|
||||
_logger.Info("Detected Specification was: [{0}]", oZugferdResult.Specification);
|
||||
|
||||
var oFilteredPropertyMap = _zugferd.FilterPropertyMap(_propertyMap, oZugferdResult.Specification);
|
||||
@@ -187,6 +190,13 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
throw new ZUGFeRDExecption(ErrorType.MissingProperties, "Missing Properties");
|
||||
}
|
||||
|
||||
oZugferdResult = _zugferd.ValidateZUGFeRDDocument(oZugferdResult);
|
||||
|
||||
if (oZugferdResult.ValidationErrors.Any())
|
||||
{
|
||||
throw new ZUGFeRDExecption(ErrorType.ValidationFailed, "Validation Failed");
|
||||
}
|
||||
|
||||
Tuple<bool, string> oValidateResult = ValidateBuyerOrderReference(oPropertyResult.ValidProperties);
|
||||
|
||||
if (oValidateResult.Item1 == false)
|
||||
@@ -234,6 +244,7 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
ErrorType.MissingProperties => "Die hochgeladene Datei ist keine gültige ZUGFeRD-Rechnung, es fehlen einige Metadaten.",
|
||||
ErrorType.FileTooBig => string.Format("Die hochgeladene Datei überschreitet die zulässige Dateigröße [{0}].", _MaxFileSizeInMegabytes),
|
||||
ErrorType.UnsupportedFormat => "Die hochgeladene Datei enthält ein falsches oder nicht unterstütztes ZUGFeRD Format.",
|
||||
ErrorType.ValidationFailed => "Die hochgeladene Datei enthält ungültige Werte.",
|
||||
_ => "Die hochgeladene Datei kann nicht validiert werden.",
|
||||
};
|
||||
|
||||
@@ -242,9 +253,12 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
{
|
||||
// Errors contains the list of missing fields
|
||||
ErrorType.MissingProperties => oPropertyResult.MissingProperties,
|
||||
ErrorType.ValidationFailed => oZugferdResult.ValidationErrors.Select(e =>
|
||||
{
|
||||
return $"Element '{e.ElementName}' mit Wert '{e.ElementValue}': {e.ErrorMessage}";
|
||||
}).ToList(),
|
||||
_ => new List<string>()
|
||||
};
|
||||
|
||||
_logger.Info($"Responding with message: [{oMessage}]");
|
||||
|
||||
return new ValidationResponse()
|
||||
|
||||
Reference in New Issue
Block a user