Improve Validation, Report, Transfer document with selected mandator
This commit is contained in:
@@ -1,16 +1,37 @@
|
||||
Namespace Documents
|
||||
Public Class DocumentRow
|
||||
Implements IComparable
|
||||
|
||||
''' <summary>
|
||||
''' GUID to match DocumentRow with Row from Grid/DataTable
|
||||
''' </summary>
|
||||
Public Property Id As New Guid
|
||||
''' <summary>
|
||||
''' Counter to ensure consistency and order when writing XML
|
||||
''' </summary>
|
||||
Public Property SortKey As Integer
|
||||
''' <summary>
|
||||
''' Tabellen/Elementname aus XML
|
||||
''' </summary>
|
||||
Public Property Name As String
|
||||
Public Property Id As New Guid
|
||||
|
||||
Public Property Fields As Dictionary(Of String, FieldValue)
|
||||
|
||||
Public ReadOnly Property HasErrors As Boolean
|
||||
Get
|
||||
Return Fields.Any(Function(f) f.Value.HasError)
|
||||
If Errors.Count > 0 Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Errors As List(Of String)
|
||||
Get
|
||||
Return Fields.
|
||||
Where(Function(f) f.Value.HasError).
|
||||
Select(Function(f) f.Key).ToList()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -18,6 +39,10 @@
|
||||
Id = Guid.NewGuid()
|
||||
End Sub
|
||||
|
||||
Public Function CompareTo(other As Object) As Integer Implements IComparable.CompareTo
|
||||
Return SortKey.CompareTo(DirectCast(other, DocumentRow).SortKey)
|
||||
End Function
|
||||
|
||||
Public Enum FieldError
|
||||
None
|
||||
MissingValue
|
||||
@@ -26,16 +51,16 @@
|
||||
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 Property [Error] As FieldError = FieldError.None
|
||||
Public Property Original As String = ""
|
||||
Public Property External As String = ""
|
||||
Public Property Final As String = ""
|
||||
Public Property Required As Boolean = False
|
||||
|
||||
Public ReadOnly Property HasError As Boolean
|
||||
Get
|
||||
Return [Error] <> FieldError.None
|
||||
Return [Error] <> FieldError.None Or (Required = True And Final = String.Empty)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Reference in New Issue
Block a user