WIP
This commit is contained in:
@@ -21,6 +21,12 @@ Namespace Documents
|
||||
|
||||
Public Property Selected As Boolean = False
|
||||
|
||||
Public ReadOnly Property HasErrors As Boolean
|
||||
Get
|
||||
Return Rows.Any(Function(r As DocumentRow) r.HasErrors)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MandatorId As String
|
||||
Get
|
||||
Return Mandator?.Id
|
||||
|
||||
@@ -11,6 +11,12 @@ Namespace Documents
|
||||
Private ReadOnly Winline As Winline.Data
|
||||
|
||||
Public Property Files As New List(Of Document)
|
||||
Public Event FileLoadComplete As EventHandler(Of FileLoadInfo)
|
||||
|
||||
Public Structure FileLoadInfo
|
||||
Public FilesLoaded As Integer
|
||||
Public FilesTotal As Integer
|
||||
End Structure
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pWinline As Winline.Data)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
@@ -35,6 +41,12 @@ Namespace Documents
|
||||
For Each oFile In oFiles
|
||||
Dim oDocument = LoadFile(oFile, pSchema, pMandator)
|
||||
Files.Add(oDocument)
|
||||
|
||||
Dim oInfo As FileLoadInfo
|
||||
oInfo.FilesLoaded = Files.Count
|
||||
oInfo.FilesTotal = oFiles.Count
|
||||
|
||||
RaiseEvent FileLoadComplete(Me, oInfo)
|
||||
Next
|
||||
|
||||
Return True
|
||||
@@ -212,6 +224,8 @@ Namespace Documents
|
||||
If oArticleNumber IsNot Nothing Then
|
||||
oNumberItem.External = oArticleNumber
|
||||
oNumberItem.Final = oArticleNumber
|
||||
Else
|
||||
oNumberItem.Error = DocumentRow.FieldError.ArticleNotFound
|
||||
End If
|
||||
End Sub).
|
||||
ToList()
|
||||
@@ -249,6 +263,8 @@ Namespace Documents
|
||||
.Final = oAccount.Name
|
||||
})
|
||||
End If
|
||||
Else
|
||||
oNumberItem.Error = DocumentRow.FieldError.AccountNotFound
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -3,21 +3,41 @@
|
||||
''' <summary>
|
||||
''' Tabellen/Elementname aus XML
|
||||
''' </summary>
|
||||
Public Name As String
|
||||
Public Id As New Guid
|
||||
Public Property Name As String
|
||||
Public Property Id As New Guid
|
||||
|
||||
Public Fields As Dictionary(Of String, FieldValue)
|
||||
Public Property Fields As Dictionary(Of String, FieldValue)
|
||||
|
||||
Public ReadOnly Property HasErrors As Boolean
|
||||
Get
|
||||
Return Fields.Any(Function(f) f.Value.HasError)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New()
|
||||
Id = Guid.NewGuid()
|
||||
End Sub
|
||||
|
||||
Public Enum FieldError
|
||||
None
|
||||
AccountNotFound
|
||||
ArticleNotFound
|
||||
End Enum
|
||||
|
||||
Public Class FieldValue
|
||||
Public [Error] As FieldError = FieldError.None
|
||||
|
||||
Public Original As String = ""
|
||||
Public External As String = ""
|
||||
Public Final As String = ""
|
||||
Public Property DataType As Constants.ColumnType = Constants.ColumnType.String
|
||||
|
||||
Public ReadOnly Property HasError As Boolean
|
||||
Get
|
||||
Return [Error] <> FieldError.None
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Final
|
||||
End Function
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Public Class ReportHead
|
||||
Public Property Title As String
|
||||
Public Property Subtitle As String
|
||||
|
||||
Public Property DateCreated As Date
|
||||
Public Property Id As String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user