refactor(EnvelopeGenerator.Common): umbenennen in EnvelopeGenerator.CommonService
This commit is contained in:
36
EnvelopeGenerator.CommonServices/Services/HistoryService.vb
Normal file
36
EnvelopeGenerator.CommonServices/Services/HistoryService.vb
Normal file
@@ -0,0 +1,36 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Public Class HistoryService
|
||||
Inherits BaseService
|
||||
|
||||
Private ReadOnly EnvelopeModel As EnvelopeModel
|
||||
Private ReadOnly ReceiverModel As ReceiverModel
|
||||
Private ReadOnly HistoryModel As HistoryModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
|
||||
EnvelopeModel = New EnvelopeModel(pState)
|
||||
ReceiverModel = New ReceiverModel(pState)
|
||||
HistoryModel = New HistoryModel(pState)
|
||||
End Sub
|
||||
|
||||
Public Function SetEnvelopeStatus(pEnvelope As Envelope, pStatus As EnvelopeStatus, pUserReference As String) As Boolean
|
||||
Dim oResult = HistoryModel.Insert(New EnvelopeHistory() With {
|
||||
.EnvelopeId = pEnvelope.Id,
|
||||
.ActionDate = Now(),
|
||||
.Status = pStatus,
|
||||
.UserReference = pUserReference
|
||||
})
|
||||
|
||||
If oResult = False Then
|
||||
Logger.Warn("Could not set Envelope status to [{0}] for Envelope [{1}].", pStatus.ToString, pEnvelope.Id)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Logger.Debug("Envelope status set to [{0}] for Envelope [{1}].", pStatus.ToString, pEnvelope.Id)
|
||||
Return True
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user