Compare commits
270 Commits
7e1ef838d7
...
feat/final
| Author | SHA1 | Date | |
|---|---|---|---|
| 6195d99fab | |||
| 50a372a224 | |||
| 35dd2e8e07 | |||
| fac5419589 | |||
| d442ad0ce0 | |||
| cbe2acc37d | |||
| 40cc467b47 | |||
| d1513dab5e | |||
| dee424e7db | |||
| e57e9e1834 | |||
| 5b30465126 | |||
| 2dfa1de7e1 | |||
| e68965543e | |||
| 958bcdfc42 | |||
| d88ed324be | |||
| 380b141738 | |||
| f3a15216a8 | |||
| 8a48bf6b51 | |||
| 0038eeed76 | |||
| 4ed118ed2b | |||
|
|
350aa259c8 | ||
|
|
737de2202e | ||
|
|
ff60cd7ef8 | ||
|
|
e1aa7fe650 | ||
|
|
9c0b1e3fa8 | ||
| 6b34b55c4f | |||
| 4a5608249e | |||
|
|
965838513f | ||
|
|
9c4766518e | ||
|
|
292b6b2ccf | ||
|
|
6f9b5d4b13 | ||
|
|
8459706c45 | ||
|
|
972c63388e | ||
|
|
cde9ed06a1 | ||
|
|
d94f885e92 | ||
|
|
028785a8c9 | ||
|
|
e6285f13f7 | ||
| 35b7b1a080 | |||
| 67d0980c63 | |||
| c6a99b56a2 | |||
| 31f5d1f340 | |||
| a2df5d7691 | |||
| f8c586dd31 | |||
| 8aea3c8301 | |||
| 495adb8c31 | |||
| 86c0a65540 | |||
| d2e8f1fc5e | |||
| f8369e350f | |||
| b8a2ad97ef | |||
| ffffc2d470 | |||
| 36b03da084 | |||
| defa53fa26 | |||
| 6134b58a4c | |||
| 5299016b43 | |||
| 55c20e83d8 | |||
| f1a140faa7 | |||
| b20d25e5b9 | |||
| e21eb2c0d6 | |||
| d237b4ab95 | |||
| dff99b163d | |||
| 70fbf31b14 | |||
| 339e0e81cd | |||
| a386ad72bb | |||
| 02c5f286ec | |||
| 5fa358ca79 | |||
| 7233d2ce98 | |||
| 5784cc7a97 | |||
| f31f680f91 | |||
| e7c2d46ef0 | |||
| 85d70c1db4 | |||
| fb340fb08a | |||
| 7d3959ae51 | |||
| 9d4890b10d | |||
| b64f4d71f5 | |||
| b7d146ddb5 | |||
| 6a5c9a3489 | |||
|
|
15f6ee7be0 | ||
|
|
1051c5356f | ||
|
|
7b13350fbf | ||
|
|
2bada327d8 | ||
|
|
a47729ebca | ||
|
|
fcfed963b7 | ||
|
|
b2ace61cd4 | ||
|
|
77cdc83a4e | ||
|
|
a611df4914 | ||
|
|
1341f69ab1 | ||
|
|
0480513288 | ||
|
|
9dbd1b16b5 | ||
|
|
c649c93921 | ||
|
|
1843119b1b | ||
|
|
bc4371cb99 | ||
|
|
05130d6163 | ||
| 567b9c9565 | |||
| b798181f91 | |||
| 7e8fc25ec9 | |||
| db76162697 | |||
| 2b4573ea73 | |||
| 4a043ed247 | |||
| a62a035ec6 | |||
| 1713a65014 | |||
| 695d7c83e0 | |||
| 428f71863d | |||
| cce2f8f90e | |||
|
|
86c9fdfcd7 | ||
|
|
89ec887510 | ||
|
|
7d5b988842 | ||
|
|
3c456562cc | ||
|
|
4d6b01030c | ||
|
|
75e7e9925b | ||
|
|
0a175b9e9d | ||
|
|
f611e74de1 | ||
|
|
08ca116628 | ||
|
|
4997f7d75c | ||
| b5cd42b6fa | |||
| 187f4a42fc | |||
| 23d4b2f31e | |||
| 8e71e5b4bb | |||
| b693615561 | |||
| 36dc9266bc | |||
| 9aabe270b4 | |||
| b303b7be06 | |||
| 02937360ea | |||
| c2735b92e0 | |||
| 568f43186c | |||
| 3bc5439b5a | |||
| 22b494a262 | |||
| 209785dda5 | |||
| 44ea893f05 | |||
| b4aa7984aa | |||
| 7c5a505ad1 | |||
| bd6d57e1e8 | |||
| 8403ce2c6a | |||
| c3deaae63b | |||
| bb0197e6ba | |||
| ec2935b524 | |||
| 4fd7982cba | |||
| ddcf5edc00 | |||
| 74d207caa3 | |||
| a367c12551 | |||
| 35a328f8dc | |||
| d259a15b4b | |||
| 23e0e5ddbe | |||
| 0bb85c28c1 | |||
| a11d9a0e0e | |||
| b9bb058137 | |||
| 0818d7d9eb | |||
| 9d200800c5 | |||
| 6feb601670 | |||
| 39c12ada45 | |||
| 985ad4dc29 | |||
| 038ac2aed0 | |||
| 5e74de0ce7 | |||
| 0ce7ae9494 | |||
| 7041a4694a | |||
| 75e47d10e3 | |||
| 7f9125b3aa | |||
| fee256a51a | |||
| 8ad7c37261 | |||
| ef28bbaaf1 | |||
| 258de6244c | |||
| a845b85a5c | |||
| 02a7b706cf | |||
| 7912469709 | |||
| 75d975223e | |||
| c456d67d03 | |||
| 241e59fc7e | |||
| f0d101bb23 | |||
| 8db5afae40 | |||
| b62cca5961 | |||
| 0e7b120ded | |||
| d8cbdb0c65 | |||
| 0107602a84 | |||
| 02ecd88758 | |||
| 17c7e46388 | |||
| f3af30c67d | |||
| 90e10d3d04 | |||
| af14ef7ce5 | |||
| 1edcfed318 | |||
| 2004c7ced2 | |||
| 40135fb8a2 | |||
| b57c0aa9c7 | |||
| 2c4c18935f | |||
| d8ed06fdb6 | |||
| 09bf8db884 | |||
| 911c812b19 | |||
| 8ae0f79365 | |||
| 0ca54fe1fe | |||
| a1d6b5347f | |||
| 6cc631111c | |||
| 9d6074874f | |||
| 26bdb0806d | |||
| 7919f02ffd | |||
| 04ae14c660 | |||
| cff79730b0 | |||
| 188cb67306 | |||
| abaa315b24 | |||
| 4f463c27e6 | |||
| d6f17ec4e8 | |||
| e3e2831da1 | |||
| 52306d481f | |||
| f046be240b | |||
| 16e5d5c692 | |||
| e64ad44b71 | |||
| e88bd55198 | |||
| 4abed0e1bc | |||
| 69821e64c6 | |||
| f13a2434f7 | |||
| ecc7552951 | |||
| d10f19d92a | |||
| 5e53f2b691 | |||
| f56928f44f | |||
| faa37e0dcd | |||
| e51470a449 | |||
| adce61fead | |||
| e052bf56f4 | |||
| 22a7619627 | |||
| 281cf47834 | |||
| a258dcdad0 | |||
| 79c26eb5b5 | |||
| ce7ca39c39 | |||
| 7b6f916486 | |||
| 57422a481c | |||
| e96523b786 | |||
| 3b7d0e1321 | |||
| 9adc1ea4e7 | |||
| 510f5e9ddd | |||
| 44b204ca68 | |||
| b72ac68daf | |||
| 7d85d59ace | |||
| 4fad41bd0b | |||
| 39936792aa | |||
| 74f444a8d6 | |||
| b67f26cc21 | |||
| a29f918125 | |||
| 3f116ce11a | |||
| 41738bb36c | |||
| 320b2ecc77 | |||
| b02cc3d7a4 | |||
| 14f2d9b6af | |||
| df74267616 | |||
| 42870b973d | |||
| 33041a8b96 | |||
| 79db05be26 | |||
| f24a218d12 | |||
| 44a9971cf8 | |||
| 82d4b7ec6a | |||
| 9472322c1d | |||
| 53a656f6ee | |||
| ca24afe3c6 | |||
| 9c867ac8aa | |||
| 12063f36de | |||
| 167ea1444b | |||
| 794029f0e5 | |||
| 04b3d630fe | |||
| d39a3d283d | |||
| 7cae9a5291 | |||
| 6f31d7b1d0 | |||
| 06431028cb | |||
| eafcd79749 | |||
| 78473a45f1 | |||
| 5c10636e37 | |||
| 91c8043a23 | |||
| 5e77b300d6 | |||
| ec30c86da1 | |||
| 341cb175a9 | |||
| cccbb36f94 | |||
| c75877b19e | |||
| dde855a08f | |||
| 247ab38536 | |||
| 737df03f01 |
@@ -0,0 +1,22 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<RootNamespace>EnvelopeGenerator.Application.VB</RootNamespace>
|
||||||
|
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Data" Version="21.2.4" />
|
||||||
|
<PackageReference Include="DevExpress.Reporting.Core" Version="21.2.4" />
|
||||||
|
<PackageReference Include="DevExpress.Win" Version="21.2.0" />
|
||||||
|
<PackageReference Include="DevExpress.Xpo" Version="21.2.4" />
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Update="Reports\rptEnvelopeHistory.vb">
|
||||||
|
<SubType>Component</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
730
EnvelopeGenerator.Application.VB/Reports/rptEnvelopeHistory.Designer.vb
generated
Normal file
730
EnvelopeGenerator.Application.VB/Reports/rptEnvelopeHistory.Designer.vb
generated
Normal file
@@ -0,0 +1,730 @@
|
|||||||
|
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||||
|
Partial Public Class rptEnvelopeHistory
|
||||||
|
Inherits DevExpress.XtraReports.UI.XtraReport
|
||||||
|
|
||||||
|
'XtraReport overrides dispose to clean up the component list.
|
||||||
|
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||||
|
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
If disposing AndAlso components IsNot Nothing Then
|
||||||
|
components.Dispose()
|
||||||
|
End If
|
||||||
|
MyBase.Dispose(disposing)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Required by the Designer
|
||||||
|
Private components As System.ComponentModel.IContainer
|
||||||
|
|
||||||
|
'NOTE: The following procedure is required by the Designer
|
||||||
|
'It can be modified using the Designer.
|
||||||
|
'Do not modify it using the code editor.
|
||||||
|
<System.Diagnostics.DebuggerStepThrough()> _
|
||||||
|
Private Sub InitializeComponent()
|
||||||
|
Me.components = New System.ComponentModel.Container()
|
||||||
|
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(rptEnvelopeHistory))
|
||||||
|
Me.TopMargin = New DevExpress.XtraReports.UI.TopMarginBand()
|
||||||
|
Me.BottomMargin = New DevExpress.XtraReports.UI.BottomMarginBand()
|
||||||
|
Me.XrLabel1 = New DevExpress.XtraReports.UI.XRLabel()
|
||||||
|
Me.pageInfo1 = New DevExpress.XtraReports.UI.XRPageInfo()
|
||||||
|
Me.pageInfo2 = New DevExpress.XtraReports.UI.XRPageInfo()
|
||||||
|
Me.ReportHeader = New DevExpress.XtraReports.UI.ReportHeaderBand()
|
||||||
|
Me.label1 = New DevExpress.XtraReports.UI.XRLabel()
|
||||||
|
Me.XrTable3 = New DevExpress.XtraReports.UI.XRTable()
|
||||||
|
Me.XrTableRow8 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||||
|
Me.XrTableCell13 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell15 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableRow9 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||||
|
Me.XrTableCell14 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell17 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell16 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell18 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableRow10 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||||
|
Me.XrTableCell19 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell20 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell21 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell22 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableRow11 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||||
|
Me.XrTableCell23 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell24 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell25 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.XrTableCell26 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.GroupHeader1 = New DevExpress.XtraReports.UI.GroupHeaderBand()
|
||||||
|
Me.table1 = New DevExpress.XtraReports.UI.XRTable()
|
||||||
|
Me.tableRow1 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||||
|
Me.tableCell1 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.tableCell2 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.tableCell3 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.Detail = New DevExpress.XtraReports.UI.DetailBand()
|
||||||
|
Me.table2 = New DevExpress.XtraReports.UI.XRTable()
|
||||||
|
Me.tableRow2 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||||
|
Me.tableCell4 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.tableCell5 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.tableCell6 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||||
|
Me.Title = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||||
|
Me.DetailCaption1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||||
|
Me.DetailData1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||||
|
Me.DetailData3_Odd = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||||
|
Me.PageInfo = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||||
|
Me.GalleryDropDown1 = New DevExpress.XtraBars.Ribbon.GalleryDropDown(Me.components)
|
||||||
|
Me.ObjectDataSource1 = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource(Me.components)
|
||||||
|
CType(Me.XrTable3, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.table1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.table2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.GalleryDropDown1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.ObjectDataSource1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
'
|
||||||
|
'TopMargin
|
||||||
|
'
|
||||||
|
Me.TopMargin.Dpi = 254.0!
|
||||||
|
Me.TopMargin.HeightF = 190.6042!
|
||||||
|
Me.TopMargin.Name = "TopMargin"
|
||||||
|
'
|
||||||
|
'BottomMargin
|
||||||
|
'
|
||||||
|
Me.BottomMargin.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel1, Me.pageInfo1, Me.pageInfo2})
|
||||||
|
Me.BottomMargin.Dpi = 254.0!
|
||||||
|
Me.BottomMargin.Name = "BottomMargin"
|
||||||
|
'
|
||||||
|
'XrLabel1
|
||||||
|
'
|
||||||
|
Me.XrLabel1.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.XrLabel1.Borders = DevExpress.XtraPrinting.BorderSide.Top
|
||||||
|
Me.XrLabel1.Dpi = 254.0!
|
||||||
|
Me.XrLabel1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||||
|
Me.XrLabel1.LocationFloat = New DevExpress.Utils.PointFloat(896.5417!, 0!)
|
||||||
|
Me.XrLabel1.Name = "XrLabel1"
|
||||||
|
Me.XrLabel1.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254.0!)
|
||||||
|
Me.XrLabel1.SizeF = New System.Drawing.SizeF(645.5836!, 58.0!)
|
||||||
|
Me.XrLabel1.StyleName = "Title"
|
||||||
|
Me.XrLabel1.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrLabel1.StylePriority.UseBorders = False
|
||||||
|
Me.XrLabel1.StylePriority.UseFont = False
|
||||||
|
Me.XrLabel1.StylePriority.UsePadding = False
|
||||||
|
Me.XrLabel1.Text = "Erstellt mit SignFlow"
|
||||||
|
'
|
||||||
|
'pageInfo1
|
||||||
|
'
|
||||||
|
Me.pageInfo1.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.pageInfo1.Borders = DevExpress.XtraPrinting.BorderSide.Top
|
||||||
|
Me.pageInfo1.Dpi = 254.0!
|
||||||
|
Me.pageInfo1.LocationFloat = New DevExpress.Utils.PointFloat(0!, 0!)
|
||||||
|
Me.pageInfo1.Name = "pageInfo1"
|
||||||
|
Me.pageInfo1.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime
|
||||||
|
Me.pageInfo1.SizeF = New System.Drawing.SizeF(896.5417!, 58.0!)
|
||||||
|
Me.pageInfo1.StyleName = "PageInfo"
|
||||||
|
Me.pageInfo1.StylePriority.UseBorderColor = False
|
||||||
|
Me.pageInfo1.StylePriority.UseBorders = False
|
||||||
|
Me.pageInfo1.TextFormatString = "{0:dddd, d. MMMM yyyy HH:mm}"
|
||||||
|
'
|
||||||
|
'pageInfo2
|
||||||
|
'
|
||||||
|
Me.pageInfo2.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.pageInfo2.Borders = DevExpress.XtraPrinting.BorderSide.Top
|
||||||
|
Me.pageInfo2.Dpi = 254.0!
|
||||||
|
Me.pageInfo2.LocationFloat = New DevExpress.Utils.PointFloat(1542.125!, 0!)
|
||||||
|
Me.pageInfo2.Name = "pageInfo2"
|
||||||
|
Me.pageInfo2.SizeF = New System.Drawing.SizeF(357.875!, 58.0!)
|
||||||
|
Me.pageInfo2.StyleName = "PageInfo"
|
||||||
|
Me.pageInfo2.StylePriority.UseBorderColor = False
|
||||||
|
Me.pageInfo2.StylePriority.UseBorders = False
|
||||||
|
Me.pageInfo2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
|
||||||
|
Me.pageInfo2.TextFormatString = "Seite {0} von {1}"
|
||||||
|
'
|
||||||
|
'ReportHeader
|
||||||
|
'
|
||||||
|
Me.ReportHeader.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.label1, Me.XrTable3})
|
||||||
|
Me.ReportHeader.Dpi = 254.0!
|
||||||
|
Me.ReportHeader.HeightF = 406.0843!
|
||||||
|
Me.ReportHeader.Name = "ReportHeader"
|
||||||
|
'
|
||||||
|
'label1
|
||||||
|
'
|
||||||
|
Me.label1.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
|
Me.label1.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.label1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||||
|
Me.label1.BorderWidth = 2.0!
|
||||||
|
Me.label1.Dpi = 254.0!
|
||||||
|
Me.label1.Font = New System.Drawing.Font("Segoe UI", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.label1.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.label1.LocationFloat = New DevExpress.Utils.PointFloat(0.0002422333!, 0!)
|
||||||
|
Me.label1.Name = "label1"
|
||||||
|
Me.label1.Padding = New DevExpress.XtraPrinting.PaddingInfo(10, 10, 5, 5, 254.0!)
|
||||||
|
Me.label1.SizeF = New System.Drawing.SizeF(1900.0!, 77.32857!)
|
||||||
|
Me.label1.StyleName = "Title"
|
||||||
|
Me.label1.StylePriority.UseBackColor = False
|
||||||
|
Me.label1.StylePriority.UseBorderColor = False
|
||||||
|
Me.label1.StylePriority.UseBorders = False
|
||||||
|
Me.label1.StylePriority.UseBorderWidth = False
|
||||||
|
Me.label1.StylePriority.UseFont = False
|
||||||
|
Me.label1.StylePriority.UseForeColor = False
|
||||||
|
Me.label1.StylePriority.UsePadding = False
|
||||||
|
Me.label1.Text = "Signierungszertifikat"
|
||||||
|
'
|
||||||
|
'XrTable3
|
||||||
|
'
|
||||||
|
Me.XrTable3.Dpi = 254.0!
|
||||||
|
Me.XrTable3.LocationFloat = New DevExpress.Utils.PointFloat(0.0002422333!, 96.60422!)
|
||||||
|
Me.XrTable3.Name = "XrTable3"
|
||||||
|
Me.XrTable3.OddStyleName = "DetailData3_Odd"
|
||||||
|
Me.XrTable3.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.XrTableRow8, Me.XrTableRow9, Me.XrTableRow10, Me.XrTableRow11})
|
||||||
|
Me.XrTable3.SizeF = New System.Drawing.SizeF(1900.0!, 284.4801!)
|
||||||
|
'
|
||||||
|
'XrTableRow8
|
||||||
|
'
|
||||||
|
Me.XrTableRow8.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.XrTableCell13, Me.XrTableCell15})
|
||||||
|
Me.XrTableRow8.Dpi = 254.0!
|
||||||
|
Me.XrTableRow8.Name = "XrTableRow8"
|
||||||
|
Me.XrTableRow8.Weight = 1.0R
|
||||||
|
'
|
||||||
|
'XrTableCell13
|
||||||
|
'
|
||||||
|
Me.XrTableCell13.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
|
Me.XrTableCell13.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.XrTableCell13.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||||
|
Me.XrTableCell13.BorderWidth = 1.0!
|
||||||
|
Me.XrTableCell13.Dpi = 254.0!
|
||||||
|
Me.XrTableCell13.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell13.Name = "XrTableCell13"
|
||||||
|
Me.XrTableCell13.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell13.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell13.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell13.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell13.StylePriority.UseBorderWidth = False
|
||||||
|
Me.XrTableCell13.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell13.Text = "Ersteller"
|
||||||
|
Me.XrTableCell13.Weight = 0.38139956730411484R
|
||||||
|
'
|
||||||
|
'XrTableCell15
|
||||||
|
'
|
||||||
|
Me.XrTableCell15.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
|
Me.XrTableCell15.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.XrTableCell15.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||||
|
Me.XrTableCell15.BorderWidth = 1.0!
|
||||||
|
Me.XrTableCell15.Dpi = 254.0!
|
||||||
|
Me.XrTableCell15.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell15.Name = "XrTableCell15"
|
||||||
|
Me.XrTableCell15.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell15.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell15.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell15.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell15.StylePriority.UseBorderWidth = False
|
||||||
|
Me.XrTableCell15.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell15.Text = "Umschlag"
|
||||||
|
Me.XrTableCell15.Weight = 0.49859081604996847R
|
||||||
|
'
|
||||||
|
'XrTableRow9
|
||||||
|
'
|
||||||
|
Me.XrTableRow9.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.XrTableCell14, Me.XrTableCell17, Me.XrTableCell16, Me.XrTableCell18})
|
||||||
|
Me.XrTableRow9.Dpi = 254.0!
|
||||||
|
Me.XrTableRow9.Name = "XrTableRow9"
|
||||||
|
Me.XrTableRow9.Weight = 1.0R
|
||||||
|
'
|
||||||
|
'XrTableCell14
|
||||||
|
'
|
||||||
|
Me.XrTableCell14.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell14.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell14.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell14.Dpi = 254.0!
|
||||||
|
Me.XrTableCell14.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell14.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell14.Multiline = True
|
||||||
|
Me.XrTableCell14.Name = "XrTableCell14"
|
||||||
|
Me.XrTableCell14.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell14.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell14.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell14.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell14.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell14.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell14.Text = "Name"
|
||||||
|
Me.XrTableCell14.Weight = 0.11578820509129036R
|
||||||
|
'
|
||||||
|
'XrTableCell17
|
||||||
|
'
|
||||||
|
Me.XrTableCell17.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell17.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell17.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell17.Dpi = 254.0!
|
||||||
|
Me.XrTableCell17.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[User].[FullName]")})
|
||||||
|
Me.XrTableCell17.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell17.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell17.Multiline = True
|
||||||
|
Me.XrTableCell17.Name = "XrTableCell17"
|
||||||
|
Me.XrTableCell17.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell17.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell17.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell17.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell17.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell17.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell17.Text = "XrTableCell17"
|
||||||
|
Me.XrTableCell17.Weight = 0.2656113622128245R
|
||||||
|
'
|
||||||
|
'XrTableCell16
|
||||||
|
'
|
||||||
|
Me.XrTableCell16.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell16.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell16.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell16.Dpi = 254.0!
|
||||||
|
Me.XrTableCell16.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell16.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell16.Multiline = True
|
||||||
|
Me.XrTableCell16.Name = "XrTableCell16"
|
||||||
|
Me.XrTableCell16.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell16.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell16.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell16.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell16.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell16.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell16.Text = "Titel"
|
||||||
|
Me.XrTableCell16.Weight = 0.11578821158083684R
|
||||||
|
'
|
||||||
|
'XrTableCell18
|
||||||
|
'
|
||||||
|
Me.XrTableCell18.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell18.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell18.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell18.Dpi = 254.0!
|
||||||
|
Me.XrTableCell18.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[Title]")})
|
||||||
|
Me.XrTableCell18.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell18.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell18.Multiline = True
|
||||||
|
Me.XrTableCell18.Name = "XrTableCell18"
|
||||||
|
Me.XrTableCell18.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell18.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell18.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell18.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell18.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell18.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell18.Text = "XrTableCell18"
|
||||||
|
Me.XrTableCell18.Weight = 0.38280260446913167R
|
||||||
|
'
|
||||||
|
'XrTableRow10
|
||||||
|
'
|
||||||
|
Me.XrTableRow10.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.XrTableCell19, Me.XrTableCell20, Me.XrTableCell21, Me.XrTableCell22})
|
||||||
|
Me.XrTableRow10.Dpi = 254.0!
|
||||||
|
Me.XrTableRow10.Name = "XrTableRow10"
|
||||||
|
Me.XrTableRow10.Weight = 1.0R
|
||||||
|
'
|
||||||
|
'XrTableCell19
|
||||||
|
'
|
||||||
|
Me.XrTableCell19.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell19.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell19.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell19.Dpi = 254.0!
|
||||||
|
Me.XrTableCell19.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell19.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell19.Multiline = True
|
||||||
|
Me.XrTableCell19.Name = "XrTableCell19"
|
||||||
|
Me.XrTableCell19.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell19.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell19.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell19.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell19.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell19.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell19.Text = "EmailAddress"
|
||||||
|
Me.XrTableCell19.Weight = 0.11578820509129036R
|
||||||
|
'
|
||||||
|
'XrTableCell20
|
||||||
|
'
|
||||||
|
Me.XrTableCell20.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell20.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell20.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell20.Dpi = 254.0!
|
||||||
|
Me.XrTableCell20.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[User].[EmailAddress]")})
|
||||||
|
Me.XrTableCell20.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell20.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell20.Multiline = True
|
||||||
|
Me.XrTableCell20.Name = "XrTableCell20"
|
||||||
|
Me.XrTableCell20.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell20.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell20.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell20.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell20.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell20.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell20.Text = "XrTableCell20"
|
||||||
|
Me.XrTableCell20.Weight = 0.2656113622128245R
|
||||||
|
'
|
||||||
|
'XrTableCell21
|
||||||
|
'
|
||||||
|
Me.XrTableCell21.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell21.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell21.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell21.Dpi = 254.0!
|
||||||
|
Me.XrTableCell21.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell21.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell21.Multiline = True
|
||||||
|
Me.XrTableCell21.Name = "XrTableCell21"
|
||||||
|
Me.XrTableCell21.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell21.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell21.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell21.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell21.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell21.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell21.Text = "Umschlag-ID"
|
||||||
|
Me.XrTableCell21.Weight = 0.11578821158083684R
|
||||||
|
'
|
||||||
|
'XrTableCell22
|
||||||
|
'
|
||||||
|
Me.XrTableCell22.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell22.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell22.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell22.Dpi = 254.0!
|
||||||
|
Me.XrTableCell22.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[Uuid]")})
|
||||||
|
Me.XrTableCell22.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell22.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell22.Multiline = True
|
||||||
|
Me.XrTableCell22.Name = "XrTableCell22"
|
||||||
|
Me.XrTableCell22.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell22.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell22.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell22.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell22.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell22.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell22.Text = "XrTableCell22"
|
||||||
|
Me.XrTableCell22.Weight = 0.38280260446913167R
|
||||||
|
'
|
||||||
|
'XrTableRow11
|
||||||
|
'
|
||||||
|
Me.XrTableRow11.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.XrTableCell23, Me.XrTableCell24, Me.XrTableCell25, Me.XrTableCell26})
|
||||||
|
Me.XrTableRow11.Dpi = 254.0!
|
||||||
|
Me.XrTableRow11.Name = "XrTableRow11"
|
||||||
|
Me.XrTableRow11.Weight = 1.0R
|
||||||
|
'
|
||||||
|
'XrTableCell23
|
||||||
|
'
|
||||||
|
Me.XrTableCell23.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell23.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell23.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell23.Dpi = 254.0!
|
||||||
|
Me.XrTableCell23.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell23.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell23.Multiline = True
|
||||||
|
Me.XrTableCell23.Name = "XrTableCell23"
|
||||||
|
Me.XrTableCell23.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell23.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell23.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell23.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell23.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell23.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell23.Weight = 0.11578820509129036R
|
||||||
|
'
|
||||||
|
'XrTableCell24
|
||||||
|
'
|
||||||
|
Me.XrTableCell24.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell24.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell24.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell24.Dpi = 254.0!
|
||||||
|
Me.XrTableCell24.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell24.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell24.Multiline = True
|
||||||
|
Me.XrTableCell24.Name = "XrTableCell24"
|
||||||
|
Me.XrTableCell24.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell24.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell24.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell24.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell24.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell24.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell24.Weight = 0.2656113622128245R
|
||||||
|
'
|
||||||
|
'XrTableCell25
|
||||||
|
'
|
||||||
|
Me.XrTableCell25.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell25.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell25.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell25.Dpi = 254.0!
|
||||||
|
Me.XrTableCell25.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell25.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell25.Multiline = True
|
||||||
|
Me.XrTableCell25.Name = "XrTableCell25"
|
||||||
|
Me.XrTableCell25.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell25.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell25.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell25.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell25.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell25.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell25.Text = "Zertifizierung"
|
||||||
|
Me.XrTableCell25.Weight = 0.11578821158083684R
|
||||||
|
'
|
||||||
|
'XrTableCell26
|
||||||
|
'
|
||||||
|
Me.XrTableCell26.BackColor = System.Drawing.Color.White
|
||||||
|
Me.XrTableCell26.BorderColor = System.Drawing.Color.Empty
|
||||||
|
Me.XrTableCell26.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.XrTableCell26.Dpi = 254.0!
|
||||||
|
Me.XrTableCell26.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[CertificationType]")})
|
||||||
|
Me.XrTableCell26.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.XrTableCell26.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.XrTableCell26.Multiline = True
|
||||||
|
Me.XrTableCell26.Name = "XrTableCell26"
|
||||||
|
Me.XrTableCell26.StyleName = "DetailCaption1"
|
||||||
|
Me.XrTableCell26.StylePriority.UseBackColor = False
|
||||||
|
Me.XrTableCell26.StylePriority.UseBorderColor = False
|
||||||
|
Me.XrTableCell26.StylePriority.UseBorders = False
|
||||||
|
Me.XrTableCell26.StylePriority.UseFont = False
|
||||||
|
Me.XrTableCell26.StylePriority.UseForeColor = False
|
||||||
|
Me.XrTableCell26.Text = "XrTableCell26"
|
||||||
|
Me.XrTableCell26.Weight = 0.38280260446913161R
|
||||||
|
'
|
||||||
|
'GroupHeader1
|
||||||
|
'
|
||||||
|
Me.GroupHeader1.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.table1})
|
||||||
|
Me.GroupHeader1.Dpi = 254.0!
|
||||||
|
Me.GroupHeader1.GroupUnion = DevExpress.XtraReports.UI.GroupUnion.WithFirstDetail
|
||||||
|
Me.GroupHeader1.HeightF = 71.12!
|
||||||
|
Me.GroupHeader1.Name = "GroupHeader1"
|
||||||
|
'
|
||||||
|
'table1
|
||||||
|
'
|
||||||
|
Me.table1.Dpi = 254.0!
|
||||||
|
Me.table1.LocationFloat = New DevExpress.Utils.PointFloat(0!, 0!)
|
||||||
|
Me.table1.Name = "table1"
|
||||||
|
Me.table1.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.tableRow1})
|
||||||
|
Me.table1.SizeF = New System.Drawing.SizeF(1900.0!, 71.12!)
|
||||||
|
'
|
||||||
|
'tableRow1
|
||||||
|
'
|
||||||
|
Me.tableRow1.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.tableCell1, Me.tableCell2, Me.tableCell3})
|
||||||
|
Me.tableRow1.Dpi = 254.0!
|
||||||
|
Me.tableRow1.Name = "tableRow1"
|
||||||
|
Me.tableRow1.Weight = 1.0R
|
||||||
|
'
|
||||||
|
'tableCell1
|
||||||
|
'
|
||||||
|
Me.tableCell1.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
|
Me.tableCell1.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.tableCell1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||||
|
Me.tableCell1.BorderWidth = 1.0!
|
||||||
|
Me.tableCell1.Dpi = 254.0!
|
||||||
|
Me.tableCell1.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.tableCell1.Name = "tableCell1"
|
||||||
|
Me.tableCell1.StyleName = "DetailCaption1"
|
||||||
|
Me.tableCell1.StylePriority.UseBackColor = False
|
||||||
|
Me.tableCell1.StylePriority.UseBorderColor = False
|
||||||
|
Me.tableCell1.StylePriority.UseBorders = False
|
||||||
|
Me.tableCell1.StylePriority.UseBorderWidth = False
|
||||||
|
Me.tableCell1.StylePriority.UseForeColor = False
|
||||||
|
Me.tableCell1.Text = "Ereignis"
|
||||||
|
Me.tableCell1.Weight = 0.51726482588176181R
|
||||||
|
'
|
||||||
|
'tableCell2
|
||||||
|
'
|
||||||
|
Me.tableCell2.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
|
Me.tableCell2.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.tableCell2.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||||
|
Me.tableCell2.BorderWidth = 1.0!
|
||||||
|
Me.tableCell2.Dpi = 254.0!
|
||||||
|
Me.tableCell2.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.tableCell2.Name = "tableCell2"
|
||||||
|
Me.tableCell2.StyleName = "DetailCaption1"
|
||||||
|
Me.tableCell2.StylePriority.UseBackColor = False
|
||||||
|
Me.tableCell2.StylePriority.UseBorderColor = False
|
||||||
|
Me.tableCell2.StylePriority.UseBorders = False
|
||||||
|
Me.tableCell2.StylePriority.UseBorderWidth = False
|
||||||
|
Me.tableCell2.StylePriority.UseForeColor = False
|
||||||
|
Me.tableCell2.Text = "Benutzer"
|
||||||
|
Me.tableCell2.Weight = 0.45140669898958585R
|
||||||
|
'
|
||||||
|
'tableCell3
|
||||||
|
'
|
||||||
|
Me.tableCell3.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
|
Me.tableCell3.BorderColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer))
|
||||||
|
Me.tableCell3.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||||
|
Me.tableCell3.BorderWidth = 1.0!
|
||||||
|
Me.tableCell3.Dpi = 254.0!
|
||||||
|
Me.tableCell3.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.tableCell3.Name = "tableCell3"
|
||||||
|
Me.tableCell3.StyleName = "DetailCaption1"
|
||||||
|
Me.tableCell3.StylePriority.UseBackColor = False
|
||||||
|
Me.tableCell3.StylePriority.UseBorderColor = False
|
||||||
|
Me.tableCell3.StylePriority.UseBorders = False
|
||||||
|
Me.tableCell3.StylePriority.UseBorderWidth = False
|
||||||
|
Me.tableCell3.StylePriority.UseForeColor = False
|
||||||
|
Me.tableCell3.Text = "Zeitstempel"
|
||||||
|
Me.tableCell3.Weight = 0.22479583469004233R
|
||||||
|
'
|
||||||
|
'Detail
|
||||||
|
'
|
||||||
|
Me.Detail.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.table2})
|
||||||
|
Me.Detail.Dpi = 254.0!
|
||||||
|
Me.Detail.HeightF = 86.174!
|
||||||
|
Me.Detail.HierarchyPrintOptions.Indent = 50.8!
|
||||||
|
Me.Detail.Name = "Detail"
|
||||||
|
'
|
||||||
|
'table2
|
||||||
|
'
|
||||||
|
Me.table2.Dpi = 254.0!
|
||||||
|
Me.table2.LocationFloat = New DevExpress.Utils.PointFloat(0!, 0!)
|
||||||
|
Me.table2.Name = "table2"
|
||||||
|
Me.table2.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.tableRow2})
|
||||||
|
Me.table2.SizeF = New System.Drawing.SizeF(1900.0!, 63.42!)
|
||||||
|
'
|
||||||
|
'tableRow2
|
||||||
|
'
|
||||||
|
Me.tableRow2.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.tableCell4, Me.tableCell5, Me.tableCell6})
|
||||||
|
Me.tableRow2.Dpi = 254.0!
|
||||||
|
Me.tableRow2.Name = "tableRow2"
|
||||||
|
Me.tableRow2.Weight = 11.683999633789062R
|
||||||
|
'
|
||||||
|
'tableCell4
|
||||||
|
'
|
||||||
|
Me.tableCell4.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.tableCell4.Dpi = 254.0!
|
||||||
|
Me.tableCell4.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ItemStatusTranslated]")})
|
||||||
|
Me.tableCell4.Name = "tableCell4"
|
||||||
|
Me.tableCell4.StyleName = "DetailData1"
|
||||||
|
Me.tableCell4.StylePriority.UseBorders = False
|
||||||
|
Me.tableCell4.Weight = 0.51726482142156094R
|
||||||
|
'
|
||||||
|
'tableCell5
|
||||||
|
'
|
||||||
|
Me.tableCell5.Dpi = 254.0!
|
||||||
|
Me.tableCell5.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ItemUserReference]")})
|
||||||
|
Me.tableCell5.Name = "tableCell5"
|
||||||
|
Me.tableCell5.StyleName = "DetailData1"
|
||||||
|
Me.tableCell5.Weight = 0.45140669932916544R
|
||||||
|
'
|
||||||
|
'tableCell6
|
||||||
|
'
|
||||||
|
Me.tableCell6.Dpi = 254.0!
|
||||||
|
Me.tableCell6.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[ItemDate]")})
|
||||||
|
Me.tableCell6.Name = "tableCell6"
|
||||||
|
Me.tableCell6.StyleName = "DetailData1"
|
||||||
|
Me.tableCell6.StylePriority.UseTextAlignment = False
|
||||||
|
Me.tableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight
|
||||||
|
Me.tableCell6.Weight = 0.22479581593269077R
|
||||||
|
'
|
||||||
|
'Title
|
||||||
|
'
|
||||||
|
Me.Title.BackColor = System.Drawing.Color.Transparent
|
||||||
|
Me.Title.BorderColor = System.Drawing.Color.Black
|
||||||
|
Me.Title.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.Title.BorderWidth = 1.0!
|
||||||
|
Me.Title.Font = New System.Drawing.Font("Arial", 14.25!)
|
||||||
|
Me.Title.ForeColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer))
|
||||||
|
Me.Title.Name = "Title"
|
||||||
|
Me.Title.Padding = New DevExpress.XtraPrinting.PaddingInfo(15, 15, 0, 0, 254.0!)
|
||||||
|
'
|
||||||
|
'DetailCaption1
|
||||||
|
'
|
||||||
|
Me.DetailCaption1.BackColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer))
|
||||||
|
Me.DetailCaption1.BorderColor = System.Drawing.Color.White
|
||||||
|
Me.DetailCaption1.Borders = DevExpress.XtraPrinting.BorderSide.Left
|
||||||
|
Me.DetailCaption1.BorderWidth = 2.0!
|
||||||
|
Me.DetailCaption1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||||
|
Me.DetailCaption1.ForeColor = System.Drawing.Color.White
|
||||||
|
Me.DetailCaption1.Name = "DetailCaption1"
|
||||||
|
Me.DetailCaption1.Padding = New DevExpress.XtraPrinting.PaddingInfo(15, 15, 0, 0, 254.0!)
|
||||||
|
Me.DetailCaption1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||||
|
'
|
||||||
|
'DetailData1
|
||||||
|
'
|
||||||
|
Me.DetailData1.BorderColor = System.Drawing.Color.Transparent
|
||||||
|
Me.DetailData1.Borders = DevExpress.XtraPrinting.BorderSide.Left
|
||||||
|
Me.DetailData1.BorderWidth = 2.0!
|
||||||
|
Me.DetailData1.Font = New System.Drawing.Font("Arial", 8.25!)
|
||||||
|
Me.DetailData1.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.DetailData1.Name = "DetailData1"
|
||||||
|
Me.DetailData1.Padding = New DevExpress.XtraPrinting.PaddingInfo(15, 15, 0, 0, 254.0!)
|
||||||
|
Me.DetailData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||||
|
'
|
||||||
|
'DetailData3_Odd
|
||||||
|
'
|
||||||
|
Me.DetailData3_Odd.BackColor = System.Drawing.Color.FromArgb(CType(CType(231, Byte), Integer), CType(CType(231, Byte), Integer), CType(CType(231, Byte), Integer))
|
||||||
|
Me.DetailData3_Odd.BorderColor = System.Drawing.Color.Transparent
|
||||||
|
Me.DetailData3_Odd.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||||
|
Me.DetailData3_Odd.BorderWidth = 1.0!
|
||||||
|
Me.DetailData3_Odd.Font = New System.Drawing.Font("Arial", 8.25!)
|
||||||
|
Me.DetailData3_Odd.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.DetailData3_Odd.Name = "DetailData3_Odd"
|
||||||
|
Me.DetailData3_Odd.Padding = New DevExpress.XtraPrinting.PaddingInfo(15, 15, 0, 0, 254.0!)
|
||||||
|
Me.DetailData3_Odd.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||||
|
'
|
||||||
|
'PageInfo
|
||||||
|
'
|
||||||
|
Me.PageInfo.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||||
|
Me.PageInfo.ForeColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer))
|
||||||
|
Me.PageInfo.Name = "PageInfo"
|
||||||
|
Me.PageInfo.Padding = New DevExpress.XtraPrinting.PaddingInfo(15, 15, 0, 0, 254.0!)
|
||||||
|
'
|
||||||
|
'GalleryDropDown1
|
||||||
|
'
|
||||||
|
Me.GalleryDropDown1.Manager = Nothing
|
||||||
|
Me.GalleryDropDown1.Name = "GalleryDropDown1"
|
||||||
|
'
|
||||||
|
'ObjectDataSource1
|
||||||
|
'
|
||||||
|
Me.ObjectDataSource1.DataMember = "Items"
|
||||||
|
'Me.ObjectDataSource1.DataSource = GetType(EnvelopeGenerator.CommonServices.ReportSource)
|
||||||
|
Me.ObjectDataSource1.Name = "ObjectDataSource1"
|
||||||
|
'
|
||||||
|
'rptEnvelopeHistory
|
||||||
|
'
|
||||||
|
Me.Bands.AddRange(New DevExpress.XtraReports.UI.Band() {Me.TopMargin, Me.BottomMargin, Me.ReportHeader, Me.GroupHeader1, Me.Detail})
|
||||||
|
Me.ComponentStorage.AddRange(New System.ComponentModel.IComponent() {Me.ObjectDataSource1})
|
||||||
|
Me.DataSource = Me.ObjectDataSource1
|
||||||
|
Me.Dpi = 254.0!
|
||||||
|
Me.Font = New System.Drawing.Font("Arial", 9.75!)
|
||||||
|
Me.Margins = New System.Drawing.Printing.Margins(100, 100, 191, 100)
|
||||||
|
Me.PageHeight = 2970
|
||||||
|
Me.PageWidth = 2100
|
||||||
|
Me.PaperKind = System.Drawing.Printing.PaperKind.A4
|
||||||
|
Me.ReportUnit = DevExpress.XtraReports.UI.ReportUnit.TenthsOfAMillimeter
|
||||||
|
Me.SnapGridSize = 25.0!
|
||||||
|
Me.StyleSheet.AddRange(New DevExpress.XtraReports.UI.XRControlStyle() {Me.Title, Me.DetailCaption1, Me.DetailData1, Me.DetailData3_Odd, Me.PageInfo})
|
||||||
|
Me.Version = "21.2"
|
||||||
|
Me.Watermark.ImageSource = New DevExpress.XtraPrinting.Drawing.ImageSource("img", resources.GetString("rptEnvelopeHistory.Watermark.ImageSource"))
|
||||||
|
Me.Watermark.ImageTransparency = 220
|
||||||
|
CType(Me.XrTable3, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.table1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.table2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.GalleryDropDown1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.ObjectDataSource1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend WithEvents TopMargin As DevExpress.XtraReports.UI.TopMarginBand
|
||||||
|
Friend WithEvents BottomMargin As DevExpress.XtraReports.UI.BottomMarginBand
|
||||||
|
Friend WithEvents pageInfo1 As DevExpress.XtraReports.UI.XRPageInfo
|
||||||
|
Friend WithEvents pageInfo2 As DevExpress.XtraReports.UI.XRPageInfo
|
||||||
|
Friend WithEvents ReportHeader As DevExpress.XtraReports.UI.ReportHeaderBand
|
||||||
|
Friend WithEvents label1 As DevExpress.XtraReports.UI.XRLabel
|
||||||
|
Friend WithEvents GroupHeader1 As DevExpress.XtraReports.UI.GroupHeaderBand
|
||||||
|
Friend WithEvents table1 As DevExpress.XtraReports.UI.XRTable
|
||||||
|
Friend WithEvents tableRow1 As DevExpress.XtraReports.UI.XRTableRow
|
||||||
|
Friend WithEvents tableCell1 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents tableCell2 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents tableCell3 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents Detail As DevExpress.XtraReports.UI.DetailBand
|
||||||
|
Friend WithEvents table2 As DevExpress.XtraReports.UI.XRTable
|
||||||
|
Friend WithEvents tableRow2 As DevExpress.XtraReports.UI.XRTableRow
|
||||||
|
Friend WithEvents tableCell4 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents tableCell5 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents tableCell6 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents ObjectDataSource1 As DevExpress.DataAccess.ObjectBinding.ObjectDataSource
|
||||||
|
Friend WithEvents Title As DevExpress.XtraReports.UI.XRControlStyle
|
||||||
|
Friend WithEvents DetailCaption1 As DevExpress.XtraReports.UI.XRControlStyle
|
||||||
|
Friend WithEvents DetailData1 As DevExpress.XtraReports.UI.XRControlStyle
|
||||||
|
Friend WithEvents DetailData3_Odd As DevExpress.XtraReports.UI.XRControlStyle
|
||||||
|
Friend WithEvents PageInfo As DevExpress.XtraReports.UI.XRControlStyle
|
||||||
|
Friend WithEvents XrLabel1 As DevExpress.XtraReports.UI.XRLabel
|
||||||
|
Friend WithEvents XrTable3 As DevExpress.XtraReports.UI.XRTable
|
||||||
|
Friend WithEvents XrTableRow8 As DevExpress.XtraReports.UI.XRTableRow
|
||||||
|
Friend WithEvents XrTableCell13 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell15 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableRow9 As DevExpress.XtraReports.UI.XRTableRow
|
||||||
|
Friend WithEvents XrTableCell14 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell17 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell16 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell18 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableRow10 As DevExpress.XtraReports.UI.XRTableRow
|
||||||
|
Friend WithEvents XrTableCell19 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell20 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell21 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell22 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableRow11 As DevExpress.XtraReports.UI.XRTableRow
|
||||||
|
Friend WithEvents XrTableCell23 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell24 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell25 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents XrTableCell26 As DevExpress.XtraReports.UI.XRTableCell
|
||||||
|
Friend WithEvents GalleryDropDown1 As DevExpress.XtraBars.Ribbon.GalleryDropDown
|
||||||
|
End Class
|
||||||
129
EnvelopeGenerator.Application.VB/Reports/rptEnvelopeHistory.resx
Normal file
129
EnvelopeGenerator.Application.VB/Reports/rptEnvelopeHistory.resx
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
|||||||
|
Public Class rptEnvelopeHistory
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace EnvelopeGenerator.Application.Common.Configurations;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class DbTriggerParams : Dictionary<string, ICollection<string>>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class GdPictureParams
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string License { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.Model;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class PDFBurnerParams : ITextStyle
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int ConcurrencyLimit { get; set; } = 5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<string> IgnoredLabels { get; set; } = new List<string>
|
||||||
|
{
|
||||||
|
"Date", "Datum", "ZIP", "PLZ", "Place", "Ort", "Position", "Stellung"
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public double TopMargin { get; set; } = 0.1;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double YOffset { get; set; } = -0.3;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string FontName { get; set; } = "Arial";
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int FontSize { get; set; } = 8;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
|
||||||
|
public FontStyle FontStyle { get; set; } = FontStyle.Italic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, int> IndexOfAnnot { get; init; } = new()
|
||||||
|
{
|
||||||
|
{ string.Empty, 0 },
|
||||||
|
{ "seal", 0 },
|
||||||
|
{ "position", 1 },
|
||||||
|
{ "city", 2 },
|
||||||
|
{ "date", 3 }
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int DefaultIndexOfAnnot { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int GetAnnotationIndex(string name) => IndexOfAnnot.TryGetValue(name, out var value) ? value : DefaultIndexOfAnnot;
|
||||||
|
}
|
||||||
73
EnvelopeGenerator.Application/Common/Dto/AnnotationDto.cs
Normal file
73
EnvelopeGenerator.Application/Common/Dto/AnnotationDto.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record AnnotationCreateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int ElementId { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; init; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Value { get; init; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Type { get; init; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double? X { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double? Y { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double? Width { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public double? Height { get; init; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record AnnotationDto : AnnotationCreateDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? ChangedWho { get; init; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record EnvelopeReportDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
// --- HEAD ---
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string HeadUuid { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string EnvelopeTitle { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string HeadMessage { get; set; } = null!;
|
||||||
|
|
||||||
|
// --- POSITIONS ---
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int ItemStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ItemDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string ItemUserReference { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -35,6 +35,9 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
||||||
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
|
CreateMap<ElementAnnotation, AnnotationDto>();
|
||||||
|
CreateMap<ThirdPartyModule, ThirdPartyModuleDto>();
|
||||||
|
CreateMap<EnvelopeReport, EnvelopeReportDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
CreateMap<ConfigDto, Config>();
|
CreateMap<ConfigDto, Config>();
|
||||||
@@ -50,6 +53,8 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<ReceiverDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
CreateMap<ReceiverDto, Domain.Entities.Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
|
||||||
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyCreateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, Domain.Entities.EnvelopeReceiverReadOnly>();
|
||||||
|
CreateMap<AnnotationCreateDto, ElementAnnotation>()
|
||||||
|
.ForMember(dest => dest.AddedWhen, opt => opt.MapFrom(_ => DateTime.UtcNow));
|
||||||
|
|
||||||
// Messaging mappings
|
// Messaging mappings
|
||||||
// for GTX messaging
|
// for GTX messaging
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class Annotation
|
||||||
|
{
|
||||||
|
private string? _id;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int EnvelopeId { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int ReceiverId { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Index { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string EgName { get; private set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool HasStructuredID { get; private set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool IsLabel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(EgName))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var parts = EgName.Split('_');
|
||||||
|
return parts.Length > 1 && parts[1] == "label";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? Id
|
||||||
|
{
|
||||||
|
get => _id;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_id = value;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(value))
|
||||||
|
throw new BurnAnnotationException("The identifier of annotation is null or empty.");
|
||||||
|
|
||||||
|
var parts = value.Split('#');
|
||||||
|
|
||||||
|
if (parts.Length != 4)
|
||||||
|
return;
|
||||||
|
// throw new BurnAnnotationException($"The identifier of annotation has more or less than 4 sub-part. Id: {_id}");
|
||||||
|
|
||||||
|
if (!int.TryParse(parts[0], out int envelopeId))
|
||||||
|
throw new BurnAnnotationException($"The envelope ID of annotation is not integer. Id: {_id}");
|
||||||
|
EnvelopeId = envelopeId;
|
||||||
|
|
||||||
|
if (!int.TryParse(parts[1], out int receiverId))
|
||||||
|
throw new BurnAnnotationException($"The receiver ID of annotation is not integer. Id: {_id}");
|
||||||
|
ReceiverId = receiverId;
|
||||||
|
|
||||||
|
if (!int.TryParse(parts[2], out int index))
|
||||||
|
throw new BurnAnnotationException($"The index of annotation is not integer. Id: {_id}");
|
||||||
|
Index = index;
|
||||||
|
|
||||||
|
EgName = parts[3];
|
||||||
|
HasStructuredID = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<double>? Bbox { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool IsSignature { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? ImageAttachmentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public Lines? Lines { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int PageIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? StrokeColor { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Binary"></param>
|
||||||
|
/// <param name="ContentType"></param>
|
||||||
|
public record Attachment(string Binary, string ContentType);
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Name"></param>
|
||||||
|
/// <param name="Value"></param>
|
||||||
|
public record FormFieldValue(string Name, string? Value = null);
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Lines"></param>
|
||||||
|
/// <param name="StrokeColor"></param>
|
||||||
|
public record Ink(Lines Lines, string? StrokeColor = null);
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class InstantData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<Annotation>? Annotations { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<List<Annotation>>? AnnotationsByReceiver
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Annotations?
|
||||||
|
.Where(a => a.HasStructuredID)
|
||||||
|
.GroupBy(a => a.ReceiverId)
|
||||||
|
.Select(g => g.ToList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<List<Annotation>>? UnstructuredAnnotations
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Annotations?
|
||||||
|
.Where(a => !a.HasStructuredID)
|
||||||
|
.GroupBy(a => a.ReceiverId)
|
||||||
|
.Select(g => g.ToList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, Attachment>? Attachments { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public List<FormFieldValue>? FormFieldValues { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Points"></param>
|
||||||
|
public record Lines(List<List<List<float>>> Points);
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ThirdPartyModuleDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool Active { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; init; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string License { get; init; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string Version { get; init; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? AddedWho { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? AddedWhen { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? ChangedWho { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
using EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using GdPicture14;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using SixLabors.ImageSharp;
|
||||||
|
using System.Drawing;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.Model;
|
||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class GdPictureExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="x"></param>
|
||||||
|
/// <param name="y"></param>
|
||||||
|
/// <param name="width"></param>
|
||||||
|
/// <param name="height"></param>
|
||||||
|
/// <param name="page"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="textStyle"></param>
|
||||||
|
public static void AddFormFieldValue(this AnnotationManager manager, double x, double y, double width, double height, int page, string value, ITextStyle textStyle)
|
||||||
|
{
|
||||||
|
manager.SelectPage(page);
|
||||||
|
|
||||||
|
// Add the text annotation
|
||||||
|
var ant = manager.AddTextAnnot((float)x, (float)y, (float)width, (float)height, value);
|
||||||
|
|
||||||
|
// Set the font properties
|
||||||
|
ant.FontName = textStyle.FontName;
|
||||||
|
ant.FontSize = textStyle.FontSize;
|
||||||
|
ant.FontStyle = textStyle.FontStyle;
|
||||||
|
|
||||||
|
manager.SaveAnnotationsToPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="pAnnotation"></param>
|
||||||
|
/// <param name="formFieldValue"></param>
|
||||||
|
/// <param name="options"></param>
|
||||||
|
public static void AddFormFieldValue(this AnnotationManager manager, Annotation pAnnotation, FormFieldValue formFieldValue, PDFBurnerParams options)
|
||||||
|
{
|
||||||
|
var ffIndex = options.GetAnnotationIndex(pAnnotation.EgName);
|
||||||
|
|
||||||
|
// Convert pixels to Inches
|
||||||
|
var oBounds = pAnnotation.Bbox?.Select(points => points.ToInches()).ToList();
|
||||||
|
|
||||||
|
if (oBounds is null || oBounds.Count < 4)
|
||||||
|
return;
|
||||||
|
|
||||||
|
double oX = oBounds[0];
|
||||||
|
double oY = oBounds[1] + options.YOffset * ffIndex + options.TopMargin;
|
||||||
|
double oWidth = oBounds[2];
|
||||||
|
double oHeight = oBounds[3];
|
||||||
|
|
||||||
|
manager.SelectPage(pAnnotation.PageIndex + 1);
|
||||||
|
|
||||||
|
// Add the text annotation
|
||||||
|
var ant = manager.AddTextAnnot((float)oX, (float)oY, (float)oWidth, (float)oHeight, formFieldValue.Value);
|
||||||
|
|
||||||
|
// Set the font properties
|
||||||
|
ant.FontName = options.FontName;
|
||||||
|
ant.FontSize = options.FontSize;
|
||||||
|
ant.FontStyle = options.FontStyle;
|
||||||
|
|
||||||
|
manager.SaveAnnotationsToPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="x"></param>
|
||||||
|
/// <param name="y"></param>
|
||||||
|
/// <param name="width"></param>
|
||||||
|
/// <param name="height"></param>
|
||||||
|
/// <param name="page"></param>
|
||||||
|
/// <param name="base64"></param>
|
||||||
|
public static void AddImageAnnotation(this AnnotationManager manager, double x, double y, double width, double height, int page, string base64)
|
||||||
|
{
|
||||||
|
manager.SelectPage(page);
|
||||||
|
manager.AddEmbeddedImageAnnotFromBase64(base64, (float)x, (float)y, (float)width, (float)height);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="pAnnotation"></param>
|
||||||
|
/// <param name="pAttachments"></param>
|
||||||
|
public static void AddImageAnnotation(this AnnotationManager manager, Annotation pAnnotation, Dictionary<string, Attachment> pAttachments)
|
||||||
|
{
|
||||||
|
var oAttachment = pAttachments
|
||||||
|
.Where(a => a.Key == pAnnotation.ImageAttachmentId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (oAttachment.Value == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Convert pixels to Inches
|
||||||
|
var oBounds = pAnnotation.Bbox?.Select(post => post.ToInches()).ToList();
|
||||||
|
|
||||||
|
if (oBounds is null || oBounds.Count < 4)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var oX = oBounds[0];
|
||||||
|
var oY = oBounds[1];
|
||||||
|
var oWidth = oBounds[2];
|
||||||
|
var oHeight = oBounds[3];
|
||||||
|
|
||||||
|
manager.SelectPage(pAnnotation.PageIndex + 1);
|
||||||
|
manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.Binary, (float)oX, (float)oY, (float)oWidth, (float)oHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="page"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
public static void AddInkAnnotation(this AnnotationManager manager, int page, string value)
|
||||||
|
{
|
||||||
|
var ink = JsonConvert.DeserializeObject<Ink>(value);
|
||||||
|
|
||||||
|
var oSegments = ink?.Lines.Points;
|
||||||
|
var oColor = ColorTranslator.FromHtml(ink?.StrokeColor ?? "#000000");
|
||||||
|
manager.SelectPage(page);
|
||||||
|
|
||||||
|
if (oSegments is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var oSegment in oSegments)
|
||||||
|
{
|
||||||
|
var oPoints = oSegment
|
||||||
|
.Select(points => points.ToPointF())
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
manager.AddFreeHandAnnot(oColor, oPoints);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="pAnnotation"></param>
|
||||||
|
public static void AddInkAnnotation(this AnnotationManager manager, Annotation pAnnotation)
|
||||||
|
{
|
||||||
|
var oSegments = pAnnotation.Lines?.Points;
|
||||||
|
var oColor = ColorTranslator.FromHtml(pAnnotation.StrokeColor ?? "#000000");
|
||||||
|
manager.SelectPage(pAnnotation.PageIndex + 1);
|
||||||
|
|
||||||
|
if (oSegments is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var oSegment in oSegments)
|
||||||
|
{
|
||||||
|
var oPoints = oSegment
|
||||||
|
.Select(points => points.ToPointF())
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
manager.AddFreeHandAnnot(oColor, oPoints);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class MathematExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="points"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static PointF ToPointF(this List<float> points)
|
||||||
|
{
|
||||||
|
var pointsInch = points.Select(ToInches).ToList();
|
||||||
|
return new PointF(pointsInch[0], pointsInch[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static double ToInches(this double value)
|
||||||
|
{
|
||||||
|
return value / 72.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static float ToInches(this float value)
|
||||||
|
{
|
||||||
|
return value / 72f;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Interfaces.Model;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public interface ITextStyle
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string FontName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public int FontSize { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
|
||||||
|
public FontStyle FontStyle { get; set; }
|
||||||
|
}
|
||||||
@@ -1,12 +1,20 @@
|
|||||||
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
using EnvelopeGenerator.Application.Common.Extensions;
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Instant"></param>
|
||||||
|
/// <param name="Structured"></param>
|
||||||
|
public record PsPdfKitAnnotation(ExpandoObject Instant, IEnumerable<AnnotationCreateDto> Structured);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -16,7 +24,7 @@ public record DocSignedNotification(EnvelopeReceiverDto Original) : EnvelopeRece
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required ExpandoObject Annotations { get; init; }
|
public PsPdfKitAnnotation PsPdfKitAnnotation { get; init; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -40,17 +48,41 @@ public static class DocSignedNotificationExtensions
|
|||||||
/// Converts an <see cref="EnvelopeReceiverDto"/> to a <see cref="DocSignedNotification"/>.
|
/// Converts an <see cref="EnvelopeReceiverDto"/> to a <see cref="DocSignedNotification"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dto">The DTO to convert.</param>
|
/// <param name="dto">The DTO to convert.</param>
|
||||||
/// <param name="annotations"></param>
|
/// <param name="psPdfKitAnnotation"></param>
|
||||||
/// <returns>A new <see cref="DocSignedNotification"/> instance.</returns>
|
/// <returns>A new <see cref="DocSignedNotification"/> instance.</returns>
|
||||||
public static DocSignedNotification ToDocSignedNotification(this EnvelopeReceiverDto dto, ExpandoObject annotations)
|
public static DocSignedNotification ToDocSignedNotification(this EnvelopeReceiverDto dto, PsPdfKitAnnotation psPdfKitAnnotation)
|
||||||
=> new(dto) { Annotations = annotations };
|
=> new(dto) { PsPdfKitAnnotation = psPdfKitAnnotation };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously converts a <see cref="Task{EnvelopeReceiverDto}"/> to a <see cref="DocSignedNotification"/>.
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dtoTask">The task that returns the DTO to convert.</param>
|
/// <param name="dtoTask"></param>
|
||||||
/// <param name="annotations"></param>
|
/// <param name="psPdfKitAnnotation"></param>
|
||||||
/// <returns>A task that represents the asynchronous conversion operation.</returns>
|
/// <returns></returns>
|
||||||
public static async Task<DocSignedNotification?> ToDocSignedNotification(this Task<EnvelopeReceiverDto?> dtoTask, ExpandoObject annotations)
|
public static async Task<DocSignedNotification?> ToDocSignedNotification(this Task<EnvelopeReceiverDto?> dtoTask, PsPdfKitAnnotation psPdfKitAnnotation)
|
||||||
=> await dtoTask is EnvelopeReceiverDto dto ? new(dto) { Annotations = annotations } : null;
|
=> await dtoTask is EnvelopeReceiverDto dto ? new(dto) { PsPdfKitAnnotation = psPdfKitAnnotation } : null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="publisher"></param>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task PublishSafely(this IPublisher publisher, DocSignedNotification notification, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await publisher.Publish(notification, cancel);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
await publisher.Publish(new RemoveSignatureNotification()
|
||||||
|
{
|
||||||
|
EnvelopeId = notification.EnvelopeId,
|
||||||
|
ReceiverId = notification.ReceiverId
|
||||||
|
}, cancel);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
using EnvelopeGenerator.Application.DocStatus.Commands;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||||
|
|
||||||
@@ -10,15 +9,18 @@ namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class AnnotationHandler : INotificationHandler<DocSignedNotification>
|
public class AnnotationHandler : INotificationHandler<DocSignedNotification>
|
||||||
{
|
{
|
||||||
private readonly ISender _sender;
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private readonly IRepository<ElementAnnotation> _repo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="repository"></param>
|
||||||
public AnnotationHandler(ISender sender)
|
public AnnotationHandler(IRepository<ElementAnnotation> repository)
|
||||||
{
|
{
|
||||||
_sender = sender;
|
_repo = repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -27,13 +29,6 @@ public class AnnotationHandler : INotificationHandler<DocSignedNotification>
|
|||||||
/// <param name="notification"></param>
|
/// <param name="notification"></param>
|
||||||
/// <param name="cancel"></param>
|
/// <param name="cancel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
|
public Task Handle(DocSignedNotification notification, CancellationToken cancel)
|
||||||
{
|
=> _repo.CreateAsync(notification.PsPdfKitAnnotation.Structured, cancel);
|
||||||
await _sender.Send(new SaveDocStatusCommand()
|
|
||||||
{
|
|
||||||
Envelope = new() { Id = notification.EnvelopeId },
|
|
||||||
Receiver = new() { Id = notification.ReceiverId},
|
|
||||||
Value = JsonSerializer.Serialize(notification.Annotations, Format.Json.ForAnnotations)
|
|
||||||
}, cancel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using EnvelopeGenerator.Application.DocStatus.Commands;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using MediatR;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DocStatusHandler : INotificationHandler<DocSignedNotification>
|
||||||
|
{
|
||||||
|
private readonly ISender _sender;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
public DocStatusHandler(ISender sender)
|
||||||
|
{
|
||||||
|
_sender = sender;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task Handle(DocSignedNotification notification, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
await _sender.Send(new SaveDocStatusCommand()
|
||||||
|
{
|
||||||
|
Envelope = new() { Id = notification.EnvelopeId },
|
||||||
|
Receiver = new() { Id = notification.ReceiverId},
|
||||||
|
Value = JsonSerializer.Serialize(notification.PsPdfKitAnnotation.Instant, Format.Json.ForAnnotations)
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
using EnvelopeGenerator.Application.Histories.Commands;
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
namespace EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class RemoveAnnotationHandler : INotificationHandler<RemoveSignatureNotification>
|
||||||
|
{
|
||||||
|
private readonly IRepository<ElementAnnotation> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public RemoveAnnotationHandler(IRepository<ElementAnnotation> repository)
|
||||||
|
{
|
||||||
|
_repo = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
notification.ThrowIfHasNoFilter();
|
||||||
|
return _repo.DeleteAsync(annots =>
|
||||||
|
{
|
||||||
|
// envelope ID filter
|
||||||
|
if (notification.EnvelopeId is int envelopeId)
|
||||||
|
annots = annots.Where(annot => annot.Element!.Document.EnvelopeId == envelopeId);
|
||||||
|
|
||||||
|
// envelope UUID filter
|
||||||
|
if (notification.EnvelopeUuid is string envelopeUuid)
|
||||||
|
annots = annots.Where(annot => annot.Element!.Document.Envelope!.Uuid == envelopeUuid);
|
||||||
|
|
||||||
|
// receiver ID
|
||||||
|
if (notification.ReceiverId is int receiverId)
|
||||||
|
annots = annots.Where(annot => annot.Element!.ReceiverId == receiverId);
|
||||||
|
|
||||||
|
// receiver signature
|
||||||
|
if (notification.ReceiverSignature is string receiverSignature)
|
||||||
|
annots = annots.Where(annot => annot.Element!.Receiver!.Signature == receiverSignature);
|
||||||
|
|
||||||
|
return annots;
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class RemoveDocResult : INotificationHandler<RemoveSignatureNotification>
|
||||||
|
{
|
||||||
|
private readonly IRepository<Envelope> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public RemoveDocResult(IRepository<Envelope> repository)
|
||||||
|
{
|
||||||
|
_repo = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
if(notification.EnvelopeId is null && notification.EnvelopeUuid is null)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
return _repo.UpdateAsync(
|
||||||
|
envelope => envelope.DocResult = null,
|
||||||
|
query => {
|
||||||
|
if (notification.EnvelopeId is int envelopeId)
|
||||||
|
query = query.Where(envelope => envelope.Id == envelopeId);
|
||||||
|
|
||||||
|
if (notification.EnvelopeUuid is string uuid)
|
||||||
|
query = query.Where(envelope => envelope.Uuid == uuid);
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using AngleSharp.Html;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class RemoveDocStatusHandler : INotificationHandler<RemoveSignatureNotification>
|
||||||
|
{
|
||||||
|
private readonly IRepository<Domain.Entities.DocumentStatus> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public RemoveDocStatusHandler(IRepository<Domain.Entities.DocumentStatus> repository)
|
||||||
|
{
|
||||||
|
_repo = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
notification.ThrowIfHasNoFilter();
|
||||||
|
return _repo.DeleteAsync(statuses =>
|
||||||
|
{
|
||||||
|
// envelope ID filter
|
||||||
|
if (notification.EnvelopeId is int envelopeId)
|
||||||
|
statuses = statuses.Where(status => status.EnvelopeId == envelopeId);
|
||||||
|
|
||||||
|
// envelope UUID filter
|
||||||
|
if (notification.EnvelopeUuid is string envelopeUuid)
|
||||||
|
statuses = statuses.Where(status => status.Envelope!.Uuid == envelopeUuid);
|
||||||
|
|
||||||
|
// receiver Id filter
|
||||||
|
if (notification.ReceiverId is int receiverId)
|
||||||
|
statuses = statuses.Where(status => status.ReceiverId == receiverId);
|
||||||
|
|
||||||
|
// receiver signature filter
|
||||||
|
if (notification.ReceiverSignature is string receiverSignature)
|
||||||
|
statuses = statuses.Where(status => status.Receiver!.Signature == receiverSignature);
|
||||||
|
|
||||||
|
return statuses;
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class RemoveHistoryHandler : INotificationHandler<RemoveSignatureNotification>
|
||||||
|
{
|
||||||
|
private readonly IRepository<Domain.Entities.History> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public RemoveHistoryHandler(IRepository<Domain.Entities.History> repository)
|
||||||
|
{
|
||||||
|
_repo = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
notification.ThrowIfHasNoFilter();
|
||||||
|
return _repo.DeleteAsync(hists =>
|
||||||
|
{
|
||||||
|
hists = hists.Where(hist => hist.Status == EnvelopeStatus.DocumentSigned);
|
||||||
|
|
||||||
|
// envelope ID filter
|
||||||
|
if (notification.EnvelopeId is int envelopeId)
|
||||||
|
hists = hists.Where(hist => hist.EnvelopeId == envelopeId);
|
||||||
|
|
||||||
|
// envelope UUID filter
|
||||||
|
if (notification.EnvelopeUuid is string envelopeUuid)
|
||||||
|
hists = hists.Where(hist => hist.Envelope!.Uuid == envelopeUuid);
|
||||||
|
|
||||||
|
// receiver ID filter
|
||||||
|
if (notification.ReceiverId is int receiverId)
|
||||||
|
hists = hists.Where(hist => hist.Receiver!.Id == receiverId);
|
||||||
|
|
||||||
|
// receiver signature filter
|
||||||
|
if (notification.ReceiverSignature is string receiverSignature)
|
||||||
|
hists = hists.Where(hist => hist.Receiver!.Signature == receiverSignature);
|
||||||
|
|
||||||
|
return hists;
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="EnvelopeId"></param>
|
||||||
|
/// <param name="ReceiverId"></param>
|
||||||
|
/// <param name="EnvelopeUuid"></param>
|
||||||
|
/// <param name="ReceiverSignature"></param>
|
||||||
|
public record RemoveSignatureNotification(
|
||||||
|
int? EnvelopeId = null,
|
||||||
|
int? ReceiverId = null,
|
||||||
|
string? EnvelopeUuid = null,
|
||||||
|
string? ReceiverSignature = null
|
||||||
|
) : INotification
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool HasFilter =>
|
||||||
|
EnvelopeId is not null
|
||||||
|
|| ReceiverId is not null
|
||||||
|
|| EnvelopeUuid is not null
|
||||||
|
|| ReceiverSignature is not null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="InvalidOperationException"></exception>
|
||||||
|
public void ThrowIfHasNoFilter()
|
||||||
|
{
|
||||||
|
if (!HasFilter)
|
||||||
|
throw new InvalidOperationException("At least one filter parameter must be provided.");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Configs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DefaultReadConfigQuery : IRequest<ConfigDto>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static readonly Guid MemoryCacheKey = Guid.NewGuid();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class DefaultReadConfigQueryExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<ConfigDto> ReadDefaultConfigAsync(this ISender sender, CancellationToken cancel = default)
|
||||||
|
=> sender.Send(new DefaultReadConfigQuery(), cancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DefaultReadConfigQueryHandler : IRequestHandler<DefaultReadConfigQuery, ConfigDto>
|
||||||
|
{
|
||||||
|
private readonly IRepository<Config> _repo;
|
||||||
|
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IMemoryCache _cache;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="cache"></param>
|
||||||
|
public DefaultReadConfigQueryHandler(IRepository<Config> repo, IMapper mapper, IMemoryCache cache)
|
||||||
|
{
|
||||||
|
_repo = repo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_cache = cache;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<ConfigDto> Handle(DefaultReadConfigQuery request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var config = await _cache.GetOrCreateAsync(DefaultReadConfigQuery.MemoryCacheKey, async entry =>
|
||||||
|
{
|
||||||
|
entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(5);
|
||||||
|
var configs = await _repo.GetAllAsync(cancel);
|
||||||
|
var defaultConfig = configs.FirstOrDefault();
|
||||||
|
var defaultConfigDto = _mapper.Map<ConfigDto>(defaultConfig);
|
||||||
|
return defaultConfigDto;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(config is null)
|
||||||
|
{
|
||||||
|
_cache.Remove(DefaultReadConfigQuery.MemoryCacheKey);
|
||||||
|
throw new NotFoundException("No configuration record is found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,11 +2,16 @@
|
|||||||
using EnvelopeGenerator.Application.Common.Configurations;
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
||||||
using EnvelopeGenerator.Application.Services;
|
using EnvelopeGenerator.Application.Services;
|
||||||
|
using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
||||||
|
using MediatR;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
using QRCoder;
|
using QRCoder;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using GdPicture14;
|
||||||
|
using EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application;
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
@@ -46,7 +51,30 @@ public static class DependencyInjection
|
|||||||
services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
|
services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
|
||||||
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
|
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
|
||||||
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
|
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
|
||||||
services.Configure<DbTriggerParams>(config.GetSection(nameof(DbTriggerParams)));
|
|
||||||
|
#region PDF Burner
|
||||||
|
services.Configure<PDFBurnerParams>(config.GetSection(nameof(PDFBurnerParams)));
|
||||||
|
services.AddOptions<GdPictureParams>()
|
||||||
|
.Configure((GdPictureParams opt, IServiceProvider provider) =>
|
||||||
|
{
|
||||||
|
opt.License = config["GdPictureLicenseKey"]
|
||||||
|
?? provider.GetRequiredService<IMediator>().ReadThirdPartyModuleLicenseAsync("GDPICTURE").GetAwaiter().GetResult()
|
||||||
|
?? throw new InvalidOperationException($"License record not found for key: {"GDPICTURE"}");
|
||||||
|
});
|
||||||
|
services.AddSingleton(provider =>
|
||||||
|
{
|
||||||
|
var license = provider.GetRequiredService<IOptions<GdPictureParams>>().Value.License;
|
||||||
|
var licenseManager = new LicenseManager();
|
||||||
|
licenseManager.RegisterKEY(license);
|
||||||
|
return licenseManager;
|
||||||
|
});
|
||||||
|
services.AddTransient(provider =>
|
||||||
|
{
|
||||||
|
// Ensure LicenseManager is resolved so that its constructor is called
|
||||||
|
_ = provider.GetRequiredService<LicenseManager>();
|
||||||
|
return new AnnotationManager();
|
||||||
|
});
|
||||||
|
#endregion PDF Burner
|
||||||
|
|
||||||
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
||||||
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
|
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
|
||||||
@@ -57,8 +85,23 @@ public static class DependencyInjection
|
|||||||
services.AddMediatR(cfg =>
|
services.AddMediatR(cfg =>
|
||||||
{
|
{
|
||||||
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
|
|
||||||
|
cfg.AddBehavior<CreateHistoryBehavior>();
|
||||||
|
cfg.AddBehavior<SavePdfBehavior>();
|
||||||
|
#if WINDOWS
|
||||||
|
cfg.AddBehavior<SendEmailBehavior>();
|
||||||
|
cfg.AddBehavior<WritePdfBehavior>();
|
||||||
|
cfg.AddBehavior<PdfMergeBehavior>();
|
||||||
|
cfg.AddBehavior<AddReportBehavior>();
|
||||||
|
#endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add memory cache
|
||||||
|
services.AddMemoryCache();
|
||||||
|
|
||||||
|
// Register mail services
|
||||||
|
services.AddScoped<IEnvelopeMailService, EnvelopeMailService>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
<TargetFrameworks>net7.0;net8.0;net9.0;net8.0-windows</TargetFrameworks>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
@@ -14,7 +14,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapper" Version="2.1.66" />
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.3.1" />
|
<PackageReference Include="DevExpress.Reporting.Core" Version="21.2.4" />
|
||||||
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.5.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
||||||
@@ -25,23 +26,36 @@
|
|||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
|
||||||
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
||||||
<PackageReference Include="UserManager" Version="1.1.3" />
|
<PackageReference Include="UserManager" Version="1.1.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
|
<PackageReference Include="System.Formats.Asn1" Version="8.0.2" />
|
||||||
|
<PackageReference Include="GdPicture" Version="14.3.19.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net8.0-windows'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
|
<PackageReference Include="System.Formats.Asn1" Version="9.0.10" />
|
||||||
|
<PackageReference Include="GdPicture" Version="14.3.19.1" />
|
||||||
|
<PackageReference Include="GdPicture.runtimes.windows" Version="14.3.19.1" />
|
||||||
|
<PackageReference Include="GdPicture.runtimes.linux" Version="14.3.19.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
||||||
|
<PackageReference Include="System.Formats.Asn1" Version="9.0.10" />
|
||||||
|
<PackageReference Include="GdPicture" Version="14.3.19.1" />
|
||||||
|
<PackageReference Include="GdPicture.runtimes.windows" Version="14.3.19.1" />
|
||||||
|
<PackageReference Include="GdPicture.runtimes.linux" Version="14.3.19.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.CommonServices\EnvelopeGenerator.CommonServices.vbproj" />
|
||||||
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -79,7 +93,7 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net8.0-windows'">
|
||||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
|
||||||
<PackageReference Include="CommandDotNet">
|
<PackageReference Include="CommandDotNet">
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.EnvelopeReports;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ReadEnvelopeReportQuery(int EnvelopeId) : IRequest<IEnumerable<EnvelopeReport>>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
[NotMapped]
|
||||||
|
public bool ThrowIfNotFound { get; init; } = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class ReadEnvelopeReportQueryExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="throwIfNotFound"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<IEnumerable<EnvelopeReport>> ReadEnvelopeReportAsync(this ISender sender, int envelopeId, bool throwIfNotFound = true, CancellationToken cancel = default)
|
||||||
|
=> sender.Send(new ReadEnvelopeReportQuery(envelopeId)
|
||||||
|
{
|
||||||
|
ThrowIfNotFound = throwIfNotFound
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadEnvelopeReportQueryHandler : IRequestHandler<ReadEnvelopeReportQuery, IEnumerable<EnvelopeReport>>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private readonly IRepository<EnvelopeReport> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
public ReadEnvelopeReportQueryHandler(IRepository<EnvelopeReport> repo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_repo = repo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IEnumerable<EnvelopeReport>> Handle(ReadEnvelopeReportQuery request, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
var reports = await _repo.Where(r => r.EnvelopeId == request.EnvelopeId).ToListAsync(cancel);
|
||||||
|
var reportDtos = _mapper.Map<IEnumerable<EnvelopeReport>>(reports);
|
||||||
|
|
||||||
|
if(request.ThrowIfNotFound && !reportDtos.Any())
|
||||||
|
throw new NotFoundException($"EnvelopeReport with EnvelopeId '{request.EnvelopeId}' was not found.");
|
||||||
|
|
||||||
|
return reportDtos;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,29 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Application.Common.Query;
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert eine Abfrage für Umschläge.
|
/// Repräsentiert eine Abfrage für Umschläge.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest
|
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest<IEnumerable<EnvelopeDto>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abfrage des Include des Umschlags
|
/// Abfrage des Include des Umschlags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeStatusQuery? Status { get; init; }
|
public EnvelopeStatusQuery? Status { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? HasDocResult { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -66,3 +77,52 @@ public record EnvelopeStatusQuery
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeStatus[]? Ignore { get; init; }
|
public EnvelopeStatus[]? Ignore { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadEnvelopeQueryHandler : IRequestHandler<ReadEnvelopeQuery, IEnumerable<EnvelopeDto>>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IRepository<Envelope> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
public ReadEnvelopeQueryHandler(IMapper mapper, IRepository<Envelope> repo)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_repo = repo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<IEnumerable<EnvelopeDto>> Handle(ReadEnvelopeQuery request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var envelopesQ = _repo.Query.Where(request, notnull: false);
|
||||||
|
|
||||||
|
EnvelopeStatusQuery? statusQ = request.Status;
|
||||||
|
bool? hasDocResult = request.HasDocResult;
|
||||||
|
|
||||||
|
var filtered =
|
||||||
|
from envelope in envelopesQ
|
||||||
|
where (statusQ == null || statusQ.Include == null || statusQ.Include.Contains(envelope.Status))
|
||||||
|
&& (statusQ == null || statusQ.Ignore == null || !statusQ.Ignore.Contains(envelope.Status))
|
||||||
|
&& (statusQ == null || statusQ.Min == null || envelope.Status > statusQ.Min)
|
||||||
|
&& (statusQ == null || statusQ.Max == null || envelope.Status < statusQ.Max)
|
||||||
|
&& (!hasDocResult.HasValue || (hasDocResult.Value ? envelope.DocResult != null : envelope.DocResult == null))
|
||||||
|
select envelope;
|
||||||
|
|
||||||
|
var envelopes = await filtered.ToListAsync(cancel);
|
||||||
|
|
||||||
|
return _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BurnAnnotationException : ApplicationException
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public BurnAnnotationException(string message)
|
||||||
|
: base(message) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public BurnAnnotationException(string message, Exception innerException)
|
||||||
|
: base(message, innerException) { }
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateReportException : ApplicationException
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
public CreateReportException(string message)
|
||||||
|
: base(message) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="innerException"></param>
|
||||||
|
public CreateReportException(string message, Exception innerException)
|
||||||
|
: base(message, innerException) { }
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ExportDocumentException : ApplicationException
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
public ExportDocumentException(string message)
|
||||||
|
: base(message) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="innerException"></param>
|
||||||
|
public ExportDocumentException(string message, Exception innerException)
|
||||||
|
: base(message, innerException) { }
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Application.Exceptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class MergeDocumentException : ApplicationException
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
public MergeDocumentException(string message)
|
||||||
|
: base(message) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="innerException"></param>
|
||||||
|
public MergeDocumentException(string message, Exception innerException)
|
||||||
|
: base(message, innerException) { }
|
||||||
|
}
|
||||||
@@ -34,7 +34,7 @@ public record CreateHistoryCommand : EnvelopeReceiverQueryBase, IRequest<History
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
public DateTime AddedWhen { get; } = DateTime.UtcNow;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
#if WINDOWS
|
||||||
|
using MediatR;
|
||||||
|
using EnvelopeGenerator.Application.EnvelopeReports;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using EnvelopeGenerator.CommonServices;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class AddReportBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
private readonly ISender _sender;
|
||||||
|
|
||||||
|
private readonly ILogger<AddReportBehavior> _logger;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
public AddReportBehavior(ISender sender, ILogger<AddReportBehavior> logger)
|
||||||
|
{
|
||||||
|
_sender = sender;
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="next"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var docResult = await next(cancel);
|
||||||
|
|
||||||
|
request.Report = await CreateReport(request.Envelope!, cancel);
|
||||||
|
|
||||||
|
return docResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="envelope"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="CreateReportException"></exception>
|
||||||
|
public async Task<byte[]> CreateReport(Envelope envelope, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var oItems = await _sender.ReadEnvelopeReportAsync(envelope.Id, cancel: cancel);
|
||||||
|
|
||||||
|
if (!oItems.Any())
|
||||||
|
{
|
||||||
|
throw new CreateReportException("No report data found!");
|
||||||
|
}
|
||||||
|
|
||||||
|
var oBuffer = DoCreateReport(oItems);
|
||||||
|
|
||||||
|
return oBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static byte[] DoCreateReport(IEnumerable<EnvelopeReport> oItems)
|
||||||
|
{
|
||||||
|
var oSource = new ReportSource { Items = oItems };
|
||||||
|
var oReport = new rptEnvelopeHistory
|
||||||
|
{
|
||||||
|
DataSource = oSource,
|
||||||
|
DataMember = "Items"
|
||||||
|
};
|
||||||
|
|
||||||
|
// Creating report in memory
|
||||||
|
oReport.CreateDocument();
|
||||||
|
|
||||||
|
// Exporting report to stream
|
||||||
|
using var oStream = new MemoryStream();
|
||||||
|
oReport.ExportToPdf(oStream);
|
||||||
|
|
||||||
|
// Writing report to buffer
|
||||||
|
return oStream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReportSource
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public required IEnumerable<EnvelopeReport> Items { get; init; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
using MediatR;
|
||||||
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class CreateHistoryBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
private readonly ISender _sender;
|
||||||
|
|
||||||
|
private readonly ILogger<CreateHistoryBehavior> _logger;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
public CreateHistoryBehavior(ISender sender, ILogger<CreateHistoryBehavior> logger)
|
||||||
|
{
|
||||||
|
_sender = sender;
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="next"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var doc = await next(cancel);
|
||||||
|
|
||||||
|
if (!request.Debug)
|
||||||
|
await _sender.Send(new CreateHistoryCommand()
|
||||||
|
{
|
||||||
|
EnvelopeId = request.EnvelopeId,
|
||||||
|
UserReference = "System",
|
||||||
|
Status = EnvelopeStatus.EnvelopeReportCreated,
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
return doc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#if WINDOWS
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using GdPicture14;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class PdfMergeBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="next"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var doc = await next(cancel);
|
||||||
|
|
||||||
|
if (request.Report is null)
|
||||||
|
throw new InvalidOperationException("The final document report could not be merged."
|
||||||
|
+ "There may be an error related to the behavior register order."
|
||||||
|
+ "Request details:\n" + request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
using var oDocumentStream = new MemoryStream(doc);
|
||||||
|
using var oReportStream = new MemoryStream(request.Report);
|
||||||
|
using var oFinalStream = new MemoryStream();
|
||||||
|
using var oDocumentPDF = new GdPicturePDF();
|
||||||
|
using var oReportPDF = new GdPicturePDF();
|
||||||
|
GdPictureStatus oStatus = GdPictureStatus.OK;
|
||||||
|
|
||||||
|
// Load the source file into memory
|
||||||
|
oDocumentPDF.LoadFromStream(oDocumentStream, true);
|
||||||
|
|
||||||
|
oStatus = oDocumentPDF.GetStat();
|
||||||
|
if (oStatus != GdPictureStatus.OK)
|
||||||
|
throw new MergeDocumentException($"Document could not be loaded: {oStatus}."
|
||||||
|
+ "Request details:\n" + request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
// Load the report file into memory
|
||||||
|
oReportPDF.LoadFromStream(oReportStream, true);
|
||||||
|
oStatus = oReportPDF.GetStat();
|
||||||
|
if (oStatus != GdPictureStatus.OK)
|
||||||
|
throw new MergeDocumentException($"Report could not be loaded: {oStatus}."
|
||||||
|
+ "Request details:\n" + request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
// Merge the documents
|
||||||
|
var oMergedPDF = oDocumentPDF.Merge2Documents(oDocumentPDF, oReportPDF);
|
||||||
|
oStatus = oMergedPDF.GetStat();
|
||||||
|
if (oStatus != GdPictureStatus.OK)
|
||||||
|
throw new MergeDocumentException($"Documents could not be merged: {oStatus}."
|
||||||
|
+ "Request details:\n" + request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
// Convert to byte
|
||||||
|
oMergedPDF.SaveToStream(oFinalStream);
|
||||||
|
oStatus = oDocumentPDF.GetStat();
|
||||||
|
if (oStatus != GdPictureStatus.OK)
|
||||||
|
throw new MergeDocumentException($"Document could not be converted to byte: {oStatus}."
|
||||||
|
+ "Request details:\n" + request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
return oFinalStream.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class SavePdfBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="next"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var docResult = await next(cancel);
|
||||||
|
var base64 = Convert.ToBase64String(docResult);
|
||||||
|
return docResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
113
EnvelopeGenerator.Application/Pdf/Behaviors/SendEmailBehavior.cs
Normal file
113
EnvelopeGenerator.Application/Pdf/Behaviors/SendEmailBehavior.cs
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
using EnvelopeGenerator.Application.Histories.Commands;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class SendEmailBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
private readonly ILogger<SendEmailBehavior> _logger;
|
||||||
|
|
||||||
|
private readonly ISender _sender;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
public SendEmailBehavior(ILogger<SendEmailBehavior> logger, ISender sender)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_sender = sender;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="next"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var docResult = await next(cancel);
|
||||||
|
|
||||||
|
var mailToCreator = request.Envelope!.FinalEmailToCreator;
|
||||||
|
var mailToReceivers = request.Envelope.FinalEmailToReceivers;
|
||||||
|
|
||||||
|
if (mailToCreator is not null && mailToCreator != (int)FinalEmailType.No)
|
||||||
|
{
|
||||||
|
_logger.LogDebug("Sending email to creator ...");
|
||||||
|
await SendFinalEmailToCreatorAsync(request, cancel); // , pAttachment
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning("No SendFinalEmailToCreatorAsync - mailToCreator [{mailToCreator}] <> [{FinalEmailType.No}] ",
|
||||||
|
mailToCreator, FinalEmailType.No);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mailToReceivers != (int)FinalEmailType.No)
|
||||||
|
{
|
||||||
|
_logger.LogDebug("Sending emails to receivers...");
|
||||||
|
await SendFinalEmailToReceiversAsync(request, cancel); // , pAttachment
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning("No SendFinalEmailToReceiversAsync - mailToReceivers [{mailToReceivers}] <> [{FinalEmailType.No}] ",
|
||||||
|
mailToReceivers, FinalEmailType.No);
|
||||||
|
}
|
||||||
|
|
||||||
|
return docResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SendFinalEmailToCreatorAsync(BurnPdfCommand request, CancellationToken cancel) //, string pAttachment
|
||||||
|
{
|
||||||
|
bool oIncludeAttachment = SendFinalEmailWithAttachment((int)request.Envelope!.FinalEmailToCreator!);
|
||||||
|
// string oAttachment = string.Empty;
|
||||||
|
|
||||||
|
_logger.LogDebug("Attachment included: [{oIncludeAttachment}]", oIncludeAttachment);
|
||||||
|
if (oIncludeAttachment)
|
||||||
|
{
|
||||||
|
// oAttachment = pAttachment;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _sender.Send(new CreateHistoryCommand()
|
||||||
|
{
|
||||||
|
EnvelopeId = request.Envelope!.Id,
|
||||||
|
Status = EnvelopeStatus.MessageCompletionSent,
|
||||||
|
UserReference = request.Envelope.User.Email,
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SendFinalEmailToReceiversAsync(BurnPdfCommand request, CancellationToken cancel) //, string pAttachment
|
||||||
|
{
|
||||||
|
bool oIncludeAttachment = SendFinalEmailWithAttachment((int)request.Envelope!.FinalEmailToReceivers!);
|
||||||
|
// string oAttachment = string.Empty;
|
||||||
|
|
||||||
|
_logger.LogDebug("Attachment included: [{oIncludeAttachment}]", oIncludeAttachment);
|
||||||
|
if (oIncludeAttachment)
|
||||||
|
{
|
||||||
|
// oAttachment = pAttachment;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO update CreateHistoryCommand to be able to create all records together
|
||||||
|
foreach (var receiver in request.Envelope.EnvelopeReceivers!)
|
||||||
|
{
|
||||||
|
if (receiver.Receiver?.EmailAddress != null)
|
||||||
|
{
|
||||||
|
await _sender.Send(new CreateHistoryCommand()
|
||||||
|
{
|
||||||
|
EnvelopeId = request.Envelope.Id,
|
||||||
|
Status = EnvelopeStatus.MessageCompletionSent,
|
||||||
|
UserReference = receiver.Receiver.EmailAddress,
|
||||||
|
}, cancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool SendFinalEmailWithAttachment(int type) => type == (int)FinalEmailType.YesWithAttachment;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
#if WINDOWS
|
||||||
|
using EnvelopeGenerator.Application.Configs;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf.Behaviors;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class WritePdfBehavior : IPipelineBehavior<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
private readonly ISender _sender;
|
||||||
|
|
||||||
|
private readonly ILogger<WritePdfBehavior> _logger;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
public WritePdfBehavior(ISender sender, ILogger<WritePdfBehavior> logger)
|
||||||
|
{
|
||||||
|
_sender = sender;
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="next"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, RequestHandlerDelegate<byte[]> next, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var docResult = await next(cancel);
|
||||||
|
|
||||||
|
var config = await _sender.ReadDefaultConfigAsync(cancel);
|
||||||
|
|
||||||
|
var exportPath = config.ExportPath ?? throw new InvalidOperationException(nameof(WritePdfBehavior) + " is not possible."
|
||||||
|
+ "No export path found in config table.");
|
||||||
|
|
||||||
|
var dirPath = Path.Combine(exportPath, request.Envelope!.Uuid);
|
||||||
|
|
||||||
|
_logger.LogDebug("dirPath is {dirPath}", dirPath);
|
||||||
|
|
||||||
|
if (!Directory.Exists(dirPath))
|
||||||
|
{
|
||||||
|
_logger.LogDebug("Directory not existing. Creating ...");
|
||||||
|
Directory.CreateDirectory(dirPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
var outputFilePath = Path.Combine(dirPath, $"{request.Envelope.Uuid}.pdf");
|
||||||
|
|
||||||
|
_logger.LogDebug("Writing finalized Pdf to disk..");
|
||||||
|
_logger.LogInformation("Output path is {outputFilePath}", outputFilePath);
|
||||||
|
|
||||||
|
await File.WriteAllBytesAsync(outputFilePath, docResult, cancel);
|
||||||
|
|
||||||
|
return docResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
305
EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs
Normal file
305
EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using DigitalData.Core.Exceptions;
|
||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto.PSPDFKitInstant;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Application.Exceptions;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using GdPicture14;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Pdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record BurnPdfCommand(int? EnvelopeId = null, string? EnvelopeUuid = null) : IRequest<byte[]>
|
||||||
|
{
|
||||||
|
internal bool Debug { get; set; }
|
||||||
|
|
||||||
|
internal Envelope? Envelope { get; set; }
|
||||||
|
|
||||||
|
#if WINDOWS
|
||||||
|
internal byte[]? Report { get; set; }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class BurnPdfCommandExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="envelopeId"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<byte[]> BurnPdf(this ISender sender, int envelopeId, CancellationToken cancel = default)
|
||||||
|
=> sender.Send(new BurnPdfCommand(EnvelopeId: envelopeId), cancel);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="envelopeUuid"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<byte[]> BurnPdf(this ISender sender, string envelopeUuid, CancellationToken cancel = default)
|
||||||
|
=> sender.Send(new BurnPdfCommand(EnvelopeUuid: envelopeUuid), cancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class BurnPdfCommandHandler : IRequestHandler<BurnPdfCommand, byte[]>
|
||||||
|
{
|
||||||
|
private readonly PDFBurnerParams _options;
|
||||||
|
|
||||||
|
private readonly AnnotationManager _manager;
|
||||||
|
|
||||||
|
private readonly ILogger<BurnPdfCommandHandler> _logger;
|
||||||
|
|
||||||
|
private readonly IRepository<Envelope> _envRepo;
|
||||||
|
|
||||||
|
private readonly IRepository<Domain.Entities.DocumentStatus> _docStatusRepo;
|
||||||
|
|
||||||
|
private readonly IConfiguration _config;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pdfBurnerParams"></param>
|
||||||
|
/// <param name="manager"></param>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
/// <param name="envRepo"></param>
|
||||||
|
/// <param name="docStatusRepo"></param>
|
||||||
|
/// <param name="config"></param>
|
||||||
|
public BurnPdfCommandHandler(IOptions<PDFBurnerParams> pdfBurnerParams, AnnotationManager manager, ILogger<BurnPdfCommandHandler> logger, IRepository<Envelope> envRepo, IRepository<Domain.Entities.DocumentStatus> docStatusRepo, IConfiguration config)
|
||||||
|
{
|
||||||
|
_options = pdfBurnerParams.Value;
|
||||||
|
_manager = manager;
|
||||||
|
_docStatusRepo = docStatusRepo;
|
||||||
|
_logger = logger;
|
||||||
|
_envRepo = envRepo;
|
||||||
|
_config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<byte[]> Handle(BurnPdfCommand request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
request.Debug = _config.GetValue<bool>("Debug");
|
||||||
|
var envQuery =
|
||||||
|
request.EnvelopeId is not null ? _envRepo.Where(env => env.Id == request.EnvelopeId) :
|
||||||
|
request.EnvelopeUuid is not null ? _envRepo.Where(env => env.Uuid == request.EnvelopeUuid) :
|
||||||
|
throw new BadRequestException("Request validation failed: Either Envelope Id or Envelope Uuid must be provided.");
|
||||||
|
|
||||||
|
request.Envelope = await envQuery
|
||||||
|
.Include(env => env.Documents!).ThenInclude(doc => doc.Elements!).ThenInclude(element => element.Annotations)
|
||||||
|
.Include(env => env.User)
|
||||||
|
.Include(env => env.EnvelopeReceivers!).ThenInclude(envRcv => envRcv.Receiver)
|
||||||
|
.FirstOrDefaultAsync(cancel)
|
||||||
|
?? throw new BadRequestException($"Envelope could not be found. Request details:\n" +
|
||||||
|
request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
var doc = request.Envelope.Documents?.FirstOrDefault()
|
||||||
|
?? throw new NotFoundException($"Document could not be located within the specified envelope. Request details:\n" +
|
||||||
|
request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
if (doc.ByteData is null)
|
||||||
|
throw new InvalidOperationException($"Document byte data is missing, indicating a potential data integrity issue. Request details:\n" +
|
||||||
|
request.ToJson(Format.Json.ForDiagnostics));
|
||||||
|
|
||||||
|
return doc.Elements?.SelectMany(e => e.Annotations ?? Enumerable.Empty<ElementAnnotation>()).Where(annot => annot is not null).Any() ?? false
|
||||||
|
? BurnElementAnnotsToPDF(doc.ByteData, doc.Elements)
|
||||||
|
: BurnInstantJSONAnnotsToPDF(doc.ByteData, await _docStatusRepo
|
||||||
|
.Where(status => status.EnvelopeId == request.Envelope.Id)
|
||||||
|
.Select(status => status.Value)
|
||||||
|
.ToListAsync(cancel));
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] BurnElementAnnotsToPDF(byte[] pSourceBuffer, List<Signature> elements)
|
||||||
|
{
|
||||||
|
// Add background
|
||||||
|
using var doc = PdfEditor.Pdf.FromMemory(pSourceBuffer);
|
||||||
|
// TODO: take the length from the largest y
|
||||||
|
pSourceBuffer = doc.Background(elements, 1.9500000000000002 * 0.93, 2.52 * 0.67)
|
||||||
|
.ExportStream()
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
GdPictureStatus oResult;
|
||||||
|
using var oSourceStream = new MemoryStream(pSourceBuffer);
|
||||||
|
// Open PDF
|
||||||
|
oResult = _manager.InitFromStream(oSourceStream);
|
||||||
|
if (oResult != GdPictureStatus.OK)
|
||||||
|
throw new BurnAnnotationException($"Could not open document for burning: [{oResult}]");
|
||||||
|
|
||||||
|
// Imported from background (add to configuration)
|
||||||
|
var margin = 0.2;
|
||||||
|
var inchFactor = 72;
|
||||||
|
|
||||||
|
// Y offset of form fields
|
||||||
|
var keys = new[] { "position", "city", "date" }; // add to configuration
|
||||||
|
var unitYOffsets = 0.2;
|
||||||
|
|
||||||
|
var yOffsetsOfFF = keys
|
||||||
|
.Select((k, i) => new { Key = k, Value = unitYOffsets * i + 1 })
|
||||||
|
.ToDictionary(x => x.Key, x => x.Value);
|
||||||
|
|
||||||
|
// Add annotations
|
||||||
|
foreach (var element in elements)
|
||||||
|
{
|
||||||
|
var frameX = element.Left - 0.7 - margin;
|
||||||
|
|
||||||
|
var frame = element.Annotations?.FirstOrDefault(a => a.Name == "frame");
|
||||||
|
var frameY = element.Top - 0.5 - margin;
|
||||||
|
var frameYShift = (frame!.Y ?? default) - frameY * inchFactor;
|
||||||
|
var frameXShift = (frame.X ?? default) - frameX * inchFactor;
|
||||||
|
|
||||||
|
foreach (var annot in element.Annotations!)
|
||||||
|
{
|
||||||
|
if (!yOffsetsOfFF.TryGetValue(annot.Name, out var yOffsetofFF))
|
||||||
|
yOffsetofFF = 0;
|
||||||
|
|
||||||
|
var y = frameY + yOffsetofFF;
|
||||||
|
|
||||||
|
if (annot.Type == AnnotationType.PSPDFKit.FormField)
|
||||||
|
{
|
||||||
|
_manager.AddFormFieldValue(
|
||||||
|
(annot.X ?? default) / inchFactor,
|
||||||
|
y,
|
||||||
|
(annot.Width ?? default) / inchFactor,
|
||||||
|
(annot.Height ?? default) / inchFactor,
|
||||||
|
element.Page,
|
||||||
|
annot.Value,
|
||||||
|
_options
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (annot.Type == AnnotationType.PSPDFKit.Image)
|
||||||
|
{
|
||||||
|
_manager.AddImageAnnotation(
|
||||||
|
(annot.X ?? default) / inchFactor,
|
||||||
|
annot.Name == "signature" ? ((annot.Y ?? default) - frameYShift) / inchFactor : y,
|
||||||
|
(annot.Width ?? default) / inchFactor,
|
||||||
|
(annot.Height ?? default) / inchFactor,
|
||||||
|
element.Page,
|
||||||
|
annot.Value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (annot.Type == AnnotationType.PSPDFKit.Ink)
|
||||||
|
{
|
||||||
|
_manager.AddInkAnnotation(element.Page, annot.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save PDF
|
||||||
|
using var oNewStream = new MemoryStream();
|
||||||
|
oResult = _manager.SaveDocumentToPDF(oNewStream);
|
||||||
|
if (oResult != GdPictureStatus.OK)
|
||||||
|
throw new BurnAnnotationException($"Could not save document to stream: [{oResult}]");
|
||||||
|
|
||||||
|
_manager.Close();
|
||||||
|
|
||||||
|
return oNewStream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] BurnInstantJSONAnnotsToPDF(byte[] pSourceBuffer, List<string> pInstantJSONList)
|
||||||
|
{
|
||||||
|
GdPictureStatus oResult;
|
||||||
|
|
||||||
|
using var oSourceStream = new MemoryStream(pSourceBuffer);
|
||||||
|
// Open PDF
|
||||||
|
oResult = _manager.InitFromStream(oSourceStream);
|
||||||
|
if (oResult != GdPictureStatus.OK)
|
||||||
|
{
|
||||||
|
throw new BurnAnnotationException($"Could not open document for burning: [{oResult}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add annotation to PDF
|
||||||
|
foreach (var oJSON in pInstantJSONList)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (oJSON is string json)
|
||||||
|
AddInstantJsonAnnotationToPdf(json);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Error in AddInstantJSONAnnotationToPDF - oJson: ");
|
||||||
|
_logger.LogWarning(oJSON);
|
||||||
|
throw new BurnAnnotationException("Adding Annotation failed", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
oResult = _manager.BurnAnnotationsToPage(RemoveInitialAnnots: true, VectorMode: true);
|
||||||
|
if (oResult != GdPictureStatus.OK)
|
||||||
|
{
|
||||||
|
throw new BurnAnnotationException($"Could not burn annotations to file: [{oResult}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save PDF
|
||||||
|
using var oNewStream = new MemoryStream();
|
||||||
|
oResult = _manager.SaveDocumentToPDF(oNewStream);
|
||||||
|
if (oResult != GdPictureStatus.OK)
|
||||||
|
{
|
||||||
|
throw new BurnAnnotationException($"Could not save document to stream: [{oResult}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
_manager.Close();
|
||||||
|
|
||||||
|
return oNewStream.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddInstantJsonAnnotationToPdf(string instantJson)
|
||||||
|
{
|
||||||
|
var annotationData = JsonConvert.DeserializeObject<InstantData>(instantJson);
|
||||||
|
|
||||||
|
annotationData?.Annotations?.Reverse();
|
||||||
|
|
||||||
|
if (annotationData?.Annotations is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var annotation in annotationData.Annotations)
|
||||||
|
{
|
||||||
|
_logger.LogDebug("Adding AnnotationID: {id}", annotation.Id);
|
||||||
|
|
||||||
|
switch (annotation.Type)
|
||||||
|
{
|
||||||
|
case AnnotationType.PSPDFKit.Image:
|
||||||
|
if (annotationData?.Attachments is not null)
|
||||||
|
_manager.AddImageAnnotation(annotation, annotationData.Attachments);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AnnotationType.PSPDFKit.Ink:
|
||||||
|
_manager.AddInkAnnotation(annotation);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AnnotationType.PSPDFKit.Widget:
|
||||||
|
// Add form field values
|
||||||
|
var formFieldValue = annotationData?.FormFieldValues?
|
||||||
|
.FirstOrDefault(fv => fv.Name == annotation.Id);
|
||||||
|
|
||||||
|
if (formFieldValue != null && !_options.IgnoredLabels.Contains(formFieldValue.Value))
|
||||||
|
{
|
||||||
|
_manager.AddFormFieldValue(annotation, formFieldValue, _options);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ReadThirdPartyModuleQuery : IRequest<IEnumerable<ThirdPartyModuleDto>>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? Active { get; init; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public record ReadThirdPartyModuleQueryHandler : IRequestHandler<ReadThirdPartyModuleQuery, IEnumerable<ThirdPartyModuleDto>>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IRepository<ThirdPartyModule> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
public ReadThirdPartyModuleQueryHandler(IMapper mapper, IRepository<ThirdPartyModule> repo)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_repo = repo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<IEnumerable<ThirdPartyModuleDto>> Handle(ReadThirdPartyModuleQuery request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var query = _repo.Query;
|
||||||
|
|
||||||
|
if(request.Name is string name)
|
||||||
|
query = query.Where(m => m.Name == name);
|
||||||
|
|
||||||
|
if (request.Active is bool active)
|
||||||
|
query = query.Where(m => m.Active == active);
|
||||||
|
|
||||||
|
var modules = await query.ToListAsync(cancel);
|
||||||
|
|
||||||
|
return _mapper.Map<IEnumerable<ThirdPartyModuleDto>>(modules);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public static class ReadThirdPartyModuleQueryExtensions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="active"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<string?> ReadThirdPartyModuleLicenseAsync(this IMediator mediator, string name, bool active = true, CancellationToken cancel = default)
|
||||||
|
{
|
||||||
|
var modules = await mediator.Send(new ReadThirdPartyModuleQuery()
|
||||||
|
{
|
||||||
|
Name = name,
|
||||||
|
Active = active,
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
return modules.FirstOrDefault()?.License;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,9 @@
|
|||||||
<StartupObject>EnvelopeGenerator.My.MyApplication</StartupObject>
|
<StartupObject>EnvelopeGenerator.My.MyApplication</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="AutoMapper, Version=10.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\AutoMapper.10.1.1\lib\net461\AutoMapper.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
<HintPath>..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -67,6 +70,12 @@
|
|||||||
<Reference Include="DigitalData.Controls.DocumentViewer, Version=1.9.8.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Controls.DocumentViewer, Version=1.9.8.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Controls.DocumentViewer.1.9.8\lib\net462\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Controls.DocumentViewer.1.9.8\lib\net462\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DigitalData.Core.Abstraction.Application, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DigitalData.Core.Abstraction.Application.1.5.0\lib\net462\DigitalData.Core.Abstraction.Application.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DigitalData.Core.Abstractions, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DigitalData.Core.Abstractions.4.3.0\lib\net462\DigitalData.Core.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Base, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Modules.Base, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Modules.Base.1.3.8\lib\net462\DigitalData.Modules.Base.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Modules.Base.1.3.8\lib\net462\DigitalData.Modules.Base.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -176,12 +185,84 @@
|
|||||||
<Reference Include="Microsoft.Bcl.Cryptography, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.Cryptography, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Bcl.Cryptography.9.0.0\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Bcl.Cryptography.9.0.0\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Data.SqlClient, Version=1.13.20136.2, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Data.SqlClient.1.1.3\lib\net46\Microsoft.Data.SqlClient.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore.Relational, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.Relational.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.SqlServer.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Caching.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Caching.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Caching.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Caching.Memory, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Caching.Memory.7.0.0\lib\net462\Microsoft.Extensions.Caching.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Configuration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Configuration.7.0.0\lib\net462\Microsoft.Extensions.Configuration.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Configuration.Binder, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.7.0.0\lib\net462\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Localization.Abstractions, Version=7.0.16.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Localization.Abstractions.7.0.16\lib\net462\Microsoft.Extensions.Localization.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.7.0.0\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Options.7.0.0\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Options.ConfigurationExtensions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Options.ConfigurationExtensions.7.0.0\lib\net462\Microsoft.Extensions.Options.ConfigurationExtensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Primitives, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Primitives.7.0.0\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.Identity.Client, Version=4.77.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Identity.Client, Version=4.77.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Identity.Client.4.77.0\lib\net462\Microsoft.Identity.Client.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Identity.Client.4.77.0\lib\net462\Microsoft.Identity.Client.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=8.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=8.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.8.14.0\lib\net462\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.8.14.0\lib\net462\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.7.5.1\lib\net462\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Logging, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Logging.7.5.1\lib\net462\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Protocols, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.5.5.0\lib\net461\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.5.5.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Tokens, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.7.5.1\lib\net462\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -216,19 +297,31 @@
|
|||||||
<Reference Include="System.Collections.Immutable, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Collections.Immutable, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Collections.Immutable.9.0.0\lib\net462\System.Collections.Immutable.dll</HintPath>
|
<HintPath>..\packages\System.Collections.Immutable.9.0.0\lib\net462\System.Collections.Immutable.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.ComponentModel.Annotations.4.7.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Data.Odbc, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Data.Odbc, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll</HintPath>
|
<HintPath>..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.6.0.1\lib\net461\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.7.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.DirectoryServices.AccountManagement" />
|
||||||
<Reference Include="System.Formats.Asn1, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Formats.Asn1, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Formats.Asn1.9.0.0\lib\net462\System.Formats.Asn1.dll</HintPath>
|
<HintPath>..\packages\System.Formats.Asn1.9.0.0\lib\net462\System.Formats.Asn1.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.IdentityModel" />
|
<Reference Include="System.IdentityModel" />
|
||||||
|
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.7.5.1\lib\net462\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.IO.Packaging, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.IO.Packaging, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.IO.Packaging.9.0.0\lib\net462\System.IO.Packaging.dll</HintPath>
|
<HintPath>..\packages\System.IO.Packaging.9.0.0\lib\net462\System.IO.Packaging.dll</HintPath>
|
||||||
@@ -252,9 +345,25 @@
|
|||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Security.Cryptography.Cng, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Cryptography.Cng.5.0.0\lib\net462\System.Security.Cryptography.Cng.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Security.Cryptography.Pkcs, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Security.Cryptography.Pkcs, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Security.Cryptography.Pkcs.9.0.0\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
|
<HintPath>..\packages\System.Security.Cryptography.Pkcs.9.0.0\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
<HintPath>..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -361,6 +470,10 @@
|
|||||||
<Project>{4F32A98D-E6F0-4A09-BD97-1CF26107E837}</Project>
|
<Project>{4F32A98D-E6F0-4A09-BD97-1CF26107E837}</Project>
|
||||||
<Name>EnvelopeGenerator.Domain</Name>
|
<Name>EnvelopeGenerator.Domain</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj">
|
||||||
|
<Project>{63e32615-0eca-42dc-96e3-91037324b7c7}</Project>
|
||||||
|
<Name>EnvelopeGenerator.Infrastructure</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="GdPicture.NET.14.barcode.1d.reader.64.dll" />
|
<Content Include="GdPicture.NET.14.barcode.1d.reader.64.dll" />
|
||||||
@@ -391,8 +504,10 @@
|
|||||||
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets'))" />
|
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets'))" />
|
||||||
<Error Condition="!Exists('..\packages\EntityFramework.6.5.1\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.5.1\build\EntityFramework.props'))" />
|
<Error Condition="!Exists('..\packages\EntityFramework.6.5.1\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.5.1\build\EntityFramework.props'))" />
|
||||||
<Error Condition="!Exists('..\packages\EntityFramework.6.5.1\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.5.1\build\EntityFramework.targets'))" />
|
<Error Condition="!Exists('..\packages\EntityFramework.6.5.1\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.5.1\build\EntityFramework.targets'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="..\packages\EntityFramework.6.5.1\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.5.1\build\EntityFramework.targets')" />
|
<Import Project="..\packages\EntityFramework.6.5.1\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.5.1\build\EntityFramework.targets')" />
|
||||||
|
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
|||||||
@@ -107,6 +107,78 @@
|
|||||||
<assemblyIdentity name="GdPicture.NET.14.Imaging" publicKeyToken="f52a2e60ad468dbb" culture="neutral" />
|
<assemblyIdentity name="GdPicture.NET.14.Imaging" publicKeyToken="f52a2e60ad468dbb" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-14.3.3.0" newVersion="14.3.3.0" />
|
<bindingRedirect oldVersion="0.0.0.0-14.3.3.0" newVersion="14.3.3.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.77.0.0" newVersion="4.77.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.14.0.0" newVersion="8.14.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Caching.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
Imports DigitalData.Modules.Database
|
Imports System.IO
|
||||||
|
Imports DigitalData.Modules.Database
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
Imports EnvelopeGenerator.CommonServices.Jobs
|
||||||
|
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument
|
||||||
Imports GdPicture14
|
Imports GdPicture14
|
||||||
Imports Newtonsoft.Json.Linq
|
Imports Newtonsoft.Json.Linq
|
||||||
Imports EnvelopeGenerator.CommonServices.Jobs
|
Imports EnvelopeGenerator.Infrastructure
|
||||||
Imports System.IO
|
Imports Microsoft.EntityFrameworkCore
|
||||||
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument
|
Imports System.Text
|
||||||
|
Imports DigitalData.Core.Abstractions
|
||||||
|
|
||||||
Public Class frmFinalizePDF
|
Public Class frmFinalizePDF
|
||||||
Private Const CONNECTIONSTRING = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=+bk8oAbbQP1AzoHtvZUbd+Mbok2f8Fl4miEx1qssJ5yEaEWoQJ9prg4L14fURpPnqi1WMNs9fE4=;"
|
Private Const CONNECTIONSTRING = "Server=sDD-VMP04-SQL17\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=+bk8oAbbQP1AzoHtvZUbd+Mbok2f8Fl4miEx1qssJ5yEaEWoQJ9prg4L14fURpPnqi1WMNs9fE4=;"
|
||||||
@@ -20,10 +24,35 @@ Public Class frmFinalizePDF
|
|||||||
|
|
||||||
Private Sub frmFinalizePDF_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmFinalizePDF_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
LogConfig = New LogConfig(LogConfig.PathType.CustomPath, Application.StartupPath)
|
LogConfig = New LogConfig(LogConfig.PathType.CustomPath, Application.StartupPath)
|
||||||
Database = New MSSQLServer(LogConfig, MSSQLServer.DecryptConnectionString(CONNECTIONSTRING))
|
|
||||||
|
|
||||||
|
Dim dCnnStr As String = MSSQLServer.DecryptConnectionString(CONNECTIONSTRING)
|
||||||
|
|
||||||
PDFBurner = New FinalizeDocument.PDFBurner(LogConfig, pGDPictureLicenseKey, _pdfBurnerParams)
|
Database = New MSSQLServer(LogConfig, dCnnStr)
|
||||||
|
|
||||||
|
#Disable Warning BC40000 ' Type or member is obsolete
|
||||||
|
Factory.Shared _
|
||||||
|
.BehaveOnPostBuild(PostBuildBehavior.Ignore) _
|
||||||
|
.AddEGInfrastructureServices(
|
||||||
|
Sub(opt)
|
||||||
|
opt.AddDbTriggerParams(
|
||||||
|
Sub(triggers)
|
||||||
|
triggers("Envelope") = New List(Of String) From {"TBSIG_ENVELOPE_AFT_INS"}
|
||||||
|
triggers("History") = New List(Of String) From {"TBSIG_ENVELOPE_HISTORY_AFT_INS"}
|
||||||
|
triggers("EmailOut") = New List(Of String) From {"TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD"}
|
||||||
|
triggers("EnvelopeReceiverReadOnly") = New List(Of String) From {"TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD"}
|
||||||
|
triggers("Receiver") = New List(Of String)() ' no tigger
|
||||||
|
triggers("EmailTemplate") = New List(Of String) From {"TBSIG_EMAIL_TEMPLATE_AFT_UPD"}
|
||||||
|
End Sub)
|
||||||
|
opt.AddDbContext(
|
||||||
|
Sub(options)
|
||||||
|
options.UseSqlServer(dCnnStr) _
|
||||||
|
.EnableSensitiveDataLogging() _
|
||||||
|
.EnableDetailedErrors()
|
||||||
|
End Sub)
|
||||||
|
End Sub)
|
||||||
|
#Enable Warning BC40000 ' Type or member is obsolete
|
||||||
|
|
||||||
|
PDFBurner = New PDFBurner(LogConfig, pGDPictureLicenseKey, _pdfBurnerParams)
|
||||||
|
|
||||||
Viewer = New GdViewer()
|
Viewer = New GdViewer()
|
||||||
Manager = New AnnotationManager()
|
Manager = New AnnotationManager()
|
||||||
@@ -72,8 +101,9 @@ Public Class frmFinalizePDF
|
|||||||
Select(Function(r As DataRow) r.Item("VALUE").ToString()).
|
Select(Function(r As DataRow) r.Item("VALUE").ToString()).
|
||||||
ToList()
|
ToList()
|
||||||
|
|
||||||
Dim oBuffer As Byte() = ReadEnvelope(CInt(txtEnvelope.Text))
|
Dim envelopeId As Integer = CInt(txtEnvelope.Text)
|
||||||
Dim oNewBuffer = PDFBurner.BurnInstantJSONAnnotationsToPDF(oBuffer, oJsonList)
|
Dim oBuffer As Byte() = ReadEnvelope(envelopeId)
|
||||||
|
Dim oNewBuffer = PDFBurner.BurnAnnotsToPDF(oBuffer, oJsonList, envelopeId)
|
||||||
Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
|
Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
|
||||||
Dim oNewPath = Path.Combine(desktopPath, $"E{txtEnvelope.Text}R{txtReceiver.Text}.burned.pdf")
|
Dim oNewPath = Path.Combine(desktopPath, $"E{txtEnvelope.Text}R{txtReceiver.Text}.burned.pdf")
|
||||||
|
|
||||||
@@ -81,7 +111,15 @@ Public Class frmFinalizePDF
|
|||||||
|
|
||||||
Process.Start(oNewPath)
|
Process.Start(oNewPath)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
Dim exMsg As StringBuilder = New StringBuilder(ex.Message).AppendLine()
|
||||||
|
|
||||||
|
Dim innerEx = ex.InnerException
|
||||||
|
While (innerEx IsNot Nothing)
|
||||||
|
exMsg.AppendLine(innerEx.Message)
|
||||||
|
innerEx = innerEx.InnerException
|
||||||
|
End While
|
||||||
|
|
||||||
|
MsgBox(exMsg.ToString(), MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="AutoMapper" version="10.1.1" targetFramework="net462" />
|
||||||
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Controls.DocumentViewer" version="1.9.8" targetFramework="net462" />
|
<package id="DigitalData.Controls.DocumentViewer" version="1.9.8" targetFramework="net462" />
|
||||||
|
<package id="DigitalData.Core.Abstraction.Application" version="1.5.0" targetFramework="net462" />
|
||||||
|
<package id="DigitalData.Core.Abstractions" version="4.3.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Database" version="2.3.5.4" targetFramework="net462" />
|
<package id="DigitalData.Modules.Database" version="2.3.5.4" targetFramework="net462" />
|
||||||
@@ -18,9 +21,35 @@
|
|||||||
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net462" />
|
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.0" targetFramework="net462" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.Bcl.Cryptography" version="9.0.0" targetFramework="net462" />
|
<package id="Microsoft.Bcl.Cryptography" version="9.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net462" />
|
||||||
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net462" />
|
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Data.SqlClient" version="1.1.3" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Data.SqlClient.SNI" version="1.1.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.Abstractions" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.Analyzers" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.Relational" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.SqlServer" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Caching.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Caching.Memory" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Configuration" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Configuration.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Configuration.Binder" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.DependencyInjection" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Localization.Abstractions" version="7.0.16" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Logging" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Options" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Primitives" version="7.0.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.Identity.Client" version="4.77.0" targetFramework="net462" />
|
<package id="Microsoft.Identity.Client" version="4.77.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.IdentityModel.Abstractions" version="8.14.0" targetFramework="net462" />
|
<package id="Microsoft.IdentityModel.Abstractions" version="8.14.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.JsonWebTokens" version="7.5.1" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Logging" version="7.5.1" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Protocols" version="5.5.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="5.5.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Tokens" version="7.5.1" targetFramework="net462" />
|
||||||
<package id="Microsoft.VisualBasic" version="10.3.0" targetFramework="net462" />
|
<package id="Microsoft.VisualBasic" version="10.3.0" targetFramework="net462" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
||||||
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net462" />
|
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net462" />
|
||||||
@@ -33,15 +62,24 @@
|
|||||||
<package id="System.Buffers" version="4.6.0" targetFramework="net462" />
|
<package id="System.Buffers" version="4.6.0" targetFramework="net462" />
|
||||||
<package id="System.CodeDom" version="9.0.0" targetFramework="net462" />
|
<package id="System.CodeDom" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="System.Collections.Immutable" version="9.0.0" targetFramework="net462" />
|
<package id="System.Collections.Immutable" version="9.0.0" targetFramework="net462" />
|
||||||
|
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net462" />
|
||||||
|
<package id="System.Data.Common" version="4.3.0" targetFramework="net462" />
|
||||||
<package id="System.Data.Odbc" version="6.0.1" targetFramework="net462" />
|
<package id="System.Data.Odbc" version="6.0.1" targetFramework="net462" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="System.DirectoryServices.AccountManagement" version="7.0.1" targetFramework="net462" />
|
||||||
<package id="System.Formats.Asn1" version="9.0.0" targetFramework="net462" />
|
<package id="System.Formats.Asn1" version="9.0.0" targetFramework="net462" />
|
||||||
|
<package id="System.IdentityModel.Tokens.Jwt" version="7.5.1" targetFramework="net462" />
|
||||||
<package id="System.IO.Packaging" version="9.0.0" targetFramework="net462" />
|
<package id="System.IO.Packaging" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="System.IO.Pipelines" version="9.0.0" targetFramework="net462" />
|
<package id="System.IO.Pipelines" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="System.Management" version="9.0.0" targetFramework="net462" />
|
<package id="System.Management" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="System.Memory" version="4.6.0" targetFramework="net462" />
|
<package id="System.Memory" version="4.6.0" targetFramework="net462" />
|
||||||
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net462" />
|
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net462" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net462" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Cryptography.Cng" version="5.0.0" targetFramework="net462" />
|
||||||
<package id="System.Security.Cryptography.Pkcs" version="9.0.0" targetFramework="net462" />
|
<package id="System.Security.Cryptography.Pkcs" version="9.0.0" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
|
||||||
<package id="System.Text.Encodings.Web" version="9.0.0" targetFramework="net462" />
|
<package id="System.Text.Encodings.Web" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="System.Text.Json" version="9.0.0" targetFramework="net462" />
|
<package id="System.Text.Json" version="9.0.0" targetFramework="net462" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
|
||||||
|
|||||||
@@ -48,6 +48,9 @@
|
|||||||
<OptionInfer>On</OptionInfer>
|
<OptionInfer>On</OptionInfer>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="AutoMapper, Version=10.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\AutoMapper.10.1.1\lib\net461\AutoMapper.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
<HintPath>..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -69,6 +72,13 @@
|
|||||||
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||||
<Reference Include="DevExpress.XtraGauges.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
<Reference Include="DevExpress.XtraGauges.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="DevExpress.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
<Reference Include="DevExpress.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="DigitalData.Core.Abstraction.Application, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DigitalData.Core.Abstraction.Application.1.5.0\lib\net462\DigitalData.Core.Abstraction.Application.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DigitalData.Core.Abstractions, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DigitalData.Core.Abstractions.4.3.0\lib\net462\DigitalData.Core.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Base, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Modules.Base, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Modules.Base.1.3.8\lib\net462\DigitalData.Modules.Base.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Modules.Base.1.3.8\lib\net462\DigitalData.Modules.Base.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -172,9 +182,84 @@
|
|||||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Data.SqlClient, Version=1.13.20136.2, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Data.SqlClient.1.1.3\lib\net46\Microsoft.Data.SqlClient.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore.Abstractions, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.Abstractions.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore.Relational, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.Relational.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.32.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.EntityFrameworkCore.SqlServer.3.1.32\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Caching.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Caching.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Caching.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Caching.Memory, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Caching.Memory.7.0.0\lib\net462\Microsoft.Extensions.Caching.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Configuration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Configuration.7.0.0\lib\net462\Microsoft.Extensions.Configuration.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Configuration.Binder, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.7.0.0\lib\net462\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Localization.Abstractions, Version=7.0.16.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Localization.Abstractions.7.0.16\lib\net462\Microsoft.Extensions.Localization.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.7.0.0\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Options.7.0.0\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Options.ConfigurationExtensions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Options.ConfigurationExtensions.7.0.0\lib\net462\Microsoft.Extensions.Options.ConfigurationExtensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Primitives, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Primitives.7.0.0\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Identity.Client, Version=3.0.8.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Identity.Client.3.0.8\lib\net45\Microsoft.Identity.Client.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.7.5.1\lib\net462\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.7.5.1\lib\net462\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Logging, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Logging.7.5.1\lib\net462\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Protocols, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.5.5.0\lib\net461\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=5.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.5.5.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Tokens, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.7.5.1\lib\net462\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
@@ -216,13 +301,26 @@
|
|||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Data.Odbc, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Data.Odbc, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll</HintPath>
|
<HintPath>..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.7.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.DirectoryServices.AccountManagement" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Drawing.Common.4.7.3\lib\net461\System.Drawing.Common.dll</HintPath>
|
<HintPath>..\packages\System.Drawing.Common.4.7.3\lib\net461\System.Drawing.Common.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.IdentityModel" />
|
||||||
|
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=7.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.7.5.1\lib\net462\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.IO.Packaging, Version=8.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.IO.Packaging, Version=8.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.IO.Packaging.8.0.1\lib\net462\System.IO.Packaging.dll</HintPath>
|
<HintPath>..\packages\System.IO.Packaging.8.0.1\lib\net462\System.IO.Packaging.dll</HintPath>
|
||||||
@@ -244,9 +342,25 @@
|
|||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Security.Cryptography.Cng, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Cryptography.Cng.5.0.0\lib\net462\System.Security.Cryptography.Cng.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Security.Cryptography.Pkcs, Version=8.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Security.Cryptography.Pkcs, Version=8.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Security.Cryptography.Pkcs.8.0.1\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
|
<HintPath>..\packages\System.Security.Cryptography.Pkcs.8.0.1\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||||
@@ -446,6 +560,10 @@
|
|||||||
<Project>{4f32a98d-e6f0-4a09-bd97-1cf26107e837}</Project>
|
<Project>{4f32a98d-e6f0-4a09-bd97-1cf26107e837}</Project>
|
||||||
<Name>EnvelopeGenerator.Domain</Name>
|
<Name>EnvelopeGenerator.Domain</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.PdfEditor\EnvelopeGenerator.PdfEditor.csproj">
|
||||||
|
<Project>{211619f5-ae25-4ba5-a552-bacafe0632d3}</Project>
|
||||||
|
<Name>EnvelopeGenerator.PdfEditor</Name>
|
||||||
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
@@ -455,7 +573,9 @@
|
|||||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||||
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets'))" />
|
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||||
<Import Project="..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets" Condition="Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" />
|
<Import Project="..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets" Condition="Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" />
|
||||||
|
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -11,6 +11,10 @@ Imports EnvelopeGenerator.Domain.Constants
|
|||||||
Imports DevExpress.DataProcessing
|
Imports DevExpress.DataProcessing
|
||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports EnvelopeGenerator.Domain.Entities
|
Imports EnvelopeGenerator.Domain.Entities
|
||||||
|
Imports DigitalData.Core.Abstraction.Application
|
||||||
|
Imports EnvelopeGenerator.Infrastructure
|
||||||
|
Imports Microsoft.EntityFrameworkCore
|
||||||
|
Imports DigitalData.Core.Abstractions
|
||||||
|
|
||||||
Namespace Jobs
|
Namespace Jobs
|
||||||
Public Class FinalizeDocumentJob
|
Public Class FinalizeDocumentJob
|
||||||
@@ -62,7 +66,8 @@ Namespace Jobs
|
|||||||
LicenseManager.RegisterKEY(oGdPictureKey)
|
LicenseManager.RegisterKEY(oGdPictureKey)
|
||||||
|
|
||||||
Logger.Debug("Loading Database..")
|
Logger.Debug("Loading Database..")
|
||||||
Database = GetDatabase(pContext, LogConfig)
|
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Value.DATABASE)
|
||||||
|
Database = New MSSQLServer(LogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||||
|
|
||||||
Logger.Debug("Loading Models & Services")
|
Logger.Debug("Loading Models & Services")
|
||||||
Dim oState = GetState()
|
Dim oState = GetState()
|
||||||
@@ -378,7 +383,6 @@ Namespace Jobs
|
|||||||
ParentFolderUID = pEnvelopeData.EnvelopeUUID
|
ParentFolderUID = pEnvelopeData.EnvelopeUUID
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID)
|
Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID)
|
||||||
Dim oInputDocumentBuffer As Byte()
|
Dim oInputDocumentBuffer As Byte()
|
||||||
If Not IsNothing(pEnvelopeData.DocAsByte) Then
|
If Not IsNothing(pEnvelopeData.DocAsByte) Then
|
||||||
@@ -391,7 +395,7 @@ Namespace Jobs
|
|||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
|
Return PDFBurner.BurnAnnotsToPDF(oInputDocumentBuffer, oAnnotations, pEnvelopeData.EnvelopeId)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GetEnvelopeData(pEnvelopeId As Integer) As EnvelopeData
|
Private Function GetEnvelopeData(pEnvelopeId As Integer) As EnvelopeData
|
||||||
@@ -439,13 +443,6 @@ Namespace Jobs
|
|||||||
ReportModel = New ReportModel(pState)
|
ReportModel = New ReportModel(pState)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
|
||||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Value.DATABASE)
|
|
||||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
|
||||||
|
|
||||||
Return Database
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetState() As State
|
Private Function GetState() As State
|
||||||
Return New State With {
|
Return New State With {
|
||||||
.LogConfig = LogConfig,
|
.LogConfig = LogConfig,
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
Imports System.Drawing
|
Imports System.Collections.Immutable
|
||||||
|
Imports System.Drawing
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports DevExpress.DataProcessing
|
||||||
|
Imports DigitalData.Core.Abstraction.Application.Repository
|
||||||
|
Imports DigitalData.Core.Abstractions
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports GdPicture14
|
|
||||||
Imports Newtonsoft.Json
|
|
||||||
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||||
|
Imports EnvelopeGenerator.Domain.Entities
|
||||||
|
Imports EnvelopeGenerator.PdfEditor
|
||||||
|
Imports GdPicture14
|
||||||
|
Imports Microsoft.EntityFrameworkCore
|
||||||
|
Imports Newtonsoft.Json
|
||||||
|
|
||||||
Namespace Jobs.FinalizeDocument
|
Namespace Jobs.FinalizeDocument
|
||||||
Public Class PDFBurner
|
Public Class PDFBurner
|
||||||
@@ -13,9 +20,6 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Private ReadOnly Manager As AnnotationManager
|
Private ReadOnly Manager As AnnotationManager
|
||||||
Private ReadOnly LicenseManager As LicenseManager
|
Private ReadOnly LicenseManager As LicenseManager
|
||||||
|
|
||||||
Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image"
|
|
||||||
Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink"
|
|
||||||
Private Const ANNOTATION_TYPE_WIDGET = "pspdfkit/widget"
|
|
||||||
Private Property _pdfBurnerParams As PDFBurnerParams
|
Private Property _pdfBurnerParams As PDFBurnerParams
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, pdfBurnerParams As PDFBurnerParams)
|
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, pdfBurnerParams As PDFBurnerParams)
|
||||||
@@ -29,7 +33,94 @@ Namespace Jobs.FinalizeDocument
|
|||||||
_pdfBurnerParams = pdfBurnerParams
|
_pdfBurnerParams = pdfBurnerParams
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
#Region "Burn PDF"
|
||||||
|
Public Function BurnAnnotsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String), envelopeId As Integer) As Byte()
|
||||||
|
'read the elements of envelope with their annotations
|
||||||
|
Using scope = Factory.Shared.ScopeFactory.CreateScope()
|
||||||
|
Dim sigRepo = scope.ServiceProvider.Repository(Of Signature)()
|
||||||
|
Dim elements = sigRepo _
|
||||||
|
.Where(Function(sig) sig.Document.EnvelopeId = envelopeId) _
|
||||||
|
.Include(Function(sig) sig.Annotations) _
|
||||||
|
.ToList()
|
||||||
|
|
||||||
|
Return If(elements.Any(),
|
||||||
|
BurnElementAnnotsToPDF(pSourceBuffer, elements),
|
||||||
|
BurnInstantJSONAnnotsToPDF(pSourceBuffer, pInstantJSONList))
|
||||||
|
End Using
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of Signature)) As Byte()
|
||||||
|
' Add background
|
||||||
|
Using doc As Pdf(Of MemoryStream, MemoryStream) = Pdf.FromMemory(pSourceBuffer)
|
||||||
|
'TODO: take the length from the largest y
|
||||||
|
pSourceBuffer = doc.Background(elements, 1.9500000000000002 * 0.93, 2.52 * 0.67).ExportStream().ToArray()
|
||||||
|
|
||||||
|
Dim oResult As GdPictureStatus
|
||||||
|
Using oSourceStream As New MemoryStream(pSourceBuffer)
|
||||||
|
' Open PDF
|
||||||
|
oResult = Manager.InitFromStream(oSourceStream)
|
||||||
|
If oResult <> GdPictureStatus.OK Then
|
||||||
|
Throw New BurnAnnotationException($"Could not open document for burning: [{oResult}]")
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Imported from background (add to configuration)
|
||||||
|
Dim margin As Double = 0.2
|
||||||
|
Dim inchFactor As Double = 72
|
||||||
|
|
||||||
|
' Y offset of form fields
|
||||||
|
Dim keys = {"position", "city", "date"} ' add to configuration
|
||||||
|
Dim unitYOffsets = 0.2
|
||||||
|
Dim yOffsetsOfFF = keys.
|
||||||
|
Select(Function(k, i) New With {Key .Key = k, Key .Value = unitYOffsets * i + 1}).
|
||||||
|
ToDictionary(Function(x) x.Key, Function(x) x.Value)
|
||||||
|
|
||||||
|
'Add annotations
|
||||||
|
For Each element In elements
|
||||||
|
|
||||||
|
Dim frameX = (element.Left - 0.7 - margin)
|
||||||
|
|
||||||
|
Dim frame = element.Annotations.FirstOrDefault(Function(a) a.Name = "frame")
|
||||||
|
Dim frameY = element.Top - 0.5 - margin
|
||||||
|
Dim frameYShift = frame.Y - frameY * inchFactor
|
||||||
|
Dim frameXShift = frame.X - frameX * inchFactor
|
||||||
|
|
||||||
|
For Each annot In element.Annotations
|
||||||
|
Dim yOffsetofFF As Double = If(yOffsetsOfFF.TryGetValue(annot.Name, yOffsetofFF), yOffsetofFF, 0)
|
||||||
|
Dim y = frameY + yOffsetofFF
|
||||||
|
|
||||||
|
If annot.Type = AnnotationType.FormField Then
|
||||||
|
AddFormFieldValue(annot.X / inchFactor, y, annot.Width / inchFactor, annot.Height / inchFactor, element.Page, annot.Value)
|
||||||
|
ElseIf annot.Type = AnnotationType.Image Then
|
||||||
|
AddImageAnnotation(
|
||||||
|
annot.X / inchFactor,
|
||||||
|
If(annot.Name = "signature", (annot.Y - frameYShift) / inchFactor, y),
|
||||||
|
annot.Width / inchFactor,
|
||||||
|
annot.Height / inchFactor,
|
||||||
|
element.Page,
|
||||||
|
annot.Value
|
||||||
|
)
|
||||||
|
ElseIf annot.Type = AnnotationType.Ink Then
|
||||||
|
AddInkAnnotation(element.Page, annot.Value)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
|
||||||
|
'Save PDF
|
||||||
|
Using oNewStream As New MemoryStream()
|
||||||
|
oResult = Manager.SaveDocumentToPDF(oNewStream)
|
||||||
|
If oResult <> GdPictureStatus.OK Then
|
||||||
|
Throw New BurnAnnotationException($"Could not save document to stream: [{oResult}]")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Manager.Close()
|
||||||
|
|
||||||
|
Return oNewStream.ToArray()
|
||||||
|
End Using
|
||||||
|
End Using
|
||||||
|
End Using
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function BurnInstantJSONAnnotsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
||||||
Dim oResult As GdPictureStatus
|
Dim oResult As GdPictureStatus
|
||||||
Using oSourceStream As New MemoryStream(pSourceBuffer)
|
Using oSourceStream As New MemoryStream(pSourceBuffer)
|
||||||
' Open PDF
|
' Open PDF
|
||||||
@@ -40,11 +131,13 @@ Namespace Jobs.FinalizeDocument
|
|||||||
|
|
||||||
' Add annotation to PDF
|
' Add annotation to PDF
|
||||||
For Each oJSON In pInstantJSONList
|
For Each oJSON In pInstantJSONList
|
||||||
If AddInstantJSONAnnotationToPDF(oJSON) = False Then
|
Try
|
||||||
|
AddInstantJSONAnnotationToPDF(oJSON)
|
||||||
|
Catch ex As Exception
|
||||||
Logger.Warn($"Error in AddInstantJSONAnnotationToPDF - oJson: ")
|
Logger.Warn($"Error in AddInstantJSONAnnotationToPDF - oJson: ")
|
||||||
Logger.Warn(oJSON)
|
Logger.Warn(oJSON)
|
||||||
Throw New BurnAnnotationException($"Adding Annotation failed")
|
Throw New BurnAnnotationException($"Adding Annotation failed", ex)
|
||||||
End If
|
End Try
|
||||||
Next
|
Next
|
||||||
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
||||||
If oResult <> GdPictureStatus.OK Then
|
If oResult <> GdPictureStatus.OK Then
|
||||||
@@ -64,128 +157,125 @@ Namespace Jobs.FinalizeDocument
|
|||||||
End Using
|
End Using
|
||||||
End Using
|
End Using
|
||||||
End Function
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
Private Function AddInstantJSONAnnotationToPDF(pInstantJSON As String) As Boolean
|
#Region "Add Value"
|
||||||
Try
|
Private Sub AddInstantJSONAnnotationToPDF(pInstantJSON As String)
|
||||||
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
|
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
|
||||||
oAnnotationData.annotations.Reverse()
|
|
||||||
|
|
||||||
Dim sigAnnotType = oAnnotationData.annotations.ElementAt(1).type
|
oAnnotationData.annotations.Reverse()
|
||||||
Dim yPosOfSigAnnot = oAnnotationData.annotations.ElementAt(2).bbox.ElementAt(1) - 71.84002685546875 + 7
|
|
||||||
Dim isSeal = True 'First element is signature seal
|
|
||||||
|
|
||||||
Dim formFieldIndex = 0
|
For Each oAnnotation In oAnnotationData.annotations
|
||||||
For Each oAnnotation In oAnnotationData.annotations
|
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
|
||||||
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
|
|
||||||
|
|
||||||
Select Case oAnnotation.type
|
Select Case oAnnotation.type
|
||||||
Case ANNOTATION_TYPE_IMAGE
|
Case AnnotationType.Image
|
||||||
|
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
||||||
|
Exit Select
|
||||||
|
Case AnnotationType.Ink
|
||||||
|
AddInkAnnotation(oAnnotation)
|
||||||
|
Exit Select
|
||||||
|
Case AnnotationType.Widget
|
||||||
|
'Add form field values
|
||||||
|
Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id)
|
||||||
|
If formFieldValue IsNot Nothing AndAlso Not _pdfBurnerParams.IgnoredLabels.Contains(formFieldValue.value) Then
|
||||||
|
AddFormFieldValue(oAnnotation, formFieldValue)
|
||||||
|
End If
|
||||||
|
Exit Select
|
||||||
|
End Select
|
||||||
|
Next
|
||||||
|
|
||||||
If (isSeal) Then
|
End Sub
|
||||||
oAnnotation.bbox.Item(1) = yPosOfSigAnnot
|
|
||||||
End If
|
|
||||||
|
|
||||||
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
Private Sub AddImageAnnotation(x As Double, y As Double, width As Double, height As Double, page As Integer, base64 As String)
|
||||||
|
Manager.SelectPage(page)
|
||||||
|
Manager.AddEmbeddedImageAnnotFromBase64(base64, x, y, width, height)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Case ANNOTATION_TYPE_INK
|
Private Sub AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment))
|
||||||
AddInkAnnotation(oAnnotation)
|
Dim oAttachment = pAttachments.Where(Function(a) a.Key = pAnnotation.imageAttachmentId).
|
||||||
|
SingleOrDefault()
|
||||||
|
|
||||||
Case ANNOTATION_TYPE_WIDGET
|
' Convert pixels to Inches
|
||||||
'Add form field values
|
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
||||||
Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id)
|
|
||||||
If formFieldValue IsNot Nothing AndAlso Not _pdfBurnerParams.IgnoredLabels.Contains(formFieldValue.value) Then
|
|
||||||
AddFormFieldValue(oAnnotation, formFieldValue, formFieldIndex)
|
|
||||||
formFieldIndex += 1
|
|
||||||
End If
|
|
||||||
End Select
|
|
||||||
|
|
||||||
isSeal = False
|
Dim oX = oBounds.Item(0)
|
||||||
Next
|
Dim oY = oBounds.Item(1)
|
||||||
|
Dim oWidth = oBounds.Item(2)
|
||||||
|
Dim oHeight = oBounds.Item(3)
|
||||||
|
|
||||||
Return True
|
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||||
Catch ex As Exception
|
Manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.binary, oX, oY, oWidth, oHeight)
|
||||||
Logger.Warn("Could not create annotation from InstantJSON")
|
End Sub
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment), Optional yOffset As Double = 0) As Boolean
|
Private Sub AddInkAnnotation(page As Integer, value As String)
|
||||||
Try
|
|
||||||
Dim oAttachment = pAttachments.Where(Function(a) a.Key = pAnnotation.imageAttachmentId).
|
|
||||||
SingleOrDefault()
|
|
||||||
|
|
||||||
' Convert pixels to Inches
|
Dim ink = JsonConvert.DeserializeObject(Of Ink)(value)
|
||||||
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
|
||||||
|
|
||||||
Dim oX = oBounds.Item(0)
|
Dim oSegments = ink.lines.points
|
||||||
Dim oY = oBounds.Item(1) + yOffset
|
Dim oColor = ColorTranslator.FromHtml(ink.strokeColor)
|
||||||
Dim oWidth = oBounds.Item(2)
|
Manager.SelectPage(page)
|
||||||
Dim oHeight = oBounds.Item(3)
|
|
||||||
|
|
||||||
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
For Each oSegment As List(Of List(Of Single)) In oSegments
|
||||||
Manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.binary, oX, oY, oWidth, oHeight)
|
Dim oPoints = oSegment.
|
||||||
|
Select(AddressOf ToPointF).
|
||||||
|
ToArray()
|
||||||
|
|
||||||
Return True
|
Manager.AddFreeHandAnnot(oColor, oPoints)
|
||||||
Catch ex As Exception
|
Next
|
||||||
Logger.Warn("Could not add image annotation!")
|
End Sub
|
||||||
Logger.Error(ex)
|
|
||||||
|
|
||||||
Return False
|
Private Sub AddInkAnnotation(pAnnotation As Annotation)
|
||||||
End Try
|
Dim oSegments = pAnnotation.lines.points
|
||||||
End Function
|
Dim oColor = ColorTranslator.FromHtml(pAnnotation.strokeColor)
|
||||||
|
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||||
|
|
||||||
Private Function AddInkAnnotation(pAnnotation As Annotation) As Boolean
|
For Each oSegment As List(Of List(Of Single)) In oSegments
|
||||||
Try
|
Dim oPoints = oSegment.
|
||||||
Dim oSegments = pAnnotation.lines.points
|
Select(AddressOf ToPointF).
|
||||||
Dim oColor = ColorTranslator.FromHtml(pAnnotation.strokeColor)
|
ToArray()
|
||||||
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
|
||||||
|
|
||||||
For Each oSegment As List(Of List(Of Single)) In oSegments
|
Manager.AddFreeHandAnnot(oColor, oPoints)
|
||||||
Dim oPoints = oSegment.
|
Next
|
||||||
Select(AddressOf ToPointF).
|
End Sub
|
||||||
ToArray()
|
|
||||||
|
|
||||||
Manager.AddFreeHandAnnot(oColor, oPoints)
|
Private Sub AddFormFieldValue(x As Double, y As Double, width As Double, height As Double, page As Integer, value As String)
|
||||||
Next
|
Manager.SelectPage(page)
|
||||||
|
|
||||||
Return True
|
' Add the text annotation
|
||||||
Catch ex As Exception
|
Dim ant = Manager.AddTextAnnot(x, y, width, height, value)
|
||||||
Logger.Warn("Could not add image annotation!")
|
|
||||||
Logger.Error(ex)
|
|
||||||
|
|
||||||
Return False
|
' Set the font properties
|
||||||
End Try
|
ant.FontName = _pdfBurnerParams.FontName
|
||||||
|
ant.FontSize = _pdfBurnerParams.FontSize
|
||||||
|
ant.FontStyle = _pdfBurnerParams.FontStyle
|
||||||
|
Manager.SaveAnnotationsToPage()
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Function
|
Private Sub AddFormFieldValue(pAnnotation As Annotation, formFieldValue As FormFieldValue)
|
||||||
|
Dim ffIndex As Integer = EGName.Index(pAnnotation.egName)
|
||||||
|
|
||||||
Private Function AddFormFieldValue(pAnnotation As Annotation, formFieldValue As FormFieldValue, index As Integer) As Boolean
|
' Convert pixels to Inches
|
||||||
Try
|
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
||||||
' Convert pixels to Inches
|
|
||||||
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
|
||||||
|
|
||||||
Dim oX = oBounds.Item(0)
|
Dim oX = oBounds.Item(0)
|
||||||
Dim oY = oBounds.Item(1) + _pdfBurnerParams.YOffset * index + _pdfBurnerParams.TopMargin
|
Dim oY = oBounds.Item(1) + _pdfBurnerParams.YOffset * ffIndex + _pdfBurnerParams.TopMargin
|
||||||
Dim oWidth = oBounds.Item(2)
|
Dim oWidth = oBounds.Item(2)
|
||||||
Dim oHeight = oBounds.Item(3)
|
Dim oHeight = oBounds.Item(3)
|
||||||
|
|
||||||
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||||
' Add the text annotation
|
' Add the text annotation
|
||||||
Dim ant = Manager.AddTextAnnot(oX, oY, oWidth, oHeight, formFieldValue.value)
|
Dim ant = Manager.AddTextAnnot(oX, oY, oWidth, oHeight, formFieldValue.value)
|
||||||
|
|
||||||
' Set the font properties
|
' Set the font properties
|
||||||
ant.FontName = _pdfBurnerParams.FontName
|
ant.FontName = _pdfBurnerParams.FontName
|
||||||
ant.FontSize = _pdfBurnerParams.FontSize
|
ant.FontSize = _pdfBurnerParams.FontSize
|
||||||
ant.FontStyle = _pdfBurnerParams.FontStyle
|
ant.FontStyle = _pdfBurnerParams.FontStyle
|
||||||
Manager.SaveAnnotationsToPage()
|
Manager.SaveAnnotationsToPage()
|
||||||
Return True
|
End Sub
|
||||||
Catch ex As Exception
|
#End Region
|
||||||
Logger.Warn("Could not add image annotation!")
|
|
||||||
Logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
|
#Region "Helpers"
|
||||||
Private Function ToPointF(pPoints As List(Of Single)) As PointF
|
Private Function ToPointF(pPoints As List(Of Single)) As PointF
|
||||||
Dim oPoints = pPoints.Select(AddressOf ToInches).ToList()
|
Dim oPoints = pPoints.Select(AddressOf ToInches).ToList()
|
||||||
Return New PointF(oPoints.Item(0), oPoints.Item(1))
|
Return New PointF(oPoints.Item(0), oPoints.Item(1))
|
||||||
@@ -198,24 +288,138 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Private Function ToInches(pValue As Single) As Single
|
Private Function ToInches(pValue As Single) As Single
|
||||||
Return pValue / 72
|
Return pValue / 72
|
||||||
End Function
|
End Function
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
#Region "Model"
|
||||||
|
Friend Class AnnotationType
|
||||||
|
Public Const Image As String = "pspdfkit/image"
|
||||||
|
Public Const Ink As String = "pspdfkit/ink"
|
||||||
|
Public Const Widget As String = "pspdfkit/widget"
|
||||||
|
Public Const FormField As String = "pspdfkit/form-field-value"
|
||||||
|
End Class
|
||||||
|
|
||||||
Friend Class AnnotationData
|
Friend Class AnnotationData
|
||||||
Public Property annotations As List(Of Annotation)
|
Public Property annotations As List(Of Annotation)
|
||||||
|
|
||||||
|
Public ReadOnly Property AnnotationsByReceiver As IEnumerable(Of List(Of Annotation))
|
||||||
|
Get
|
||||||
|
Return annotations _
|
||||||
|
.Where(Function(annot) annot.hasStructuredID).ToList() _
|
||||||
|
.GroupBy(Function(a) a.receiverId) _
|
||||||
|
.Select(Function(g) g.ToList())
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property UnstructuredAnnotations As IEnumerable(Of List(Of Annotation))
|
||||||
|
Get
|
||||||
|
Return annotations _
|
||||||
|
.Where(Function(annot) Not annot.hasStructuredID).ToList() _
|
||||||
|
.GroupBy(Function(a) a.receiverId) _
|
||||||
|
.Select(Function(g) g.ToList())
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Property attachments As Dictionary(Of String, Attachment)
|
Public Property attachments As Dictionary(Of String, Attachment)
|
||||||
Public Property formFieldValues As List(Of FormFieldValue)
|
Public Property formFieldValues As List(Of FormFieldValue)
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Friend Class Annotation
|
Friend Class Annotation
|
||||||
|
|
||||||
|
Private _id As String = Nothing
|
||||||
|
|
||||||
|
Public envelopeId As Integer = Nothing
|
||||||
|
|
||||||
|
Public receiverId As Integer = Nothing
|
||||||
|
|
||||||
|
Public index As Integer = Nothing
|
||||||
|
|
||||||
|
Public egName As String = PDFBurner.EGName.NoName
|
||||||
|
|
||||||
|
Public hasStructuredID As Boolean = False
|
||||||
|
|
||||||
|
Public ReadOnly Property isLabel As Boolean
|
||||||
|
Get
|
||||||
|
If String.IsNullOrEmpty(egName) Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim parts As String() = egName.Split("_"c)
|
||||||
|
Return parts.Length > 1 AndAlso parts(1) = "label"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Property id As String
|
Public Property id As String
|
||||||
|
Get
|
||||||
|
Return _id
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
_id = value
|
||||||
|
|
||||||
|
If String.IsNullOrWhiteSpace(_id) Then
|
||||||
|
Throw New BurnAnnotationException("The identifier of annotation is null or empty.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim parts As String() = value.Split("#"c)
|
||||||
|
|
||||||
|
If (parts.Length <> 4) Then
|
||||||
|
Return
|
||||||
|
'Throw New BurnAnnotationException($"The identifier of annotation has more or less than 4 sub-part. Id: {_id}")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not Integer.TryParse(parts(0), envelopeId) Then
|
||||||
|
Throw New BurnAnnotationException($"The envelope ID of annotation is not integer. Id: {_id}")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not Integer.TryParse(parts(1), receiverId) Then
|
||||||
|
Throw New BurnAnnotationException($"The receiver ID of annotation is not integer. Id: {_id}")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not Integer.TryParse(parts(2), index) Then
|
||||||
|
Throw New BurnAnnotationException($"The index of annotation is not integer. Id: {_id}")
|
||||||
|
End If
|
||||||
|
|
||||||
|
egName = parts(3)
|
||||||
|
|
||||||
|
hasStructuredID = True
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Property bbox As List(Of Double)
|
Public Property bbox As List(Of Double)
|
||||||
|
|
||||||
Public Property type As String
|
Public Property type As String
|
||||||
|
|
||||||
Public Property isSignature As Boolean
|
Public Property isSignature As Boolean
|
||||||
|
|
||||||
Public Property imageAttachmentId As String
|
Public Property imageAttachmentId As String
|
||||||
|
|
||||||
Public Property lines As Lines
|
Public Property lines As Lines
|
||||||
|
|
||||||
Public Property pageIndex As Integer
|
Public Property pageIndex As Integer
|
||||||
|
|
||||||
Public Property strokeColor As String
|
Public Property strokeColor As String
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
Friend Class Ink
|
||||||
|
Public Property lines As Lines
|
||||||
|
|
||||||
|
Public Property strokeColor As String
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class EGName
|
||||||
|
Public Shared ReadOnly NoName As String = Guid.NewGuid().ToString()
|
||||||
|
|
||||||
|
Public Shared ReadOnly Seal As String = "signature"
|
||||||
|
|
||||||
|
Public Shared ReadOnly Index As ImmutableDictionary(Of String, Integer) =
|
||||||
|
New Dictionary(Of String, Integer) From {
|
||||||
|
{NoName, 0},
|
||||||
|
{Seal, 0},
|
||||||
|
{"position", 1},
|
||||||
|
{"city", 2},
|
||||||
|
{"date", 3}
|
||||||
|
}.ToImmutableDictionary()
|
||||||
|
End Class
|
||||||
|
|
||||||
Friend Class Lines
|
Friend Class Lines
|
||||||
Public Property points As List(Of List(Of List(Of Single)))
|
Public Property points As List(Of List(Of List(Of Single)))
|
||||||
End Class
|
End Class
|
||||||
@@ -229,5 +433,6 @@ Namespace Jobs.FinalizeDocument
|
|||||||
Public Property name As String
|
Public Property name As String
|
||||||
Public Property value As String
|
Public Property value As String
|
||||||
End Class
|
End Class
|
||||||
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -55,7 +55,7 @@ Public Class PDFMerger
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' Convert to PDF/A
|
' Convert to PDF/A
|
||||||
oMergedPDF.ConvertToPDFA(oFinalStream, PDFAConformanceLevel, ALLOW_VECTORIZATION, ALLOW_RASTERIZATION)
|
oMergedPDF.SaveToStream(oFinalStream)
|
||||||
oStatus = oDocumentPDF.GetStat()
|
oStatus = oDocumentPDF.GetStat()
|
||||||
If oStatus <> GdPictureStatus.OK Then
|
If oStatus <> GdPictureStatus.OK Then
|
||||||
Throw New MergeDocumentException($"Document could not be converted to PDF/A: {oStatus}")
|
Throw New MergeDocumentException($"Document could not be converted to PDF/A: {oStatus}")
|
||||||
|
|||||||
@@ -77,6 +77,70 @@
|
|||||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.5" newVersion="8.0.0.5" />
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.5" newVersion="8.0.0.5" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Caching.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="AutoMapper" version="10.1.1" targetFramework="net462" />
|
||||||
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
||||||
|
<package id="DigitalData.Core.Abstraction.Application" version="1.5.0" targetFramework="net462" />
|
||||||
|
<package id="DigitalData.Core.Abstractions" version="4.3.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Database" version="2.3.5.4" targetFramework="net462" />
|
<package id="DigitalData.Modules.Database" version="2.3.5.4" targetFramework="net462" />
|
||||||
@@ -15,8 +18,35 @@
|
|||||||
<package id="GdPicture.runtimes.windows" version="14.3.3" targetFramework="net462" />
|
<package id="GdPicture.runtimes.windows" version="14.3.3" targetFramework="net462" />
|
||||||
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net462" />
|
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net462" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net462" />
|
||||||
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net462" />
|
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.1" targetFramework="net462" />
|
<package id="Microsoft.Data.SqlClient" version="1.1.3" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Data.SqlClient.SNI" version="1.1.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.Abstractions" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.Analyzers" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.Relational" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.EntityFrameworkCore.SqlServer" version="3.1.32" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Caching.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Caching.Memory" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Configuration" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Configuration.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Configuration.Binder" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.DependencyInjection" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Localization.Abstractions" version="7.0.16" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Logging" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Options" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Extensions.Primitives" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.Identity.Client" version="3.0.8" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Abstractions" version="7.5.1" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.JsonWebTokens" version="7.5.1" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Logging" version="7.5.1" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Protocols" version="5.5.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="5.5.0" targetFramework="net462" />
|
||||||
|
<package id="Microsoft.IdentityModel.Tokens" version="7.5.1" targetFramework="net462" />
|
||||||
<package id="Microsoft.VisualBasic" version="10.3.0" targetFramework="net462" />
|
<package id="Microsoft.VisualBasic" version="10.3.0" targetFramework="net462" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
||||||
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net462" />
|
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net462" />
|
||||||
@@ -31,14 +61,22 @@
|
|||||||
<package id="System.CodeDom" version="8.0.0" targetFramework="net462" />
|
<package id="System.CodeDom" version="8.0.0" targetFramework="net462" />
|
||||||
<package id="System.Collections.Immutable" version="8.0.0" targetFramework="net462" />
|
<package id="System.Collections.Immutable" version="8.0.0" targetFramework="net462" />
|
||||||
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net462" />
|
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net462" />
|
||||||
|
<package id="System.Data.Common" version="4.3.0" targetFramework="net462" />
|
||||||
<package id="System.Data.Odbc" version="6.0.1" targetFramework="net462" />
|
<package id="System.Data.Odbc" version="6.0.1" targetFramework="net462" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="7.0.0" targetFramework="net462" />
|
||||||
|
<package id="System.DirectoryServices.AccountManagement" version="7.0.1" targetFramework="net462" />
|
||||||
<package id="System.Drawing.Common" version="4.7.3" targetFramework="net462" />
|
<package id="System.Drawing.Common" version="4.7.3" targetFramework="net462" />
|
||||||
|
<package id="System.IdentityModel.Tokens.Jwt" version="7.5.1" targetFramework="net462" />
|
||||||
<package id="System.IO.Packaging" version="8.0.1" targetFramework="net462" />
|
<package id="System.IO.Packaging" version="8.0.1" targetFramework="net462" />
|
||||||
<package id="System.Management" version="8.0.0" targetFramework="net462" />
|
<package id="System.Management" version="8.0.0" targetFramework="net462" />
|
||||||
<package id="System.Memory" version="4.6.0" targetFramework="net462" />
|
<package id="System.Memory" version="4.6.0" targetFramework="net462" />
|
||||||
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net462" />
|
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net462" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net462" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Cryptography.Cng" version="5.0.0" targetFramework="net462" />
|
||||||
<package id="System.Security.Cryptography.Pkcs" version="8.0.1" targetFramework="net462" />
|
<package id="System.Security.Cryptography.Pkcs" version="8.0.1" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
|
||||||
|
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
|
||||||
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net462" />
|
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net462" />
|
||||||
<package id="System.Text.Json" version="8.0.5" targetFramework="net462" />
|
<package id="System.Text.Json" version="8.0.5" targetFramework="net462" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
|
||||||
|
|||||||
98
EnvelopeGenerator.DependencyInjection/DependencyInjection.cs
Normal file
98
EnvelopeGenerator.DependencyInjection/DependencyInjection.cs
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
using DigitalData.EmailProfilerDispatcher;
|
||||||
|
using DigitalData.UserManager.DependencyInjection;
|
||||||
|
using EnvelopeGenerator.Application;
|
||||||
|
using EnvelopeGenerator.Infrastructure;
|
||||||
|
using Microsoft.Extensions.Caching.SqlServer;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using static EnvelopeGenerator.Infrastructure.DependencyInjection;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.DependencyInjection;
|
||||||
|
|
||||||
|
public static class DependencyInjection
|
||||||
|
{
|
||||||
|
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, Action<EGConfiguration> options)
|
||||||
|
{
|
||||||
|
var egConfig = new EGConfiguration();
|
||||||
|
options.Invoke(egConfig);
|
||||||
|
egConfig.EnsureAllServicesConfigured();
|
||||||
|
egConfig.RegisterAll(services);
|
||||||
|
|
||||||
|
// Add envelope generator services
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
services.AddUserManager<EGDbContext>();
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
|
||||||
|
services.AddDispatcher<EGDbContext>();
|
||||||
|
|
||||||
|
return services;
|
||||||
|
}
|
||||||
|
|
||||||
|
public record EGConfiguration
|
||||||
|
{
|
||||||
|
internal readonly Queue<Action<IServiceCollection>> _serviceRegs = new();
|
||||||
|
|
||||||
|
internal void RegisterAll(IServiceCollection services)
|
||||||
|
{
|
||||||
|
while (_serviceRegs.Count > 0)
|
||||||
|
_serviceRegs.Dequeue().Invoke(services);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: update to use attributes and reflections instead of _addingStatus-dictionary
|
||||||
|
private readonly Dictionary<string, bool> _addingStatus = new ()
|
||||||
|
{
|
||||||
|
{ nameof(AddLocalization), false },
|
||||||
|
{ nameof(AddDistributedSqlServerCache), false },
|
||||||
|
{ nameof(AddInfrastructure), false },
|
||||||
|
{ nameof(AddServices), false },
|
||||||
|
};
|
||||||
|
|
||||||
|
public EGConfiguration AddLocalization(Action<IServiceCollection>? customLocalizationOptions = null)
|
||||||
|
{
|
||||||
|
_serviceRegs.Enqueue(customLocalizationOptions ?? (s => s.AddLocalization()));
|
||||||
|
_addingStatus[nameof(AddLocalization)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EGConfiguration AddDistributedSqlServerCache(Action<SqlServerCacheOptions> setupAction)
|
||||||
|
{
|
||||||
|
_serviceRegs.Enqueue(s => s.AddDistributedSqlServerCache(setupAction));
|
||||||
|
_addingStatus[nameof(AddDistributedSqlServerCache)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EGConfiguration AddInfrastructure(Action<EGInfrastructureConfiguration> options)
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
_serviceRegs.Enqueue(s => s.AddEGInfrastructureServices(options));
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
_addingStatus[nameof(AddInfrastructure)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EGConfiguration AddServices(IConfiguration config, bool usePdfBurner = false)
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
_serviceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(config));
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
_addingStatus[nameof(AddServices)] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void EnsureAllServicesConfigured()
|
||||||
|
{
|
||||||
|
var missingServices = _addingStatus
|
||||||
|
.Where(kv => !kv.Value)
|
||||||
|
.Select(kv => kv.Key)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (missingServices.Count > 0)
|
||||||
|
{
|
||||||
|
var missingList = string.Join(", ", missingServices);
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Service configuration incomplete. The following required service methods were not called: {missingList}. " +
|
||||||
|
"Please ensure all necessary configuration methods are invoked before building the application.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.10" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
13
EnvelopeGenerator.Domain/Constants/AnnotationType.cs
Normal file
13
EnvelopeGenerator.Domain/Constants/AnnotationType.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
namespace EnvelopeGenerator.Domain.Constants
|
||||||
|
{
|
||||||
|
public static class AnnotationType
|
||||||
|
{
|
||||||
|
public static class PSPDFKit
|
||||||
|
{
|
||||||
|
public const string Image = "pspdfkit/image";
|
||||||
|
public const string Ink = "pspdfkit/ink";
|
||||||
|
public const string Widget = "pspdfkit/widget";
|
||||||
|
public const string FormField = "pspdfkit/form-field-value";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@@ -14,7 +15,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_DOCUMENT", Schema = "dbo")]
|
||||||
public class Document
|
public class Document : IHasEnvelope
|
||||||
{
|
{
|
||||||
public Document()
|
public Document()
|
||||||
{
|
{
|
||||||
@@ -30,27 +31,50 @@ public class Document
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ENVELOPE_ID")]
|
[Column("ENVELOPE_ID")]
|
||||||
public int EnvelopeId { get; set; } = 0;
|
public int EnvelopeId { get; set; }
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
= 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
|
[Column("BYTE_DATA", TypeName = "varbinary(max)")]
|
||||||
public byte[] ByteData { get; set; }
|
public byte[]
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ByteData { get; set; }
|
||||||
|
|
||||||
public List<Signature> Elements { get; set; }
|
#region File
|
||||||
|
[Column("FILENAME", TypeName = "nvarchar(256)")]
|
||||||
|
public string Filename { get; set; }
|
||||||
|
|
||||||
// TODO: * Check the Form App and remove the default value
|
[Column("FILEPATH", TypeName = "nvarchar(256)")]
|
||||||
[NotMapped]
|
|
||||||
public string Filepath { get; set; }
|
public string Filepath { get; set; }
|
||||||
|
|
||||||
|
[Column("FILENAME_ORIGINAL", TypeName = "nvarchar(256)")]
|
||||||
|
public string
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
FileNameOriginal { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public virtual List<Signature>
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Elements { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("EnvelopeId")]
|
||||||
|
public virtual Envelope
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Envelope { get; set; }
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
[NotMapped]
|
|
||||||
public string FileNameOriginal { get; set; }
|
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool IsTempFile { get; set; }
|
public bool IsTempFile { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
public string Filename { get; set; }
|
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public Bitmap Thumbnail { get; set; }
|
public Bitmap Thumbnail { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using DigitalData.Core.Abstractions.Interfaces;
|
||||||
using EnvelopeGenerator.Domain.Interfaces;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
@@ -14,7 +15,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
[Table("TBSIG_DOCUMENT_STATUS", Schema = "dbo")]
|
||||||
public class DocumentStatus : IHasEnvelope, IHasReceiver
|
public class DocumentStatus : IHasEnvelope, IHasReceiver, IEntity
|
||||||
{
|
{
|
||||||
public DocumentStatus()
|
public DocumentStatus()
|
||||||
{
|
{
|
||||||
|
|||||||
92
EnvelopeGenerator.Domain/Entities/ElementAnnotation.cs
Normal file
92
EnvelopeGenerator.Domain/Entities/ElementAnnotation.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
|
#if NET
|
||||||
|
;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT_ANNOTATION")]
|
||||||
|
public class ElementAnnotation
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[Column("GUID", TypeName = "bigint")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("ELEMENT_ID", TypeName = "int")]
|
||||||
|
public int ElementId { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("NAME", TypeName = "nvarchar(100)")]
|
||||||
|
[StringLength(100)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("VALUE", TypeName = "nvarchar(max)")]
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("TYPE", TypeName = "nvarchar(50)")]
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
[Column("POSITION_X", TypeName = "float")]
|
||||||
|
public double
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
X { get; set; }
|
||||||
|
|
||||||
|
[Column("POSITION_Y", TypeName = "float")]
|
||||||
|
public double
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Y { get; set; }
|
||||||
|
|
||||||
|
[Column("WIDTH", TypeName = "float")]
|
||||||
|
public double
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Width { get; set; }
|
||||||
|
|
||||||
|
[Column("HEIGHT", TypeName = "float")]
|
||||||
|
public double
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Height { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
|
public DateTime AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN", TypeName = "datetime")]
|
||||||
|
public DateTime? ChangedWhen { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHO", TypeName = "nvarchar(100)")]
|
||||||
|
[StringLength(100)]
|
||||||
|
public string
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("ElementId")]
|
||||||
|
public virtual Signature
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Element { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -134,14 +133,12 @@ public class Envelope
|
|||||||
= false;
|
= false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
[Column("DOC_RESULT")]
|
[Column("DOC_RESULT")]
|
||||||
public byte[]
|
public byte[]
|
||||||
#if NET
|
#if NET
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
DocResult
|
DocResult { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
[ForeignKey("EnvelopeTypeId")]
|
[ForeignKey("EnvelopeTypeId")]
|
||||||
public virtual EnvelopeType
|
public virtual EnvelopeType
|
||||||
|
|||||||
36
EnvelopeGenerator.Domain/Entities/EnvelopeReport.cs
Normal file
36
EnvelopeGenerator.Domain/Entities/EnvelopeReport.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
|
{
|
||||||
|
[Table("VWSIG_ENVELOPE_REPORT", Schema = "dbo")]
|
||||||
|
public class EnvelopeReport
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[Column("ENVELOPE_ID")]
|
||||||
|
public int EnvelopeId { get; set; }
|
||||||
|
|
||||||
|
// --- HEAD ---
|
||||||
|
[Column("HEAD_UUID")]
|
||||||
|
public string HeadUuid { get; set; }
|
||||||
|
|
||||||
|
[Column("HEAD_TITLE")]
|
||||||
|
public string EnvelopeTitle { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Column("HEAD_MESSAGE")]
|
||||||
|
public string HeadMessage { get; set; }
|
||||||
|
|
||||||
|
// --- POSITIONS ---
|
||||||
|
[Column("POS_STATUS")]
|
||||||
|
public int ItemStatus { get; set; }
|
||||||
|
|
||||||
|
[Column("POS_WHEN")]
|
||||||
|
public DateTime? ItemDate { get; set; }
|
||||||
|
|
||||||
|
[Column("POS_WHO")]
|
||||||
|
public string ItemUserReference { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using EnvelopeGenerator.Domain.Interfaces;
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using DigitalData.Core.Abstractions.Interfaces;
|
||||||
|
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
@@ -17,7 +18,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
[Table("TBSIG_ENVELOPE_HISTORY", Schema = "dbo")]
|
||||||
public class History : IHasEnvelope, IHasReceiver
|
public class History : IHasEnvelope, IHasReceiver, IEntity
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
#elif NET
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
@@ -14,7 +17,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
||||||
public class Signature : ISignature
|
public class Signature : ISignature, IHasReceiver
|
||||||
{
|
{
|
||||||
public Signature()
|
public Signature()
|
||||||
{
|
{
|
||||||
@@ -107,15 +110,29 @@ public class Signature : ISignature
|
|||||||
public virtual Document Document { get; set; }
|
public virtual Document Document { get; set; }
|
||||||
|
|
||||||
[ForeignKey("ReceiverId")]
|
[ForeignKey("ReceiverId")]
|
||||||
public virtual Receiver Receiver { get; set; }
|
public virtual Receiver
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Receiver { get; set; }
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
public virtual IEnumerable<ElementAnnotation>
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Annotations { get; set; }
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
[JsonIgnore]
|
||||||
|
#endif
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public double Top => Math.Round(Y, 5);
|
public double Top => Math.Round(Y, 5);
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
[JsonIgnore]
|
||||||
|
#endif
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public double Left => Math.Round(X, 5);
|
public double Left => Math.Round(X, 5);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
|
|||||||
73
EnvelopeGenerator.Domain/Entities/ThirdPartyModule.cs
Normal file
73
EnvelopeGenerator.Domain/Entities/ThirdPartyModule.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
|
{
|
||||||
|
[Table("TBDD_3RD_PARTY_MODULES")]
|
||||||
|
public class ThirdPartyModule
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[Column("GUID")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("ACTIVE")]
|
||||||
|
public bool Active { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[StringLength(50)]
|
||||||
|
[Column("NAME")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[StringLength(500)]
|
||||||
|
[Column("DESCRIPTION")]
|
||||||
|
public string
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Description { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[Column("LICENSE", TypeName = "varchar(max)")]
|
||||||
|
public string License { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[StringLength(20)]
|
||||||
|
[Column("VERSION")]
|
||||||
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
[StringLength(50)]
|
||||||
|
[Column("ADDED_WHO")]
|
||||||
|
public string
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("ADDED_WHEN")]
|
||||||
|
public DateTime
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWhen { get; set; }
|
||||||
|
|
||||||
|
[StringLength(50)]
|
||||||
|
[Column("CHANGED_WHO")]
|
||||||
|
public string
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWho { get; set; }
|
||||||
|
|
||||||
|
[Column("CHANGED_WHEN")]
|
||||||
|
public DateTime
|
||||||
|
#if nullable
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWhen { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction.Attributes" Version="1.0.0" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction.Attributes" Version="1.0.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="UserManager.Domain" Version="3.2.3" />
|
<PackageReference Include="UserManager.Domain" Version="3.2.3" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="4.1.1" />
|
<PackageReference Include="DigitalData.Core.Abstractions" Version="4.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UserSecretsId>dotnet-EnvelopeGenerator.Finalizer.Win-6d5cc618-4159-4ff2-b600-8a15fbfa8099</UserSecretsId>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Quartz.AspNetCore" Version="3.15.1" />
|
||||||
|
<PackageReference Include="Quartzmon" Version="1.0.5" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Quartz" Version="3.15.1" />
|
||||||
|
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.15.1" />
|
||||||
|
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="appsettings.Database.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="appsettings.Logging.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
35
EnvelopeGenerator.Finalizer.Win/Extensions.cs
Normal file
35
EnvelopeGenerator.Finalizer.Win/Extensions.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using EnvelopeGenerator.Finalizer.Job;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer;
|
||||||
|
|
||||||
|
public static class Extensions
|
||||||
|
{
|
||||||
|
public static IServiceCollectionQuartzConfigurator ScheduleJobDefault<TJob>(this IServiceCollectionQuartzConfigurator q,
|
||||||
|
string croneEpression)
|
||||||
|
where TJob : IJob
|
||||||
|
{
|
||||||
|
var name = $"{typeof(TJob).FullName}";
|
||||||
|
var jobKey = new JobKey(name);
|
||||||
|
|
||||||
|
return q.ScheduleJob<TJob>(trigger => trigger
|
||||||
|
.WithIdentity(name + "-trigger")
|
||||||
|
.WithCronSchedule(croneEpression),
|
||||||
|
job => job.WithIdentity(jobKey)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IServiceCollectionQuartzConfigurator ScheduleJobDefault<TJob>(this IServiceCollectionQuartzConfigurator q,
|
||||||
|
IConfiguration configuration)
|
||||||
|
where TJob : IJob
|
||||||
|
{
|
||||||
|
var expression = configuration[$"{typeof(TJob).Name}:CronExpression"];
|
||||||
|
if (string.IsNullOrWhiteSpace(expression))
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
"Cron expression for the Worker job is not configured. " +
|
||||||
|
"Please provide a valid cron schedule in the configuration under " +
|
||||||
|
$"'{typeof(TJob).FullName}:CronExpression'.");
|
||||||
|
|
||||||
|
return q.ScheduleJobDefault<TJob>(expression);
|
||||||
|
}
|
||||||
|
}
|
||||||
28
EnvelopeGenerator.Finalizer.Win/Job/CreateReportJob.cs
Normal file
28
EnvelopeGenerator.Finalizer.Win/Job/CreateReportJob.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer.Job
|
||||||
|
{
|
||||||
|
public class CreateReportJob : IJob
|
||||||
|
{
|
||||||
|
private readonly ILogger<CreateReportJob> _logger;
|
||||||
|
|
||||||
|
private readonly IMediator _mediator;
|
||||||
|
|
||||||
|
private readonly PDFBurnerParams _options;
|
||||||
|
|
||||||
|
public CreateReportJob(ILogger<CreateReportJob> logger, IMediator mediator, IOptions<PDFBurnerParams> options)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_mediator = mediator;
|
||||||
|
_options = options.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task Execute(IJobExecutionContext context)
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
128
EnvelopeGenerator.Finalizer.Win/Program.cs
Normal file
128
EnvelopeGenerator.Finalizer.Win/Program.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
using EnvelopeGenerator.DependencyInjection;
|
||||||
|
using EnvelopeGenerator.Finalizer;
|
||||||
|
using EnvelopeGenerator.Finalizer.Job;
|
||||||
|
using EnvelopeGenerator.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Quartz;
|
||||||
|
using Quartz.AspNetCore;
|
||||||
|
using Quartzmon;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
|
// Load Serilog from appsettings.json
|
||||||
|
Log.Logger = new LoggerConfiguration()
|
||||||
|
.ReadFrom.Configuration(new ConfigurationBuilder()
|
||||||
|
.AddJsonFile("appsettings.Logging.json", optional: false, reloadOnChange: true)
|
||||||
|
.Build())
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.Information("Application is starting...");
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
#region Logging
|
||||||
|
builder.Logging.ClearProviders();
|
||||||
|
builder.Logging.AddSerilog();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Configuration
|
||||||
|
var config = builder.Configuration;
|
||||||
|
Directory
|
||||||
|
.GetFiles(builder.Environment.ContentRootPath, "appsettings.*.json", SearchOption.TopDirectoryOnly)
|
||||||
|
.Where(file => Path.GetFileName(file) != $"appsettings.Development.json")
|
||||||
|
.Where(file => Path.GetFileName(file) != $"appsettings.migration.json")
|
||||||
|
.ToList()
|
||||||
|
.ForEach(file => config.AddJsonFile(file, true, true));
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Web API Services
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Quartz
|
||||||
|
builder.Services.AddQuartz(q =>
|
||||||
|
{
|
||||||
|
q.ScheduleJobDefault<CreateReportJob>(config);
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.AddQuartzServer(options =>
|
||||||
|
{
|
||||||
|
options.WaitForJobsToComplete = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.AddQuartzmon();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton(provider =>
|
||||||
|
provider.GetRequiredService<ISchedulerFactory>().GetScheduler().Result
|
||||||
|
);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Add DB Context, EG Inf. and Services
|
||||||
|
var cnnStrName = "Default";
|
||||||
|
var connStr = config.GetConnectionString(cnnStrName)
|
||||||
|
?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration.");
|
||||||
|
|
||||||
|
builder.Services.AddEnvelopeGenerator(egOptions => egOptions
|
||||||
|
.AddLocalization()
|
||||||
|
.AddDistributedSqlServerCache(options =>
|
||||||
|
{
|
||||||
|
options.ConnectionString = connStr;
|
||||||
|
options.SchemaName = "dbo";
|
||||||
|
options.TableName = "TBDD_CACHE";
|
||||||
|
})
|
||||||
|
.AddInfrastructure(opt =>
|
||||||
|
{
|
||||||
|
opt.AddDbTriggerParams(config);
|
||||||
|
opt.AddDbContext((provider, options) =>
|
||||||
|
{
|
||||||
|
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
|
||||||
|
var useInMemoryDb = config.GetValue<bool>("UseInMemoryDb");
|
||||||
|
var dbCtxOpt = useInMemoryDb ? options.UseInMemoryDatabase("EGInMemoryDb") : options.UseSqlServer(connStr);
|
||||||
|
dbCtxOpt.LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace)
|
||||||
|
.EnableSensitiveDataLogging()
|
||||||
|
.EnableDetailedErrors();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.AddServices(config, true)
|
||||||
|
);
|
||||||
|
#endregion Add DB Context, EG Inf. and Services
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
#region Web API Middleware
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.UseQuartzmon(new QuartzmonOptions()
|
||||||
|
{
|
||||||
|
Scheduler = app.Services.GetRequiredService<IScheduler>(),
|
||||||
|
VirtualPathRoot = "/quartz"
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapControllers();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
||||||
|
Log.Information("The worker was stopped.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Fatal(ex, "Worker could not be started!");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:17119",
|
||||||
|
"sslPort": 44321
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": false,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"applicationUrl": "http://localhost:5010",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "quartz",
|
||||||
|
"applicationUrl": "https://localhost:7141;http://localhost:5010",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": false,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
EnvelopeGenerator.Finalizer.Win/appsettings.Database.json
Normal file
22
EnvelopeGenerator.Finalizer.Win/appsettings.Database.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UseDbMigration": false,
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
|
||||||
|
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
||||||
|
},
|
||||||
|
"DbTriggerParams": {
|
||||||
|
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
|
||||||
|
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
|
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
||||||
|
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
||||||
|
"Receiver": [],
|
||||||
|
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
|
||||||
|
},
|
||||||
|
"UseInMemoryDb": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Debug": true
|
||||||
|
}
|
||||||
8
EnvelopeGenerator.Finalizer.Win/appsettings.Job.json
Normal file
8
EnvelopeGenerator.Finalizer.Win/appsettings.Job.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"FinishEnvelopeJob": {
|
||||||
|
"CronExpression": "* * * * * ?"
|
||||||
|
},
|
||||||
|
"EnvelopeTaskApiJob": {
|
||||||
|
"CronExpression": "* * * * * ?"
|
||||||
|
}
|
||||||
|
}
|
||||||
81
EnvelopeGenerator.Finalizer.Win/appsettings.Logging.json
Normal file
81
EnvelopeGenerator.Finalizer.Win/appsettings.Logging.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"Serilog": {
|
||||||
|
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Verbose",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WriteTo": [
|
||||||
|
{
|
||||||
|
"Name": "Console",
|
||||||
|
"Args": {
|
||||||
|
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Verbose",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Debug",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Information",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Warning",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Error",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Fatal",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
14
EnvelopeGenerator.Finalizer.Win/appsettings.PdfBurner.json
Normal file
14
EnvelopeGenerator.Finalizer.Win/appsettings.PdfBurner.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"IgnoredLabels": {
|
||||||
|
"Label": [
|
||||||
|
"Date",
|
||||||
|
"Datum",
|
||||||
|
"ZIP",
|
||||||
|
"PLZ",
|
||||||
|
"Place",
|
||||||
|
"Ort",
|
||||||
|
"Position",
|
||||||
|
"Stellung"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
3
EnvelopeGenerator.Finalizer.Win/appsettings.json
Normal file
3
EnvelopeGenerator.Finalizer.Win/appsettings.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"GdPictureLicenseKey": "kG1Qf9PwmqgR8aDmIW2zI_ebj48RzqAJegRxcystEmkbTGQqfkNBdFOXIb6C_A00Ra8zZkrHdfjqzOPXK7kgkF2YDhvrqKfqh4WDug2vOt0qO31IommzkANSuLjZ4zmraoubyEVd25rE3veQ2h_j7tGIoH_LyIHmy24GaXsxdG0yCzIBMdiLbMMMDwcPY-809KeZ83Grv76OVhFvcbBWyYc251vou1N-kGg5_ZlHDgfWoY85gTLRxafjD3KS_i9ARW4BMiy36y8n7UP2jN8kGRnW_04ubpFtfjJqvtsrP_J9D0x7bqV8xtVtT5JI6dpKsVTiMgDCrIcoFSo5gCC1fw9oUopX4TDCkBQttO4-WHBlOeq9dG5Yb0otonVmJKaQA2tP6sMR-lZDs3ql_WI9t91yPWgpssrJUxSHDd27_LMTH_owJIqkF3NOJd9mYQuAv22oNKFYbH8e41pVKb8cT33Y9CgcQ_sy6YDA5PTuIRi67mjKge_nD9rd0IN213Ir9M_EFWqg9e4haWzIdHXQUo0md70kVhPX4UIH_BKJnxEEnFfoFRNMh77bB0N4jkcBEHPl-ghOERv8dOztf4vCnNpzzWvcLD2cqWIm6THy8XGGq9h4hp8aEreRleSMwv9QQAC7mjLwhQ1rBYkpUHlpTjhTLnMwHknl6HH0Z6zzmsgkRKVyfquv94Pd7QbQfZrRka0ss_48pf9p8hAywEn81Q=="
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UserSecretsId>dotnet-EnvelopeGenerator.Finalizer-6d5cc618-4159-4ff2-b600-8a15fbfa8099</UserSecretsId>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Quartz.AspNetCore" Version="3.15.1" />
|
||||||
|
<PackageReference Include="Quartzmon" Version="1.0.5" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
|
||||||
|
<PackageReference Include="Quartz" Version="3.15.1" />
|
||||||
|
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.15.1" />
|
||||||
|
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj" />
|
||||||
|
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="appsettings.Database.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="appsettings.Logging.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
35
EnvelopeGenerator.Finalizer/Extensions.cs
Normal file
35
EnvelopeGenerator.Finalizer/Extensions.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using EnvelopeGenerator.Finalizer.Job;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer;
|
||||||
|
|
||||||
|
public static class Extensions
|
||||||
|
{
|
||||||
|
public static IServiceCollectionQuartzConfigurator ScheduleJobDefault<TJob>(this IServiceCollectionQuartzConfigurator q,
|
||||||
|
string croneEpression)
|
||||||
|
where TJob : IJob
|
||||||
|
{
|
||||||
|
var name = $"{typeof(TJob).FullName}";
|
||||||
|
var jobKey = new JobKey(name);
|
||||||
|
|
||||||
|
return q.ScheduleJob<TJob>(trigger => trigger
|
||||||
|
.WithIdentity(name + "-trigger")
|
||||||
|
.WithCronSchedule(croneEpression),
|
||||||
|
job => job.WithIdentity(jobKey)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IServiceCollectionQuartzConfigurator ScheduleJobDefault<TJob>(this IServiceCollectionQuartzConfigurator q,
|
||||||
|
IConfiguration configuration)
|
||||||
|
where TJob : IJob
|
||||||
|
{
|
||||||
|
var expression = configuration[$"{typeof(TJob).Name}:CronExpression"];
|
||||||
|
if (string.IsNullOrWhiteSpace(expression))
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
"Cron expression for the Worker job is not configured. " +
|
||||||
|
"Please provide a valid cron schedule in the configuration under " +
|
||||||
|
$"'{typeof(TJob).FullName}:CronExpression'.");
|
||||||
|
|
||||||
|
return q.ScheduleJobDefault<TJob>(expression);
|
||||||
|
}
|
||||||
|
}
|
||||||
24
EnvelopeGenerator.Finalizer/Job/EnvelopeTaskApiJob.cs
Normal file
24
EnvelopeGenerator.Finalizer/Job/EnvelopeTaskApiJob.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer.Job
|
||||||
|
{
|
||||||
|
public class EnvelopeTaskApiJob : IJob
|
||||||
|
{
|
||||||
|
private readonly ILogger<EnvelopeTaskApiJob> _logger;
|
||||||
|
|
||||||
|
public EnvelopeTaskApiJob(ILogger<EnvelopeTaskApiJob> logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task Execute(IJobExecutionContext context)
|
||||||
|
{
|
||||||
|
if (_logger.IsEnabled(LogLevel.Information))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("{jobName} running at: {time}", context.JobDetail.Key, DateTimeOffset.Now);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
72
EnvelopeGenerator.Finalizer/Job/FinishEnvelopeJob.cs
Normal file
72
EnvelopeGenerator.Finalizer/Job/FinishEnvelopeJob.cs
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
|
using EnvelopeGenerator.Application.Pdf;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer.Job
|
||||||
|
{
|
||||||
|
public class FinishEnvelopeJob : IJob
|
||||||
|
{
|
||||||
|
private readonly ILogger<FinishEnvelopeJob> _logger;
|
||||||
|
|
||||||
|
private readonly IMediator _mediator;
|
||||||
|
|
||||||
|
private readonly PDFBurnerParams _options;
|
||||||
|
|
||||||
|
public FinishEnvelopeJob(ILogger<FinishEnvelopeJob> logger, IMediator mediator, IOptions<PDFBurnerParams> options)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_mediator = mediator;
|
||||||
|
_options = options.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Execute(IJobExecutionContext context)
|
||||||
|
{
|
||||||
|
var cancel = context.CancellationToken;
|
||||||
|
|
||||||
|
var envelopes = await _mediator.Send(new ReadEnvelopeQuery()
|
||||||
|
{
|
||||||
|
Status = new() { Include = [ EnvelopeStatus.EnvelopeCompletelySigned ] },
|
||||||
|
HasDocResult = false
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
using var semaphore = new SemaphoreSlim(_options.ConcurrencyLimit);
|
||||||
|
await Task.WhenAll(envelopes.Select(async envelope =>
|
||||||
|
{
|
||||||
|
await semaphore.WaitAsync(cancel);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _mediator.BurnPdf(envelope.Id, cancel);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Error burning envelope {EnvelopeId}", envelope.Id);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
semaphore.Release();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
var envelopeCount = envelopes.Count();
|
||||||
|
if (envelopeCount > 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"Job '{JobName}' executed at {Timestamp}. {EnvelopeCount} envelope(s) successfully finalized. UUID(s): {EnvelopeUuids}",
|
||||||
|
context.JobDetail.Key.Name,
|
||||||
|
context.FireTimeUtc.ToLocalTime(),
|
||||||
|
envelopeCount,
|
||||||
|
string.Join(", ", envelopes.Select(e => e.Uuid))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_logger.LogInformation("Job '{JobName}' executed successfully at {Timestamp}. No envelopes were finalized.",
|
||||||
|
context.JobDetail.Key.Name,
|
||||||
|
context.FireTimeUtc.ToLocalTime()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
129
EnvelopeGenerator.Finalizer/Program.cs
Normal file
129
EnvelopeGenerator.Finalizer/Program.cs
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
using EnvelopeGenerator.DependencyInjection;
|
||||||
|
using EnvelopeGenerator.Finalizer;
|
||||||
|
using EnvelopeGenerator.Finalizer.Job;
|
||||||
|
using EnvelopeGenerator.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Quartz;
|
||||||
|
using Quartz.AspNetCore;
|
||||||
|
using Quartzmon;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
|
// Load Serilog from appsettings.json
|
||||||
|
Log.Logger = new LoggerConfiguration()
|
||||||
|
.ReadFrom.Configuration(new ConfigurationBuilder()
|
||||||
|
.AddJsonFile("appsettings.Logging.json", optional: false, reloadOnChange: true)
|
||||||
|
.Build())
|
||||||
|
.CreateLogger();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.Information("Application is starting...");
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
#region Logging
|
||||||
|
builder.Logging.ClearProviders();
|
||||||
|
builder.Logging.AddSerilog();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Configuration
|
||||||
|
var config = builder.Configuration;
|
||||||
|
Directory
|
||||||
|
.GetFiles(builder.Environment.ContentRootPath, "appsettings.*.json", SearchOption.TopDirectoryOnly)
|
||||||
|
.Where(file => Path.GetFileName(file) != $"appsettings.Development.json")
|
||||||
|
.Where(file => Path.GetFileName(file) != $"appsettings.migration.json")
|
||||||
|
.ToList()
|
||||||
|
.ForEach(file => config.AddJsonFile(file, true, true));
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Web API Services
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Quartz
|
||||||
|
builder.Services.AddQuartz(q =>
|
||||||
|
{
|
||||||
|
q.ScheduleJobDefault<FinishEnvelopeJob>(config);
|
||||||
|
q.ScheduleJobDefault<EnvelopeTaskApiJob>(config);
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.AddQuartzServer(options =>
|
||||||
|
{
|
||||||
|
options.WaitForJobsToComplete = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.AddQuartzmon();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton(provider =>
|
||||||
|
provider.GetRequiredService<ISchedulerFactory>().GetScheduler().Result
|
||||||
|
);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Add DB Context, EG Inf. and Services
|
||||||
|
var cnnStrName = "Default";
|
||||||
|
var connStr = config.GetConnectionString(cnnStrName)
|
||||||
|
?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration.");
|
||||||
|
|
||||||
|
builder.Services.AddEnvelopeGenerator(egOptions => egOptions
|
||||||
|
.AddLocalization()
|
||||||
|
.AddDistributedSqlServerCache(options =>
|
||||||
|
{
|
||||||
|
options.ConnectionString = connStr;
|
||||||
|
options.SchemaName = "dbo";
|
||||||
|
options.TableName = "TBDD_CACHE";
|
||||||
|
})
|
||||||
|
.AddInfrastructure(opt =>
|
||||||
|
{
|
||||||
|
opt.AddDbTriggerParams(config);
|
||||||
|
opt.AddDbContext((provider, options) =>
|
||||||
|
{
|
||||||
|
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
|
||||||
|
var useInMemoryDb = config.GetValue<bool>("UseInMemoryDb");
|
||||||
|
var dbCtxOpt = useInMemoryDb ? options.UseInMemoryDatabase("EGInMemoryDb") : options.UseSqlServer(connStr);
|
||||||
|
dbCtxOpt.LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace)
|
||||||
|
.EnableSensitiveDataLogging()
|
||||||
|
.EnableDetailedErrors();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.AddServices(config, true)
|
||||||
|
);
|
||||||
|
#endregion Add DB Context, EG Inf. and Services
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
#region Web API Middleware
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.UseQuartzmon(new QuartzmonOptions()
|
||||||
|
{
|
||||||
|
Scheduler = app.Services.GetRequiredService<IScheduler>(),
|
||||||
|
VirtualPathRoot = "/quartz"
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapControllers();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
||||||
|
Log.Information("The worker was stopped.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Fatal(ex, "Worker could not be started!");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
41
EnvelopeGenerator.Finalizer/Properties/launchSettings.json
Normal file
41
EnvelopeGenerator.Finalizer/Properties/launchSettings.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:17119",
|
||||||
|
"sslPort": 44321
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": false,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"applicationUrl": "http://localhost:5010",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "quartz",
|
||||||
|
"applicationUrl": "https://localhost:7141;http://localhost:5010",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": false,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
EnvelopeGenerator.Finalizer/appsettings.Database.json
Normal file
22
EnvelopeGenerator.Finalizer/appsettings.Database.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UseDbMigration": false,
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
|
||||||
|
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
||||||
|
},
|
||||||
|
"DbTriggerParams": {
|
||||||
|
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
|
||||||
|
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
|
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
||||||
|
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
||||||
|
"Receiver": [],
|
||||||
|
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
|
||||||
|
},
|
||||||
|
"UseInMemoryDb": false
|
||||||
|
}
|
||||||
9
EnvelopeGenerator.Finalizer/appsettings.Development.json
Normal file
9
EnvelopeGenerator.Finalizer/appsettings.Development.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Error",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Debug": true
|
||||||
|
}
|
||||||
11
EnvelopeGenerator.Finalizer/appsettings.Job.json
Normal file
11
EnvelopeGenerator.Finalizer/appsettings.Job.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"FinishEnvelopeJob": {
|
||||||
|
"CronExpression": "0 0/1 * 1/1 * ? *"
|
||||||
|
},
|
||||||
|
"EnvelopeTaskApiJob": {
|
||||||
|
"CronExpression": "0 0/1 * 1/1 * ? *"
|
||||||
|
}
|
||||||
|
"Expressions": {
|
||||||
|
"PerSec": "* * * * * ?"
|
||||||
|
}
|
||||||
|
}
|
||||||
81
EnvelopeGenerator.Finalizer/appsettings.Logging.json
Normal file
81
EnvelopeGenerator.Finalizer/appsettings.Logging.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"Serilog": {
|
||||||
|
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
||||||
|
"MinimumLevel": {
|
||||||
|
"Default": "Verbose",
|
||||||
|
"Override": {
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"System": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WriteTo": [
|
||||||
|
{
|
||||||
|
"Name": "Console",
|
||||||
|
"Args": {
|
||||||
|
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Verbose",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Debug",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Information",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Warning",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Error",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "File",
|
||||||
|
"Args": {
|
||||||
|
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
|
||||||
|
"rollingInterval": "Day",
|
||||||
|
"restrictedToMinimumLevel": "Fatal",
|
||||||
|
"retainedFileCountLimit": 30,
|
||||||
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
14
EnvelopeGenerator.Finalizer/appsettings.PdfBurner.json
Normal file
14
EnvelopeGenerator.Finalizer/appsettings.PdfBurner.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"IgnoredLabels": {
|
||||||
|
"Label": [
|
||||||
|
"Date",
|
||||||
|
"Datum",
|
||||||
|
"ZIP",
|
||||||
|
"PLZ",
|
||||||
|
"Place",
|
||||||
|
"Ort",
|
||||||
|
"Position",
|
||||||
|
"Stellung"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
3
EnvelopeGenerator.Finalizer/appsettings.json
Normal file
3
EnvelopeGenerator.Finalizer/appsettings.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"GdPictureLicenseKey": "kG1Qf9PwmqgR8aDmIW2zI_ebj48RzqAJegRxcystEmkbTGQqfkNBdFOXIb6C_A00Ra8zZkrHdfjqzOPXK7kgkF2YDhvrqKfqh4WDug2vOt0qO31IommzkANSuLjZ4zmraoubyEVd25rE3veQ2h_j7tGIoH_LyIHmy24GaXsxdG0yCzIBMdiLbMMMDwcPY-809KeZ83Grv76OVhFvcbBWyYc251vou1N-kGg5_ZlHDgfWoY85gTLRxafjD3KS_i9ARW4BMiy36y8n7UP2jN8kGRnW_04ubpFtfjJqvtsrP_J9D0x7bqV8xtVtT5JI6dpKsVTiMgDCrIcoFSo5gCC1fw9oUopX4TDCkBQttO4-WHBlOeq9dG5Yb0otonVmJKaQA2tP6sMR-lZDs3ql_WI9t91yPWgpssrJUxSHDd27_LMTH_owJIqkF3NOJd9mYQuAv22oNKFYbH8e41pVKb8cT33Y9CgcQ_sy6YDA5PTuIRi67mjKge_nD9rd0IN213Ir9M_EFWqg9e4haWzIdHXQUo0md70kVhPX4UIH_BKJnxEEnFfoFRNMh77bB0N4jkcBEHPl-ghOERv8dOztf4vCnNpzzWvcLD2cqWIm6THy8XGGq9h4hp8aEreRleSMwv9QQAC7mjLwhQ1rBYkpUHlpTjhTLnMwHknl6HH0Z6zzmsgkRKVyfquv94Pd7QbQfZrRka0ss_48pf9p8hAywEn81Q=="
|
||||||
|
}
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
@@ -121,20 +121,92 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Security.Cryptography.Pkcs" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Security.Cryptography.Pkcs" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.IO.Packaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.IO.Packaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.5" newVersion="8.0.0.5" />
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.22.0.0" newVersion="6.22.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2.1.1.0" newVersion="2.1.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Caching.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-3.0.8.0" newVersion="3.0.8.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.5.1.0" newVersion="7.5.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ try
|
|||||||
});
|
});
|
||||||
builder.Services.AddOpenApi();
|
builder.Services.AddOpenApi();
|
||||||
|
|
||||||
|
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
|
||||||
//AddEF Core dbcontext
|
//AddEF Core dbcontext
|
||||||
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
|
||||||
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";
|
||||||
@@ -185,7 +186,19 @@ try
|
|||||||
// Envelope generator serives
|
// Envelope generator serives
|
||||||
#pragma warning disable CS0618 // Type or member is obsolete
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
builder.Services
|
builder.Services
|
||||||
.AddEnvelopeGeneratorInfrastructureServices(sqlExecutorConfigureOptions: executor => executor.ConnectionString = connStr)
|
.AddEGInfrastructureServices(opt =>
|
||||||
|
{
|
||||||
|
opt.AddDbTriggerParams(config);
|
||||||
|
opt.AddDbContext((provider, options) =>
|
||||||
|
{
|
||||||
|
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
|
||||||
|
options.UseSqlServer(connStr)
|
||||||
|
.LogTo(log => logger.LogInformation("{log}", log), Microsoft.Extensions.Logging.LogLevel.Trace)
|
||||||
|
.EnableSensitiveDataLogging()
|
||||||
|
.EnableDetailedErrors();
|
||||||
|
});
|
||||||
|
opt.AddSQLExecutor(executor => executor.ConnectionString = connStr);
|
||||||
|
})
|
||||||
.AddEnvelopeGeneratorServices(config);
|
.AddEnvelopeGeneratorServices(config);
|
||||||
#pragma warning restore CS0618 // Type or member is obsolete
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
|
||||||
|
|||||||
18
EnvelopeGenerator.Infrastructure/DbTriggerParams.cs
Normal file
18
EnvelopeGenerator.Infrastructure/DbTriggerParams.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#if NETFRAMEWORK
|
||||||
|
using System.Collections.Generic;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Infrastructure
|
||||||
|
#if NET
|
||||||
|
;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public class DbTriggerParams : Dictionary<string, ICollection<string>>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
using EnvelopeGenerator.Infrastructure.Repositories;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using DigitalData.Core.Infrastructure;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using EnvelopeGenerator.Infrastructure.Executor;
|
|
||||||
using Dapper;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using System.Reflection;
|
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
|
||||||
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
|
||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Infrastructure;
|
|
||||||
|
|
||||||
public static class DIExtensions
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Registers the required repositories for the Envelope Generator service to the given <see cref="IServiceCollection"/>.
|
|
||||||
/// This method adds the repositories for various envelope-related entities, such as configuration, document receivers, envelopes, and users,
|
|
||||||
/// as scoped services to the dependency injection container. Optionally, it can also configure the <see cref="EGDbContext"/>
|
|
||||||
/// with the provided database context options if specified.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="services">The <see cref="IServiceCollection"/> to which the services are added.</param>
|
|
||||||
/// <param name="dbContextOptions">An optional action to configure the <see cref="DbContextOptionsBuilder"/> for the <see cref="EGDbContext"/>.
|
|
||||||
/// If not provided, the <see cref="EGDbContext"/> will not be configured.</param>
|
|
||||||
/// <returns>The updated <see cref="IServiceCollection"/> with the added repository services.</returns>
|
|
||||||
/// <remarks>
|
|
||||||
/// This method ensures that the repositories are registered as scoped services, meaning that a new instance of each repository
|
|
||||||
/// will be created per HTTP request (or per scope) within the dependency injection container.
|
|
||||||
/// </remarks>
|
|
||||||
[Obsolete("Use IRepository")]
|
|
||||||
public static IServiceCollection AddEnvelopeGeneratorInfrastructureServices(this IServiceCollection services,
|
|
||||||
Action<IServiceProvider, DbContextOptionsBuilder>? dbContextOptions = null,
|
|
||||||
IConfiguration? sqlExecutorConfiguration = null,
|
|
||||||
Action<SQLExecutorParams>? sqlExecutorConfigureOptions = null)
|
|
||||||
{
|
|
||||||
if(dbContextOptions is not null)
|
|
||||||
services.AddDbContext<EGDbContext>(dbContextOptions);
|
|
||||||
|
|
||||||
services.TryAddScoped<IConfigRepository, ConfigRepository>();
|
|
||||||
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
|
||||||
services.TryAddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
|
|
||||||
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
|
||||||
services.TryAddScoped<IDocumentStatusRepository, DocumentStatusRepository>();
|
|
||||||
services.TryAddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
|
|
||||||
services.TryAddScoped<IEnvelopeRepository, EnvelopeRepository>();
|
|
||||||
services.TryAddScoped<IEnvelopeHistoryRepository, EnvelopeHistoryRepository>();
|
|
||||||
services.TryAddScoped<IEnvelopeReceiverRepository, EnvelopeReceiverRepository>();
|
|
||||||
services.TryAddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
|
|
||||||
services.TryAddScoped<IReceiverRepository, ReceiverRepository>();
|
|
||||||
services.TryAddScoped<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyRepository>();
|
|
||||||
|
|
||||||
services.AddDbRepository(opt =>
|
|
||||||
{
|
|
||||||
// scan EnvelopeGenerator
|
|
||||||
opt.RegisterFromAssembly<EGDbContext>(typeof(Config).Assembly);
|
|
||||||
|
|
||||||
// scan UserManager
|
|
||||||
opt.RegisterFromAssembly<EGDbContext>(typeof(User).Assembly);
|
|
||||||
|
|
||||||
// scan EmailProfilerDispatcher
|
|
||||||
opt.RegisterFromAssembly<EGDbContext>(typeof(EmailOut).Assembly);
|
|
||||||
});
|
|
||||||
|
|
||||||
services.AddSQLExecutor<Envelope>();
|
|
||||||
services.AddSQLExecutor<Receiver>();
|
|
||||||
services.AddSQLExecutor<Document>();
|
|
||||||
services.AddSQLExecutor<Signature>();
|
|
||||||
services.AddSQLExecutor<DocumentStatus>();
|
|
||||||
|
|
||||||
SetDapperTypeMap<Envelope>();
|
|
||||||
SetDapperTypeMap<User>();
|
|
||||||
SetDapperTypeMap<Receiver>();
|
|
||||||
SetDapperTypeMap<Document>();
|
|
||||||
SetDapperTypeMap<Signature>();
|
|
||||||
SetDapperTypeMap<DocumentStatus>();
|
|
||||||
|
|
||||||
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();
|
|
||||||
services.AddScoped<IEnvelopeReceiverExecutor, EnvelopeReceiverExecutor>();
|
|
||||||
services.AddScoped<IDocumentExecutor, DocumentExecutor>();
|
|
||||||
|
|
||||||
if (sqlExecutorConfiguration is not null || sqlExecutorConfigureOptions is not null)
|
|
||||||
services.AddSQLExecutor(sqlExecutorConfiguration, sqlExecutorConfigureOptions);
|
|
||||||
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IServiceCollection AddSQLExecutor(this IServiceCollection services, IConfiguration? configuration = null, Action<SQLExecutorParams>? configureOptions = null)
|
|
||||||
{
|
|
||||||
if(configuration is not null && configureOptions is not null)
|
|
||||||
throw new InvalidOperationException("Cannot use both 'configuration' and 'configureOptions'. Only one should be provided.");
|
|
||||||
|
|
||||||
if (configuration is not null)
|
|
||||||
services.Configure<SQLExecutorParams>(configuration);
|
|
||||||
|
|
||||||
if(configureOptions is not null)
|
|
||||||
services.Configure(configureOptions);
|
|
||||||
|
|
||||||
return services.AddSingleton<ISQLExecutor, SQLExecutor>();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetDapperTypeMap<TModel>()
|
|
||||||
{
|
|
||||||
Dapper.SqlMapper.SetTypeMap(typeof(TModel), new CustomPropertyTypeMap(
|
|
||||||
typeof(TModel),
|
|
||||||
(type, columnName) =>
|
|
||||||
{
|
|
||||||
return type.GetProperties().FirstOrDefault(prop =>
|
|
||||||
{
|
|
||||||
var attr = prop.GetCustomAttribute<ColumnAttribute>();
|
|
||||||
return attr != null && string.Equals(attr.Name, columnName, StringComparison.OrdinalIgnoreCase)
|
|
||||||
|| string.Equals(prop.Name, columnName, StringComparison.OrdinalIgnoreCase);
|
|
||||||
})!;
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IServiceCollection AddSQLExecutor<T>(this IServiceCollection services, IConfiguration? configuration = null, Action<SQLExecutorParams>? configureOptions = null) where T : class
|
|
||||||
{
|
|
||||||
if (configuration is not null && configureOptions is not null)
|
|
||||||
throw new InvalidOperationException("Cannot use both 'configuration' and 'configureOptions'. Only one should be provided.");
|
|
||||||
|
|
||||||
if (configuration is not null)
|
|
||||||
services.Configure<SQLExecutorParams>(configuration);
|
|
||||||
|
|
||||||
services.AddScoped<ISQLExecutor<T>, SQLExecutor<T>>();
|
|
||||||
|
|
||||||
var interfaceType = typeof(ISQL<>);
|
|
||||||
var targetGenericType = interfaceType.MakeGenericType(typeof(T));
|
|
||||||
|
|
||||||
var implementations = AppDomain.CurrentDomain.GetAssemblies()
|
|
||||||
.SelectMany(a =>
|
|
||||||
{
|
|
||||||
try { return a.GetTypes(); }
|
|
||||||
catch { return Array.Empty<Type>(); }
|
|
||||||
})
|
|
||||||
.Where(t =>
|
|
||||||
t is { IsClass: true, IsAbstract: false } &&
|
|
||||||
t.GetInterfaces().Any(i =>
|
|
||||||
i.IsGenericType &&
|
|
||||||
i.GetGenericTypeDefinition() == interfaceType &&
|
|
||||||
i.GenericTypeArguments[0] == typeof(T)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach (var impl in implementations)
|
|
||||||
{
|
|
||||||
services.AddSingleton(impl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
213
EnvelopeGenerator.Infrastructure/DependencyInjection.cs
Normal file
213
EnvelopeGenerator.Infrastructure/DependencyInjection.cs
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using DigitalData.Core.Infrastructure;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Dapper;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Reflection;
|
||||||
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
#if NET
|
||||||
|
using CommandDotNet.Execution;
|
||||||
|
using EnvelopeGenerator.Infrastructure.Repositories;
|
||||||
|
using EnvelopeGenerator.Infrastructure.Executor;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
|
||||||
|
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
|
||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Infrastructure
|
||||||
|
{
|
||||||
|
public static class DependencyInjection
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Registers the required repositories for the Envelope Generator service to the given <see cref="IServiceCollection"/>.
|
||||||
|
/// This method adds the repositories for various envelope-related entities, such as configuration, document receivers, envelopes, and users,
|
||||||
|
/// as scoped services to the dependency injection container. Optionally, it can also configure the <see cref="EGDbContext"/>
|
||||||
|
/// with the provided database context options if specified.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="services">The <see cref="IServiceCollection"/> to which the services are added.</param>
|
||||||
|
/// <param name="dbContextOptions">An optional action to configure the <see cref="DbContextOptionsBuilder"/> for the <see cref="EGDbContext"/>.
|
||||||
|
/// If not provided, the <see cref="EGDbContext"/> will not be configured.</param>
|
||||||
|
/// <returns>The updated <see cref="IServiceCollection"/> with the added repository services.</returns>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method ensures that the repositories are registered as scoped services, meaning that a new instance of each repository
|
||||||
|
/// will be created per HTTP request (or per scope) within the dependency injection container.
|
||||||
|
/// </remarks>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
|
public static IServiceCollection AddEGInfrastructureServices(this IServiceCollection services, Action<EGInfrastructureConfiguration> options)
|
||||||
|
{
|
||||||
|
// configure custom options
|
||||||
|
options(new EGInfrastructureConfiguration(services));
|
||||||
|
#if NET
|
||||||
|
services.TryAddScoped<IConfigRepository, ConfigRepository>();
|
||||||
|
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
||||||
|
services.TryAddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
|
||||||
|
services.TryAddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
||||||
|
services.TryAddScoped<IDocumentStatusRepository, DocumentStatusRepository>();
|
||||||
|
services.TryAddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
|
||||||
|
services.TryAddScoped<IEnvelopeRepository, EnvelopeRepository>();
|
||||||
|
services.TryAddScoped<IEnvelopeHistoryRepository, EnvelopeHistoryRepository>();
|
||||||
|
services.TryAddScoped<IEnvelopeReceiverRepository, EnvelopeReceiverRepository>();
|
||||||
|
services.TryAddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
|
||||||
|
services.TryAddScoped<IReceiverRepository, ReceiverRepository>();
|
||||||
|
services.TryAddScoped<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyRepository>();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
services.AddDbRepository(opt =>
|
||||||
|
{
|
||||||
|
// scan EnvelopeGenerator
|
||||||
|
opt.RegisterFromAssembly<EGDbContext>(typeof(EnvelopeReceiver).Assembly);
|
||||||
|
|
||||||
|
// scan UserManager
|
||||||
|
opt.RegisterFromAssembly<EGDbContext>(typeof(User).Assembly);
|
||||||
|
#if NET
|
||||||
|
// scan EmailProfilerDispatcher
|
||||||
|
opt.RegisterFromAssembly<EGDbContext>(typeof(EmailOut).Assembly);
|
||||||
|
#endif
|
||||||
|
});
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
services.AddSQLExecutor<Envelope>();
|
||||||
|
services.AddSQLExecutor<Receiver>();
|
||||||
|
services.AddSQLExecutor<Document>();
|
||||||
|
services.AddSQLExecutor<Signature>();
|
||||||
|
services.AddSQLExecutor<DocumentStatus>();
|
||||||
|
|
||||||
|
SetDapperTypeMap<Envelope>();
|
||||||
|
SetDapperTypeMap<User>();
|
||||||
|
SetDapperTypeMap<Receiver>();
|
||||||
|
SetDapperTypeMap<Document>();
|
||||||
|
SetDapperTypeMap<Signature>();
|
||||||
|
SetDapperTypeMap<DocumentStatus>();
|
||||||
|
|
||||||
|
services.AddScoped<IEnvelopeExecutor, EnvelopeExecutor>();
|
||||||
|
services.AddScoped<IEnvelopeReceiverExecutor, EnvelopeReceiverExecutor>();
|
||||||
|
services.AddScoped<IDocumentExecutor, DocumentExecutor>();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return services;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
public static IServiceCollection AddSQLExecutor(this IServiceCollection services, IConfiguration? configuration = null, Action<SQLExecutorParams>? configureOptions = null)
|
||||||
|
{
|
||||||
|
if (configuration is not null && configureOptions is not null)
|
||||||
|
throw new InvalidOperationException("Cannot use both 'configuration' and 'configureOptions'. Only one should be provided.");
|
||||||
|
|
||||||
|
if (configuration is not null)
|
||||||
|
services.Configure<SQLExecutorParams>(configuration);
|
||||||
|
|
||||||
|
if (configureOptions is not null)
|
||||||
|
services.Configure(configureOptions);
|
||||||
|
|
||||||
|
return services.AddSingleton<ISQLExecutor, SQLExecutor>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetDapperTypeMap<TModel>()
|
||||||
|
{
|
||||||
|
Dapper.SqlMapper.SetTypeMap(typeof(TModel), new CustomPropertyTypeMap(
|
||||||
|
typeof(TModel),
|
||||||
|
(type, columnName) =>
|
||||||
|
{
|
||||||
|
return type.GetProperties().FirstOrDefault(prop =>
|
||||||
|
{
|
||||||
|
var attr = prop.GetCustomAttribute<ColumnAttribute>();
|
||||||
|
return attr != null && string.Equals(attr.Name, columnName, StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals(prop.Name, columnName, StringComparison.OrdinalIgnoreCase);
|
||||||
|
})!;
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IServiceCollection AddSQLExecutor<T>(this IServiceCollection services, IConfiguration? configuration = null, Action<SQLExecutorParams>? configureOptions = null) where T : class
|
||||||
|
{
|
||||||
|
if (configuration is not null && configureOptions is not null)
|
||||||
|
throw new InvalidOperationException("Cannot use both 'configuration' and 'configureOptions'. Only one should be provided.");
|
||||||
|
|
||||||
|
if (configuration is not null)
|
||||||
|
services.Configure<SQLExecutorParams>(configuration);
|
||||||
|
|
||||||
|
services.AddScoped<ISQLExecutor<T>, SQLExecutor<T>>();
|
||||||
|
|
||||||
|
var interfaceType = typeof(ISQL<>);
|
||||||
|
var targetGenericType = interfaceType.MakeGenericType(typeof(T));
|
||||||
|
|
||||||
|
var implementations = AppDomain.CurrentDomain.GetAssemblies()
|
||||||
|
.SelectMany(a =>
|
||||||
|
{
|
||||||
|
try { return a.GetTypes(); }
|
||||||
|
catch { return Array.Empty<Type>(); }
|
||||||
|
})
|
||||||
|
.Where(t =>
|
||||||
|
t is { IsClass: true, IsAbstract: false } &&
|
||||||
|
t.GetInterfaces().Any(i =>
|
||||||
|
i.IsGenericType &&
|
||||||
|
i.GetGenericTypeDefinition() == interfaceType &&
|
||||||
|
i.GenericTypeArguments[0] == typeof(T)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach (var impl in implementations)
|
||||||
|
{
|
||||||
|
services.AddSingleton(impl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return services;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public class EGInfrastructureConfiguration
|
||||||
|
{
|
||||||
|
private readonly IServiceCollection _services;
|
||||||
|
|
||||||
|
internal EGInfrastructureConfiguration(IServiceCollection services)
|
||||||
|
{
|
||||||
|
_services = services;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddDbTriggerParams(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_services.Configure<DbTriggerParams>(configuration.GetSection(nameof(DbTriggerParams)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddDbTriggerParams(Action<DbTriggerParams> configureOptions)
|
||||||
|
{
|
||||||
|
_services.Configure(configureOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddDbContext(Action<DbContextOptionsBuilder> dbContextOptions)
|
||||||
|
{
|
||||||
|
_services.AddDbContext<EGDbContext>(dbContextOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddDbContext(Action<IServiceProvider, DbContextOptionsBuilder> dbContextOptions)
|
||||||
|
{
|
||||||
|
_services.AddDbContext<EGDbContext>(dbContextOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
public void AddSQLExecutor(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_services.Configure<SQLExecutorParams>(configuration);
|
||||||
|
|
||||||
|
_services.AddSingleton<ISQLExecutor, SQLExecutor>();
|
||||||
|
|
||||||
|
_services.AddSQLExecutor(configuration, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddSQLExecutor(Action<SQLExecutorParams> options)
|
||||||
|
{
|
||||||
|
_services.Configure(options);
|
||||||
|
|
||||||
|
_services.AddSingleton<ISQLExecutor, SQLExecutor>();
|
||||||
|
|
||||||
|
_services.AddSQLExecutor(null, options);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,28 +1,43 @@
|
|||||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
|
||||||
using DigitalData.UserManager.Infrastructure;
|
|
||||||
using DigitalData.UserManager.Infrastructure.Contracts;
|
|
||||||
using EnvelopeGenerator.Domain.Entities;
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Group = DigitalData.UserManager.Domain.Entities.Group;
|
using Group = DigitalData.UserManager.Domain.Entities.Group;
|
||||||
using Module = DigitalData.UserManager.Domain.Entities.Module;
|
using Module = DigitalData.UserManager.Domain.Entities.Module;
|
||||||
using DigitalData.EmailProfilerDispatcher;
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using DigitalData.Core.Client;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using EnvelopeGenerator.Application.Common.Configurations;
|
#if NET
|
||||||
|
using DigitalData.EmailProfilerDispatcher;
|
||||||
|
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
|
||||||
|
using DigitalData.UserManager.Infrastructure;
|
||||||
|
using DigitalData.UserManager.Infrastructure.Contracts;
|
||||||
|
using DigitalData.Core.Client;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
using System.Linq;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Infrastructure;
|
namespace EnvelopeGenerator.Infrastructure
|
||||||
|
#if NET
|
||||||
|
;
|
||||||
|
#elif NETFRAMEWORK
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
public class EGDbContext : EGDbContextBase
|
public class EGDbContext : EGDbContextBase
|
||||||
{
|
{
|
||||||
public EGDbContext(DbContextOptions<EGDbContext> options, IOptions<DbTriggerParams> triggerParamOptions, ILogger<EGDbContext>? logger = null) : base(options, triggerParamOptions, logger)
|
public EGDbContext(DbContextOptions<EGDbContext> options, IOptions<DbTriggerParams> triggerParamOptions, ILogger<EGDbContext>
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
logger = null) : base(options, triggerParamOptions, logger)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Adding EmailOut instead of EmailOut.Abst is not correct for the arch. Re-design EmailPut consedering this. IMailDbContext shoud move to Abstraction layer (hint: in this case using DBSet in abst. will be problem because entity framework will have to be added.
|
//TODO: Adding EmailOut instead of EmailOut.Abst is not correct for the arch. Re-design EmailPut consedering this. IMailDbContext shoud move to Abstraction layer (hint: in this case using DBSet in abst. will be problem because entity framework will have to be added.
|
||||||
public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailDbContext
|
public abstract class EGDbContextBase : DbContext
|
||||||
|
#if NET
|
||||||
|
, IUserManagerDbContext, IMailDbContext
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
public DbSet<Config> Configs { get; set; }
|
public DbSet<Config> Configs { get; set; }
|
||||||
|
|
||||||
@@ -56,41 +71,36 @@ public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailD
|
|||||||
|
|
||||||
public DbSet<UserRep> UserReps { get; set; }
|
public DbSet<UserRep> UserReps { get; set; }
|
||||||
|
|
||||||
|
#if NET
|
||||||
public DbSet<EmailOut> EMailOuts { get; set; }
|
public DbSet<EmailOut> EMailOuts { get; set; }
|
||||||
|
#endif
|
||||||
|
|
||||||
public DbSet<EnvelopeReceiverReadOnly> EnvelopeReceiverReadOnlys { get; set; }
|
public DbSet<EnvelopeReceiverReadOnly> EnvelopeReceiverReadOnlys { get; set; }
|
||||||
|
|
||||||
public DbSet<ClientUser> ClientUsers { get; set; }
|
public DbSet<ClientUser> ClientUsers { get; set; }
|
||||||
|
|
||||||
|
public DbSet<ThirdPartyModule> ThirdPartyModules { get; set; }
|
||||||
|
|
||||||
|
public DbSet<EnvelopeReport> EnvelopeReports { get; set; }
|
||||||
|
|
||||||
private readonly DbTriggerParams _triggers;
|
private readonly DbTriggerParams _triggers;
|
||||||
|
|
||||||
private readonly ILogger? _logger;
|
private readonly ILogger
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
_logger;
|
||||||
|
|
||||||
public bool IsMigration { get; set; } = false;
|
public bool IsMigration { get; set; } = false;
|
||||||
|
|
||||||
public EGDbContextBase(DbContextOptions options, IOptions<DbTriggerParams> triggerParamOptions, ILogger? logger = null) : base(options)
|
public EGDbContextBase(DbContextOptions options, IOptions<DbTriggerParams> triggerParamOptions, ILogger
|
||||||
|
#if NET
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
logger = null) : base(options)
|
||||||
{
|
{
|
||||||
_triggers = triggerParamOptions.Value;
|
_triggers = triggerParamOptions.Value;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
|
||||||
Configs = Set<Config>();
|
|
||||||
EnvelopeReceivers = Set<EnvelopeReceiver>();
|
|
||||||
Envelopes = Set<Envelope>();
|
|
||||||
DocumentReceiverElements = Set<Signature>();
|
|
||||||
DocumentStatus = Set<DocumentStatus>();
|
|
||||||
EnvelopeDocument = Set<Document>();
|
|
||||||
EnvelopeHistories = Set<History>();
|
|
||||||
EnvelopeTypes = Set<EnvelopeType>();
|
|
||||||
Receivers = Set<Receiver>();
|
|
||||||
|
|
||||||
GroupOfUsers = Set<GroupOfUser>();
|
|
||||||
Groups = Set<Group>();
|
|
||||||
ModuleOfUsers = Set<ModuleOfUser>();
|
|
||||||
Modules = Set<Module>();
|
|
||||||
Users = Set<User>();
|
|
||||||
UserReps = Set<UserRep>();
|
|
||||||
EMailOuts = Set<EmailOut>();
|
|
||||||
EnvelopeReceiverReadOnlys = Set<EnvelopeReceiverReadOnly>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
@@ -119,7 +129,7 @@ public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailD
|
|||||||
|
|
||||||
modelBuilder.Entity<Envelope>()
|
modelBuilder.Entity<Envelope>()
|
||||||
.HasMany(e => e.Documents)
|
.HasMany(e => e.Documents)
|
||||||
.WithOne()
|
.WithOne(d => d.Envelope)
|
||||||
.HasForeignKey(ed => ed.EnvelopeId);
|
.HasForeignKey(ed => ed.EnvelopeId);
|
||||||
|
|
||||||
modelBuilder.Entity<Envelope>()
|
modelBuilder.Entity<Envelope>()
|
||||||
@@ -187,6 +197,13 @@ public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailD
|
|||||||
.HasForeignKey(ds => ds.ReceiverId);
|
.HasForeignKey(ds => ds.ReceiverId);
|
||||||
#endregion DocumentStatus
|
#endregion DocumentStatus
|
||||||
|
|
||||||
|
#region Annotation
|
||||||
|
modelBuilder.Entity<Signature>()
|
||||||
|
.HasMany(signature => signature.Annotations)
|
||||||
|
.WithOne(annot => annot.Element)
|
||||||
|
.HasForeignKey(annot => annot.ElementId);
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Trigger
|
#region Trigger
|
||||||
// Configure entities to handle database triggers
|
// Configure entities to handle database triggers
|
||||||
void AddTrigger<T>() where T : class => _triggers
|
void AddTrigger<T>() where T : class => _triggers
|
||||||
@@ -194,7 +211,9 @@ public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailD
|
|||||||
.SelectMany(t => t.Value)
|
.SelectMany(t => t.Value)
|
||||||
.ForEach(tName =>
|
.ForEach(tName =>
|
||||||
{
|
{
|
||||||
|
#if NET
|
||||||
modelBuilder.Entity<T>().ToTable(tb => tb.HasTrigger(tName));
|
modelBuilder.Entity<T>().ToTable(tb => tb.HasTrigger(tName));
|
||||||
|
#endif
|
||||||
_logger?.LogInformation("Trigger '{triggerName}' has been added to the '{entityName}' entity.", tName, typeof(T).Name);
|
_logger?.LogInformation("Trigger '{triggerName}' has been added to the '{entityName}' entity.", tName, typeof(T).Name);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -210,12 +229,20 @@ public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailD
|
|||||||
AddTrigger<EnvelopeReceiverReadOnly>();
|
AddTrigger<EnvelopeReceiverReadOnly>();
|
||||||
AddTrigger<EnvelopeType>();
|
AddTrigger<EnvelopeType>();
|
||||||
AddTrigger<Receiver>();
|
AddTrigger<Receiver>();
|
||||||
|
#if NET
|
||||||
AddTrigger<EmailOut>();
|
AddTrigger<EmailOut>();
|
||||||
|
#endif
|
||||||
#endregion Trigger
|
#endregion Trigger
|
||||||
|
|
||||||
//configure model builder for user manager tables
|
//configure model builder for user manager tables
|
||||||
|
#if NET
|
||||||
modelBuilder.ConfigureUserManager();
|
modelBuilder.ConfigureUserManager();
|
||||||
|
#endif
|
||||||
|
|
||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(modelBuilder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using EnvelopeGenerator.Application.Common.Configurations;
|
#if NET
|
||||||
|
using EnvelopeGenerator.Application.Common.Configurations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Design;
|
using Microsoft.EntityFrameworkCore.Design;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
@@ -22,10 +23,10 @@ namespace EnvelopeGenerator.Infrastructure
|
|||||||
// create DbTriggerParams
|
// create DbTriggerParams
|
||||||
var triggerLists = config.GetSection("DbTriggerParams").Get<Dictionary<string, List<string>>>();
|
var triggerLists = config.GetSection("DbTriggerParams").Get<Dictionary<string, List<string>>>();
|
||||||
var dbTriggerParams = new DbTriggerParams();
|
var dbTriggerParams = new DbTriggerParams();
|
||||||
if(triggerLists is not null)
|
if (triggerLists is not null)
|
||||||
foreach (var triggerList in triggerLists)
|
foreach (var triggerList in triggerLists)
|
||||||
{
|
{
|
||||||
if(triggerList.Value.Count == 0)
|
if (triggerList.Value.Count == 0)
|
||||||
continue; // Skip empty trigger lists
|
continue; // Skip empty trigger lists
|
||||||
|
|
||||||
var tableName = triggerList.Key;
|
var tableName = triggerList.Key;
|
||||||
@@ -44,3 +45,4 @@ namespace EnvelopeGenerator.Infrastructure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
20
EnvelopeGenerator.Infrastructure/EnumerableExtensions.cs
Normal file
20
EnvelopeGenerator.Infrastructure/EnumerableExtensions.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#if NETFRAMEWORK
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Infrastructure
|
||||||
|
{
|
||||||
|
public static class EnumerableExtensions
|
||||||
|
{
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
public static void ForEach<T>(this IEnumerable<T> values, Action<T> action)
|
||||||
|
{
|
||||||
|
foreach (T value in values)
|
||||||
|
{
|
||||||
|
action(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user