Remove old Common project
This commit is contained in:
parent
946d9c2119
commit
3f4f4681b5
@ -1,6 +0,0 @@
|
|||||||
Imports DigitalData.Modules.Config.ConfigAttributes
|
|
||||||
|
|
||||||
Public Class Config
|
|
||||||
<ConnectionString>
|
|
||||||
Property ConnectionString As String = ""
|
|
||||||
End Class
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
Public Class Constants
|
|
||||||
|
|
||||||
Public Enum EnvelopeStatus
|
|
||||||
Created = 0
|
|
||||||
Saved = 1
|
|
||||||
Sent = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ElementType
|
|
||||||
Signature = 0
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum ElementStatus
|
|
||||||
Created = 0
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
Public Class DbConfig
|
|
||||||
Public Property DocumentPath As String = ""
|
|
||||||
End Class
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
Public Class ElementMetadata
|
|
||||||
Public Property Index As Integer
|
|
||||||
Public Property Page As Integer
|
|
||||||
End Class
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
Imports EnvelopeGenerator.Common.Constants
|
|
||||||
|
|
||||||
Public Class EnvelopeHistoryEntry
|
|
||||||
Public EnvelopeId As Integer
|
|
||||||
Public Status As EnvelopeStatus
|
|
||||||
Public UserEmailAddress As String
|
|
||||||
Public ActionTitle As String
|
|
||||||
Public ActionDescription As String
|
|
||||||
Public AddedWhen As Date
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<RootNamespace>EnvelopeGenerator.Common</RootNamespace>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="NLog" Version="5.0.5" />
|
|
||||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="DigitalData.Modules.Base">
|
|
||||||
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.Modules.Config">
|
|
||||||
<HintPath>..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.Modules.Database">
|
|
||||||
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DigitalData.Modules.Logging">
|
|
||||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="Strings\Envelope.Designer.vb">
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Envelope.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Update="Strings\Envelope.resx">
|
|
||||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
|
||||||
<LastGenOutput>Envelope.Designer.vb</LastGenOutput>
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
Imports DigitalData.Modules.Database
|
|
||||||
Imports DigitalData.Modules.Logging
|
|
||||||
Imports System.Data
|
|
||||||
|
|
||||||
Public MustInherit Class BaseModel
|
|
||||||
Protected Database As MSSQLServer
|
|
||||||
Protected Logger As Logger
|
|
||||||
Protected State As State
|
|
||||||
|
|
||||||
Public Sub New(pState As State)
|
|
||||||
Logger = pState.LogConfig.GetLogger()
|
|
||||||
Database = pState.Database
|
|
||||||
State = pState
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
Imports System.Data
|
|
||||||
Imports DigitalData.Modules.Base
|
|
||||||
Public Class DocumentModel
|
|
||||||
Inherits BaseModel
|
|
||||||
|
|
||||||
Public Sub New(pState As State)
|
|
||||||
MyBase.New(pState)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Function ToDocument(pRow As DataRow) As EnvelopeDocument
|
|
||||||
Return New EnvelopeDocument() With {
|
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
|
||||||
.EnvelopeId = pRow.ItemEx("ENVELOPE_ID", 0),
|
|
||||||
.FileInfo = New IO.FileInfo(pRow.ItemEx("FILEPATH", "")),
|
|
||||||
.IsTempFile = False
|
|
||||||
}
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function List(pEnvelopeId As Integer) As IEnumerable(Of EnvelopeDocument)
|
|
||||||
Try
|
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE_DOCUMENT] WHERE ENVELOPE_ID = {pEnvelopeId}"
|
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
|
||||||
|
|
||||||
Return oTable?.Rows.Cast(Of DataRow).
|
|
||||||
Select(AddressOf ToDocument).
|
|
||||||
ToList()
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
Imports System.Data
|
|
||||||
Imports DigitalData.Modules.Base
|
|
||||||
|
|
||||||
Public Class ElementModel
|
|
||||||
Inherits BaseModel
|
|
||||||
|
|
||||||
Public Sub New(pState As State)
|
|
||||||
MyBase.New(pState)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Function ToElement(pRow As DataRow) As EnvelopeDocumentElement
|
|
||||||
Return New EnvelopeDocumentElement() With {
|
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
|
||||||
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
|
|
||||||
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
|
|
||||||
.ElementType = [Enum].Parse(GetType(Constants.ElementType), pRow.ItemEx("ELEMENT_TYPE", Constants.ElementType.Signature.ToString)),
|
|
||||||
.X = pRow.ItemEx("POSITION_X", 0.0),
|
|
||||||
.Y = pRow.ItemEx("POSITION_Y", 0.0),
|
|
||||||
.Width = pRow.ItemEx("WIDTH", 0.0),
|
|
||||||
.Height = pRow.ItemEx("HEIGHT", 0.0),
|
|
||||||
.Page = pRow.ItemEx("PAGE", 0),
|
|
||||||
.AnnotationIndex = pRow.ItemEx("ANNOTATION_INDEX", 0)
|
|
||||||
}
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function ElementsExist(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql = $"SELECT COUNT(*) FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] T
|
|
||||||
JOIN TBSIG_ENVELOPE_DOCUMENT T2 ON T.DOCUMENT_ID = T2.GUID
|
|
||||||
WHERE T.RECEIVER_ID = {pReceiverId} AND T2.ENVELOPE_ID = {pEnvelopeId}"
|
|
||||||
Dim oElementCount As Integer = Database.GetScalarValue(oSql)
|
|
||||||
|
|
||||||
Return oElementCount > 0
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function List(pDocumentId As Integer) As List(Of EnvelopeDocumentElement)
|
|
||||||
Try
|
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC, ANNOTATION_INDEX ASC"
|
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
|
||||||
|
|
||||||
Return oTable?.Rows.Cast(Of DataRow).
|
|
||||||
Select(AddressOf ToElement).
|
|
||||||
ToList()
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
Imports System.Data.SqlClient
|
|
||||||
Imports DigitalData.Modules.Logging
|
|
||||||
Imports DigitalData.Modules.Base
|
|
||||||
Imports System.Data
|
|
||||||
|
|
||||||
Public Class EnvelopeModel
|
|
||||||
Inherits BaseModel
|
|
||||||
|
|
||||||
Public Sub New(pState As State)
|
|
||||||
MyBase.New(pState)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Function ToEnvelope(pRow As DataRow) As Envelope
|
|
||||||
Dim oEnvelope = New Envelope() With {
|
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
|
||||||
.Uuid = pRow.ItemEx("ENVELOPE_UUID", ""),
|
|
||||||
.Subject = pRow.ItemEx("SUBJECT", ""),
|
|
||||||
.Message = pRow.ItemEx("MESSAGE", ""),
|
|
||||||
.UserId = State.UserId,
|
|
||||||
.Status = ObjectEx.ToEnum(Of Constants.EnvelopeStatus)(pRow.ItemEx("STATUS", "Created"))
|
|
||||||
}
|
|
||||||
|
|
||||||
Return oEnvelope
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function List() As IEnumerable(Of Envelope)
|
|
||||||
Try
|
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE USER_ID = {State.UserId}"
|
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
|
||||||
|
|
||||||
Return oTable?.Rows.Cast(Of DataRow).
|
|
||||||
Select(AddressOf ToEnvelope).
|
|
||||||
ToList()
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Insert(pEnvelope As Envelope) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE] (SUBJECT, MESSAGE, ENVELOPE_UUID, STATUS, USER_ID) VALUES (@SUBJECT, @MESSAGE, @UUID, @STATUS, @USER_ID)"
|
|
||||||
Dim oCommand As New SqlCommand(oSql)
|
|
||||||
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = String.Empty
|
|
||||||
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = String.Empty
|
|
||||||
oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
|
|
||||||
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = Constants.EnvelopeStatus.Created
|
|
||||||
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
|
||||||
|
|
||||||
If Database.ExecuteNonQuery(oCommand) Then
|
|
||||||
pEnvelope.Id = GetEnvelopeId(pEnvelope)
|
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Update(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET [SUBJECT] = @SUBJECT, [MESSAGE] = @MESSAGE, [STATUS] = @STATUS WHERE GUID = @ID AND USER_ID = @USER_ID"
|
|
||||||
Dim oCommand As New SqlCommand(oSql)
|
|
||||||
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = pEnvelope.Subject
|
|
||||||
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pEnvelope.Message
|
|
||||||
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = pEnvelope.Status
|
|
||||||
|
|
||||||
oCommand.Parameters.Add("ID", SqlDbType.Int).Value = pEnvelope.Id
|
|
||||||
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
|
||||||
|
|
||||||
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Delete(pEnvelope As Envelope) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql = $"DELETE FROM [dbo].[TBSIG_ENVELOPE] WHERE GUID = {pEnvelope.Id}"
|
|
||||||
Return Database.ExecuteNonQuery(oSql)
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Return False
|
|
||||||
Logger.Error(ex)
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetEnvelopeId(pEnvelope As Envelope) As Integer
|
|
||||||
Try
|
|
||||||
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_ENVELOPE WHERE USER_ID = {pEnvelope.UserId}")
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
Imports System.Data
|
|
||||||
Imports System.Data.SqlClient
|
|
||||||
|
|
||||||
Public Class HistoryModel
|
|
||||||
Inherits BaseModel
|
|
||||||
|
|
||||||
Public Sub New(pState As State)
|
|
||||||
MyBase.New(pState)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Function Insert(pHistory As EnvelopeHistoryEntry) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY]
|
|
||||||
([ENVELOPE_ID]
|
|
||||||
,[STATUS]
|
|
||||||
,[USER_EMAIL_ADDRESS]
|
|
||||||
,[ACTION_TITLE]
|
|
||||||
,[ACTION_DESCRIPTION])
|
|
||||||
VALUES
|
|
||||||
(@ENVELOPE_ID
|
|
||||||
,@STATUS
|
|
||||||
,@EMAIL
|
|
||||||
,@TITLE
|
|
||||||
,@DESCRIPTION"
|
|
||||||
|
|
||||||
Dim oCommand As New SqlCommand(oSql)
|
|
||||||
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pHistory.EnvelopeId
|
|
||||||
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = pHistory.Status
|
|
||||||
oCommand.Parameters.Add("EMAIL", SqlDbType.NVarChar).Value = pHistory.UserEmailAddress
|
|
||||||
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pHistory.ActionTitle
|
|
||||||
oCommand.Parameters.Add("DESCRIPTION", SqlDbType.NVarChar).Value = pHistory.ActionDescription
|
|
||||||
|
|
||||||
If Database.ExecuteNonQuery(oCommand) Then
|
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
Imports System.Data
|
|
||||||
Imports System.Data.Common
|
|
||||||
Imports System.Data.SqlClient
|
|
||||||
Imports DigitalData.Modules.Base
|
|
||||||
Public Class ReceiverModel
|
|
||||||
Inherits BaseModel
|
|
||||||
|
|
||||||
Public Sub New(pState As State)
|
|
||||||
MyBase.New(pState)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Function ToReceiver(pRow As DataRow) As EnvelopeReceiver
|
|
||||||
Return New EnvelopeReceiver() With {
|
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
|
||||||
.Email = pRow.ItemEx("EMAIL_ADDRESS", ""),
|
|
||||||
.Name = pRow.ItemEx("NAME", ""),
|
|
||||||
.Sequence = pRow.ItemEx("SEQUENCE", 0)
|
|
||||||
}
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function TestReceiverExists(pReceiver As EnvelopeReceiver) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oGuid = Database.GetScalarValue($"SELECT COALESCE(GUID, 0) FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pReceiver.Email}'")
|
|
||||||
pReceiver.Id = oGuid
|
|
||||||
Return oGuid > 0
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Insert(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql As String = "INSERT INTO [dbo].[TBSIG_RECEIVER]
|
|
||||||
([EMAIL_ADDRESS]
|
|
||||||
,[SIGNATURE])
|
|
||||||
VALUES
|
|
||||||
(@EMAIL
|
|
||||||
,@SIGNATURE)"
|
|
||||||
|
|
||||||
Dim oCommand = New SqlCommand(oSql)
|
|
||||||
oCommand.Parameters.Add("EMAIL", SqlDbType.NVarChar).Value = pReceiver.Email
|
|
||||||
oCommand.Parameters.Add("SIGNATURE", SqlDbType.NVarChar).Value = pReceiver.Signature
|
|
||||||
|
|
||||||
Dim oResult = Database.ExecuteNonQuery(oCommand, pTransaction)
|
|
||||||
If oResult = True Then
|
|
||||||
pReceiver.Id = GetReceiverId(pReceiver.Email, pTransaction)
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
|
|
||||||
Return True
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Update(pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql As String = "UPDATE [dbo].[TBSIG_USER_RECEIVER]
|
|
||||||
SET [NAME] = @NAME
|
|
||||||
,[COMPANY_NAME] = @COMPANY
|
|
||||||
,[JOB_TITLE] = @JOB
|
|
||||||
WHERE RECEIVER_ID = @RECEIVER_ID"
|
|
||||||
|
|
||||||
Dim oCommand = New SqlCommand(oSql)
|
|
||||||
oCommand.Parameters.Add("NAME", SqlDbType.NVarChar).Value = pReceiver.Name
|
|
||||||
oCommand.Parameters.Add("COMPANY", SqlDbType.NVarChar).Value = pReceiver.Company
|
|
||||||
oCommand.Parameters.Add("JOB", SqlDbType.NVarChar).Value = pReceiver.JobTitle
|
|
||||||
oCommand.Parameters.Add("RECEIVER_ID", SqlDbType.Int).Value = pReceiver.Id
|
|
||||||
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pReceiver.Id
|
|
||||||
|
|
||||||
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Unassign(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
|
|
||||||
Try
|
|
||||||
Return Database.ExecuteNonQuery($"DELETE FROM [dbo].[TBSIG_ENVELOPE_RECEIVER] WHERE [ENVELOPE_ID] = {pEnvelope.Id}", pTransaction)
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Assign(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pTransaction As SqlTransaction) As Boolean
|
|
||||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_RECEIVER]
|
|
||||||
([ENVELOPE_ID]
|
|
||||||
,[RECEIVER_ID]
|
|
||||||
,[PRIVATE_MESSAGE]
|
|
||||||
,[ACCESS_CODE]
|
|
||||||
,[NAME]
|
|
||||||
,[JOB_TITLE]
|
|
||||||
,[COMPANY_NAME]
|
|
||||||
,[SEQUENCE])
|
|
||||||
VALUES
|
|
||||||
(@ENVELOPE_ID
|
|
||||||
,@RECEIVER_ID
|
|
||||||
,@MESSAGE
|
|
||||||
,@ACCESS_CODE
|
|
||||||
,@NAME
|
|
||||||
,@JOB
|
|
||||||
,@COMPANY
|
|
||||||
,@SEQUENCE)"
|
|
||||||
|
|
||||||
Dim oCommand As New SqlCommand(oSql)
|
|
||||||
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.NVarChar).Value = pEnvelope.Id
|
|
||||||
oCommand.Parameters.Add("RECEIVER_ID", SqlDbType.NVarChar).Value = pReceiver.Id
|
|
||||||
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pReceiver.PrivateMessage
|
|
||||||
oCommand.Parameters.Add("ACCESS_CODE", SqlDbType.NVarChar).Value = pReceiver.AccessCode
|
|
||||||
oCommand.Parameters.Add("NAME", SqlDbType.NVarChar).Value = pReceiver.Name
|
|
||||||
oCommand.Parameters.Add("JOB", SqlDbType.NVarChar).Value = pReceiver.JobTitle
|
|
||||||
oCommand.Parameters.Add("COMPANY", SqlDbType.NVarChar).Value = pReceiver.Company
|
|
||||||
oCommand.Parameters.Add("SEQUENCE", SqlDbType.NVarChar).Value = pReceiver.Sequence
|
|
||||||
|
|
||||||
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function List(pEnvelopeId As Integer) As IEnumerable(Of EnvelopeReceiver)
|
|
||||||
Try
|
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE ENVELOPE_ID = {pEnvelopeId}"
|
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
|
||||||
|
|
||||||
Return oTable?.Rows.Cast(Of DataRow).
|
|
||||||
Select(AddressOf ToReceiver).
|
|
||||||
ToList()
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function Delete(pReceiverId As Integer, pDocumentId As Integer) As Boolean
|
|
||||||
Try
|
|
||||||
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER WHERE RECEIVER_ID = {pReceiverId} AND DOCUMENT_ID = {pDocumentId}"
|
|
||||||
Return Database.ExecuteNonQuery(oSql)
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetReceiverId(pEmailAddress As String, pTransaction As SqlTransaction) As Integer
|
|
||||||
Try
|
|
||||||
Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pEmailAddress}'", pTransaction)
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
'------------------------------------------------------------------------------
|
|
||||||
' <auto-generated>
|
|
||||||
' Dieser Code wurde von einem Tool generiert.
|
|
||||||
' Laufzeitversion:4.0.30319.42000
|
|
||||||
'
|
|
||||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
|
||||||
' der Code erneut generiert wird.
|
|
||||||
' </auto-generated>
|
|
||||||
'------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Option Strict On
|
|
||||||
Option Explicit On
|
|
||||||
|
|
||||||
Imports System
|
|
||||||
|
|
||||||
Namespace My.Resources
|
|
||||||
|
|
||||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
|
||||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
|
||||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
|
||||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
|
||||||
'''<summary>
|
|
||||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
|
||||||
'''</summary>
|
|
||||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
|
||||||
Friend Class Envelope
|
|
||||||
|
|
||||||
Private Shared resourceMan As Global.System.Resources.ResourceManager
|
|
||||||
|
|
||||||
Private Shared resourceCulture As Global.System.Globalization.CultureInfo
|
|
||||||
|
|
||||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
|
||||||
Friend Sub New()
|
|
||||||
MyBase.New
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
|
||||||
'''</summary>
|
|
||||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
|
||||||
Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
|
||||||
Get
|
|
||||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
|
||||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EnvelopeGenerator.Common.Envelope", GetType(Envelope).Assembly)
|
|
||||||
resourceMan = temp
|
|
||||||
End If
|
|
||||||
Return resourceMan
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
|
||||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
|
||||||
'''</summary>
|
|
||||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
|
||||||
Friend Shared Property Culture() As Global.System.Globalization.CultureInfo
|
|
||||||
Get
|
|
||||||
Return resourceCulture
|
|
||||||
End Get
|
|
||||||
Set
|
|
||||||
resourceCulture = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Empfänger {0} hat keine gültige Email Addresse. ähnelt.
|
|
||||||
'''</summary>
|
|
||||||
Friend Shared ReadOnly Property Invalid_Email_Address() As String
|
|
||||||
Get
|
|
||||||
Return ResourceManager.GetString("Invalid Email Address", resourceCulture)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Documents ähnelt.
|
|
||||||
'''</summary>
|
|
||||||
Friend Shared ReadOnly Property Missing_Documents() As String
|
|
||||||
Get
|
|
||||||
Return ResourceManager.GetString("Missing Documents", resourceCulture)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Message ähnelt.
|
|
||||||
'''</summary>
|
|
||||||
Friend Shared ReadOnly Property Missing_Message() As String
|
|
||||||
Get
|
|
||||||
Return ResourceManager.GetString("Missing Message", resourceCulture)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Receivers ähnelt.
|
|
||||||
'''</summary>
|
|
||||||
Friend Shared ReadOnly Property Missing_Receivers() As String
|
|
||||||
Get
|
|
||||||
Return ResourceManager.GetString("Missing Receivers", resourceCulture)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Subject ähnelt.
|
|
||||||
'''</summary>
|
|
||||||
Friend Shared ReadOnly Property Missing_Subject() As String
|
|
||||||
Get
|
|
||||||
Return ResourceManager.GetString("Missing Subject", resourceCulture)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
End Class
|
|
||||||
End Namespace
|
|
||||||
@ -1,135 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<data name="Invalid Email Address" xml:space="preserve">
|
|
||||||
<value>Empfänger {0} hat keine gültige Email Addresse.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Missing Documents" xml:space="preserve">
|
|
||||||
<value>Missing Documents</value>
|
|
||||||
</data>
|
|
||||||
<data name="Missing Message" xml:space="preserve">
|
|
||||||
<value>Missing Message</value>
|
|
||||||
</data>
|
|
||||||
<data name="Missing Receivers" xml:space="preserve">
|
|
||||||
<value>Missing Receivers</value>
|
|
||||||
</data>
|
|
||||||
<data name="Missing Subject" xml:space="preserve">
|
|
||||||
<value>Missing Subject</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user