refactor(EnvelopeReceiver): unbenutzte Eigenschaften entfernen und in Receiver umbenennen
This commit is contained in:
parent
d34a1016c4
commit
806b990556
@ -27,7 +27,7 @@ Public Class EmailData
|
|||||||
''' <param name="pEnvelope"></param>
|
''' <param name="pEnvelope"></param>
|
||||||
''' <param name="pReceiver"></param>
|
''' <param name="pReceiver"></param>
|
||||||
''' <param name="pStatus"></param>
|
''' <param name="pStatus"></param>
|
||||||
Public Sub New(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pStatus As Constants.EnvelopeStatus)
|
Public Sub New(pEnvelope As Envelope, pReceiver As Receiver, pStatus As Constants.EnvelopeStatus)
|
||||||
EmailAdress = pReceiver.Email
|
EmailAdress = pReceiver.Email
|
||||||
EmailSubject = String.Empty
|
EmailSubject = String.Empty
|
||||||
EmailType = pStatus
|
EmailType = pStatus
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Public Class Envelope
|
|||||||
Public Property User As New User()
|
Public Property User As New User()
|
||||||
|
|
||||||
Public Property Documents As New List(Of EnvelopeDocument)
|
Public Property Documents As New List(Of EnvelopeDocument)
|
||||||
Public Property Receivers As New List(Of EnvelopeReceiver)
|
Public Property Receivers As New List(Of Receiver)
|
||||||
Public Property History As New List(Of EnvelopeHistoryEntry)
|
Public Property History As New List(Of EnvelopeHistoryEntry)
|
||||||
Public Property EnvelopeType As EnvelopeType
|
Public Property EnvelopeType As EnvelopeType
|
||||||
Public Property DOC_RESULT As Byte()
|
Public Property DOC_RESULT As Byte()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Public Class EnvelopeResponse
|
Public Class EnvelopeResponse
|
||||||
Public Property Envelope As Envelope
|
Public Property Envelope As Envelope
|
||||||
Public Property Receiver As EnvelopeReceiver
|
Public Property Receiver As Receiver
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -4,9 +4,8 @@ Imports DigitalData.Modules.Base
|
|||||||
Imports EnvelopeGenerator.Domain.Constants
|
Imports EnvelopeGenerator.Domain.Constants
|
||||||
Imports Newtonsoft.Json
|
Imports Newtonsoft.Json
|
||||||
|
|
||||||
Public Class EnvelopeReceiver
|
Public Class Receiver
|
||||||
Public Property Id As Integer = 0
|
Public Property Id As Integer = 0
|
||||||
Public Property UserId As Integer
|
|
||||||
Public Property Signature As String
|
Public Property Signature As String
|
||||||
Public ReadOnly Property Color As Color
|
Public ReadOnly Property Color As Color
|
||||||
Get
|
Get
|
||||||
@ -14,18 +13,6 @@ Public Class EnvelopeReceiver
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
<JsonIgnore>
|
|
||||||
Public ReadOnly Property Image As SvgBitmap
|
|
||||||
Get
|
|
||||||
Try
|
|
||||||
Return SvgBitmap.FromFile("Images/circle.svg")
|
|
||||||
Catch ex As Exception
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
|
|
||||||
Public Property ColorType As ColorType
|
Public Property ColorType As ColorType
|
||||||
|
|
||||||
Public Property Name As String
|
Public Property Name As String
|
||||||
@ -38,13 +25,6 @@ Public Class EnvelopeReceiver
|
|||||||
|
|
||||||
Public Property Status As ReceiverStatus
|
Public Property Status As ReceiverStatus
|
||||||
|
|
||||||
Public ReadOnly Property StatusTranslated As String
|
|
||||||
Get
|
|
||||||
Dim oStatus = Status.ToString()
|
|
||||||
Return My.Resources.Model.ResourceManager.GetString(oStatus)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public Property SignedDate As DateTime = DateTime.MinValue
|
Public Property SignedDate As DateTime = DateTime.MinValue
|
||||||
|
|
||||||
Public ReadOnly Property SignedDateDisplayValue As String
|
Public ReadOnly Property SignedDateDisplayValue As String
|
||||||
@ -284,7 +284,7 @@
|
|||||||
<Compile Include="Entities\EnvelopeDocument.vb" />
|
<Compile Include="Entities\EnvelopeDocument.vb" />
|
||||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
||||||
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
||||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
<Compile Include="Entities\Receiver.vb" />
|
||||||
<Compile Include="Entities\EnvelopeResponse.vb" />
|
<Compile Include="Entities\EnvelopeResponse.vb" />
|
||||||
<Compile Include="Entities\EnvelopeType.vb" />
|
<Compile Include="Entities\EnvelopeType.vb" />
|
||||||
<Compile Include="Entities\State.vb" />
|
<Compile Include="Entities\State.vb" />
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Public Class ReceiverModel
|
|||||||
MyBase.New(pState)
|
MyBase.New(pState)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ToReceiver(pRow As DataRow, pColorIndex As Integer) As EnvelopeReceiver
|
Private Function ToReceiver(pRow As DataRow, pColorIndex As Integer) As Receiver
|
||||||
Dim EmailAdress As String = pRow.ItemEx("EMAIL_ADDRESS", "")
|
Dim EmailAdress As String = pRow.ItemEx("EMAIL_ADDRESS", "")
|
||||||
Dim EnvelopeId As Integer = pRow.ItemEx("ENVELOPE_ID", 0)
|
Dim EnvelopeId As Integer = pRow.ItemEx("ENVELOPE_ID", 0)
|
||||||
Dim SignedDate As DateTime = DateTime.MinValue
|
Dim SignedDate As DateTime = DateTime.MinValue
|
||||||
@ -24,7 +24,7 @@ Public Class ReceiverModel
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return New EnvelopeReceiver() With {
|
Return New Receiver() With {
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
.Id = pRow.ItemEx("GUID", 0),
|
||||||
.Email = pRow.ItemEx("EMAIL_ADDRESS", ""),
|
.Email = pRow.ItemEx("EMAIL_ADDRESS", ""),
|
||||||
.Name = pRow.ItemEx("NAME", ""),
|
.Name = pRow.ItemEx("NAME", ""),
|
||||||
@ -38,13 +38,13 @@ Public Class ReceiverModel
|
|||||||
}
|
}
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function ToReceiver(pTable As DataTable) As EnvelopeReceiver
|
Private Function ToReceiver(pTable As DataTable) As Receiver
|
||||||
Return pTable?.Rows.Cast(Of DataRow).
|
Return pTable?.Rows.Cast(Of DataRow).
|
||||||
Select(AddressOf ToReceiver).
|
Select(AddressOf ToReceiver).
|
||||||
Single()
|
Single()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function TestReceiverExists(pReceiver As EnvelopeReceiver) As Boolean
|
Public Function TestReceiverExists(pReceiver As Receiver) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oGuid = Database.GetScalarValue($"SELECT COALESCE(GUID, 0) FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pReceiver.Email}'")
|
Dim oGuid = Database.GetScalarValue($"SELECT COALESCE(GUID, 0) FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pReceiver.Email}'")
|
||||||
pReceiver.Id = oGuid
|
pReceiver.Id = oGuid
|
||||||
@ -55,7 +55,7 @@ Public Class ReceiverModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Insert(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
Public Function Insert(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSignature As String = pReceiver.GetSignature()
|
Dim oSignature As String = pReceiver.GetSignature()
|
||||||
Dim oCheck = $"SELECT COUNT(GUID) FROM [dbo].[TBSIG_RECEIVER] WHERE SIGNATURE = '{oSignature}'"
|
Dim oCheck = $"SELECT COUNT(GUID) FROM [dbo].[TBSIG_RECEIVER] WHERE SIGNATURE = '{oSignature}'"
|
||||||
@ -87,7 +87,7 @@ Public Class ReceiverModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Update(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
Public Function Update(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSql As String = $"UPDATE [dbo].[TBSIG_USER_RECEIVER]
|
Dim oSql As String = $"UPDATE [dbo].[TBSIG_USER_RECEIVER]
|
||||||
SET [NAME] = '{pReceiver.Name}'
|
SET [NAME] = '{pReceiver.Name}'
|
||||||
@ -118,7 +118,7 @@ Public Class ReceiverModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Assign(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
Public Function Assign(pEnvelope As Envelope, pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||||
Dim oSql = $"INSERT INTO [dbo].[TBSIG_ENVELOPE_RECEIVER]
|
Dim oSql = $"INSERT INTO [dbo].[TBSIG_ENVELOPE_RECEIVER]
|
||||||
([ENVELOPE_ID]
|
([ENVELOPE_ID]
|
||||||
,[RECEIVER_ID]
|
,[RECEIVER_ID]
|
||||||
@ -153,7 +153,7 @@ Public Class ReceiverModel
|
|||||||
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ListEnvelopeReceivers(pEnvelopeId As Integer) As IEnumerable(Of EnvelopeReceiver)
|
Public Function ListEnvelopeReceivers(pEnvelopeId As Integer) As IEnumerable(Of Receiver)
|
||||||
Try
|
Try
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE ENVELOPE_ID = {pEnvelopeId}"
|
Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE ENVELOPE_ID = {pEnvelopeId}"
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
Dim oTable = Database.GetDatatable(oSql)
|
||||||
@ -187,7 +187,7 @@ Public Class ReceiverModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ListReceivers() As IEnumerable(Of EnvelopeReceiver)
|
Public Function ListReceivers() As IEnumerable(Of Receiver)
|
||||||
Try
|
Try
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_RECEIVER]"
|
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_RECEIVER]"
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
Dim oTable = Database.GetDatatable(oSql)
|
||||||
@ -202,10 +202,10 @@ Public Class ReceiverModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function ListReceivers(pReceiversFromGrid As List(Of EnvelopeReceiver)) As IEnumerable(Of EnvelopeReceiver)
|
Public Function ListReceivers(pReceiversFromGrid As List(Of Receiver)) As IEnumerable(Of Receiver)
|
||||||
Try
|
Try
|
||||||
If pReceiversFromGrid.Count = 0 Then
|
If pReceiversFromGrid.Count = 0 Then
|
||||||
Return New List(Of EnvelopeReceiver)
|
Return New List(Of Receiver)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oAddresses = pReceiversFromGrid.Select(Function(r) $"'{r.Email}'").JoinToString(",")
|
Dim oAddresses = pReceiversFromGrid.Select(Function(r) $"'{r.Email}'").JoinToString(",")
|
||||||
@ -235,7 +235,7 @@ Public Class ReceiverModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetById(pReceiverId As Integer) As EnvelopeReceiver
|
Public Function GetById(pReceiverId As Integer) As Receiver
|
||||||
'Try
|
'Try
|
||||||
' Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE RECEIVER_ID = {pReceiverId}"
|
' Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE RECEIVER_ID = {pReceiverId}"
|
||||||
' Dim oTable = Database.GetDatatable(oSql)
|
' Dim oTable = Database.GetDatatable(oSql)
|
||||||
|
|||||||
@ -56,7 +56,7 @@ Public Class ActionService
|
|||||||
Next
|
Next
|
||||||
Return oSendResult
|
Return oSendResult
|
||||||
End Function
|
End Function
|
||||||
Public Function ResendReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function ResendReceiver(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Return EmailService.SendDocumentReceivedEmail(pEnvelope, pReceiver)
|
Return EmailService.SendDocumentReceivedEmail(pEnvelope, pReceiver)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ Public Class ActionService
|
|||||||
End Function
|
End Function
|
||||||
Public Function API_SendWithdrawn_Mails(pEnvelope As Envelope, pReason As String) As Boolean
|
Public Function API_SendWithdrawn_Mails(pEnvelope As Envelope, pReason As String) As Boolean
|
||||||
Dim oSendResult As Boolean = False
|
Dim oSendResult As Boolean = False
|
||||||
For Each oReceiver As EnvelopeReceiver In pEnvelope.Receivers
|
For Each oReceiver As Receiver In pEnvelope.Receivers
|
||||||
If EmailService.SendEnvelopeDeletedEmail(pEnvelope, oReceiver, pReason) = False Then
|
If EmailService.SendEnvelopeDeletedEmail(pEnvelope, oReceiver, pReason) = False Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@ -94,7 +94,7 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function OpenEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function OpenEnvelope(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Dim oUserReference = pReceiver.Email
|
Dim oUserReference = pReceiver.Email
|
||||||
|
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentOpened, oUserReference) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentOpened, oUserReference) = False Then
|
||||||
@ -104,7 +104,7 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function RequestAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function RequestAccessCode(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Dim oUserReference = pReceiver.Email
|
Dim oUserReference = pReceiver.Email
|
||||||
|
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeRequested, oUserReference) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeRequested, oUserReference) = False Then
|
||||||
@ -114,7 +114,7 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function EnterCorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function EnterCorrectAccessCode(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Dim oUserReference = pReceiver.Email
|
Dim oUserReference = pReceiver.Email
|
||||||
|
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeCorrect, oUserReference) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeCorrect, oUserReference) = False Then
|
||||||
@ -124,7 +124,7 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function EnterIncorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function EnterIncorrectAccessCode(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Dim oUserReference = pReceiver.Email
|
Dim oUserReference = pReceiver.Email
|
||||||
|
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeIncorrect, oUserReference) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.AccessCodeIncorrect, oUserReference) = False Then
|
||||||
@ -134,7 +134,7 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SignEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function SignEnvelope(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Dim oUserReference = pReceiver.Email
|
Dim oUserReference = pReceiver.Email
|
||||||
|
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentSigned, oUserReference) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.DocumentSigned, oUserReference) = False Then
|
||||||
@ -152,7 +152,7 @@ Public Class ActionService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As Receiver) As Boolean ', pAttachment As String
|
||||||
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.MessageCompletionSent, pReceiver.Email) = False Then
|
If HistoryService.SetEnvelopeStatus(pEnvelope, EnvelopeStatus.MessageCompletionSent, pReceiver.Email) = False Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|||||||
@ -13,7 +13,7 @@ Public Class EmailService
|
|||||||
EmailTemplate = New TemplateService(pState)
|
EmailTemplate = New TemplateService(pState)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pReason As String) As Boolean
|
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As Receiver, pReason As String) As Boolean
|
||||||
Logger.Debug("SendEnvelopeDeletedEmail - Creating email data object...")
|
Logger.Debug("SendEnvelopeDeletedEmail - Creating email data object...")
|
||||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageDeletionSent) With
|
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageDeletionSent) With
|
||||||
{
|
{
|
||||||
@ -31,7 +31,7 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||||
{
|
{
|
||||||
@ -49,7 +49,7 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetReceiverUrl(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As String
|
Public Function GetReceiverUrl(pEnvelope As Envelope, pReceiver As Receiver) As String
|
||||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||||
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
Logger.Debug($" pReceiver.Signature: {pReceiver.Signature}")
|
||||||
@ -62,7 +62,7 @@ Public Class EmailService
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
Logger.Debug($"State.DbConfig.SignatureHost: {State.DbConfig.SignatureHost}")
|
||||||
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
Logger.Debug($" pEnvelope.Uuid: {pEnvelope.Uuid}")
|
||||||
@ -83,7 +83,7 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageConfirmationSent) With
|
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageConfirmationSent) With
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ Public Class EmailService
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As Receiver) As Boolean ', pAttachment As String
|
||||||
Logger.Debug("Creating email data object.")
|
Logger.Debug("Creating email data object.")
|
||||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Domain.Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Public Class EnvelopeEditorController
|
|||||||
Public Function DocumentRotationChanged() As Boolean
|
Public Function DocumentRotationChanged() As Boolean
|
||||||
Return ActionService.SetStatusDocumentRotationChanged(Envelope)
|
Return ActionService.SetStatusDocumentRotationChanged(Envelope)
|
||||||
End Function
|
End Function
|
||||||
Public Function ResendReceiverInvitation(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
Public Function ResendReceiverInvitation(pEnvelope As Envelope, pReceiver As Receiver) As Boolean
|
||||||
Return ActionService.ResendReceiver(pEnvelope, pReceiver)
|
Return ActionService.ResendReceiver(pEnvelope, pReceiver)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ Public Class EnvelopeEditorController
|
|||||||
|
|
||||||
If ElementModel.OneElementPerReceiverExist(Envelope.Id) = False Then
|
If ElementModel.OneElementPerReceiverExist(Envelope.Id) = False Then
|
||||||
|
|
||||||
For Each receiverItem As EnvelopeReceiver In Envelope.Receivers
|
For Each receiverItem As Receiver In Envelope.Receivers
|
||||||
If ElementModel.ElementsExist(Envelope.Id, receiverItem.Id) = False Then
|
If ElementModel.ElementsExist(Envelope.Id, receiverItem.Id) = False Then
|
||||||
oEnvelopeErrors.Add(String.Format(Resources.Envelope.Missing_Elements_for_Receiver, receiverItem.Name))
|
oEnvelopeErrors.Add(String.Format(Resources.Envelope.Missing_Elements_for_Receiver, receiverItem.Name))
|
||||||
End If
|
End If
|
||||||
@ -89,8 +89,8 @@ Public Class EnvelopeEditorController
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SaveReceivers(pEnvelope As Envelope, pReceiversFromGrid As List(Of EnvelopeReceiver)) As Boolean
|
Public Function SaveReceivers(pEnvelope As Envelope, pReceiversFromGrid As List(Of Receiver)) As Boolean
|
||||||
Dim oExistingReceivers As List(Of EnvelopeReceiver) = ReceiverModel.ListReceivers(pReceiversFromGrid).ToList()
|
Dim oExistingReceivers As List(Of Receiver) = ReceiverModel.ListReceivers(pReceiversFromGrid).ToList()
|
||||||
Dim oExistingAddresses = oExistingReceivers.Select(Function(r) r.Email)
|
Dim oExistingAddresses = oExistingReceivers.Select(Function(r) r.Email)
|
||||||
Logger.Debug($"oExistingReceivers.count: {oExistingReceivers.Count}")
|
Logger.Debug($"oExistingReceivers.count: {oExistingReceivers.Count}")
|
||||||
Logger.Debug($"oExistingAddresses.count: {oExistingAddresses.Count}")
|
Logger.Debug($"oExistingAddresses.count: {oExistingAddresses.Count}")
|
||||||
@ -103,7 +103,7 @@ Public Class EnvelopeEditorController
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oAllReceivers As List(Of EnvelopeReceiver) = ReceiverModel.ListReceivers(pReceiversFromGrid).ToList()
|
Dim oAllReceivers As List(Of Receiver) = ReceiverModel.ListReceivers(pReceiversFromGrid).ToList()
|
||||||
|
|
||||||
pEnvelope.Receivers.Clear()
|
pEnvelope.Receivers.Clear()
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ Public Class EnvelopeEditorController
|
|||||||
Return ReceiverModel.ListAllEnvelopeReceiverAddresses(pUserId)
|
Return ReceiverModel.ListAllEnvelopeReceiverAddresses(pUserId)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function CreateNewReceivers(pNewReceivers As List(Of EnvelopeReceiver)) As Boolean
|
Public Function CreateNewReceivers(pNewReceivers As List(Of Receiver)) As Boolean
|
||||||
If pNewReceivers.Count = 0 Then
|
If pNewReceivers.Count = 0 Then
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
@ -350,7 +350,7 @@ Public Class EnvelopeEditorController
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function DeleteReceiver(pReceiver As EnvelopeReceiver) As Boolean
|
Public Function DeleteReceiver(pReceiver As Receiver) As Boolean
|
||||||
Dim oConnection As SqlConnection = Database.GetConnection()
|
Dim oConnection As SqlConnection = Database.GetConnection()
|
||||||
Dim oTransaction As SqlTransaction = oConnection.BeginTransaction()
|
Dim oTransaction As SqlTransaction = oConnection.BeginTransaction()
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ Public Class EnvelopeEditorController
|
|||||||
Return ElementModel.ElementsExist(Envelope.Id, pReceiverId)
|
Return ElementModel.ElementsExist(Envelope.Id, pReceiverId)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function InsertReceivers(pReceivers As List(Of EnvelopeReceiver), pTransaction As SqlTransaction) As Boolean
|
Private Function InsertReceivers(pReceivers As List(Of Receiver), pTransaction As SqlTransaction) As Boolean
|
||||||
Try
|
Try
|
||||||
Return pReceivers.
|
Return pReceivers.
|
||||||
Select(Function(r) InsertReceiver(r, pTransaction)).
|
Select(Function(r) InsertReceiver(r, pTransaction)).
|
||||||
@ -404,7 +404,7 @@ Public Class EnvelopeEditorController
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function InsertReceiver(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
Private Function InsertReceiver(pReceiver As Receiver, pTransaction As SqlTransaction) As Boolean
|
||||||
If pReceiver.HasId = False Then
|
If pReceiver.HasId = False Then
|
||||||
Return ReceiverModel.Insert(pReceiver, pTransaction)
|
Return ReceiverModel.Insert(pReceiver, pTransaction)
|
||||||
Else
|
Else
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Imports EnvelopeGenerator.Domain.Constants
|
|||||||
Partial Public Class frmEnvelopeEditor
|
Partial Public Class frmEnvelopeEditor
|
||||||
Public Property Envelope As Envelope
|
Public Property Envelope As Envelope
|
||||||
Public Property Documents As New BindingList(Of EnvelopeDocument)
|
Public Property Documents As New BindingList(Of EnvelopeDocument)
|
||||||
Public Property Receivers As New BindingList(Of EnvelopeReceiver)
|
Public Property Receivers As New BindingList(Of Receiver)
|
||||||
|
|
||||||
Private AllReceiverEmails As New List(Of String)
|
Private AllReceiverEmails As New List(Of String)
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
Else
|
Else
|
||||||
Controller = New EnvelopeEditorController(State, Envelope)
|
Controller = New EnvelopeEditorController(State, Envelope)
|
||||||
Documents = New BindingList(Of EnvelopeDocument)(Controller.Envelope.Documents)
|
Documents = New BindingList(Of EnvelopeDocument)(Controller.Envelope.Documents)
|
||||||
Receivers = New BindingList(Of EnvelopeReceiver)(Controller.Envelope.Receivers)
|
Receivers = New BindingList(Of Receiver)(Controller.Envelope.Receivers)
|
||||||
|
|
||||||
For Each docItem As EnvelopeDocument In Documents
|
For Each docItem As EnvelopeDocument In Documents
|
||||||
If Not File.Exists(docItem.Filepath) Then
|
If Not File.Exists(docItem.Filepath) Then
|
||||||
@ -365,7 +365,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oReceiver As EnvelopeReceiver = ViewReceivers.GetFocusedRow()
|
Dim oReceiver As Receiver = ViewReceivers.GetFocusedRow()
|
||||||
|
|
||||||
If oReceiver Is Nothing Then
|
If oReceiver Is Nothing Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -458,7 +458,7 @@ Partial Public Class frmEnvelopeEditor
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ViewReceivers_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles ViewReceivers.InitNewRow
|
Private Sub ViewReceivers_InitNewRow(sender As Object, e As InitNewRowEventArgs) Handles ViewReceivers.InitNewRow
|
||||||
Dim oReceiver As EnvelopeReceiver = ViewReceivers.GetRow(e.RowHandle)
|
Dim oReceiver As Receiver = ViewReceivers.GetRow(e.RowHandle)
|
||||||
|
|
||||||
Dim oUsedColors = Receivers.Select(Of Integer)(Function(r) r.ColorType).ToList()
|
Dim oUsedColors = Receivers.Select(Of Integer)(Function(r) r.ColorType).ToList()
|
||||||
Dim oAllColors = [Enum].GetValues(GetType(Domain.Constants.ColorType)).Cast(Of Integer).ToList()
|
Dim oAllColors = [Enum].GetValues(GetType(Domain.Constants.ColorType)).Cast(Of Integer).ToList()
|
||||||
|
|||||||
@ -20,8 +20,8 @@ Partial Public Class frmFieldEditor
|
|||||||
Private Controller As FieldEditorController
|
Private Controller As FieldEditorController
|
||||||
|
|
||||||
Public Property Document As EnvelopeDocument = Nothing
|
Public Property Document As EnvelopeDocument = Nothing
|
||||||
Public Property Receivers As List(Of EnvelopeReceiver)
|
Public Property Receivers As List(Of Receiver)
|
||||||
Public Property SelectedReceiver As EnvelopeReceiver = Nothing
|
Public Property SelectedReceiver As Receiver = Nothing
|
||||||
|
|
||||||
Private UnsavedChanges As Boolean = False
|
Private UnsavedChanges As Boolean = False
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ Partial Public Class frmFieldEditor
|
|||||||
UnsavedChanges = True
|
UnsavedChanges = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateBarItem(pReceiver As EnvelopeReceiver) As BarItem
|
Private Function CreateBarItem(pReceiver As Receiver) As BarItem
|
||||||
Dim oItem = New BarButtonItem(BarManager1, pReceiver.Name)
|
Dim oItem = New BarButtonItem(BarManager1, pReceiver.Name)
|
||||||
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
||||||
Dim oColorCircle = Helpers.GetColorCircle(oBaseCircle, pReceiver.Color)
|
Dim oColorCircle = Helpers.GetColorCircle(oBaseCircle, pReceiver.Color)
|
||||||
@ -122,7 +122,7 @@ Partial Public Class frmFieldEditor
|
|||||||
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
Private Sub ReceiverItem_Click(sender As Object, e As ItemClickEventArgs)
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
|
|
||||||
Dim oSelectedReceiver As EnvelopeReceiver = e.Item.Tag
|
Dim oSelectedReceiver As Receiver = e.Item.Tag
|
||||||
Dim oCurrentPage = GDViewer.CurrentPage
|
Dim oCurrentPage = GDViewer.CurrentPage
|
||||||
Dim oCurrentPosition = GDViewer.GetVScrollBarPosition()
|
Dim oCurrentPosition = GDViewer.GetVScrollBarPosition()
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ Partial Public Class frmFieldEditor
|
|||||||
Me.ResumeLayout()
|
Me.ResumeLayout()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetReceiver(pReceiver As EnvelopeReceiver)
|
Private Sub SetReceiver(pReceiver As Receiver)
|
||||||
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
Dim oBaseCircle As SvgImage = SvgImageCollection1.Item(0)
|
||||||
|
|
||||||
txtReceiver.Caption = pReceiver.Name
|
txtReceiver.Caption = pReceiver.Name
|
||||||
|
|||||||
@ -318,7 +318,7 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oView As GridView = DirectCast(sender, GridView)
|
Dim oView As GridView = DirectCast(sender, GridView)
|
||||||
Dim oReceiver As EnvelopeReceiver = oView.GetRow(e.RowHandle)
|
Dim oReceiver As Receiver = oView.GetRow(e.RowHandle)
|
||||||
|
|
||||||
If (oReceiver Is Nothing) Then
|
If (oReceiver Is Nothing) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -352,7 +352,7 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oView As GridView = DirectCast(sender, GridView)
|
Dim oView As GridView = DirectCast(sender, GridView)
|
||||||
Dim oReceiver As EnvelopeReceiver = oView.GetRow(e.RowHandle)
|
Dim oReceiver As Receiver = oView.GetRow(e.RowHandle)
|
||||||
|
|
||||||
If (oReceiver Is Nothing) Then
|
If (oReceiver Is Nothing) Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@ -384,7 +384,7 @@ Public Class frmMain
|
|||||||
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
|
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
|
||||||
Dim oView As GridView = GridEnvelopes.FocusedView
|
Dim oView As GridView = GridEnvelopes.FocusedView
|
||||||
If oView.Name = ViewReceivers.Name Then
|
If oView.Name = ViewReceivers.Name Then
|
||||||
Dim oReceiver As EnvelopeReceiver = oView.GetRow(oView.FocusedRowHandle)
|
Dim oReceiver As Receiver = oView.GetRow(oView.FocusedRowHandle)
|
||||||
Dim oEnvelopeTitle As String = Net.WebUtility.UrlEncode(oEnvelope.Title)
|
Dim oEnvelopeTitle As String = Net.WebUtility.UrlEncode(oEnvelope.Title)
|
||||||
Process.Start($"mailto:{oReceiver.Email}?subject={oEnvelopeTitle}")
|
Process.Start($"mailto:{oReceiver.Email}?subject={oEnvelopeTitle}")
|
||||||
Else
|
Else
|
||||||
@ -567,7 +567,7 @@ Public Class frmMain
|
|||||||
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
|
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
|
||||||
Dim oView As GridView = GridEnvelopes.FocusedView
|
Dim oView As GridView = GridEnvelopes.FocusedView
|
||||||
If oView.Name = ViewReceivers.Name Then
|
If oView.Name = ViewReceivers.Name Then
|
||||||
Dim oReceiver As EnvelopeReceiver = oView.GetRow(oView.FocusedRowHandle)
|
Dim oReceiver As Receiver = oView.GetRow(oView.FocusedRowHandle)
|
||||||
Dim mailto As String = "mailto:support-flow@digitaldata.works"
|
Dim mailto As String = "mailto:support-flow@digitaldata.works"
|
||||||
Dim subject As String = Uri.EscapeDataString("signFLOW - Envelope issue - ID: " & oEnvelope.Id)
|
Dim subject As String = Uri.EscapeDataString("signFLOW - Envelope issue - ID: " & oEnvelope.Id)
|
||||||
Dim body As String = Uri.EscapeDataString($"Dear Digital Data Team," & vbCrLf & "There is an error or misbehavin with following envelope and Receiver:" & vbCrLf &
|
Dim body As String = Uri.EscapeDataString($"Dear Digital Data Team," & vbCrLf & "There is an error or misbehavin with following envelope and Receiver:" & vbCrLf &
|
||||||
@ -595,7 +595,7 @@ Public Class frmMain
|
|||||||
|
|
||||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitm_ResendInvitation.ItemClick
|
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitm_ResendInvitation.ItemClick
|
||||||
Dim oView As GridView = GridEnvelopes.FocusedView
|
Dim oView As GridView = GridEnvelopes.FocusedView
|
||||||
Dim selReceiver As EnvelopeReceiver
|
Dim selReceiver As Receiver
|
||||||
If oView.Name = ViewReceivers.Name Then
|
If oView.Name = ViewReceivers.Name Then
|
||||||
selReceiver = oView.GetRow(oView.FocusedRowHandle)
|
selReceiver = oView.GetRow(oView.FocusedRowHandle)
|
||||||
Else
|
Else
|
||||||
@ -608,9 +608,9 @@ Public Class frmMain
|
|||||||
|
|
||||||
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
Dim oController = New EnvelopeEditorController(State, oEnvelope)
|
||||||
Dim Documents As New BindingList(Of EnvelopeDocument)
|
Dim Documents As New BindingList(Of EnvelopeDocument)
|
||||||
Dim Receivers As New BindingList(Of EnvelopeReceiver)
|
Dim Receivers As New BindingList(Of Receiver)
|
||||||
Receivers = New BindingList(Of EnvelopeReceiver)(oController.Envelope.Receivers)
|
Receivers = New BindingList(Of Receiver)(oController.Envelope.Receivers)
|
||||||
For Each oReceiver As EnvelopeReceiver In Receivers
|
For Each oReceiver As Receiver In Receivers
|
||||||
If oReceiver.Email = selReceiver.Email Then
|
If oReceiver.Email = selReceiver.Email Then
|
||||||
If oController.ActionService.ResendReceiver(oEnvelope, oReceiver) = True Then
|
If oController.ActionService.ResendReceiver(oEnvelope, oReceiver) = True Then
|
||||||
Dim oMsg = Resources.Envelope.Invitation_successfully_resend.Replace("@Mail", oReceiver.Email)
|
Dim oMsg = Resources.Envelope.Invitation_successfully_resend.Replace("@Mail", oReceiver.Email)
|
||||||
@ -779,7 +779,7 @@ Public Class frmMain
|
|||||||
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
|
Dim oEnvelope As Envelope = ViewEnvelopes.GetRow(ViewEnvelopes.FocusedRowHandle)
|
||||||
Dim oView As GridView = GridEnvelopes.FocusedView
|
Dim oView As GridView = GridEnvelopes.FocusedView
|
||||||
If oView.Name = ViewReceivers.Name Then
|
If oView.Name = ViewReceivers.Name Then
|
||||||
Dim oReceiver As EnvelopeReceiver = oView.GetRow(oView.FocusedRowHandle)
|
Dim oReceiver As Receiver = oView.GetRow(oView.FocusedRowHandle)
|
||||||
Dim oEnvelopeTitle As String = Net.WebUtility.UrlEncode(oEnvelope.Title)
|
Dim oEnvelopeTitle As String = Net.WebUtility.UrlEncode(oEnvelope.Title)
|
||||||
Dim oDT As DataTable = DB_DD_ECM.GetDatatable($"SELECT * FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{oReceiver.Email}'")
|
Dim oDT As DataTable = DB_DD_ECM.GetDatatable($"SELECT * FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{oReceiver.Email}'")
|
||||||
If Not IsNothing(oDT) Then
|
If Not IsNothing(oDT) Then
|
||||||
|
|||||||
@ -78,7 +78,7 @@ namespace EnvelopeGenerator.Web.Services
|
|||||||
|
|
||||||
_logger.LogInformation("Envelope receivers found: [{0}]", envelope.Receivers.Count);
|
_logger.LogInformation("Envelope receivers found: [{0}]", envelope.Receivers.Count);
|
||||||
|
|
||||||
EnvelopeReceiver? receiver = envelope.Receivers.Where(r => r.Id == receiverId).SingleOrDefault();
|
Receiver? receiver = envelope.Receivers.Where(r => r.Id == receiverId).SingleOrDefault();
|
||||||
|
|
||||||
if (receiver == null)
|
if (receiver == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user