12.01.2024

This commit is contained in:
Jonathan Jenne
2024-01-12 12:06:29 +01:00
parent c8106f4fb0
commit e0bbdf8c0e
12 changed files with 1129 additions and 1052 deletions

View File

@@ -2,7 +2,7 @@
Public Property Id As Integer = 0
Public Property UserId As Integer
Public Property Title As String = ""
Public Property EnvelopeType As Integer
Public Property EnvelopeTypeId As Integer
Public Property ContractType As Integer
Public Property Status As Constants.EnvelopeStatus = Constants.EnvelopeStatus.EnvelopeCreated
Public Property Uuid As String = Guid.NewGuid.ToString()
@@ -30,6 +30,13 @@
Public Property Documents As New List(Of EnvelopeDocument)
Public Property Receivers As New List(Of EnvelopeReceiver)
Public Property History As New List(Of EnvelopeHistoryEntry)
Public Property EnvelopeType As EnvelopeType
Public ReadOnly Property EnvelopeTypeTitle As String
Get
Return EnvelopeType.Title
End Get
End Property
Public ReadOnly Property IsAlreadySent As Boolean
Get

View File

@@ -17,4 +17,12 @@ Public Class EnvelopeDocument
Public Property Filename As String
Public Property Filepath As String
Public Property PageCount As Integer
Public ReadOnly Property PageCountTranslated As String
Get
Return $"{PageCount} Seiten"
End Get
End Property
End Class

View File

@@ -10,7 +10,7 @@ Public Class EnvelopeModel
Private ReadOnly ReceiverModel As ReceiverModel
Private ReadOnly HistoryModel As HistoryModel
Private ReadOnly DocumentModel As DocumentModel
Private ReadOnly EnvelopeTypeModel As EnvelopeTypeModel
Public Sub New(pState As State)
MyBase.New(pState)
@@ -19,13 +19,14 @@ Public Class EnvelopeModel
ReceiverModel = New ReceiverModel(pState)
DocumentModel = New DocumentModel(pState)
HistoryModel = New HistoryModel(pState)
EnvelopeTypeModel = New EnvelopeTypeModel(pState)
End Sub
Private Function ToEnvelope(pRow As DataRow) As Envelope
Dim oEnvelope = New Envelope() With {
.Id = pRow.ItemEx("GUID", 0),
.Title = pRow.ItemEx("TITLE", ""),
.EnvelopeType = pRow.ItemEx("ENVELOPE_TYPE", 0),
.EnvelopeTypeId = pRow.ItemEx("ENVELOPE_TYPE", 0),
.ContractType = pRow.ItemEx("CONTRACT_TYPE", 0),
.Uuid = pRow.ItemEx("ENVELOPE_UUID", ""),
.Message = pRow.ItemEx("MESSAGE", ""),
@@ -51,6 +52,7 @@ Public Class EnvelopeModel
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id)
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
oEnvelope.History = HistoryModel.List(oEnvelope.Id)
oEnvelope.EnvelopeType = EnvelopeTypeModel.GetById(oEnvelope.EnvelopeTypeId)
Return oEnvelope
End Function
@@ -181,7 +183,7 @@ Public Class EnvelopeModel
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pEnvelope.Message
oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = pEnvelope.Status
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
oCommand.Parameters.Add("ENVELOPE_TYPE", SqlDbType.Int).Value = pEnvelope.EnvelopeType
oCommand.Parameters.Add("ENVELOPE_TYPE", SqlDbType.Int).Value = pEnvelope.EnvelopeTypeId
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.Int).Value = pEnvelope.ContractType
oCommand.Parameters.Add("LANGUAGE", SqlDbType.NVarChar).Value = pEnvelope.Language
oCommand.Parameters.Add("CERTIFICATION_TYPE", SqlDbType.Int).Value = pEnvelope.CertificationType

View File

@@ -25,6 +25,18 @@ Public Class EnvelopeTypeModel
}
End Function
Public Function GetById(pEnvelopeTypeId As Integer) As EnvelopeType
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE WHERE GUID = {pEnvelopeTypeId}"
Dim oTable As DataTable = Database.GetDatatable(oSql)
If oTable.Rows.Count = 0 Then
Return Nothing
End If
Dim oRow = oTable.Rows.Item(0)
Return ToEnvelopeType(oRow)
End Function
Public Function List() As IEnumerable(Of EnvelopeType)
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE"
Dim oTable As DataTable = Database.GetDatatable(oSql)