2023-08-07
This commit is contained in:
33
EnvelopeGenerator.Common/Models/DocumentModel.vb
Normal file
33
EnvelopeGenerator.Common/Models/DocumentModel.vb
Normal file
@@ -0,0 +1,33 @@
|
||||
Imports System.Data
|
||||
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
|
||||
Reference in New Issue
Block a user