refactor(Common.Entities.EnvelopeDocumentElement): umbenennen in DocumentReceiverElement
This commit is contained in:
parent
35e9f6404c
commit
7326f03a8d
@ -1,6 +1,6 @@
|
||||
Imports EnvelopeGenerator.Domain
|
||||
|
||||
Public Class EnvelopeDocumentElement
|
||||
Public Class DocumentReceiverElement
|
||||
Public Property Id As Integer = -1
|
||||
Public Property X As Double
|
||||
Public Property Y As Double
|
||||
@ -280,7 +280,7 @@
|
||||
<Compile Include="Jobs\APIBackendJobs\APIEnvelopeJob.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\PDFBurnerParams.vb" />
|
||||
<Compile Include="Services\TemplateService.vb" />
|
||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
||||
<Compile Include="Entities\DocumentReceiverElement.vb" />
|
||||
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||
<Compile Include="Entities\State.vb" />
|
||||
|
||||
@ -9,8 +9,8 @@ Public Class ElementModel
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToElement(pRow As DataRow) As EnvelopeDocumentElement
|
||||
Return New EnvelopeDocumentElement() With {
|
||||
Private Function ToElement(pRow As DataRow) As DocumentReceiverElement
|
||||
Return New DocumentReceiverElement() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
|
||||
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
|
||||
@ -23,7 +23,7 @@ Public Class ElementModel
|
||||
}
|
||||
End Function
|
||||
|
||||
Private Function ToElements(pTable As DataTable) As List(Of EnvelopeDocumentElement)
|
||||
Private Function ToElements(pTable As DataTable) As List(Of DocumentReceiverElement)
|
||||
Return pTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToElement).
|
||||
ToList()
|
||||
@ -79,7 +79,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function List(pDocumentId As Integer) As List(Of EnvelopeDocumentElement)
|
||||
Public Function List(pDocumentId As Integer) As List(Of DocumentReceiverElement)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
@ -92,7 +92,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of EnvelopeDocumentElement)
|
||||
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of DocumentReceiverElement)
|
||||
Try
|
||||
Dim oReceiverConstraint = ""
|
||||
If pReceiverId > 0 Then
|
||||
@ -110,7 +110,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Insert(pElement As EnvelopeDocumentElement) As Boolean
|
||||
Public Function Insert(pElement As DocumentReceiverElement) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||
([DOCUMENT_ID]
|
||||
@ -160,7 +160,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Update(pElement As EnvelopeDocumentElement) As Boolean
|
||||
Public Function Update(pElement As DocumentReceiverElement) As Boolean
|
||||
Try
|
||||
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||
SET [POSITION_X] = @POSITION_X
|
||||
@ -184,7 +184,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetElementId(pElement As EnvelopeDocumentElement) As Integer
|
||||
Private Function GetElementId(pElement As DocumentReceiverElement) As Integer
|
||||
Try
|
||||
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
|
||||
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
|
||||
@ -195,7 +195,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function DeleteElement(pElement As EnvelopeDocumentElement) As Boolean
|
||||
Public Function DeleteElement(pElement As DocumentReceiverElement) As Boolean
|
||||
Try
|
||||
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
|
||||
Return Database.ExecuteNonQuery(oSql)
|
||||
|
||||
@ -8,7 +8,7 @@ Public Class FieldEditorController
|
||||
Inherits BaseController
|
||||
|
||||
Private ReadOnly Document As EnvelopeDocument
|
||||
Public Property Elements As New List(Of EnvelopeDocumentElement)
|
||||
Public Property Elements As New List(Of Common.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 EnvelopeDocumentElement
|
||||
Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As Common.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 EnvelopeDocumentElement
|
||||
Private Function GetElementByGuid(pGuid As Integer) As Common.DocumentReceiverElement
|
||||
Dim oElement = Elements.Where(Function(e) pGuid = e.Id).SingleOrDefault()
|
||||
Return oElement
|
||||
End Function
|
||||
|
||||
Public Function GetElement(pAnnotation As AnnotationStickyNote) As EnvelopeDocumentElement
|
||||
Public Function GetElement(pAnnotation As AnnotationStickyNote) As Common.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 EnvelopeDocumentElement() With {
|
||||
Elements.Add(New Common.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 EnvelopeDocumentElement)
|
||||
Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of Common.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 EnvelopeDocumentElement) As Boolean
|
||||
Public Function SaveElement(pElement As Common.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 EnvelopeDocumentElement) As Boolean
|
||||
Public Function DeleteElement(pElement As Common.DocumentReceiverElement) As Boolean
|
||||
Try
|
||||
' Element aus Datenbank löschen
|
||||
If ElementModel.DeleteElement(pElement) Then
|
||||
Dim oElement = New List(Of EnvelopeDocumentElement)() From {pElement}
|
||||
Dim oElement = New List(Of Common.DocumentReceiverElement)() From {pElement}
|
||||
Elements = Elements.Except(oElement).ToList()
|
||||
Return True
|
||||
Else
|
||||
|
||||
@ -280,7 +280,7 @@ Partial Public Class frmFieldEditor
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LoadAnnotation(pElement As EnvelopeDocumentElement, pReceiverId As Integer)
|
||||
Private Sub LoadAnnotation(pElement As Common.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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user