diff --git a/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs b/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs index 5f5f8a03..23c6ab0a 100644 --- a/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs +++ b/EnvelopeGenerator.Application/Common/Dto/MappingProfile.cs @@ -23,7 +23,7 @@ public class MappingProfile : Profile { // Entity to DTO mappings CreateMap(); - CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap(); @@ -39,7 +39,7 @@ public class MappingProfile : Profile // DTO to Entity mappings CreateMap(); - CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap(); diff --git a/EnvelopeGenerator.Application/Common/Interfaces/Repositories/IDocumentReceiverElementRepository.cs b/EnvelopeGenerator.Application/Common/Interfaces/Repositories/IDocumentReceiverElementRepository.cs index b2b4df75..41a92929 100644 --- a/EnvelopeGenerator.Application/Common/Interfaces/Repositories/IDocumentReceiverElementRepository.cs +++ b/EnvelopeGenerator.Application/Common/Interfaces/Repositories/IDocumentReceiverElementRepository.cs @@ -6,6 +6,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Repositories; /// /// [Obsolete("Use IRepository")] -public interface IDocumentReceiverElementRepository : ICRUDRepository +public interface IDocumentReceiverElementRepository : ICRUDRepository { } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs b/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs index 603d36b2..15f54def 100644 --- a/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs +++ b/EnvelopeGenerator.Application/Common/Interfaces/Services/IDocumentReceiverElementService.cs @@ -8,6 +8,6 @@ namespace EnvelopeGenerator.Application.Common.Interfaces.Services; /// /// [Obsolete("Use MediatR")] -public interface IDocumentReceiverElementService : IBasicCRUDService +public interface IDocumentReceiverElementService : IBasicCRUDService { } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs b/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs index bc9800cd..e0e00927 100644 --- a/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs +++ b/EnvelopeGenerator.Application/Services/DocumentReceiverElementService.cs @@ -11,7 +11,7 @@ namespace EnvelopeGenerator.Application.Services; /// /// [Obsolete("Use MediatR")] -public class DocumentReceiverElementService : BasicCRUDService, IDocumentReceiverElementService +public class DocumentReceiverElementService : BasicCRUDService, IDocumentReceiverElementService { /// /// diff --git a/EnvelopeGenerator.BBTests/frmFinalizePDF.vb b/EnvelopeGenerator.BBTests/frmFinalizePDF.vb index 24847ec0..5e58eaed 100644 --- a/EnvelopeGenerator.BBTests/frmFinalizePDF.vb +++ b/EnvelopeGenerator.BBTests/frmFinalizePDF.vb @@ -164,7 +164,7 @@ Public Class frmFinalizePDF Return End If - Dim sigRepo = scope.ServiceProvider.Repository(Of Signature)() + Dim sigRepo = scope.ServiceProvider.Repository(Of DocReceiverElement)() Dim elements = sigRepo _ .Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _ .Include(Function(sig) sig.Annotations) _ diff --git a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb index 97347a72..cb6dc3d0 100644 --- a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb +++ b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb @@ -46,7 +46,7 @@ Namespace Jobs.FinalizeDocument Return pSourceBuffer End If - Dim sigRepo = scope.ServiceProvider.Repository(Of Signature)() + Dim sigRepo = scope.ServiceProvider.Repository(Of DocReceiverElement)() Dim elements = sigRepo _ .Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _ .Include(Function(sig) sig.Annotations) _ @@ -58,7 +58,7 @@ Namespace Jobs.FinalizeDocument End Using End Function - Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of Signature)) As Byte() + Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of DocReceiverElement)) As Byte() ' Add background Using doc As Pdf(Of MemoryStream, MemoryStream) = Pdf.FromMemory(pSourceBuffer) 'TODO: take the length from the largest y diff --git a/EnvelopeGenerator.CommonServices/Models/ElementModel.vb b/EnvelopeGenerator.CommonServices/Models/ElementModel.vb index c303d883..c400341d 100644 --- a/EnvelopeGenerator.CommonServices/Models/ElementModel.vb +++ b/EnvelopeGenerator.CommonServices/Models/ElementModel.vb @@ -10,8 +10,8 @@ Public Class ElementModel MyBase.New(pState) End Sub - Private Function ToElement(pRow As DataRow) As Signature - Return New Signature() With { + Private Function ToElement(pRow As DataRow) As DocReceiverElement + Return New DocReceiverElement() With { .Id = pRow.ItemEx("GUID", 0), .DocumentId = pRow.ItemEx("DOCUMENT_ID", 0), .ReceiverId = pRow.ItemEx("RECEIVER_ID", 0), @@ -24,7 +24,7 @@ Public Class ElementModel } End Function - Private Function ToElements(pTable As DataTable) As List(Of Signature) + Private Function ToElements(pTable As DataTable) As List(Of DocReceiverElement) Return pTable?.Rows.Cast(Of DataRow). Select(AddressOf ToElement). ToList() @@ -80,7 +80,7 @@ Public Class ElementModel End Try End Function - Public Function List(pDocumentId As Integer) As List(Of Signature) + Public Function List(pDocumentId As Integer) As List(Of DocReceiverElement) Try Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC" Dim oTable = Database.GetDatatable(oSql) @@ -93,7 +93,7 @@ Public Class ElementModel End Try End Function - Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of Signature) + Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of DocReceiverElement) Try Dim oReceiverConstraint = "" If pReceiverId > 0 Then @@ -111,7 +111,7 @@ Public Class ElementModel End Try End Function - Public Function Insert(pElement As Signature) As Boolean + Public Function Insert(pElement As DocReceiverElement) As Boolean Try Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] ([DOCUMENT_ID] @@ -161,7 +161,7 @@ Public Class ElementModel End Try End Function - Public Function Update(pElement As Signature) As Boolean + Public Function Update(pElement As DocReceiverElement) As Boolean Try Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] SET [POSITION_X] = @POSITION_X @@ -185,7 +185,7 @@ Public Class ElementModel End Try End Function - Private Function GetElementId(pElement As Signature) As Integer + Private Function GetElementId(pElement As DocReceiverElement) As Integer Try Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}") @@ -196,7 +196,7 @@ Public Class ElementModel End Try End Function - Public Function DeleteElement(pElement As Signature) As Boolean + Public Function DeleteElement(pElement As DocReceiverElement) As Boolean Try Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}" Return Database.ExecuteNonQuery(oSql) diff --git a/EnvelopeGenerator.Domain/Entities/Signature.cs b/EnvelopeGenerator.Domain/Entities/DocReceiverElement.cs similarity index 96% rename from EnvelopeGenerator.Domain/Entities/Signature.cs rename to EnvelopeGenerator.Domain/Entities/DocReceiverElement.cs index 8e717815..c7a44977 100644 --- a/EnvelopeGenerator.Domain/Entities/Signature.cs +++ b/EnvelopeGenerator.Domain/Entities/DocReceiverElement.cs @@ -11,9 +11,9 @@ using System.Collections.Generic; namespace EnvelopeGenerator.Domain.Entities { [Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")] - public class Signature : ISignature, IHasReceiver, IHasAddedWhen, IUpdateAuditable + public class DocReceiverElement : ISignature, IHasReceiver, IHasAddedWhen, IUpdateAuditable { - public Signature() + public DocReceiverElement() { // TODO: * Check the Form App and remove the default value #if NETFRAMEWORK diff --git a/EnvelopeGenerator.Domain/Entities/Document.cs b/EnvelopeGenerator.Domain/Entities/Document.cs index fa02a825..d4a00c78 100644 --- a/EnvelopeGenerator.Domain/Entities/Document.cs +++ b/EnvelopeGenerator.Domain/Entities/Document.cs @@ -18,7 +18,7 @@ namespace EnvelopeGenerator.Domain.Entities public Document() { #if NETFRAMEWORK - Elements = Enumerable.Empty().ToList(); + Elements = Enumerable.Empty().ToList(); #endif } @@ -60,7 +60,7 @@ namespace EnvelopeGenerator.Domain.Entities FileNameOriginal { get; set; } #endregion - public virtual List + public virtual List #if nullable ? #endif diff --git a/EnvelopeGenerator.Domain/Entities/ElementAnnotation.cs b/EnvelopeGenerator.Domain/Entities/ElementAnnotation.cs index 3685a7b1..b2926b2f 100644 --- a/EnvelopeGenerator.Domain/Entities/ElementAnnotation.cs +++ b/EnvelopeGenerator.Domain/Entities/ElementAnnotation.cs @@ -76,7 +76,7 @@ namespace EnvelopeGenerator.Domain.Entities ChangedWho { get; set; } [ForeignKey("ElementId")] - public virtual Signature + public virtual DocReceiverElement #if nullable ? #endif diff --git a/EnvelopeGenerator.Form/Controllers/FieldEditorController.vb b/EnvelopeGenerator.Form/Controllers/FieldEditorController.vb index f6e6c83e..2aa7c8e4 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 Document - Public Property Elements As New List(Of Signature) + Public Property Elements As New List(Of DocReceiverElement) 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 Signature + Private Function GetElementByPosition(pAnnotation As AnnotationStickyNote, pPage As Integer, pReceiverId As Integer) As DocReceiverElement 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 Signature + Private Function GetElementByGuid(pGuid As Integer) As DocReceiverElement Dim oElement = Elements.Where(Function(e) pGuid = e.Id).SingleOrDefault() Return oElement End Function - Public Function GetElement(pAnnotation As AnnotationStickyNote) As Signature + Public Function GetElement(pAnnotation As AnnotationStickyNote) As DocReceiverElement 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 Signature() With { + Elements.Add(New DocReceiverElement() 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 Signature) + Public Function ClearElements(pPage As Integer, pReceiverId As Integer) As IEnumerable(Of DocReceiverElement) 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 Signature) As Boolean + Public Function SaveElement(pElement As DocReceiverElement) 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 Signature) As Boolean + Public Function DeleteElement(pElement As DocReceiverElement) As Boolean Try ' Element aus Datenbank löschen If ElementModel.DeleteElement(pElement) Then - Dim oElement = New List(Of Signature)() From {pElement} + Dim oElement = New List(Of DocReceiverElement)() From {pElement} Elements = Elements.Except(oElement).ToList() Return True Else diff --git a/EnvelopeGenerator.Form/frmFieldEditor.vb b/EnvelopeGenerator.Form/frmFieldEditor.vb index e99c8718..a99728c7 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 Signature, pReceiverId As Integer) + Private Sub LoadAnnotation(pElement As DocReceiverElement, 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() diff --git a/EnvelopeGenerator.Infrastructure/DependencyInjection.cs b/EnvelopeGenerator.Infrastructure/DependencyInjection.cs index 587ea312..00cf5aba 100644 --- a/EnvelopeGenerator.Infrastructure/DependencyInjection.cs +++ b/EnvelopeGenerator.Infrastructure/DependencyInjection.cs @@ -74,14 +74,14 @@ namespace EnvelopeGenerator.Infrastructure services.AddSQLExecutor(); services.AddSQLExecutor(); services.AddSQLExecutor(); - services.AddSQLExecutor(); + services.AddSQLExecutor(); services.AddSQLExecutor(); SetDapperTypeMap(); SetDapperTypeMap(); SetDapperTypeMap(); SetDapperTypeMap(); - SetDapperTypeMap(); + SetDapperTypeMap(); SetDapperTypeMap(); services.AddScoped(); diff --git a/EnvelopeGenerator.Infrastructure/EGDbContext.cs b/EnvelopeGenerator.Infrastructure/EGDbContext.cs index cff50672..2b6bdee0 100644 --- a/EnvelopeGenerator.Infrastructure/EGDbContext.cs +++ b/EnvelopeGenerator.Infrastructure/EGDbContext.cs @@ -45,7 +45,7 @@ public abstract class EGDbContextBase : DbContext public DbSet Envelopes { get; set; } - public DbSet DocumentReceiverElements { get; set; } + public DbSet DocumentReceiverElements { get; set; } public DbSet DocumentReceiverElementAnnotations { get; set; } @@ -154,7 +154,7 @@ public abstract class EGDbContextBase : DbContext #endregion EnvelopeDocument #region DocumentReceiverElement - modelBuilder.Entity() + modelBuilder.Entity() .HasOne(dre => dre.Document) .WithMany(ed => ed.Elements) .HasForeignKey(dre => dre.DocumentId); @@ -196,7 +196,7 @@ public abstract class EGDbContextBase : DbContext #endregion DocumentStatus #region Annotation - modelBuilder.Entity() + modelBuilder.Entity() .HasMany(signature => signature.Annotations) .WithOne(annot => annot.Element) .HasForeignKey(annot => annot.ElementId); @@ -217,7 +217,7 @@ public abstract class EGDbContextBase : DbContext // TODO: call add trigger methods with attributes and reflection AddTrigger(); - AddTrigger(); + AddTrigger(); AddTrigger(); AddTrigger(); AddTrigger(); diff --git a/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs index 759763f2..25b2b728 100644 --- a/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs +++ b/EnvelopeGenerator.Infrastructure/Repositories/DocumentReceiverElementRepository.cs @@ -6,7 +6,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Repositories; namespace EnvelopeGenerator.Infrastructure.Repositories; [Obsolete("Use IRepository")] -public class DocumentReceiverElementRepository : CRUDRepository, IDocumentReceiverElementRepository +public class DocumentReceiverElementRepository : CRUDRepository, IDocumentReceiverElementRepository { public DocumentReceiverElementRepository(EGDbContext dbContext) : base(dbContext, dbContext.DocumentReceiverElements) { diff --git a/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs b/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs index c27316ee..f52073db 100644 --- a/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs +++ b/EnvelopeGenerator.Web/Controllers/Test/TestDocumentReceiverElementController.cs @@ -5,7 +5,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Services; namespace EnvelopeGenerator.Web.Controllers.Test; [Obsolete("Use MediatR")] -public class TestDocumentReceiverElementController : TestControllerBase +public class TestDocumentReceiverElementController : TestControllerBase { public TestDocumentReceiverElementController(ILogger logger, IDocumentReceiverElementService service) : base(logger, service) {