2023-08-07
This commit is contained in:
4
EnvelopeGenerator.Common/Entities/ElementMetadata.vb
Normal file
4
EnvelopeGenerator.Common/Entities/ElementMetadata.vb
Normal file
@@ -0,0 +1,4 @@
|
||||
Public Class ElementMetadata
|
||||
Public Property Index As Integer
|
||||
Public Property Page As Integer
|
||||
End Class
|
||||
48
EnvelopeGenerator.Common/Entities/Envelope.vb
Normal file
48
EnvelopeGenerator.Common/Entities/Envelope.vb
Normal file
@@ -0,0 +1,48 @@
|
||||
Public Class Envelope
|
||||
Public Property Id As Integer = 0
|
||||
Public Property Subject As String
|
||||
Public Property Message As String
|
||||
Public Property UserId As Integer
|
||||
Public Property Uuid As String = Guid.NewGuid.ToString()
|
||||
Public Property Status As Constants.EnvelopeStatus
|
||||
|
||||
Public Property Documents As New List(Of EnvelopeDocument)
|
||||
Public Property Receivers As New List(Of EnvelopeReceiver)
|
||||
|
||||
Public Function Validate() As List(Of String)
|
||||
Dim oErrors As New List(Of String)
|
||||
|
||||
If String.IsNullOrWhiteSpace(Subject) Then
|
||||
oErrors.Add(My.Resources.Envelope.Missing_Subject)
|
||||
End If
|
||||
|
||||
If String.IsNullOrWhiteSpace(Message) Then
|
||||
oErrors.Add(My.Resources.Envelope.Missing_Message)
|
||||
End If
|
||||
|
||||
If Documents.Count = 0 Then
|
||||
oErrors.Add(My.Resources.Envelope.Missing_Documents)
|
||||
End If
|
||||
|
||||
If Receivers.Count = 0 Then
|
||||
oErrors.Add(My.Resources.Envelope.Missing_Receivers)
|
||||
End If
|
||||
|
||||
For Each Receiver In Receivers
|
||||
If IsValidEmailAddress(Receiver.Email) = False Then
|
||||
oErrors.Add(String.Format(My.Resources.Envelope.Invalid_Email_Address, Receiver.Name))
|
||||
End If
|
||||
Next
|
||||
|
||||
Return oErrors
|
||||
End Function
|
||||
|
||||
Private Function IsValidEmailAddress(pEmailAddress As String) As Boolean
|
||||
Try
|
||||
Dim oAddress = New System.Net.Mail.MailAddress(pEmailAddress)
|
||||
Return oAddress.Address = pEmailAddress
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
23
EnvelopeGenerator.Common/Entities/EnvelopeDocument.vb
Normal file
23
EnvelopeGenerator.Common/Entities/EnvelopeDocument.vb
Normal file
@@ -0,0 +1,23 @@
|
||||
Imports System.IO
|
||||
|
||||
Public Class EnvelopeDocument
|
||||
Public Property Id As Integer
|
||||
|
||||
Public Property FileInfo As FileInfo
|
||||
|
||||
Public Property IsTempFile As Boolean = True
|
||||
|
||||
Public Property EnvelopeId As Integer = 0
|
||||
|
||||
Public ReadOnly Property Filename As String
|
||||
Get
|
||||
Return FileInfo.Name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Filepath As String
|
||||
Get
|
||||
Return FileInfo.FullName
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
15
EnvelopeGenerator.Common/Entities/EnvelopeDocumentElement.vb
Normal file
15
EnvelopeGenerator.Common/Entities/EnvelopeDocumentElement.vb
Normal file
@@ -0,0 +1,15 @@
|
||||
Public Class EnvelopeDocumentElement
|
||||
Public Property Id As Integer = 0
|
||||
Public Property X As Double
|
||||
Public Property Y As Double
|
||||
Public Property Width As Double
|
||||
Public Property Height As Double
|
||||
Public Property ElementType As String
|
||||
Public Property DocumentId As Integer
|
||||
Public Property ReceiverId As Integer
|
||||
Public Property Required As Boolean = False
|
||||
Public Property [ReadOnly] As Boolean = False
|
||||
Public Property Page As Integer = 1
|
||||
Public Property Status As Constants.ElementStatus = Constants.ElementStatus.Created
|
||||
Public Property AnnotationIndex As Integer
|
||||
End Class
|
||||
10
EnvelopeGenerator.Common/Entities/EnvelopeHistoryEntry.vb
Normal file
10
EnvelopeGenerator.Common/Entities/EnvelopeHistoryEntry.vb
Normal file
@@ -0,0 +1,10 @@
|
||||
Public Class EnvelopeHistoryEntry
|
||||
Public EnvelopeId As Integer
|
||||
Public Status As Constants.EnvelopeStatus
|
||||
Public UserEmailAddress As String
|
||||
Public ActionTitle As String
|
||||
Public ActionDescription As String
|
||||
Public AddedWhen As Date
|
||||
|
||||
|
||||
End Class
|
||||
26
EnvelopeGenerator.Common/Entities/EnvelopeReceiver.vb
Normal file
26
EnvelopeGenerator.Common/Entities/EnvelopeReceiver.vb
Normal file
@@ -0,0 +1,26 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Public Class EnvelopeReceiver
|
||||
Public Property Id As Integer
|
||||
Public Property UserId As Integer
|
||||
|
||||
Public Property Name As String
|
||||
Public Property Company As String = ""
|
||||
Public Property JobTitle As String = ""
|
||||
|
||||
Public Property Email As String
|
||||
Public ReadOnly Property Signature As String
|
||||
Get
|
||||
Return StringEx.GetChecksum(Email.ToUpper)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property HasId As Boolean
|
||||
Get
|
||||
Return Id > 0
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Sequence As Integer = 0
|
||||
Public Property PrivateMessage As String = ""
|
||||
Public Property AccessCode As String = ""
|
||||
End Class
|
||||
10
EnvelopeGenerator.Common/Entities/State.vb
Normal file
10
EnvelopeGenerator.Common/Entities/State.vb
Normal file
@@ -0,0 +1,10 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class State
|
||||
Public Property UserId As Integer
|
||||
Public Property Config As Config
|
||||
Public Property DbConfig As DbConfig
|
||||
Public Property LogConfig As LogConfig
|
||||
Public Property Database As MSSQLServer
|
||||
End Class
|
||||
Reference in New Issue
Block a user