From 3625508460be0c1a1bd92ad7a66a0eb2b6e75016 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Mon, 26 May 2025 09:49:01 +0200 Subject: [PATCH] refactor(Common.Entities.DocumentReceiverElement): Ersetzt durch Common.Entities.DocumentReceiverElement --- .../Entities/DocumentReceiverElement.vb | 29 ------------------- .../EnvelopeGenerator.Common.vbproj | 1 - .../Models/ElementModel.vb | 1 + .../Controllers/FieldEditorController.vb | 18 ++++++------ EnvelopeGenerator.Form/frmFieldEditor.vb | 2 +- 5 files changed, 11 insertions(+), 40 deletions(-) delete mode 100644 EnvelopeGenerator.Common/Entities/DocumentReceiverElement.vb diff --git a/EnvelopeGenerator.Common/Entities/DocumentReceiverElement.vb b/EnvelopeGenerator.Common/Entities/DocumentReceiverElement.vb deleted file mode 100644 index 18cdff20..00000000 --- a/EnvelopeGenerator.Common/Entities/DocumentReceiverElement.vb +++ /dev/null @@ -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 diff --git a/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj b/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj index 68e8b565..d9e9efa4 100644 --- a/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj +++ b/EnvelopeGenerator.Common/EnvelopeGenerator.Common.vbproj @@ -280,7 +280,6 @@ - diff --git a/EnvelopeGenerator.Common/Models/ElementModel.vb b/EnvelopeGenerator.Common/Models/ElementModel.vb index e66a9881..438294da 100644 --- a/EnvelopeGenerator.Common/Models/ElementModel.vb +++ b/EnvelopeGenerator.Common/Models/ElementModel.vb @@ -1,6 +1,7 @@ Imports System.Data.SqlClient Imports DigitalData.Modules.Base Imports EnvelopeGenerator.Domain +Imports EnvelopeGenerator.Domain.Entities Public Class ElementModel Inherits BaseModel diff --git a/EnvelopeGenerator.Form/Controllers/FieldEditorController.vb b/EnvelopeGenerator.Form/Controllers/FieldEditorController.vb index fdf07f64..467972bd 100644 --- a/EnvelopeGenerator.Form/Controllers/FieldEditorController.vb +++ b/EnvelopeGenerator.Form/Controllers/FieldEditorController.vb @@ -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 diff --git a/EnvelopeGenerator.Form/frmFieldEditor.vb b/EnvelopeGenerator.Form/frmFieldEditor.vb index cc5cbb78..3dadc24b 100644 --- a/EnvelopeGenerator.Form/frmFieldEditor.vb +++ b/EnvelopeGenerator.Form/frmFieldEditor.vb @@ -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()