2021-11-19 14:16:07 +01:00

59 lines
1.6 KiB
VB.net

Imports System.IO
Imports MultiTool.Shared.Templates
Imports MultiTool.Shared.Winline.Entities
Namespace Documents
Public Class Document
Public File As FileInfo
Public Property Type As DocumentType
Public Schema As Template
Public Mandator As Mandator
Public TemplateName As String
Public TemplateType As Integer
Public [Option] As Integer
Public PrintVoucher As Integer
''' <summary>
''' Original Values, read-only
''' </summary>
Public Property Rows As New List(Of DocumentRow)
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
End Get
End Property
Public ReadOnly Property CreatedAt As Date
Get
Return File?.CreationTime
End Get
End Property
Public ReadOnly Property FullName As String
Get
Return File?.FullName
End Get
End Property
Public ReadOnly Property FileName As String
Get
Return File?.Name
End Get
End Property
Public Overrides Function Equals(obj As Object) As Boolean
Return FullName = DirectCast(obj, Document).FullName
End Function
End Class
End Namespace