30-11-23
This commit is contained in:
@@ -1,32 +1,52 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DevExpress.DataAccess.Native.Web
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Public Class ActionService
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly State As State
|
||||
Private ReadOnly EmailService As EmailService
|
||||
Private ReadOnly HistoryService As HistoryService
|
||||
|
||||
Private EmailService As EmailService
|
||||
Private HistoryService As HistoryService
|
||||
Private ReadOnly ReceiverModel As ReceiverModel
|
||||
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState.LogConfig)
|
||||
|
||||
State = pState
|
||||
EmailService = New EmailService(pState)
|
||||
HistoryService = New HistoryService(pState)
|
||||
|
||||
ReceiverModel = New ReceiverModel(pState)
|
||||
End Sub
|
||||
|
||||
Public Function DeleteEnvelope(pEnvelope As Envelope) As Boolean
|
||||
|
||||
HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeDeleted, pEnvelope.User.Email)
|
||||
|
||||
For Each oReceiver As EnvelopeReceiver In pEnvelope.Receivers
|
||||
EmailService.SendEnvelopeDeletedEmail(oReceiver.Id, pEnvelope.Id)
|
||||
Next
|
||||
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function OpenEnvelope(pEnvelope As Envelope, pReceiverId As Integer) As Boolean
|
||||
Dim oReceiver As EnvelopeReceiver = ReceiverModel.GetById(pReceiverId)
|
||||
Dim oUserReference = oReceiver.Email
|
||||
|
||||
Return HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.DocumentOpened, oUserReference)
|
||||
End Function
|
||||
|
||||
Public Function SignEnvelope(pEnvelope As Envelope, pReceiverId As Integer) As Boolean
|
||||
Dim oReceiver As EnvelopeReceiver = ReceiverModel.GetById(pReceiverId)
|
||||
Dim oUserReference = oReceiver.Email
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.DocumentSigned, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return EmailService.SendSignedEmail(oReceiver.Id, pEnvelope.Id)
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user