refactor(Common.Entities.EnvelopeDocumentElement): umbenennen in DocumentReceiverElement
This commit is contained in:
parent
35e9f6404c
commit
7326f03a8d
@ -1,6 +1,6 @@
|
|||||||
Imports EnvelopeGenerator.Domain
|
Imports EnvelopeGenerator.Domain
|
||||||
|
|
||||||
Public Class EnvelopeDocumentElement
|
Public Class DocumentReceiverElement
|
||||||
Public Property Id As Integer = -1
|
Public Property Id As Integer = -1
|
||||||
Public Property X As Double
|
Public Property X As Double
|
||||||
Public Property Y As Double
|
Public Property Y As Double
|
||||||
@ -280,7 +280,7 @@
|
|||||||
<Compile Include="Jobs\APIBackendJobs\APIEnvelopeJob.vb" />
|
<Compile Include="Jobs\APIBackendJobs\APIEnvelopeJob.vb" />
|
||||||
<Compile Include="Jobs\FinalizeDocument\PDFBurnerParams.vb" />
|
<Compile Include="Jobs\FinalizeDocument\PDFBurnerParams.vb" />
|
||||||
<Compile Include="Services\TemplateService.vb" />
|
<Compile Include="Services\TemplateService.vb" />
|
||||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
<Compile Include="Entities\DocumentReceiverElement.vb" />
|
||||||
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
||||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||||
<Compile Include="Entities\State.vb" />
|
<Compile Include="Entities\State.vb" />
|
||||||
|
|||||||
@ -9,8 +9,8 @@ Public Class ElementModel
|
|||||||
MyBase.New(pState)
|
MyBase.New(pState)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ToElement(pRow As DataRow) As EnvelopeDocumentElement
|
Private Function ToElement(pRow As DataRow) As DocumentReceiverElement
|
||||||
Return New EnvelopeDocumentElement() With {
|
Return New DocumentReceiverElement() With {
|
||||||
.Id = pRow.ItemEx("GUID", 0),
|
.Id = pRow.ItemEx("GUID", 0),
|
||||||
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
|
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
|
||||||
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
|
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
|
||||||
@ -23,7 +23,7 @@ Public Class ElementModel
|
|||||||
}
|
}
|
||||||
End Function
|
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).
|
Return pTable?.Rows.Cast(Of DataRow).
|
||||||
Select(AddressOf ToElement).
|
Select(AddressOf ToElement).
|
||||||
ToList()
|
ToList()
|
||||||
@ -79,7 +79,7 @@ Public Class ElementModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function List(pDocumentId As Integer) As List(Of EnvelopeDocumentElement)
|
Public Function List(pDocumentId As Integer) As List(Of DocumentReceiverElement)
|
||||||
Try
|
Try
|
||||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
|
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
|
||||||
Dim oTable = Database.GetDatatable(oSql)
|
Dim oTable = Database.GetDatatable(oSql)
|
||||||
@ -92,7 +92,7 @@ Public Class ElementModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
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
|
Try
|
||||||
Dim oReceiverConstraint = ""
|
Dim oReceiverConstraint = ""
|
||||||
If pReceiverId > 0 Then
|
If pReceiverId > 0 Then
|
||||||
@ -110,7 +110,7 @@ Public Class ElementModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Insert(pElement As EnvelopeDocumentElement) As Boolean
|
Public Function Insert(pElement As DocumentReceiverElement) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||||
([DOCUMENT_ID]
|
([DOCUMENT_ID]
|
||||||
@ -160,7 +160,7 @@ Public Class ElementModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Update(pElement As EnvelopeDocumentElement) As Boolean
|
Public Function Update(pElement As DocumentReceiverElement) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||||
SET [POSITION_X] = @POSITION_X
|
SET [POSITION_X] = @POSITION_X
|
||||||
@ -184,7 +184,7 @@ Public Class ElementModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GetElementId(pElement As EnvelopeDocumentElement) As Integer
|
Private Function GetElementId(pElement As DocumentReceiverElement) As Integer
|
||||||
Try
|
Try
|
||||||
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
|
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
|
||||||
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
|
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
|
||||||
@ -195,7 +195,7 @@ Public Class ElementModel
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function DeleteElement(pElement As EnvelopeDocumentElement) As Boolean
|
Public Function DeleteElement(pElement As DocumentReceiverElement) As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
|
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
|
||||||
Return Database.ExecuteNonQuery(oSql)
|
Return Database.ExecuteNonQuery(oSql)
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Public Class FieldEditorController
|
|||||||
Inherits BaseController
|
Inherits BaseController
|
||||||
|
|
||||||
Private ReadOnly Document As EnvelopeDocument
|
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 Class ElementInfo
|
||||||
Public ReceiverId As Integer
|
Public ReceiverId As Integer
|
||||||
@ -36,7 +36,7 @@ Public Class FieldEditorController
|
|||||||
}
|
}
|
||||||
End Function
|
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.
|
Dim oElement = Elements.
|
||||||
Where(Function(e)
|
Where(Function(e)
|
||||||
Return e.Left = CSng(Math.Round(pAnnotation.Left, 5)) And
|
Return e.Left = CSng(Math.Round(pAnnotation.Left, 5)) And
|
||||||
@ -47,12 +47,12 @@ Public Class FieldEditorController
|
|||||||
Return oElement
|
Return oElement
|
||||||
End Function
|
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()
|
Dim oElement = Elements.Where(Function(e) pGuid = e.Id).SingleOrDefault()
|
||||||
Return oElement
|
Return oElement
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetElement(pAnnotation As AnnotationStickyNote) As EnvelopeDocumentElement
|
Public Function GetElement(pAnnotation As AnnotationStickyNote) As Common.DocumentReceiverElement
|
||||||
Dim oInfo = GetElementInfo(pAnnotation.Tag)
|
Dim oInfo = GetElementInfo(pAnnotation.Tag)
|
||||||
|
|
||||||
If oInfo.Guid = -1 Then
|
If oInfo.Guid = -1 Then
|
||||||
@ -85,7 +85,7 @@ Public Class FieldEditorController
|
|||||||
Else
|
Else
|
||||||
Dim oInfo = GetElementInfo(pAnnotation.Tag)
|
Dim oInfo = GetElementInfo(pAnnotation.Tag)
|
||||||
|
|
||||||
Elements.Add(New EnvelopeDocumentElement() With {
|
Elements.Add(New Common.DocumentReceiverElement() With {
|
||||||
.ElementType = Constants.ElementType.Signature,
|
.ElementType = Constants.ElementType.Signature,
|
||||||
.Height = oAnnotationHeight,
|
.Height = oAnnotationHeight,
|
||||||
.Width = oAnnotationWidth,
|
.Width = oAnnotationWidth,
|
||||||
@ -98,7 +98,7 @@ Public Class FieldEditorController
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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.
|
Return Elements.
|
||||||
Where(Function(e) e.Page <> pPage And e.ReceiverId <> pReceiverId).
|
Where(Function(e) e.Page <> pPage And e.ReceiverId <> pReceiverId).
|
||||||
ToList()
|
ToList()
|
||||||
@ -120,7 +120,7 @@ Public Class FieldEditorController
|
|||||||
All(Function(pResult) pResult = True)
|
All(Function(pResult) pResult = True)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function SaveElement(pElement As EnvelopeDocumentElement) As Boolean
|
Public Function SaveElement(pElement As Common.DocumentReceiverElement) As Boolean
|
||||||
Try
|
Try
|
||||||
If pElement.Id > 0 Then
|
If pElement.Id > 0 Then
|
||||||
Return ElementModel.Update(pElement)
|
Return ElementModel.Update(pElement)
|
||||||
@ -134,11 +134,11 @@ Public Class FieldEditorController
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function DeleteElement(pElement As EnvelopeDocumentElement) As Boolean
|
Public Function DeleteElement(pElement As Common.DocumentReceiverElement) As Boolean
|
||||||
Try
|
Try
|
||||||
' Element aus Datenbank löschen
|
' Element aus Datenbank löschen
|
||||||
If ElementModel.DeleteElement(pElement) Then
|
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()
|
Elements = Elements.Except(oElement).ToList()
|
||||||
Return True
|
Return True
|
||||||
Else
|
Else
|
||||||
|
|||||||
@ -280,7 +280,7 @@ Partial Public Class frmFieldEditor
|
|||||||
End If
|
End If
|
||||||
End Sub
|
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 oAnnotation As AnnotationStickyNote = Manager.AddStickyNoteAnnot(0, 0, 0, 0, "SIGNATUR")
|
||||||
Dim oPage = pElement.Page
|
Dim oPage = pElement.Page
|
||||||
Dim oReceiver = Receivers.Where(Function(r) r.Id = pReceiverId).Single()
|
Dim oReceiver = Receivers.Where(Function(r) r.Id = pReceiverId).Single()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user