refactor(EnvelopeDocument): Aktualisiert, um Comon.Entities.EnvelopeDocument zu enthalten

This commit is contained in:
Developer 02
2025-05-23 11:29:20 +02:00
parent 10aa857544
commit 8e4266fcf6
3 changed files with 17 additions and 8 deletions

View File

@@ -10,14 +10,11 @@ Public Class EnvelopeDocument
Public Property EnvelopeId As Integer = 0
Public Property Thumbnail As Bitmap
Public Property Elements As New List(Of EnvelopeDocumentElement)
Public Property Filename As String
Public Property Filepath As String
Public Property PageCount As Integer
Public Property Byte_Data As Byte()
Public Property ByteData As Byte()
End Class

View File

@@ -26,7 +26,7 @@ Public Class DocumentModel
.FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
.IsTempFile = False,
.Elements = ElementModel.List(oDocumentId, pReceiverId),
.Byte_Data = DirectCast(pRow.Item("BYTE_DATA"), Byte())
.ByteData = DirectCast(pRow.Item("BYTE_DATA"), Byte())
}
End Function
@@ -95,7 +95,7 @@ Public Class DocumentModel
oCommand.Parameters.Add("FILENAME_ORIGINAL", SqlDbType.NVarChar).Value = pDocument.FileNameOriginal
oCommand.Parameters.Add("FILEPATH", SqlDbType.NVarChar).Value = pDocument.Filepath
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id
oCommand.Parameters.Add(New SqlParameter("@BYTE_DATA", DirectCast(pDocument.Byte_Data, Object)))
oCommand.Parameters.Add(New SqlParameter("@BYTE_DATA", DirectCast(pDocument.ByteData, Object)))
If Database.ExecuteNonQuery(oCommand, pTransaction) Then
pDocument.EnvelopeId = pEnvelope.Id

View File

@@ -17,7 +17,7 @@ namespace EnvelopeGenerator.Domain.Entities
[Required]
[Column("ENVELOPE_ID")]
public int EnvelopeId { get; set; }
public int EnvelopeId { get; set; } = 0;
[Required]
[Column("ADDED_WHEN", TypeName = "datetime")]
@@ -26,6 +26,18 @@ namespace EnvelopeGenerator.Domain.Entities
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
public byte[] ByteData { get; set; }
public IEnumerable<DocumentReceiverElement> Elements { get; set; }
// TODO: * Check the Form App and remove the default value
public IEnumerable<DocumentReceiverElement> Elements { get; set; } = new List<DocumentReceiverElement>();
[NotMapped]
public string FileNameOriginal { get; set; }
[NotMapped]
public bool IsTempFile { get; set; }
[NotMapped]
public string Filename { get; set; }
public string Filepath { get; set; }
}
}