This commit is contained in:
Jonathan Jenne
2023-08-23 12:42:03 +02:00
parent b312396bb5
commit 3ecd9ecb27
44 changed files with 1549 additions and 56 deletions

View File

@@ -3,6 +3,7 @@ Imports System.IO
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.Common
Imports EnvelopeGenerator.Common.Constants
Imports EnvelopeGenerator.Common.My
Public Class EnvelopeEditorController
Inherits BaseController
@@ -24,6 +25,27 @@ Public Class EnvelopeEditorController
End Sub
#Region "Public"
Public Function SendEnvelope() As Boolean
If EnvelopeModel.Send(Envelope) Then
'TODO: Send email
Return True
Else
Return False
End If
End Function
Public Function ValidateEnvelopeForSending() As List(Of String)
Dim oEnvelopeErrors = Envelope.Validate()
If ElementModel.ElementsExist(Envelope.Id) = False Then
oEnvelopeErrors.Add(Resources.Envelope.Missing_Elements)
End If
Return oEnvelopeErrors
End Function
Public Function CreateEnvelope() As Envelope
Dim oEnvelope As New Envelope() With {
.UserId = State.UserId,
@@ -45,26 +67,26 @@ Public Class EnvelopeEditorController
End If
End Function
Public Function SaveEnvelope(pEnvelope As Envelope) As Boolean
Public Function SaveEnvelope() As Boolean
Dim oConnection = Database.GetConnection()
Dim oTransaction = oConnection.BeginTransaction(IsolationLevel.ReadUncommitted)
Try
pEnvelope.Status = EnvelopeStatus.Saved
Envelope.Status = EnvelopeStatus.Saved
If SaveEnvelopeDocumentsToFilesystem(pEnvelope) = False Then
If SaveEnvelopeDocumentsToFilesystem(Envelope) = False Then
Throw New ApplicationException
End If
If EnvelopeModel.Update(pEnvelope, oTransaction) = False Then
If EnvelopeModel.Update(Envelope, oTransaction) = False Then
Throw New ApplicationException
End If
If SaveEnvelopeReceivers(pEnvelope, oTransaction) = False Then
If SaveEnvelopeReceivers(Envelope, oTransaction) = False Then
Throw New ApplicationException
End If
If SaveEnvelopeDocuments(pEnvelope, oTransaction) = False Then
If SaveEnvelopeDocuments(Envelope, oTransaction) = False Then
Throw New ApplicationException
End If