refactor(Common.Entities.DocumentReceiverElement): Ersetzt durch Common.Entities.DocumentReceiverElement

This commit is contained in:
Developer 02 2025-05-26 09:49:01 +02:00
parent 7326f03a8d
commit 3625508460
5 changed files with 11 additions and 40 deletions

View File

@ -1,29 +0,0 @@
Imports EnvelopeGenerator.Domain
Public Class DocumentReceiverElement
Public Property Id As Integer = -1
Public Property X As Double
Public Property Y As Double
Public Property Width As Double
Public Property Height As Double
Public Property ElementType As Constants.ElementType
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 AnnotationIndex As Integer = 0
Public ReadOnly Property Top As Single
Get
Return Math.Round(Y, 5)
End Get
End Property
Public ReadOnly Property Left As Single
Get
Return Math.Round(X, 5)
End Get
End Property
End Class

View File

@ -280,7 +280,6 @@
<Compile Include="Jobs\APIBackendJobs\APIEnvelopeJob.vb" />
<Compile Include="Jobs\FinalizeDocument\PDFBurnerParams.vb" />
<Compile Include="Services\TemplateService.vb" />
<Compile Include="Entities\DocumentReceiverElement.vb" />
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
<Compile Include="Entities\EnvelopeReceiver.vb" />
<Compile Include="Entities\State.vb" />

View File

@ -1,6 +1,7 @@
Imports System.Data.SqlClient
Imports DigitalData.Modules.Base
Imports EnvelopeGenerator.Domain
Imports EnvelopeGenerator.Domain.Entities
Public Class ElementModel
Inherits BaseModel

View File

@ -8,7 +8,7 @@ Public Class FieldEditorController
Inherits BaseController
Private ReadOnly Document As EnvelopeDocument
Public Property Elements As New List(Of Common.DocumentReceiverElement)
Public Property Elements As New List(Of DocumentReceiverElement)
Public Class ElementInfo
Public ReceiverId As Integer
@ -36,7 +36,7 @@ Public Class FieldEditorController
}
End Function
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As Common.DocumentReceiverElement
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As DocumentReceiverElement
Dim oElement = Elements.
Where(Function(e)
Return e.Left = CSng(Math.Round(pAnnotation.Left, 5)) And
@ -47,12 +47,12 @@ Public Class FieldEditorController
Return oElement
End Function
Private Function GetElementByGuid(pGuid As Integer) As Common.DocumentReceiverElement
Private Function GetElementByGuid(pGuid As Integer) As DocumentReceiverElement
Dim oElement = Elements.Where(Function(e) pGuid = e.Id).SingleOrDefault()
Return oElement
End Function
Public Function GetElement(pAnnotation As AnnotationStickyNote) As Common.DocumentReceiverElement
Public Function GetElement(pAnnotation As AnnotationStickyNote) As DocumentReceiverElement
Dim oInfo = GetElementInfo(pAnnotation.Tag)
If oInfo.Guid = -1 Then
@ -85,7 +85,7 @@ Public Class FieldEditorController
Else
Dim oInfo = GetElementInfo(pAnnotation.Tag)
Elements.Add(New Common.DocumentReceiverElement() With {
Elements.Add(New DocumentReceiverElement() With {
.ElementType = Constants.ElementType.Signature,
.Height = oAnnotationHeight,
.Width = oAnnotationWidth,
@ -98,7 +98,7 @@ Public Class FieldEditorController
End If
End Sub
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of Common.DocumentReceiverElement)
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of DocumentReceiverElement)
Return Elements.
Where(Function(e) e.Page <> pPage And e.ReceiverId <> pReceiverId).
ToList()
@ -120,7 +120,7 @@ Public Class FieldEditorController
All(Function(pResult) pResult = True)
End Function
Public Function SaveElement(pElement As Common.DocumentReceiverElement) As Boolean
Public Function SaveElement(pElement As DocumentReceiverElement) As Boolean
Try
If pElement.Id > 0 Then
Return ElementModel.Update(pElement)
@ -134,11 +134,11 @@ Public Class FieldEditorController
End Try
End Function
Public Function DeleteElement(pElement As Common.DocumentReceiverElement) As Boolean
Public Function DeleteElement(pElement As DocumentReceiverElement) As Boolean
Try
' Element aus Datenbank löschen
If ElementModel.DeleteElement(pElement) Then
Dim oElement = New List(Of Common.DocumentReceiverElement)() From {pElement}
Dim oElement = New List(Of DocumentReceiverElement)() From {pElement}
Elements = Elements.Except(oElement).ToList()
Return True
Else

View File

@ -280,7 +280,7 @@ Partial Public Class frmFieldEditor
End If
End Sub
Private Sub LoadAnnotation(pElement As Common.DocumentReceiverElement, pReceiverId As Integer)
Private Sub LoadAnnotation(pElement As DocumentReceiverElement, pReceiverId As Integer)
Dim oAnnotation As AnnotationStickyNote = Manager.AddStickyNoteAnnot(0, 0, 0, 0, "SIGNATUR")
Dim oPage = pElement.Page
Dim oReceiver = Receivers.Where(Function(r) r.Id = pReceiverId).Single()