Jonathan Jenne 13cf091d8e 31.07.2023
2023-07-31 11:51:33 +02:00

33 lines
1014 B
VB.net

Imports DigitalData.Modules.Base
Public Class DocumentModel
Inherits BaseModel
Public Sub New(pState As State)
MyBase.New(pState)
End Sub
Private Function ToDocument(pRow As DataRow) As EnvelopeDocument
Return New EnvelopeDocument() With {
.Id = pRow.ItemEx("GUID", 0),
.EnvelopeId = pRow.ItemEx("ENVELOPE_ID", 0),
.FileInfo = New IO.FileInfo(pRow.ItemEx("FILEPATH", "")),
.IsTempFile = False
}
End Function
Public Function List(pEnvelopeId As Integer) As IEnumerable(Of EnvelopeDocument)
Try
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE_DOCUMENT] WHERE ENVELOPE_ID = {pEnvelopeId}"
Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows.Cast(Of DataRow).
Select(AddressOf ToDocument).
ToList()
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class