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

@@ -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