2023-09-11 - THUMBNAILS!!!!!

This commit is contained in:
2023-09-11 12:57:29 +02:00
parent 0306ab1992
commit d4c010cda4
25 changed files with 947 additions and 83 deletions

View File

@@ -18,4 +18,8 @@
Created = 0
End Enum
Public Enum ContractType
Contract = 0
ReadAndSign = 1
End Enum
End Class

View File

@@ -1,6 +1,8 @@
Public Class Envelope
Public Property Id As Integer = 0
Public Property UserId As Integer
Public Property Title As String = ""
Public Property ContractType As Constants.ContractType
Public Property Status As Constants.EnvelopeStatus
Public Property Uuid As String = Guid.NewGuid.ToString()
Public Property Subject As String

View File

@@ -1,14 +1,19 @@
Imports System.IO
Imports System.Drawing
Imports System.IO
Public Class EnvelopeDocument
Public Property Id As Integer
Public Property FileInfo As FileInfo
Public Property FileNameOriginal As String
Public Property IsTempFile As Boolean = True
Public Property EnvelopeId As Integer = 0
Public Property Thumbnail As Bitmap
Public Property Elements As New List(Of EnvelopeDocumentElement)
Public ReadOnly Property Filename As String

View File

@@ -20,6 +20,7 @@ Public Class DocumentModel
.Id = oDocumentId,
.EnvelopeId = pRow.ItemEx("ENVELOPE_ID", 0),
.FileInfo = New IO.FileInfo(pRow.ItemEx("FILEPATH", "")),
.FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
.IsTempFile = False,
.Elements = ElementModel.List(oDocumentId)
}
@@ -59,15 +60,18 @@ Public Class DocumentModel
Try
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_DOCUMENT]
([FILENAME]
,[FILENAME_ORIGINAL]
,[FILEPATH]
,[ENVELOPE_ID])
VALUES
(@FILENAME
,@FILENAME_ORIGINAL
,@FILEPATH
,@ENVELOPE_ID)"
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("FILENAME", SqlDbType.NVarChar).Value = pDocument.Filename
oCommand.Parameters.Add("FILENAME_ORIGINAL", SqlDbType.NVarChar).Value = pDocument.FileNameOriginal
oCommand.Parameters.Add("FILEPATH", SqlDbType.NVarChar).Value = pDocument.Filepath
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id

View File

@@ -12,6 +12,8 @@ Public Class EnvelopeModel
Private Function ToEnvelope(pRow As DataRow) As Envelope
Dim oEnvelope = New Envelope() With {
.Id = pRow.ItemEx("GUID", 0),
.Title = pRow.ItemEx("TITLE", ""),
.ContractType = ObjectEx.ToEnum(Of Constants.ContractType)(pRow.ItemEx("CONTRACT_TYPE", "Contract")),
.Uuid = pRow.ItemEx("ENVELOPE_UUID", ""),
.Subject = pRow.ItemEx("SUBJECT", ""),
.Message = pRow.ItemEx("MESSAGE", ""),
@@ -26,7 +28,7 @@ Public Class EnvelopeModel
Public Function GetByUuid(pEnvelopeUuid As String) As Envelope
Try
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE ENVELOPE_UUID = '{pEnvelopeUuid}'"
Dim oTable = Database.GetDatatable(oSql)
Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows.Cast(Of DataRow).
Select(AddressOf ToEnvelope).
@@ -72,13 +74,16 @@ Public Class EnvelopeModel
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 oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE] (SUBJECT, MESSAGE, ENVELOPE_UUID, STATUS, USER_ID, TITLE, CONTRACT_TYPE) "
oSql += " VALUES (@SUBJECT, @MESSAGE, @UUID, @STATUS, @USER_ID, @TITLE, @CONTRACT_TYPE)"
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
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.NVarChar).Value = Constants.ContractType.Contract ' TODO - Contract Type
If Database.ExecuteNonQuery(oCommand) Then
pEnvelope.Id = GetEnvelopeId(pEnvelope)
@@ -96,11 +101,18 @@ 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, [CHANGED_WHEN] = GETDATE() WHERE GUID = @ID AND USER_ID = @USER_ID"
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET "
oSql += " [SUBJECT] = @SUBJECT, "
oSql += " [MESSAGE] = @MESSAGE, "
oSql += " [STATUS] = @STATUS, "
oSql += " [TITLE] = @TITLE, "
oSql += " [CHANGED_WHEN] = GETDATE() "
oSql += " 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("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
oCommand.Parameters.Add("ID", SqlDbType.Int).Value = pEnvelope.Id
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId

View File

@@ -25,11 +25,11 @@ Public Class UserModel
Public Function SelectUser() As User
Try
Dim oSql = $"SELECT * FROM [dbo].[TBDD_USER] WHERE USER_ID = {State.UserId}"
Dim oSql = $"SELECT * FROM [dbo].[TBDD_USER] WHERE GUID = {State.UserId}"
Dim oTable = Database.GetDatatable(oSql)
Return oTable?.Rows.Cast(Of DataRow).
Select(AddressOf ToUser)
Select(AddressOf ToUser).First
Catch ex As Exception
Logger.Error(ex)
Return Nothing

View File

@@ -117,6 +117,36 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Do you really want to delete this envelope" xml:space="preserve">
<value>Wollen Sie diesen Umschlag wirklich löschen?</value>
</data>
<data name="Do you want to delete the selected recipient" xml:space="preserve">
<value>Wollen Sie den ausgewählten Empfänger löschen?</value>
</data>
<data name="Document Could Not Be Saved" xml:space="preserve">
<value>Dokument konnte nicht gespeichert werden!</value>
</data>
<data name="Elements could not be loaded" xml:space="preserve">
<value>Elemente konnten nicht geladen werden!</value>
</data>
<data name="Elements could not be saved" xml:space="preserve">
<value>Elemente konnten nicht gespeichert werden!</value>
</data>
<data name="Envelope could not be sent" xml:space="preserve">
<value>Umschlag konnte nicht gesendet werden!</value>
</data>
<data name="Error sending the envelope" xml:space="preserve">
<value>Fehler beim Senden des Umschlags:</value>
</data>
<data name="Error when saving the envelope" xml:space="preserve">
<value>Fehler beim Speichern des Umschlags!</value>
</data>
<data name="Error when saving the recipients" xml:space="preserve">
<value>Fehler beim Speichern der Empfänger!</value>
</data>
<data name="Errors when saving the envelope" xml:space="preserve">
<value>Fehler beim Speichern des Umschlags: </value>
</data>
<data name="Invalid Email Address" xml:space="preserve">
<value>Empfänger {0} hat keine gültige Email Addresse.</value>
</data>
@@ -135,4 +165,10 @@
<data name="Missing Subject" xml:space="preserve">
<value>Missing Subject</value>
</data>
<data name="Recipient could not be deleted" xml:space="preserve">
<value>Empfänger konnte nicht gelöscht werden!</value>
</data>
<data name="The envelope could not be deleted" xml:space="preserve">
<value>Der Umschlag konnte nicht gelöscht werden!</value>
</data>
</root>

View File

@@ -64,6 +64,96 @@ Namespace My.Resources
End Set
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Wollen Sie diesen Umschlag wirklich löschen? ähnelt.
'''</summary>
Public Shared ReadOnly Property Do_you_really_want_to_delete_this_envelope() As String
Get
Return ResourceManager.GetString("Do you really want to delete this envelope", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Wollen Sie den ausgewählten Empfänger löschen? ähnelt.
'''</summary>
Public Shared ReadOnly Property Do_you_want_to_delete_the_selected_recipient() As String
Get
Return ResourceManager.GetString("Do you want to delete the selected recipient", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Dokument konnte nicht gespeichert werden! ähnelt.
'''</summary>
Public Shared ReadOnly Property Document_Could_Not_Be_Saved() As String
Get
Return ResourceManager.GetString("Document Could Not Be Saved", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Elemente konnten nicht geladen werden! ähnelt.
'''</summary>
Public Shared ReadOnly Property Elements_could_not_be_loaded() As String
Get
Return ResourceManager.GetString("Elements could not be loaded", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Elemente konnten nicht gespeichert werden! ähnelt.
'''</summary>
Public Shared ReadOnly Property Elements_could_not_be_saved() As String
Get
Return ResourceManager.GetString("Elements could not be saved", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Umschlag konnte nicht gesendet werden! ähnelt.
'''</summary>
Public Shared ReadOnly Property Envelope_could_not_be_sent() As String
Get
Return ResourceManager.GetString("Envelope could not be sent", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Fehler beim Senden des Umschlags: ähnelt.
'''</summary>
Public Shared ReadOnly Property Error_sending_the_envelope() As String
Get
Return ResourceManager.GetString("Error sending the envelope", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Fehler beim Speichern des Umschlags! ähnelt.
'''</summary>
Public Shared ReadOnly Property Error_when_saving_the_envelope() As String
Get
Return ResourceManager.GetString("Error when saving the envelope", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Fehler beim Speichern der Empfänger! ähnelt.
'''</summary>
Public Shared ReadOnly Property Error_when_saving_the_recipients() As String
Get
Return ResourceManager.GetString("Error when saving the recipients", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Fehler beim Speichern des Umschlags: ähnelt.
'''</summary>
Public Shared ReadOnly Property Errors_when_saving_the_envelope() As String
Get
Return ResourceManager.GetString("Errors when saving the envelope", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Empfänger {0} hat keine gültige Email Addresse. ähnelt.
'''</summary>
@@ -117,5 +207,23 @@ Namespace My.Resources
Return ResourceManager.GetString("Missing Subject", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Empfänger konnte nicht gelöscht werden! ähnelt.
'''</summary>
Public Shared ReadOnly Property Recipient_could_not_be_deleted() As String
Get
Return ResourceManager.GetString("Recipient could not be deleted", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die Der Umschlag konnte nicht gelöscht werden! ähnelt.
'''</summary>
Public Shared ReadOnly Property The_envelope_could_not_be_deleted() As String
Get
Return ResourceManager.GetString("The envelope could not be deleted", resourceCulture)
End Get
End Property
End Class
End Namespace