20-09-2023
This commit is contained in:
@@ -15,14 +15,19 @@ Public Class DocumentModel
|
||||
End Sub
|
||||
|
||||
Private Function ToDocument(pRow As DataRow) As EnvelopeDocument
|
||||
Return ToDocument(pRow, 0)
|
||||
End Function
|
||||
|
||||
Private Function ToDocument(pRow As DataRow, pReceiverId As Integer) As EnvelopeDocument
|
||||
Dim oDocumentId = pRow.ItemEx("GUID", 0)
|
||||
Return New EnvelopeDocument() With {
|
||||
.Id = oDocumentId,
|
||||
.EnvelopeId = pRow.ItemEx("ENVELOPE_ID", 0),
|
||||
.FileInfo = New IO.FileInfo(pRow.ItemEx("FILEPATH", "")),
|
||||
.Filename = pRow.ItemEx("FILENAME", ""),
|
||||
.Filepath = pRow.ItemEx("FILEPATH", ""),
|
||||
.FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
|
||||
.IsTempFile = False,
|
||||
.Elements = ElementModel.List(oDocumentId)
|
||||
.Elements = ElementModel.List(oDocumentId, pReceiverId)
|
||||
}
|
||||
End Function
|
||||
|
||||
@@ -32,7 +37,7 @@ Public Class DocumentModel
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToDocument).
|
||||
Select(Function(row) ToDocument(row)).
|
||||
Single()
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -47,7 +52,22 @@ Public Class DocumentModel
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToDocument).
|
||||
Select(Function(row) ToDocument(row)).
|
||||
ToList()
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function List(pEnvelopeId As Integer, pReceiverId 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(Function(row) ToDocument(row, pReceiverId)).
|
||||
ToList()
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user