feat(ReceiverVM): add From method to be able to generate from EnvelopeReceiver
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Net.Mail
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
|
||||
Imports EnvelopeGenerator.Domain.Constants
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
|
||||
@@ -2,102 +2,119 @@
|
||||
Imports EnvelopeGenerator.Domain
|
||||
Imports EnvelopeGenerator.Domain.Entities
|
||||
|
||||
Namespace EnvelopeGenerator.Domain.Entities
|
||||
''' <summary>
|
||||
''' Handles the combination of the envelope and receiver for common services and submodules as a view model.
|
||||
''' </summary>
|
||||
Public Class ReceiverVM
|
||||
Inherits EnvelopeReceiver
|
||||
''' <summary>
|
||||
''' Handles the combination of the envelope and receiver for common services and submodules as a view model.
|
||||
''' </summary>
|
||||
Public Class ReceiverVM
|
||||
Inherits EnvelopeReceiver
|
||||
|
||||
Private ReadOnly Property SReceiver As Receiver
|
||||
Get
|
||||
If Receiver Is Nothing Then
|
||||
Receiver = New Receiver()
|
||||
End If
|
||||
Return Receiver
|
||||
End Get
|
||||
End Property
|
||||
Public Shared Function From(source As EnvelopeReceiver) As ReceiverVM
|
||||
Return New ReceiverVM() With {
|
||||
.EnvelopeId = source.EnvelopeId,
|
||||
.ReceiverId = source.ReceiverId,
|
||||
.Sequence = source.Sequence,
|
||||
.Name = source.Name,
|
||||
.JobTitle = source.JobTitle,
|
||||
.CompanyName = source.CompanyName,
|
||||
.PrivateMessage = source.PrivateMessage,
|
||||
.AccessCode = source.AccessCode,
|
||||
.AddedWhen = source.AddedWhen,
|
||||
.ChangedWhen = source.ChangedWhen,
|
||||
.PhoneNumber = source.PhoneNumber,
|
||||
.Company = source.Company,
|
||||
.Status = source.Status,
|
||||
.Envelope = source.Envelope,
|
||||
.Receiver = source.Receiver
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Property Id As Integer
|
||||
Get
|
||||
Return SReceiver.Id
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
SReceiver.Id = value
|
||||
End Set
|
||||
End Property
|
||||
Private ReadOnly Property SReceiver As Receiver
|
||||
Get
|
||||
If Receiver Is Nothing Then
|
||||
Receiver = New Receiver()
|
||||
End If
|
||||
Return Receiver
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property EmailAddress As String
|
||||
Get
|
||||
Return SReceiver.EmailAddress
|
||||
End Get
|
||||
Set(value As String)
|
||||
SReceiver.EmailAddress = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Id As Integer
|
||||
Get
|
||||
Return SReceiver.Id
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
SReceiver.Id = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Signature As String
|
||||
Get
|
||||
Return SReceiver.Signature
|
||||
End Get
|
||||
Set(value As String)
|
||||
SReceiver.Signature = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EmailAddress As String
|
||||
Get
|
||||
Return SReceiver.EmailAddress
|
||||
End Get
|
||||
Set(value As String)
|
||||
SReceiver.EmailAddress = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AddedWhen As DateTime
|
||||
Get
|
||||
Return SReceiver.AddedWhen
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
SReceiver.AddedWhen = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Signature As String
|
||||
Get
|
||||
Return SReceiver.Signature
|
||||
End Get
|
||||
Set(value As String)
|
||||
SReceiver.Signature = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TotpSecretkey As String
|
||||
Get
|
||||
Return SReceiver.TotpSecretkey
|
||||
End Get
|
||||
Set(value As String)
|
||||
SReceiver.TotpSecretkey = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property AddedWhen As DateTime
|
||||
Get
|
||||
Return SReceiver.AddedWhen
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
SReceiver.AddedWhen = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TfaRegDeadline As DateTime?
|
||||
Get
|
||||
Return SReceiver.TfaRegDeadline
|
||||
End Get
|
||||
Set(value As DateTime?)
|
||||
SReceiver.TfaRegDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property TotpSecretkey As String
|
||||
Get
|
||||
Return SReceiver.TotpSecretkey
|
||||
End Get
|
||||
Set(value As String)
|
||||
SReceiver.TotpSecretkey = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TfaRegDeadline As DateTime?
|
||||
Get
|
||||
Return SReceiver.TfaRegDeadline
|
||||
End Get
|
||||
Set(value As DateTime?)
|
||||
SReceiver.TfaRegDeadline = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Model of old service"
|
||||
Public Property SignedDate As DateTime = DateTime.MinValue
|
||||
Public Property SignedDate As DateTime = DateTime.MinValue
|
||||
|
||||
Public Property ColorType As Constants.ColorType
|
||||
Public Property ColorType As Constants.ColorType
|
||||
|
||||
Public ReadOnly Property SignedDateDisplayValue As String
|
||||
Get
|
||||
If SignedDate = DateTime.MinValue Then
|
||||
Return "-"
|
||||
Else
|
||||
Return SignedDate.ToString("G")
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SignedDateDisplayValue As String
|
||||
Get
|
||||
If SignedDate = DateTime.MinValue Then
|
||||
Return "-"
|
||||
Else
|
||||
Return SignedDate.ToString("G")
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Color As Color
|
||||
Get
|
||||
Return ColorType.ToColor()
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Color As Color
|
||||
Get
|
||||
Return ColorType.ToColor()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function GetSignature() As String
|
||||
Return Receiver.GetSignature()
|
||||
End Function
|
||||
Public Function GetSignature() As String
|
||||
Return Receiver.GetSignature()
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user