23-08-23
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||
<Compile Include="Entities\State.vb" />
|
||||
<Compile Include="Entities\User.vb" />
|
||||
<Compile Include="Helpers.vb" />
|
||||
<Compile Include="Models\BaseModel.vb" />
|
||||
<Compile Include="Models\DocumentModel.vb" />
|
||||
<Compile Include="Models\ElementModel.vb" />
|
||||
@@ -125,7 +126,11 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Strings\Envelope.Designer.vb" />
|
||||
<Compile Include="Strings\Envelope1.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Envelope.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
@@ -134,7 +139,11 @@
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings\Envelope.resx" />
|
||||
<EmbeddedResource Include="Strings\Envelope.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Envelope1.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
|
||||
13
EnvelopeGenerator.Common/Helpers.vb
Normal file
13
EnvelopeGenerator.Common/Helpers.vb
Normal file
@@ -0,0 +1,13 @@
|
||||
Public Class Helpers
|
||||
Public Shared Function EncodeEnvelopeReceiverId(pEnvelopeUuid As String, pReceiverSignature As String) As String
|
||||
Dim oString = $"{pEnvelopeUuid}::{pReceiverSignature}"
|
||||
'TODO: Verschlüsseln
|
||||
Return oString
|
||||
End Function
|
||||
|
||||
Public Shared Function DecodeEnvelopeReceiverId(pEnvelopeReceiverId As String) As Tuple(Of String, String)
|
||||
Dim oSplit = pEnvelopeReceiverId.Split("::")
|
||||
'TODO: Entschlüsseln
|
||||
Return New Tuple(Of String, String)(oSplit(0), oSplit(1))
|
||||
End Function
|
||||
End Class
|
||||
@@ -38,6 +38,21 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ElementsExist(pEnvelopeId 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 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"
|
||||
|
||||
@@ -37,6 +37,25 @@ Public Class EnvelopeModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Send(pEnvelope As Envelope) As Boolean
|
||||
Try
|
||||
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET STATUS = @STATUS, SENT_WHEN = GETDATE() WHERE GUID = @GUID"
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("GUID", SqlDbType.Int).Value = pEnvelope.Id
|
||||
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = Constants.EnvelopeStatus.Sent
|
||||
|
||||
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
|
||||
|
||||
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)"
|
||||
@@ -63,7 +82,7 @@ Public Class EnvelopeModel
|
||||
|
||||
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 oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET [SUBJECT] = @SUBJECT, [MESSAGE] = @MESSAGE, [STATUS] = @STATUS, [CHANGED_WHEN] = GETDATE() 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
|
||||
|
||||
@@ -123,6 +123,9 @@
|
||||
<data name="Missing Documents" xml:space="preserve">
|
||||
<value>Missing Documents</value>
|
||||
</data>
|
||||
<data name="Missing Elements" xml:space="preserve">
|
||||
<value>Missing at least one Element</value>
|
||||
</data>
|
||||
<data name="Missing Message" xml:space="preserve">
|
||||
<value>Missing Message</value>
|
||||
</data>
|
||||
|
||||
@@ -25,7 +25,7 @@ Namespace My.Resources
|
||||
<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
|
||||
Public Class Envelope
|
||||
|
||||
Private Shared resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
@@ -40,7 +40,7 @@ Namespace My.Resources
|
||||
''' 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
|
||||
Public 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)
|
||||
@@ -55,7 +55,7 @@ Namespace My.Resources
|
||||
''' 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
|
||||
Public Shared Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
@@ -67,7 +67,7 @@ Namespace My.Resources
|
||||
'''<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
|
||||
Public Shared ReadOnly Property Invalid_Email_Address() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Invalid Email Address", resourceCulture)
|
||||
End Get
|
||||
@@ -76,16 +76,25 @@ Namespace My.Resources
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Documents ähnelt.
|
||||
'''</summary>
|
||||
Friend Shared ReadOnly Property Missing_Documents() As String
|
||||
Public 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 at least one Element ähnelt.
|
||||
'''</summary>
|
||||
Public Shared ReadOnly Property Missing_Elements() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Missing Elements", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Message ähnelt.
|
||||
'''</summary>
|
||||
Friend Shared ReadOnly Property Missing_Message() As String
|
||||
Public Shared ReadOnly Property Missing_Message() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Missing Message", resourceCulture)
|
||||
End Get
|
||||
@@ -94,7 +103,7 @@ Namespace My.Resources
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Receivers ähnelt.
|
||||
'''</summary>
|
||||
Friend Shared ReadOnly Property Missing_Receivers() As String
|
||||
Public Shared ReadOnly Property Missing_Receivers() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Missing Receivers", resourceCulture)
|
||||
End Get
|
||||
@@ -103,7 +112,7 @@ Namespace My.Resources
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Missing Subject ähnelt.
|
||||
'''</summary>
|
||||
Friend Shared ReadOnly Property Missing_Subject() As String
|
||||
Public Shared ReadOnly Property Missing_Subject() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Missing Subject", resourceCulture)
|
||||
End Get
|
||||
Reference in New Issue
Block a user