2023-08-07
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
Imports DigitalData.Modules.Config.ConfigAttributes
|
||||
|
||||
Public Class Config
|
||||
<ConnectionString>
|
||||
Property ConnectionString As String = ""
|
||||
End Class
|
||||
@@ -1,16 +0,0 @@
|
||||
Public Class Constants
|
||||
|
||||
Public Enum EnvelopeStatus
|
||||
Created = 0
|
||||
Saved = 1
|
||||
End Enum
|
||||
|
||||
Public Enum ElementType
|
||||
Signature = 0
|
||||
End Enum
|
||||
|
||||
Public Enum ElementStatus
|
||||
Created = 0
|
||||
End Enum
|
||||
|
||||
End Class
|
||||
@@ -5,6 +5,7 @@ Imports System.Runtime.Remoting.Messaging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common
|
||||
Imports EnvelopeGenerator.Form.My.Resources
|
||||
|
||||
Public Class EnvelopeEditorController
|
||||
@@ -66,7 +67,7 @@ Public Class EnvelopeEditorController
|
||||
Dim oTransaction = oConnection.BeginTransaction(IsolationLevel.ReadUncommitted)
|
||||
|
||||
Try
|
||||
pEnvelope.Status = Constants.EnvelopeStatus.Saved
|
||||
pEnvelope.Status = Common.Constants.EnvelopeStatus.Created
|
||||
|
||||
If SaveEnvelopeDocumentsToFilesystem(pEnvelope) = False Then
|
||||
Throw New ApplicationException
|
||||
@@ -97,7 +98,7 @@ Public Class EnvelopeEditorController
|
||||
End Function
|
||||
|
||||
Public Function CleanupEnvelope() As Boolean
|
||||
If Envelope.Status = Constants.EnvelopeStatus.Created Then
|
||||
If Envelope.Status = Common.Constants.EnvelopeStatus.Created Then
|
||||
'TODO: Delete Documents and Receivers and elements
|
||||
Return EnvelopeModel.Delete(Envelope)
|
||||
|
||||
@@ -171,7 +172,7 @@ Public Class EnvelopeEditorController
|
||||
Return oEnvelopePath
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.error(ex)
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports EnvelopeGenerator.Common
|
||||
|
||||
Public Class EnvelopeListController
|
||||
Inherits BaseClass
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports DevExpress.Utils.CommonDialogs
|
||||
Imports DevExpress.XtraBars.Docking2010.Views.NativeMdi
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports EnvelopeGenerator.Common
|
||||
Imports GdPicture14.Annotations
|
||||
|
||||
Public Class FieldEditorController
|
||||
@@ -36,7 +37,7 @@ Public Class FieldEditorController
|
||||
oELement.Y = pAnnotation.Top
|
||||
Else
|
||||
Elements.Add(New EnvelopeDocumentElement() With {
|
||||
.ElementType = Constants.ElementType.Signature.ToString,
|
||||
.ElementType = Common.Constants.ElementType.Signature.ToString,
|
||||
.Height = pAnnotation.Height,
|
||||
.Width = pAnnotation.Width,
|
||||
.X = pAnnotation.Left,
|
||||
|
||||
@@ -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,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
|
||||
@@ -102,18 +102,9 @@
|
||||
<Import Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Config.vb" />
|
||||
<Compile Include="Constants.vb" />
|
||||
<Compile Include="Controllers\EnvelopeEditorController.vb" />
|
||||
<Compile Include="Controllers\EnvelopeListController.vb" />
|
||||
<Compile Include="Controllers\FieldEditorController.vb" />
|
||||
<Compile Include="DbConfig.vb" />
|
||||
<Compile Include="Entities\ElementMetadata.vb" />
|
||||
<Compile Include="Entities\Envelope.vb" />
|
||||
<Compile Include="Entities\EnvelopeDocument.vb" />
|
||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||
<Compile Include="Entities\State.vb" />
|
||||
<Compile Include="frmEnvelopeEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -132,22 +123,12 @@
|
||||
<Compile Include="frmMain.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Models\BaseModel.vb" />
|
||||
<Compile Include="Models\DocumentModel.vb" />
|
||||
<Compile Include="Models\ElementModel.vb" />
|
||||
<Compile Include="Models\EnvelopeModel.vb" />
|
||||
<Compile Include="Models\ReceiverModel.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="Strings\Envelope.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Envelope.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="frmEnvelopeEditor.resx">
|
||||
<DependentUpon>frmEnvelopeEditor.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -168,11 +149,6 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Strings\Envelope.resx">
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Envelope.Designer.vb</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\DataSources\EnvelopeReceiver.datasource" />
|
||||
<None Include="My Project\DataSources\frmEditor.datasource" />
|
||||
<None Include="My Project\Settings.settings">
|
||||
@@ -198,6 +174,12 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj">
|
||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
||||
<Name>EnvelopeGenerator.Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
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,32 +0,0 @@
|
||||
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,55 +0,0 @@
|
||||
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,101 +0,0 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
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,159 +0,0 @@
|
||||
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
|
||||
' TODO: Update ENVELOPE_RECEIVER instead
|
||||
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
|
||||
112
EnvelopeGenerator.Form/Strings/Envelope.Designer.vb
generated
112
EnvelopeGenerator.Form/Strings/Envelope.Designer.vb
generated
@@ -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.Form.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>
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common
|
||||
|
||||
Partial Public Class frmEnvelopeEditor
|
||||
Public Property Envelope As Envelope
|
||||
|
||||
@@ -3,6 +3,7 @@ Imports System.Text
|
||||
Imports DevExpress.Utils.Svg
|
||||
Imports DevExpress.XtraBars
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common
|
||||
Imports GdPicture14
|
||||
Imports GdPicture14.Annotations
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports EnvelopeGenerator.Common
|
||||
|
||||
Public Class frmMain
|
||||
Private LogConfig As LogConfig
|
||||
|
||||
Reference in New Issue
Block a user