Compare commits
448 Commits
e20f42a88e
...
customer/C
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd7454d38e | ||
|
|
f7c3ed280a | ||
|
|
9ffeb7afe8 | ||
|
|
a83994af43 | ||
|
|
8345034fcd | ||
|
|
a763d3c353 | ||
|
|
5ba5d2755b | ||
|
|
8629599f86 | ||
|
|
d166ae5a8b | ||
|
|
145d139e3a | ||
|
|
d3ce34ee31 | ||
|
|
fd61d4431f | ||
|
|
93417d1b37 | ||
|
|
ca3ea36a83 | ||
|
|
c59d9bbf57 | ||
|
|
0cf1cd10c0 | ||
|
|
1da73d1754 | ||
|
|
24037f8366 | ||
|
|
91b891513f | ||
|
|
e7d1f1574f | ||
|
|
80a3a26af8 | ||
|
|
9905ea5a12 | ||
|
|
a7a77cd491 | ||
|
|
f795b1447f | ||
|
|
e5e12bfb61 | ||
|
|
6a8baf08ed | ||
|
|
10ac34a9f7 | ||
|
|
72af1cc2a2 | ||
|
|
cd32ae2a35 | ||
|
|
ddc0c9c6f3 | ||
|
|
489c2a2a9f | ||
|
|
320e81719b | ||
|
|
66a8471f05 | ||
|
|
c7a4ef4722 | ||
|
|
1673ea81df | ||
|
|
306956a7be | ||
|
|
bfe3d38ecc | ||
|
|
6e5bb58f65 | ||
|
|
b96c6c10f8 | ||
|
|
afedfdd596 | ||
|
|
3a7099feb4 | ||
|
|
c704d222f0 | ||
|
|
83ce528e2f | ||
|
|
9cc15f9beb | ||
|
|
d323244157 | ||
|
|
56d35c65bb | ||
|
|
15eabfc834 | ||
|
|
11e8c46e44 | ||
|
|
a14bd78415 | ||
|
|
609f7d09fc | ||
|
|
4c21cb4ba7 | ||
|
|
00ebf45605 | ||
|
|
387777972b | ||
|
|
b7569982ff | ||
|
|
d6be88b61d | ||
|
|
8e454a0419 | ||
|
|
f8932e14c0 | ||
|
|
812bf9b25a | ||
|
|
0d591d5350 | ||
|
|
c9712af73e | ||
|
|
da483706b1 | ||
|
|
4b600cb190 | ||
|
|
25a56a22fa | ||
|
|
4e81f0949c | ||
|
|
18e79cf516 | ||
|
|
fad0a6070c | ||
|
|
755fcfeef2 | ||
|
|
40739b598b | ||
|
|
9782503d1d | ||
|
|
35ced9b9ad | ||
|
|
9b28c0a1d1 | ||
|
|
fd19c5be58 | ||
|
|
58b13e233c | ||
|
|
ce55066208 | ||
|
|
7d582d2422 | ||
|
|
fe1d553a8d | ||
|
|
99c05a44f5 | ||
|
|
678360953d | ||
|
|
9867e81220 | ||
|
|
49cfc3c044 | ||
|
|
43ae15b71c | ||
|
|
1c2df71e0f | ||
|
|
a806ec27db | ||
|
|
14bd2e22fc | ||
|
|
f94728bf67 | ||
|
|
caeaf1774e | ||
|
|
1388b40a6b | ||
|
|
e44d5f644c | ||
|
|
fe9fd3024e | ||
|
|
b664e35b11 | ||
|
|
a77a31121f | ||
|
|
381de6b554 | ||
|
|
13bd727b3e | ||
|
|
9021291aef | ||
|
|
8bd7ab13d0 | ||
|
|
8eefd94569 | ||
|
|
b3b2baf0e4 | ||
|
|
836380048a | ||
|
|
f105aaa567 | ||
|
|
6238d66ca2 | ||
|
|
7e325a7eb6 | ||
|
|
c91446c5ac | ||
| eaf4cd773d | |||
| 8950482bac | |||
|
|
b615446274 | ||
|
|
f276735b5c | ||
|
|
31aa5829f6 | ||
| 27a5538229 | |||
| 322fb2fd7e | |||
| 8e33094806 | |||
| 54b246f8e4 | |||
|
|
5c51ea679e | ||
|
|
e264a10a36 | ||
| 2f8aed8640 | |||
| 29eac347c3 | |||
|
|
dd6ab13e6e | ||
|
|
d94d9f045e | ||
|
|
12bfcb1f25 | ||
|
|
63613f2073 | ||
|
|
1c11a0e8f0 | ||
|
|
d376065246 | ||
|
|
4166dfde4b | ||
|
|
1bc43a5a77 | ||
|
|
33f4c6e489 | ||
|
|
a4b880f1d2 | ||
| a7f38eafb2 | |||
| 67a8506a37 | |||
|
|
ecec1e1206 | ||
|
|
854ed45abd | ||
|
|
c0cece62af | ||
|
|
408969d6dd | ||
|
|
9e019c0b69 | ||
|
|
2f4ffac9c4 | ||
|
|
6464a591a8 | ||
|
|
56df8234c7 | ||
|
|
95958f2a1d | ||
|
|
39cc257466 | ||
|
|
c4a66ee5bb | ||
|
|
cc3f6efbd7 | ||
|
|
c0a6103eb2 | ||
|
|
79bb454fd1 | ||
|
|
fc91a451f6 | ||
|
|
1efd241ab0 | ||
|
|
e8ff922726 | ||
|
|
8f3e72ae8b | ||
|
|
9279f8e79a | ||
|
|
1b2a316e5f | ||
|
|
36d305a1e8 | ||
|
|
963a36acfa | ||
|
|
30ee71eaf5 | ||
|
|
5f161d81f2 | ||
|
|
4d040959a5 | ||
|
|
5846a7433c | ||
|
|
2f41a993ee | ||
|
|
eac7454989 | ||
|
|
8c767a73b4 | ||
|
|
9e33fc1d96 | ||
|
|
23bf7579f6 | ||
|
|
13b9394073 | ||
|
|
af27163b08 | ||
|
|
155726a6b0 | ||
|
|
9f8142a5d6 | ||
|
|
0f97c325cf | ||
|
|
7961fcbf0f | ||
|
|
a1d251d705 | ||
|
|
07ad18eccb | ||
|
|
bf23fceb6b | ||
|
|
2dc860b923 | ||
|
|
9b2c5d9ca5 | ||
|
|
76bfb895a9 | ||
|
|
38aa6a6217 | ||
|
|
0268756cf9 | ||
|
|
f509cc8b3b | ||
|
|
290a1dd522 | ||
|
|
2c147f44b7 | ||
|
|
3fd2f90f65 | ||
|
|
d077a66796 | ||
|
|
f16a8bcdb9 | ||
|
|
33f161a5fe | ||
|
|
7697939d7e | ||
|
|
34b3c46720 | ||
|
|
65618e5df9 | ||
|
|
8d5493969f | ||
|
|
0818b8d606 | ||
|
|
047c4d09e8 | ||
|
|
26f2e157c6 | ||
|
|
f26f400937 | ||
|
|
0e4cfc452f | ||
|
|
95b80a650c | ||
|
|
f4dd17fca9 | ||
|
|
e4aed5309e | ||
|
|
c31f081208 | ||
| 76d4151182 | |||
| df2537bf29 | |||
| 5ca4c04669 | |||
| 297ecfab7b | |||
| 48db26931c | |||
|
|
21934928c2 | ||
|
|
21e8a86a99 | ||
|
|
0228e82c63 | ||
|
|
50247517b9 | ||
|
|
1357b714cf | ||
|
|
88da8e4ace | ||
|
|
89290c03f9 | ||
|
|
3b27260b14 | ||
|
|
9fa5827b09 | ||
|
|
3448c17d8b | ||
|
|
48ec83161d | ||
|
|
cc63b24947 | ||
|
|
c3db8d0d00 | ||
|
|
037ebfbe5c | ||
|
|
42258cbbb8 | ||
|
|
4c96274084 | ||
|
|
b594ddb646 | ||
|
|
b60ae62779 | ||
|
|
7863e861c7 | ||
|
|
2014f6149d | ||
|
|
60afdc23da | ||
|
|
90ac81c576 | ||
|
|
8d6d483c5d | ||
|
|
824bf6fb82 | ||
|
|
0c6fd2efe3 | ||
|
|
1f4cf54406 | ||
|
|
a6635f4a20 | ||
|
|
ed25482cee | ||
|
|
1664b5739e | ||
|
|
0ef9d3c49e | ||
|
|
86bdb233c2 | ||
|
|
bc6972bcfb | ||
|
|
2e66129485 | ||
|
|
81220ac9b4 | ||
|
|
d7252ce888 | ||
|
|
ba723bdddb | ||
|
|
68714c2937 | ||
|
|
cf9286e4c3 | ||
|
|
87a766a2e8 | ||
|
|
674d753735 | ||
|
|
c688a42e45 | ||
|
|
db83f25d57 | ||
|
|
ef6e921451 | ||
|
|
dd18094deb | ||
|
|
4f61f1b6cb | ||
|
|
efcd254749 | ||
|
|
357866ea44 | ||
|
|
d8617093ce | ||
|
|
b19cccdc34 | ||
|
|
79aa6f4cb3 | ||
|
|
a285a0b9c2 | ||
|
|
84442410a5 | ||
|
|
22a3ec914d | ||
|
|
9620cb7189 | ||
|
|
eb096cb201 | ||
|
|
cc01f57125 | ||
| a7cf500858 | |||
| b24f06509e | |||
|
|
6b3c90c618 | ||
|
|
966b7de3c4 | ||
|
|
8efe321cc7 | ||
|
|
6338b81571 | ||
| 0582e7e002 | |||
| 3f40b9449b | |||
| fd694b2cee | |||
| d4a9eba6ab | |||
|
|
f2e718565d | ||
|
|
f7b11e3427 | ||
|
|
74cb595128 | ||
|
|
23609d2bd7 | ||
|
|
1c55c4aa99 | ||
|
|
87c839549a | ||
| 02d883dfbf | |||
| f51c500f90 | |||
|
|
49cfeb28d9 | ||
|
|
5e758899ab | ||
|
|
f5dd3cf8be | ||
|
|
2c17d440c0 | ||
|
|
6941a3db8d | ||
|
|
1584fd6f1c | ||
|
|
2512de0f26 | ||
|
|
db83eb90ee | ||
|
|
501d48961e | ||
|
|
ab713a23ac | ||
|
|
cbb03d77ba | ||
|
|
29ae546d98 | ||
|
|
8de0d70e7b | ||
|
|
b43b1ef866 | ||
|
|
b8d4abb7b2 | ||
|
|
b65766ce24 | ||
| 83746abb1b | |||
| c14ed86181 | |||
| 56eb385312 | |||
| 5abc1d9779 | |||
|
|
6fc210132d | ||
| a3c66ecd19 | |||
| a25b517445 | |||
|
|
181ee67bab | ||
|
|
c459828706 | ||
|
|
6f59906a7e | ||
| 21baf0bad0 | |||
| 47f924ad7e | |||
| a2b0682a77 | |||
| 86d9bd185a | |||
| 0064eee9d5 | |||
| d4aa3ec82e | |||
| 55f2a6a775 | |||
| 4cd39c6c5c | |||
| 51741be5de | |||
| 31ca8b8b9e | |||
| dd55e2a2d9 | |||
|
|
02a197e535 | ||
|
|
ddd0808f41 | ||
|
|
c504567c41 | ||
|
|
6131948f2a | ||
|
|
0a01bf59ef | ||
|
|
a4ed41419d | ||
|
|
6460c2b4ea | ||
|
|
91930c94e9 | ||
|
|
e0bbdf8c0e | ||
|
|
c8106f4fb0 | ||
|
|
9f568e357e | ||
|
|
52ffcc21cc | ||
|
|
32a965800e | ||
|
|
c7dba51ec9 | ||
| 8657c0b212 | |||
| 54debebd05 | |||
| c77772aa7c | |||
|
|
37908b6a1b | ||
|
|
277f5d3f0d | ||
| 2723b10a45 | |||
|
|
b7fbb21076 | ||
|
|
b849a8d87b | ||
|
|
26fe798a68 | ||
|
|
119f54e8aa | ||
|
|
73cb1d8963 | ||
|
|
9b39f0b4ae | ||
|
|
f54532a4b1 | ||
|
|
13b9003186 | ||
|
|
bdf7bdd37a | ||
|
|
0ad1d214ba | ||
|
|
eea1bd2177 | ||
|
|
d8742332ec | ||
|
|
27a611e8dc | ||
|
|
f50a19d537 | ||
|
|
0dfc9b4f09 | ||
|
|
8581cb555a | ||
|
|
97987aa22f | ||
|
|
f8b30e1a06 | ||
|
|
788d7fac9f | ||
|
|
c4e9f5aa2b | ||
|
|
d8ba020bb9 | ||
|
|
fd4dd8b457 | ||
|
|
bc178caec1 | ||
|
|
49e6da3d79 | ||
|
|
feb429f8f8 | ||
|
|
d1fc258f19 | ||
|
|
681583b3f0 | ||
| d47f75133d | |||
| eedd80d1c9 | |||
|
|
330ffe30a5 | ||
|
|
1b85236513 | ||
| 1eba05e5f7 | |||
|
|
aadcef6b15 | ||
|
|
951c9d9122 | ||
| 124414b940 | |||
| db57da0e5c | |||
| 2bf784690d | |||
|
|
dbeabab832 | ||
| b2f6076fb2 | |||
|
|
eb6e1cef03 | ||
|
|
bbfccc4a4f | ||
| cd7af973a1 | |||
|
|
2d49e4704d | ||
|
|
33f5bec8d0 | ||
|
|
1ab7235fcf | ||
|
|
c859a721e6 | ||
|
|
a049166d83 | ||
|
|
5dd4b3496c | ||
| 03f24e6d61 | |||
| faf700eac2 | |||
| 855cbae55e | |||
|
|
08ffecaea7 | ||
|
|
6aef316b03 | ||
| f803fc03de | |||
| 474bf89ee8 | |||
|
|
752dbe3718 | ||
|
|
cd23c5b974 | ||
| 1108fa47e0 | |||
| e20b9c0bb6 | |||
|
|
fe9c5d048f | ||
|
|
c617dbb528 | ||
| e4545a90d4 | |||
| 7c450c56ed | |||
|
|
327102d63a | ||
|
|
588b532d86 | ||
|
|
5b313e069e | ||
|
|
970aa5056f | ||
|
|
7abde3a1f4 | ||
|
|
9c66de2b8e | ||
|
|
f5cb74d9c7 | ||
|
|
cb2e3eb955 | ||
| f42ef8107c | |||
|
|
538b6d4bcd | ||
|
|
70e4842a39 | ||
|
|
c45939b89b | ||
| ba6406b4b5 | |||
|
|
25f7aeb45c | ||
|
|
078b1d30fe | ||
|
|
3675e83102 | ||
| 27e5e9245e | |||
| 364e478b52 | |||
| 3701ac30ef | |||
|
|
2d1574bcbf | ||
| d0b7c6fbd8 | |||
|
|
f506587d2c | ||
|
|
489c7879da | ||
|
|
3b3445cc03 | ||
|
|
f6480adb04 | ||
|
|
7124ad3015 | ||
|
|
6f91ecac83 | ||
|
|
763ac96f4e | ||
|
|
a1062027c8 | ||
|
|
411851b0f6 | ||
|
|
0455795165 | ||
| c2d27e089a | |||
| 0f41312a01 | |||
| c44ade2ee1 | |||
| 9ea63b7cbe | |||
| 6dad6c1e96 | |||
| e143b7bccc | |||
| 78ed65fb9f | |||
|
|
5d210350e7 | ||
| 3d20a9b401 | |||
| 064171e6ca | |||
| 99008dfbe7 | |||
| df02dcf0cf | |||
| 62d88d6770 | |||
| cb44e25fea | |||
| 544d6e9de0 | |||
| 6971a5d641 | |||
|
|
15e163bd60 | ||
|
|
562935e07e | ||
|
|
61c3a859c6 | ||
|
|
d966e88583 | ||
| 1b56789858 | |||
| 39b880d406 | |||
|
|
55b2865387 | ||
|
|
ac3bbc79f3 | ||
|
|
859e971b26 | ||
|
|
d603fcfec6 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -360,4 +360,6 @@ MigrationBackup/
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
FodyWeavers.xsd
|
||||
/EnvelopeGenerator.Web/.config/dotnet-tools.json
|
||||
/EnvelopeGenerator.GeneratorAPI/ClientApp/envelope-generator-ui/.vscode
|
||||
|
||||
17
EnvelopeGenerator.Application/Contracts/IConfigService.cs
Normal file
17
EnvelopeGenerator.Application/Contracts/IConfigService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IConfigService : IBasicCRUDService<ConfigDto, Config, int>
|
||||
{
|
||||
Task<DataResult<ConfigDto>> ReadFirstAsync();
|
||||
|
||||
Task<ConfigDto> ReadDefaultAsync();
|
||||
|
||||
Task<string> ReadDefaultSignatureHost();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
|
||||
{
|
||||
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>
|
||||
{
|
||||
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
|
||||
|
||||
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
|
||||
|
||||
Task<bool> IsSigned(int envelopeId, string userReference);
|
||||
|
||||
Task<bool> IsRejected(int envelopeId, string? userReference = null);
|
||||
|
||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false);
|
||||
|
||||
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
|
||||
|
||||
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
|
||||
|
||||
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Common;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeMailService : IEmailOutService
|
||||
{
|
||||
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType);
|
||||
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, object>
|
||||
{
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false);
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true);
|
||||
|
||||
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true);
|
||||
|
||||
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true);
|
||||
|
||||
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
|
||||
|
||||
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
|
||||
|
||||
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
|
||||
|
||||
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
|
||||
|
||||
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
|
||||
}
|
||||
}
|
||||
15
EnvelopeGenerator.Application/Contracts/IEnvelopeService.cs
Normal file
15
EnvelopeGenerator.Application/Contracts/IEnvelopeService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
|
||||
{
|
||||
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
|
||||
|
||||
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
|
||||
{
|
||||
}
|
||||
}
|
||||
24
EnvelopeGenerator.Application/Contracts/IJWTService.cs
Normal file
24
EnvelopeGenerator.Application/Contracts/IJWTService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IJWTService<TClaimValue>
|
||||
{
|
||||
public static SymmetricSecurityKey GenerateSecurityKey(int byteSize = 32)
|
||||
{
|
||||
using var rng = RandomNumberGenerator.Create();
|
||||
var randomBytes = new byte[byteSize];
|
||||
rng.GetBytes(randomBytes);
|
||||
var securityKey = new SymmetricSecurityKey(randomBytes);
|
||||
|
||||
return securityKey;
|
||||
}
|
||||
|
||||
string GenerateToken(TClaimValue claimValue);
|
||||
|
||||
JwtSecurityToken? ReadSecurityToken(string token);
|
||||
}
|
||||
}
|
||||
14
EnvelopeGenerator.Application/Contracts/IReceiverService.cs
Normal file
14
EnvelopeGenerator.Application/Contracts/IReceiverService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>
|
||||
{
|
||||
public Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
|
||||
|
||||
public Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Contracts
|
||||
{
|
||||
public interface IUserReceiverService : IBasicCRUDService<UserReceiverDto, UserReceiver, int>
|
||||
{
|
||||
}
|
||||
}
|
||||
57
EnvelopeGenerator.Application/DIExtensions.cs
Normal file
57
EnvelopeGenerator.Application/DIExtensions.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using DigitalData.UserManager.Application.MappingProfiles;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.MappingProfiles;
|
||||
using EnvelopeGenerator.Application.Services;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using EnvelopeGenerator.Infrastructure.Repositories;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EnvelopeGenerator.Application
|
||||
{
|
||||
public static class DIExtensions
|
||||
{
|
||||
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services)
|
||||
{
|
||||
//Inject CRUD Service and repositoriesad
|
||||
services.AddScoped<IConfigRepository, ConfigRepository>();
|
||||
services.AddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
||||
services.AddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
|
||||
services.AddScoped<IConfigRepository, ConfigRepository>();
|
||||
services.AddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
|
||||
services.AddScoped<IDocumentStatusRepository, DocumentStatusRepository>();
|
||||
services.AddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
|
||||
services.AddScoped<IEnvelopeRepository, EnvelopeRepository>();
|
||||
services.AddScoped<IEnvelopeCertificateRepository, EnvelopeCertificateRepository>();
|
||||
services.AddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
|
||||
services.AddScoped<IEnvelopeHistoryRepository, EnvelopeHistoryRepository>();
|
||||
services.AddScoped<IEnvelopeReceiverRepository, EnvelopeReceiverRepository>();
|
||||
services.AddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
|
||||
services.AddScoped<IReceiverRepository, ReceiverRepository>();
|
||||
services.AddScoped<IUserReceiverRepository, UserReceiverRepository>();
|
||||
services.AddScoped<IConfigService, ConfigService>();
|
||||
services.AddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>();
|
||||
services.AddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
||||
services.AddScoped<IEnvelopeHistoryService, EnvelopeHistoryService>();
|
||||
services.AddScoped<IDocumentStatusService, DocumentStatusService>();
|
||||
services.AddScoped<IEmailTemplateService, EmailTemplateService>();
|
||||
services.AddScoped<IEnvelopeService, EnvelopeService>();
|
||||
services.AddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
|
||||
services.AddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
|
||||
services.AddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
|
||||
services.AddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
|
||||
services.AddScoped<IReceiverService, ReceiverService>();
|
||||
services.AddScoped<IUserReceiverService, UserReceiverService>();
|
||||
|
||||
//Auto mapping profiles
|
||||
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly);
|
||||
services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
EnvelopeGenerator.Application/DTOs/ConfigDto.cs
Normal file
12
EnvelopeGenerator.Application/DTOs/ConfigDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record ConfigDto(
|
||||
string DocumentPath,
|
||||
int SendingProfile,
|
||||
string SignatureHost,
|
||||
string ExternalProgramName,
|
||||
string ExportPath,
|
||||
string DocumentPathDmz,
|
||||
string ExportPathDmz,
|
||||
string DocumentPathMoveAftsend);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record DocumentReceiverElementDto(
|
||||
int Id,
|
||||
int DocumentId,
|
||||
int ReceiverId,
|
||||
int ElementType,
|
||||
double X,
|
||||
double Y,
|
||||
double Width,
|
||||
double Height,
|
||||
int Page,
|
||||
bool Required,
|
||||
string? Tooltip,
|
||||
bool ReadOnly,
|
||||
int AnnotationIndex,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ChangedWhen,
|
||||
double Top,
|
||||
double Left
|
||||
);
|
||||
}
|
||||
12
EnvelopeGenerator.Application/DTOs/DocumentStatusDto.cs
Normal file
12
EnvelopeGenerator.Application/DTOs/DocumentStatusDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record DocumentStatusDto(
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
int ReceiverId,
|
||||
int Status,
|
||||
DateTime? StatusChangedWhen,
|
||||
string Value,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ChangedWhen);
|
||||
}
|
||||
8
EnvelopeGenerator.Application/DTOs/EmailTemplateDto.cs
Normal file
8
EnvelopeGenerator.Application/DTOs/EmailTemplateDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EmailTemplateDto(
|
||||
int Id,
|
||||
string Name,
|
||||
string Body,
|
||||
string Subject);
|
||||
}
|
||||
12
EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs
Normal file
12
EnvelopeGenerator.Application/DTOs/EnvelopeCertificateDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeCertificateDto(
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
string EnvelopeUuid,
|
||||
string EnvelopeSubject,
|
||||
int CreatorId,
|
||||
string CreatorName,
|
||||
string CreatorEmail,
|
||||
int EnvelopeStatus);
|
||||
}
|
||||
10
EnvelopeGenerator.Application/DTOs/EnvelopeDocumentDto.cs
Normal file
10
EnvelopeGenerator.Application/DTOs/EnvelopeDocumentDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeDocumentDto
|
||||
(
|
||||
int Id,
|
||||
int EnvelopeId,
|
||||
DateTime AddedWhen,
|
||||
IEnumerable<DocumentReceiverElementDto>? Elements
|
||||
);
|
||||
}
|
||||
66
EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs
Normal file
66
EnvelopeGenerator.Application/DTOs/EnvelopeDto.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeDto()
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
|
||||
public string StatusName { get; set; }
|
||||
|
||||
public string Uuid { get; set; }
|
||||
|
||||
[TemplatePlaceholder("[MESSAGE]")]
|
||||
public string Message { get; set; }
|
||||
public DateTime? ExpiresWhen { get; set; }
|
||||
public DateTime? ExpiresWarningWhen { get; set; }
|
||||
public DateTime AddedWhen { get; set; }
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
|
||||
public string Title { get; set; }
|
||||
|
||||
public int? ContractType { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
|
||||
public bool? SendReminderEmails { get; set; }
|
||||
|
||||
public int? FirstReminderDays { get; set; }
|
||||
|
||||
public int? ReminderIntervalDays { get; set; }
|
||||
|
||||
public int? EnvelopeTypeId { get; set; }
|
||||
|
||||
public int? CertificationType { get; set; }
|
||||
|
||||
public bool? UseAccessCode { get; set; }
|
||||
|
||||
public int? FinalEmailToCreator { get; set; }
|
||||
|
||||
public int? FinalEmailToReceivers { get; set; }
|
||||
|
||||
public int? ExpiresWhenDays { get; set; }
|
||||
|
||||
public int? ExpiresWarningWhenDays { get; set; }
|
||||
|
||||
public bool DmzMoved { get; set; }
|
||||
public UserReadDto? User { get; set; }
|
||||
public EnvelopeType? EnvelopeType { get; set; }
|
||||
|
||||
public string? EnvelopeTypeTitle { get; set; }
|
||||
|
||||
public bool IsAlreadySent { get; set; }
|
||||
|
||||
public string? StatusTranslated { get; set; }
|
||||
|
||||
public string? ContractTypeTranslated { get; set; }
|
||||
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
||||
{
|
||||
public record EnvelopeHistoryCreateDto(
|
||||
int EnvelopeId,
|
||||
string UserReference,
|
||||
int Status,
|
||||
DateTime? ActionDate,
|
||||
string? Comment = null);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
|
||||
{
|
||||
public record EnvelopeHistoryDto(
|
||||
long Id,
|
||||
int EnvelopeId,
|
||||
string UserReference,
|
||||
int Status,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ActionDate,
|
||||
UserCreateDto? Sender,
|
||||
ReceiverReadDto? Receiver,
|
||||
ReferenceType ReferenceType,
|
||||
string? Comment = null) : BaseDTO<long>(Id);
|
||||
}
|
||||
31
EnvelopeGenerator.Application/DTOs/EnvelopeReceiverDto.cs
Normal file
31
EnvelopeGenerator.Application/DTOs/EnvelopeReceiverDto.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeReceiverDto()
|
||||
{
|
||||
public int EnvelopeId { get; set; }
|
||||
|
||||
public int ReceiverId { get; set; }
|
||||
|
||||
public int Sequence { get; set; }
|
||||
|
||||
[TemplatePlaceholder("[NAME_RECEIVER]")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? JobTitle { get; set; }
|
||||
|
||||
public string? CompanyName { get; set; }
|
||||
|
||||
public string? PrivateMessage { get; set; }
|
||||
|
||||
public DateTime AddedWhen { get; set; }
|
||||
|
||||
public DateTime? ChangedWhen { get; set; }
|
||||
|
||||
public EnvelopeDto? Envelope { get; set; }
|
||||
|
||||
public ReceiverReadDto? Receiver { get; set; }
|
||||
}
|
||||
}
|
||||
19
EnvelopeGenerator.Application/DTOs/EnvelopeTypeDto.cs
Normal file
19
EnvelopeGenerator.Application/DTOs/EnvelopeTypeDto.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record EnvelopeTypeDto(
|
||||
int Id,
|
||||
string Title,
|
||||
string Language,
|
||||
int? ExpiresDays,
|
||||
int? CertificationType,
|
||||
bool? UseAccessCode,
|
||||
int? FinalEmailToCreator,
|
||||
int? FinalEmailToReceivers,
|
||||
DateTime AddedWhen,
|
||||
DateTime? ChangedWhen,
|
||||
int? ExpiresWarningDays,
|
||||
bool? SendReminderEmails,
|
||||
int? FirstReminderDays,
|
||||
int? ReminderIntervalDays,
|
||||
int? ContractType);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||
{
|
||||
public record ReceiverCreateDto([EmailAddress] string EmailAddress)
|
||||
{
|
||||
public string Signature => sha256HexOfMail.Value;
|
||||
|
||||
private readonly Lazy<string> sha256HexOfMail = new(() =>
|
||||
{
|
||||
var bytes_arr = Encoding.UTF8.GetBytes(EmailAddress.ToUpper());
|
||||
var hash_arr = SHA256.HashData(bytes_arr);
|
||||
var hexa_str = BitConverter.ToString(hash_arr);
|
||||
return hexa_str.Replace("-", string.Empty);
|
||||
});
|
||||
|
||||
public DateTime AddedWhen { get; } = DateTime.Now;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using DigitalData.Core.DTO;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||
{
|
||||
public record ReceiverReadDto(
|
||||
int Id,
|
||||
string EmailAddress,
|
||||
string Signature,
|
||||
DateTime AddedWhen
|
||||
) : BaseDTO<int>(Id);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs.Receiver
|
||||
{
|
||||
public record ReceiverUpdateDto();
|
||||
}
|
||||
11
EnvelopeGenerator.Application/DTOs/UserReceiverDto.cs
Normal file
11
EnvelopeGenerator.Application/DTOs/UserReceiverDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
{
|
||||
public record UserReceiverDto(
|
||||
int Id,
|
||||
int UserId,
|
||||
int ReceiverId,
|
||||
string Name,
|
||||
string CompanyName,
|
||||
string JobTitle,
|
||||
DateTime AddedWhen);
|
||||
}
|
||||
13
EnvelopeGenerator.Application/DispatcherConfig.cs
Normal file
13
EnvelopeGenerator.Application/DispatcherConfig.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace EnvelopeGenerator.Application
|
||||
{
|
||||
public class DispatcherConfig
|
||||
{
|
||||
public int SendingProfile { get; init; } = 1;
|
||||
|
||||
public string AddedWho { get; init; } = "DDEnvelopGenerator";
|
||||
|
||||
public int ReminderTypeId { get; init; } = 202377;
|
||||
|
||||
public string EmailAttmt1 { get; init; } = string.Empty;
|
||||
}
|
||||
}
|
||||
10
EnvelopeGenerator.Application/EnvelopeFlag.cs
Normal file
10
EnvelopeGenerator.Application/EnvelopeFlag.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace EnvelopeGenerator.Application
|
||||
{
|
||||
public enum EnvelopeFlag
|
||||
{
|
||||
EnvelopeOrReceiverNonexists,
|
||||
NonDecodableEnvelopeReceiverId,
|
||||
WrongEnvelopeReceiverId,
|
||||
AccessCodeNull
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Resources\Model.Designer.vb" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.1.1" />
|
||||
<PackageReference Include="DigitalData.Core.Application" Version="1.0.0" />
|
||||
<PackageReference Include="DigitalData.Core.DTO" Version="1.0.0" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
|
||||
<PackageReference Include="UserManager.Application" Version="1.0.0" />
|
||||
<PackageReference Include="UserManager.Infrastructure" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Resources\Model.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Model.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Resources\Model.en.resx">
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<LastGenOutput>Model.en.Designer.vb</LastGenOutput>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\Model.resx">
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<LastGenOutput>Model.Designer.cs</LastGenOutput>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\Resource.de-DE.resx">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\Resource.en-US.resx">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
148
EnvelopeGenerator.Application/EnvelopeGeneratorExtensions.cs
Normal file
148
EnvelopeGenerator.Application/EnvelopeGeneratorExtensions.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text;
|
||||
|
||||
namespace EnvelopeGenerator.Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods for decoding and extracting information from an envelope receiver ID.
|
||||
/// </summary>
|
||||
public static class EnvelopeGeneratorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates whether a given string is a correctly formatted Base-64 encoded string.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This method checks the string for proper Base-64 formatting, which includes validating
|
||||
/// the length of the string (must be divisible by 4). It also checks each character to ensure
|
||||
/// it belongs to the Base-64 character set (A-Z, a-z, 0-9, '+', '/', and '=' for padding).
|
||||
/// The method ensures that padding characters ('=') only appear at the end of the string and
|
||||
/// are in a valid configuration (either one '=' at the end if the string's length % 4 is 3,
|
||||
/// or two '==' if the length % 4 is 2).
|
||||
/// </remarks>
|
||||
/// <param name="input">The Base-64 encoded string to validate.</param>
|
||||
/// <returns>
|
||||
/// <c>true</c> if the string is a valid Base-64 encoded string; otherwise, <c>false</c>.
|
||||
/// </returns>
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// string testString = "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk=";
|
||||
/// bool isValid = IsValidBase64String(testString);
|
||||
/// Console.WriteLine(isValid); // Output: true
|
||||
/// </code>
|
||||
/// </example>
|
||||
public static bool IsBase64String(this string input)
|
||||
{
|
||||
// Check if the string is null or empty
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Replace valid base-64 padding
|
||||
input = input.Trim();
|
||||
int mod4 = input.Length % 4;
|
||||
if (mod4 > 0)
|
||||
{
|
||||
// Base-64 string lengths should be divisible by 4
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check each character to ensure it is valid base-64
|
||||
foreach (char c in input)
|
||||
{
|
||||
if (!char.IsLetterOrDigit(c) && c != '+' && c != '/' && c != '=')
|
||||
{
|
||||
// Invalid character detected
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure no invalid padding scenarios exist
|
||||
if (input.EndsWith("==") && (input.Length % 4 == 0) ||
|
||||
input.EndsWith("=") && (input.Length % 4 == 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return input.IndexOf('=') == -1; // No padding allowed except at the end
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes the envelope receiver ID and extracts the envelope UUID and receiver signature.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string containing the envelope UUID and receiver signature.</param>
|
||||
/// <returns>A tuple containing the envelope UUID and receiver signature.</returns>
|
||||
public static (string? EnvelopeUuid, string? ReceiverSignature) DecodeEnvelopeReceiverId(this string envelopeReceiverId)
|
||||
{
|
||||
if (!envelopeReceiverId.IsBase64String())
|
||||
{
|
||||
return (null, null);
|
||||
}
|
||||
byte[] bytes = Convert.FromBase64String(envelopeReceiverId);
|
||||
string decodedString = System.Text.Encoding.UTF8.GetString(bytes);
|
||||
string[] parts = decodedString.Split(new string[] { "::" }, StringSplitOptions.None);
|
||||
|
||||
if (parts.Length > 1)
|
||||
return (EnvelopeUuid: parts[0], ReceiverSignature: parts[1]);
|
||||
else
|
||||
return (string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the envelope UUID from the decoded envelope receiver ID.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||
/// <returns>The envelope UUID.</returns>
|
||||
public static string? GetEnvelopeUuid(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().EnvelopeUuid;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the receiver signature from the decoded envelope receiver ID.
|
||||
/// </summary>
|
||||
/// <param name="envelopeReceiverId">The base64 encoded string to decode.</param>
|
||||
/// <returns>The receiver signature.</returns>
|
||||
public static string? GetReceiverSignature(this string envelopeReceiverId) => envelopeReceiverId.DecodeEnvelopeReceiverId().ReceiverSignature;
|
||||
|
||||
public static string EncodeEnvelopeReceiverId(this (string envelopeUuid, string receiverSignature) input)
|
||||
{
|
||||
string combinedString = $"{input.envelopeUuid}::{input.receiverSignature}";
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(combinedString);
|
||||
string base64String = Convert.ToBase64String(bytes);
|
||||
|
||||
return base64String;
|
||||
}
|
||||
|
||||
public static void LogEnvelopeError(this ILogger logger, string envelopeReceiverId, Exception? exception = null, string? message = null, params object?[] args)
|
||||
{
|
||||
var sb = new StringBuilder().AppendLine(envelopeReceiverId.DecodeEnvelopeReceiverId().ToTitle());
|
||||
|
||||
if (message is not null)
|
||||
sb.AppendLine(message);
|
||||
|
||||
if(exception is null)
|
||||
logger.Log(LogLevel.Error, sb.ToString(), args);
|
||||
else
|
||||
logger.Log(LogLevel.Error, exception, sb.AppendLine(exception.Message).ToString(), args);
|
||||
}
|
||||
|
||||
public static void LogEnvelopeError(this ILogger logger, string? uuid, string? signature = null, Exception? exception = null, string? message = null, params object?[] args)
|
||||
{
|
||||
var sb = new StringBuilder($"Envelope Uuid: {uuid}");
|
||||
|
||||
if(signature is not null)
|
||||
sb.AppendLine().Append($"Receiver Signature: {signature}");
|
||||
|
||||
if (message is not null)
|
||||
sb.AppendLine().Append(message);
|
||||
|
||||
if (exception is null)
|
||||
logger.Log(LogLevel.Error, sb.ToString(), args);
|
||||
else
|
||||
logger.Log(LogLevel.Error, exception, sb.ToString(), args);
|
||||
}
|
||||
|
||||
public static string ToTitle(this (string? UUID, string? Signature) envelopeReceiverTuple)
|
||||
{
|
||||
return $"UUID is {envelopeReceiverTuple.UUID} and signature is {envelopeReceiverTuple.Signature}";
|
||||
}
|
||||
}
|
||||
}
|
||||
19
EnvelopeGenerator.Application/Key.cs
Normal file
19
EnvelopeGenerator.Application/Key.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace EnvelopeGenerator.Application
|
||||
{
|
||||
public static class Key
|
||||
{
|
||||
public static readonly string InnerServiceError = nameof(InnerServiceError);
|
||||
public static readonly string EnvelopeNotFound = nameof(EnvelopeNotFound);
|
||||
public static readonly string EnvelopeReceiverNotFound = nameof(EnvelopeReceiverNotFound);
|
||||
public static readonly string AccessCodeNull = nameof(AccessCodeNull);
|
||||
public static readonly string WrongAccessCode = nameof(WrongAccessCode);
|
||||
public static readonly string DataIntegrityIssue = nameof(DataIntegrityIssue);
|
||||
public static readonly string SecurityBreachOrDataIntegrity = nameof(SecurityBreachOrDataIntegrity);
|
||||
public static readonly string PossibleDataIntegrityIssue = nameof(PossibleDataIntegrityIssue);
|
||||
public static readonly string SecurityBreach = nameof(SecurityBreach);
|
||||
public static readonly string PossibleSecurityBreach = nameof(PossibleSecurityBreach);
|
||||
public static readonly string WrongEnvelopeReceiverId = nameof(WrongEnvelopeReceiverId);
|
||||
public static readonly string EnvelopeOrReceiverNonexists = nameof(EnvelopeOrReceiverNonexists);
|
||||
public static readonly string Default = nameof(Default);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using AutoMapper;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
namespace EnvelopeGenerator.Application.MappingProfiles
|
||||
{
|
||||
public class BasicDtoMappingProfile : Profile
|
||||
{
|
||||
public BasicDtoMappingProfile()
|
||||
{
|
||||
// Entity to DTO mappings
|
||||
CreateMap<Config, ConfigDto>();
|
||||
CreateMap<DocumentReceiverElement, DocumentReceiverElementDto>();
|
||||
CreateMap<DocumentStatus, DocumentStatusDto>();
|
||||
CreateMap<EmailTemplate, EmailTemplateDto>();
|
||||
CreateMap<Envelope, EnvelopeDto>();
|
||||
CreateMap<EnvelopeCertificate, EnvelopeCertificateDto>();
|
||||
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
|
||||
CreateMap<EnvelopeHistory, EnvelopeHistoryDto>();
|
||||
CreateMap<EnvelopeHistory, EnvelopeHistoryCreateDto>();
|
||||
CreateMap<EnvelopeReceiver, EnvelopeReceiverDto>();
|
||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
||||
CreateMap<Receiver, ReceiverReadDto>();
|
||||
CreateMap<Receiver, ReceiverCreateDto>();
|
||||
CreateMap<Receiver, ReceiverUpdateDto>();
|
||||
CreateMap<UserReceiver, UserReceiverDto>();
|
||||
|
||||
// DTO to Entity mappings
|
||||
CreateMap<ConfigDto, Config>();
|
||||
CreateMap<DocumentReceiverElementDto, DocumentReceiverElement>();
|
||||
CreateMap<DocumentStatusDto, DocumentStatus>();
|
||||
CreateMap<EmailTemplateDto, EmailTemplate>();
|
||||
CreateMap<EnvelopeDto, Envelope>();
|
||||
CreateMap<EnvelopeCertificateDto, EnvelopeCertificate>();
|
||||
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
|
||||
CreateMap<EnvelopeHistoryDto, EnvelopeHistory>();
|
||||
CreateMap<EnvelopeHistoryCreateDto, EnvelopeHistory>();
|
||||
CreateMap<EnvelopeReceiverDto, EnvelopeReceiver>();
|
||||
CreateMap<EnvelopeTypeDto, EnvelopeType>();
|
||||
CreateMap<ReceiverReadDto, Receiver>();
|
||||
CreateMap<ReceiverCreateDto, Receiver>();
|
||||
CreateMap<ReceiverUpdateDto, Receiver>();
|
||||
CreateMap<UserReceiverDto, UserReceiver>();
|
||||
}
|
||||
}
|
||||
}
|
||||
9
EnvelopeGenerator.Application/Resources/Resource.cs
Normal file
9
EnvelopeGenerator.Application/Resources/Resource.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace EnvelopeGenerator.Application.Resources
|
||||
{
|
||||
/// <summary>
|
||||
/// The place holder class for Resource.*.resx
|
||||
/// </summary>
|
||||
public class Resource
|
||||
{
|
||||
}
|
||||
}
|
||||
219
EnvelopeGenerator.Application/Resources/Resource.de-DE.resx
Normal file
219
EnvelopeGenerator.Application/Resources/Resource.de-DE.resx
Normal file
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="and" xml:space="preserve">
|
||||
<value>und</value>
|
||||
</data>
|
||||
<data name="Back" xml:space="preserve">
|
||||
<value>Zurück</value>
|
||||
</data>
|
||||
<data name="Complete" xml:space="preserve">
|
||||
<value>Abschließen</value>
|
||||
</data>
|
||||
<data name="Confirmation" xml:space="preserve">
|
||||
<value>Bestätigung</value>
|
||||
</data>
|
||||
<data name="de-DE" xml:space="preserve">
|
||||
<value>Deutch</value>
|
||||
</data>
|
||||
<data name="DocProtected" xml:space="preserve">
|
||||
<value>Dokument geschützt</value>
|
||||
</data>
|
||||
<data name="DocRejected" xml:space="preserve">
|
||||
<value>Dokument abgelehnt</value>
|
||||
</data>
|
||||
<data name="DocSigned" xml:space="preserve">
|
||||
<value>Dokument unterschrieben</value>
|
||||
</data>
|
||||
<data name="en-US" xml:space="preserve">
|
||||
<value>Englisch</value>
|
||||
</data>
|
||||
<data name="EnvelopeInfo1" xml:space="preserve">
|
||||
<value>Sie müssen {0} Vorgang unterzeichen. <span class="highlight highlight-envelope-info-1">Bitte prüfen Sie die Seite {1}</span>.</value>
|
||||
</data>
|
||||
<data name="EnvelopeInfo2" xml:space="preserve">
|
||||
<value>Erstellt am {0} von {1}. Sie können den Absender über <span class="highlight highlight-envelope-info-2"><a class="mail-link" href="mailto:{2}?subject={3}&body=Sehr%20geehrter%20{4}%20{5},%0A%0A%0A">{6}</a></span> kontaktieren.</value>
|
||||
</data>
|
||||
<data name="Finalize" xml:space="preserve">
|
||||
<value>Abschließen</value>
|
||||
</data>
|
||||
<data name="Hello" xml:space="preserve">
|
||||
<value>Hallo</value>
|
||||
</data>
|
||||
<data name="LocakedOpen" xml:space="preserve">
|
||||
<value>Öffnen</value>
|
||||
</data>
|
||||
<data name="LocationWarning" xml:space="preserve">
|
||||
<value>Bitte überprüfen Sie die Standortinformationen. Wenn sie falsch sind, korrigieren Sie diese bitte.</value>
|
||||
</data>
|
||||
<data name="LockedAccessCode" xml:space="preserve">
|
||||
<value>Zugriffscode</value>
|
||||
</data>
|
||||
<data name="LockedBody" xml:space="preserve">
|
||||
<value>Wir haben Ihnen gerade den Zugriffscode an die hinterlegte Email Adresse gesendet. Dies kann evtl. einige Minuten dauern.</value>
|
||||
</data>
|
||||
<data name="LockedFooterBody" xml:space="preserve">
|
||||
<value>Bitte überprüfen Sie Ihr Email Postfach inklusive Spam-Ordner. Sie können auch den Absender bitten, Ihnen den Code auf anderem Wege zukommen zu lassen.</value>
|
||||
</data>
|
||||
<data name="LockedFooterTitle" xml:space="preserve">
|
||||
<value>Sie haben keinen Zugriffscode erhalten?</value>
|
||||
</data>
|
||||
<data name="LockedTitle" xml:space="preserve">
|
||||
<value>Dokument erfordert einen Zugriffscode</value>
|
||||
</data>
|
||||
<data name="Reject" xml:space="preserve">
|
||||
<value>Ablehnen</value>
|
||||
</data>
|
||||
<data name="Rejection" xml:space="preserve">
|
||||
<value>Ablehnung</value>
|
||||
</data>
|
||||
<data name="RejectionInfo1" xml:space="preserve">
|
||||
<value>Dieser Unterzeichnungsvorgang wurde abgelehnt!</value>
|
||||
</data>
|
||||
<data name="RejectionInfo1_ext" xml:space="preserve">
|
||||
<value>Vorgang abgebrochen!</value>
|
||||
</data>
|
||||
<data name="RejectionInfo2" xml:space="preserve">
|
||||
<value>Sie können bei Bedarf mit {0}, <a href="mailto:{1}?subject={2}&body=Sehr geehrte(r)%20{0},%0A%0A%0A">{1}</a> Kontakt aufnehmen.</value>
|
||||
</data>
|
||||
<data name="RejectionInfo2_ext" xml:space="preserve">
|
||||
<value>Das Vorgang wurde von einer der beteiligten Parteien abgelehnt. Sie können bei Bedarf mit {0}, <a href="mailto:{1}?subject={2}&body=Sehr geehrte(r)%20{0},%0A%0A%0A">{1}</a> Kontakt aufnehmen.</value>
|
||||
</data>
|
||||
<data name="RejectionReasonQ" xml:space="preserve">
|
||||
<value>Bitte geben Sie einen Grund an:</value>
|
||||
</data>
|
||||
<data name="SigAgree" xml:space="preserve">
|
||||
<value>Durch Klick auf Abschließen stimme ich zu, dass die abgebildete und übermittelte Signatur als elektronische Darstellung meiner Signatur in den Fällen gelten, in denen ich sie auf Dokumenten, einschließlich rechtsgültiger Verträge verwende.</value>
|
||||
</data>
|
||||
<data name="SignDoc" xml:space="preserve">
|
||||
<value>Dokument unterschreiben</value>
|
||||
</data>
|
||||
<data name="SigningProcessTitle" xml:space="preserve">
|
||||
<value>Titel des Unterzeichnungs-Vorgangs</value>
|
||||
</data>
|
||||
<data name="UnexpectedError" xml:space="preserve">
|
||||
<value>Ein unerwarteter Fehler ist aufgetreten.</value>
|
||||
</data>
|
||||
<data name="WelcomeToTheESignPortal" xml:space="preserve">
|
||||
<value>Herzlich willkommen im eSign-Portal</value>
|
||||
</data>
|
||||
<data name="WrongAccessCode" xml:space="preserve">
|
||||
<value>Ungültiger Zugangscode.</value>
|
||||
</data>
|
||||
</root>
|
||||
219
EnvelopeGenerator.Application/Resources/Resource.en-US.resx
Normal file
219
EnvelopeGenerator.Application/Resources/Resource.en-US.resx
Normal file
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="and" xml:space="preserve">
|
||||
<value>and</value>
|
||||
</data>
|
||||
<data name="Back" xml:space="preserve">
|
||||
<value>Back</value>
|
||||
</data>
|
||||
<data name="Complete" xml:space="preserve">
|
||||
<value>Complete</value>
|
||||
</data>
|
||||
<data name="Confirmation" xml:space="preserve">
|
||||
<value>Confirmation</value>
|
||||
</data>
|
||||
<data name="de-DE" xml:space="preserve">
|
||||
<value>German</value>
|
||||
</data>
|
||||
<data name="DocProtected" xml:space="preserve">
|
||||
<value>Document protected</value>
|
||||
</data>
|
||||
<data name="DocRejected" xml:space="preserve">
|
||||
<value>Document rejected</value>
|
||||
</data>
|
||||
<data name="DocSigned" xml:space="preserve">
|
||||
<value>Document signed</value>
|
||||
</data>
|
||||
<data name="en-US" xml:space="preserve">
|
||||
<value>English</value>
|
||||
</data>
|
||||
<data name="EnvelopeInfo1" xml:space="preserve">
|
||||
<value>You have to sign {0} process. <span class="highlight highlight-envelope-info-1">Please check page {1}</span>.</value>
|
||||
</data>
|
||||
<data name="EnvelopeInfo2" xml:space="preserve">
|
||||
<value>Created on {0} by {1}. You can contact the sender via <span class="highlight highlight-envelope-info-2"><a class="mail-link" href="mailto:{2}?subject={3}&body=Dear%20{4}%20{5},%0A%0A%0A">{6}</a></span>.</value>
|
||||
</data>
|
||||
<data name="Finalize" xml:space="preserve">
|
||||
<value>Finalize</value>
|
||||
</data>
|
||||
<data name="Hello" xml:space="preserve">
|
||||
<value>Hello</value>
|
||||
</data>
|
||||
<data name="LocakedOpen" xml:space="preserve">
|
||||
<value>Open</value>
|
||||
</data>
|
||||
<data name="LocationWarning" xml:space="preserve">
|
||||
<value>Please review the location information. If it is incorrect, kindly make the necessary corrections.</value>
|
||||
</data>
|
||||
<data name="LockedAccessCode" xml:space="preserve">
|
||||
<value>Access Code</value>
|
||||
</data>
|
||||
<data name="LockedBody" xml:space="preserve">
|
||||
<value>We have just sent you the access code to the email address you provided. This may take a few minutes.</value>
|
||||
</data>
|
||||
<data name="LockedFooterBody" xml:space="preserve">
|
||||
<value>Please check your email inbox including your spam folder. Furthermore, you can also ask the sender to send the code by other means.</value>
|
||||
</data>
|
||||
<data name="LockedFooterTitle" xml:space="preserve">
|
||||
<value>You have not received an access code?</value>
|
||||
</data>
|
||||
<data name="LockedTitle" xml:space="preserve">
|
||||
<value>Document requires an access code</value>
|
||||
</data>
|
||||
<data name="Reject" xml:space="preserve">
|
||||
<value>Reject</value>
|
||||
</data>
|
||||
<data name="Rejection" xml:space="preserve">
|
||||
<value>Rejection</value>
|
||||
</data>
|
||||
<data name="RejectionInfo1" xml:space="preserve">
|
||||
<value>This signing process was rejected!</value>
|
||||
</data>
|
||||
<data name="RejectionInfo1_ext" xml:space="preserve">
|
||||
<value>Process canceled!</value>
|
||||
</data>
|
||||
<data name="RejectionInfo2" xml:space="preserve">
|
||||
<value>You can contact {0}, <a href="mailto:{1}?subject={2}&body=Dear%20{0},%0A%0A%0A">{1}</a> if required.</value>
|
||||
</data>
|
||||
<data name="RejectionInfo2_ext" xml:space="preserve">
|
||||
<value>The process has been rejected by one of the parties involved. You can contact {0}, <a href="mailto:{1}?subject={2}&body=Dear%20{0},%0A%0A%0A">{1}</a> if required.</value>
|
||||
</data>
|
||||
<data name="RejectionReasonQ" xml:space="preserve">
|
||||
<value>Please give a reason:</value>
|
||||
</data>
|
||||
<data name="SigAgree" xml:space="preserve">
|
||||
<value>By clicking on Finalize, I agree that the signature shown and submitted is an electronic representation of my signature in cases where I use it on documents, including legally binding contracts.</value>
|
||||
</data>
|
||||
<data name="SignDoc" xml:space="preserve">
|
||||
<value>Sign document</value>
|
||||
</data>
|
||||
<data name="SigningProcessTitle" xml:space="preserve">
|
||||
<value>Title of the signing process</value>
|
||||
</data>
|
||||
<data name="UnexpectedError" xml:space="preserve">
|
||||
<value>An unexpected error has occurred.</value>
|
||||
</data>
|
||||
<data name="WelcomeToTheESignPortal" xml:space="preserve">
|
||||
<value>Welcome to the eSign portal</value>
|
||||
</data>
|
||||
<data name="WrongAccessCode" xml:space="preserve">
|
||||
<value>Invalid access code.</value>
|
||||
</data>
|
||||
</root>
|
||||
62
EnvelopeGenerator.Application/Services/ConfigService.cs
Normal file
62
EnvelopeGenerator.Application/Services/ConfigService.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class ConfigService : BasicCRUDService<IConfigRepository, ConfigDto, Config, int>, IConfigService
|
||||
{
|
||||
private static readonly Guid DefaultConfigCacheId = Guid.NewGuid();
|
||||
|
||||
private readonly IMemoryCache _cache;
|
||||
private readonly ILogger<ConfigService> _logger;
|
||||
public ConfigService(IConfigRepository repository, IMapper mapper, IMemoryCache memoryCache, ILogger<ConfigService> logger) : base(repository, mapper)
|
||||
{
|
||||
_cache = memoryCache;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<DataResult<ConfigDto>> ReadFirstAsync()
|
||||
{
|
||||
var config = await _repository.ReadFirstAsync();
|
||||
return config is null
|
||||
? Result.Fail<ConfigDto>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, "There is no configuration in DB.")
|
||||
: Result.Success(_mapper.MapOrThrow<ConfigDto>(config));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads the default configuration asynchronously.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The configuration is cached in memory upon the first retrieval. If the configuration is updated,
|
||||
/// the application needs to be restarted for the changes to take effect as the memory cache will not be updated automatically.
|
||||
/// </remarks>
|
||||
/// <returns>
|
||||
/// A task that represents the asynchronous read operation. The task result contains the default configuration as a <see cref="ConfigDto"/>.
|
||||
/// </returns>
|
||||
/// <exception cref="InvalidOperationException">
|
||||
/// Thrown when the default configuration cannot be found.
|
||||
/// </exception>
|
||||
public async Task<ConfigDto> ReadDefaultAsync()
|
||||
{
|
||||
var config = await _cache.GetOrCreateAsync(DefaultConfigCacheId, _ => ReadFirstAsync().ThenAsync(
|
||||
Success: config => config,
|
||||
Fail: (mssg, ntc) =>
|
||||
{
|
||||
_logger.LogNotice(ntc);
|
||||
throw new InvalidOperationException("Default configuration cannot find.");
|
||||
}));
|
||||
|
||||
return config!;
|
||||
}
|
||||
|
||||
public async Task<string> ReadDefaultSignatureHost() => (await ReadDefaultAsync()).SignatureHost;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocumentReceiverElementDto, DocumentReceiverElement, int>, IDocumentReceiverElementService
|
||||
{
|
||||
public DocumentReceiverElementService(IDocumentReceiverElementRepository repository, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class DocumentStatusService : BasicCRUDService<IDocumentStatusRepository, DocumentStatusDto, DocumentStatus, int>, IDocumentStatusService
|
||||
{
|
||||
public DocumentStatusService(IDocumentStatusRepository repository, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EmailTemplateService : BasicCRUDService<IEmailTemplateRepository, EmailTemplateDto, EmailTemplate, int>, IEmailTemplateService
|
||||
{
|
||||
public EmailTemplateService(IEmailTemplateRepository repository, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type)
|
||||
{
|
||||
var temp = await _repository.ReadByNameAsync(type);
|
||||
return temp is null
|
||||
? Result.Fail<EmailTemplateDto>()
|
||||
.Message(Key.InnerServiceError)
|
||||
.Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"EmailTemplateType '{type}' is not found in DB. Please, define required e-mail template.")
|
||||
: Result.Success(_mapper.MapOrThrow<EmailTemplateDto>(temp));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeCertificateService : BasicCRUDService<IEnvelopeCertificateRepository, EnvelopeCertificateDto, EnvelopeCertificate, int>, IEnvelopeCertificateService
|
||||
{
|
||||
public EnvelopeCertificateService(IEnvelopeCertificateRepository repository, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
|
||||
{
|
||||
public EnvelopeDocumentService(IEnvelopeDocumentRepository repository, IMapper mapper) : base(repository, mapper)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
||||
{
|
||||
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await _repository.CountAsync(envelopeId: envelopeId, userReference: userReference, status: status);
|
||||
|
||||
public async Task<bool> HasStatus(EnvelopeStatus status, int envelopeId, string userReference) => await _repository.CountAsync(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
status: (int) status) > 0;
|
||||
|
||||
public async Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference) => await _repository.CountAsync(
|
||||
envelopeId: envelopeId,
|
||||
userReference:userReference,
|
||||
status: (int) EnvelopeStatus.AccessCodeRequested) > 0;
|
||||
|
||||
public async Task<bool> IsSigned(int envelopeId, string userReference) => await _repository.CountAsync(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
status: (int) EnvelopeStatus.DocumentSigned) > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the specified envelope has been rejected.
|
||||
/// <para><b>Note:</b> <i>If any document within the envelope is rejected, the entire envelope will be considered rejected.</i></para>
|
||||
/// </summary>
|
||||
/// <param name="envelopeId">The ID of the envelope to check.</param>
|
||||
/// <param name="userReference">Optional user reference associated with the envelope.</param>
|
||||
/// <returns>A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the envelope is rejected.</returns>
|
||||
public async Task<bool> IsRejected(int envelopeId, string? userReference = null)
|
||||
{
|
||||
return await _repository.CountAsync(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
status: (int)EnvelopeStatus.DocumentRejected) > 0;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
||||
{
|
||||
var histDTOs = _mapper.MapOrThrow<IEnumerable<EnvelopeHistoryDto>>(
|
||||
await _repository.ReadAsync(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
status: status,
|
||||
withSender: withSender,
|
||||
withReceiver: withReceiver));
|
||||
return referenceType is null ? histDTOs : histDTOs.Where(h => h.ReferenceType == referenceType);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
|
||||
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
|
||||
|
||||
//TODO: use IQueryable in repository to incerease the performance
|
||||
public async Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId)
|
||||
{
|
||||
var envelopes = await ReadRejectedAsync(envelopeId);
|
||||
return envelopes is null
|
||||
? Enumerable.Empty<ReceiverReadDto>()
|
||||
: envelopes
|
||||
.Where(eh => eh?.Receiver != null)
|
||||
.Select(eh => eh.Receiver!);
|
||||
}
|
||||
|
||||
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
||||
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment))
|
||||
.ThenAsync(
|
||||
Success: id => Result.Success(id),
|
||||
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
|
||||
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
|
||||
using DigitalData.UserManager.Application;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Common;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeMailService : EmailOutService, IEnvelopeMailService
|
||||
{
|
||||
private readonly IEmailTemplateService _tempService;
|
||||
private readonly IEnvelopeReceiverService _envRcvService;
|
||||
private readonly DispatcherConfig _dConfig;
|
||||
private readonly IConfigService _configService;
|
||||
|
||||
public EnvelopeMailService(IEmailOutRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherConfig> dispatcherConfigOptions, IConfigService configService) : base(repository, mapper)
|
||||
{
|
||||
_tempService = tempService;
|
||||
_envRcvService = envelopeReceiverService;
|
||||
_dConfig = dispatcherConfigOptions.Value;
|
||||
_configService = configService;
|
||||
}
|
||||
|
||||
//TODO: create ioptions and implement TemplatePlaceHolderAttribute instead of this method
|
||||
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null)
|
||||
{
|
||||
Dictionary<string, string> placeholders = new() {
|
||||
{ "[NAME_PORTAL]", "signFlow" },
|
||||
{ "[SIGNATURE_TYPE]" , "signieren"},
|
||||
{ "[REASON]", string.Empty } };
|
||||
|
||||
if (accessCode is not null)
|
||||
placeholders["[DOCUMENT_ACCESS_CODE]"] = accessCode;
|
||||
|
||||
if(envelopeReceiverDto is not null && envelopeReceiverDto.Envelope is not null && envelopeReceiverDto.Receiver is not null)
|
||||
{
|
||||
var erId = (envelopeReceiverDto.Envelope.Uuid, envelopeReceiverDto.Receiver.Signature).EncodeEnvelopeReceiverId();
|
||||
var sigHost = await _configService.ReadDefaultSignatureHost();
|
||||
var linkToDoc = $"{sigHost}/envelope/{erId}";
|
||||
placeholders["[LINK_TO_DOCUMENT]"] = linkToDoc;
|
||||
placeholders["[LINK_TO_DOCUMENT_TEXT]"] = linkToDoc[..Math.Min(40, linkToDoc.Length)];
|
||||
}
|
||||
|
||||
return placeholders;
|
||||
}
|
||||
|
||||
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: Constants.EmailTemplateType.DocumentAccessCodeReceived);
|
||||
|
||||
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, Constants.EmailTemplateType tempType)
|
||||
{
|
||||
var tempSerResult = await _tempService.ReadByNameAsync(tempType);
|
||||
if (tempSerResult.IsFailed)
|
||||
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{tempType}' template cannot found.");
|
||||
var temp = tempSerResult.Data;
|
||||
|
||||
var mail = new EmailOutCreateDto()
|
||||
{
|
||||
EmailAddress = dto.Receiver!.EmailAddress,
|
||||
EmailSubj = temp.Subject,
|
||||
EmailBody = temp.Body,
|
||||
//email_type = envelope_status,
|
||||
//message = envelope_message,
|
||||
ReferenceId = dto.EnvelopeId, //REFERENCE_ID = ENVELOPE_ID
|
||||
ReferenceString = dto!.Envelope!.Uuid, //REFERENCE_STRING = ENVELOPE_UUID
|
||||
//receiver_name = receiver.name,
|
||||
//receiver_access_code = receiver.access_code,
|
||||
//sender_adress = envelope.user.email,
|
||||
//sender_name = envelope.user.full_name,
|
||||
//envelope_title = envelope.title,
|
||||
ReminderTypeId = _dConfig.ReminderTypeId,
|
||||
SendingProfile = _dConfig.SendingProfile,
|
||||
EntityId = null,
|
||||
WfId = (int) EnvelopeStatus.MessageAccessCodeSent,
|
||||
WfReference = null,
|
||||
AddedWho = _dConfig.AddedWho,
|
||||
EmailAttmt1 = _dConfig.EmailAttmt1
|
||||
};
|
||||
|
||||
//get acccess code
|
||||
var acResult = await _envRcvService.ReadAccessCodeByIdAsync(envelopeId: dto.EnvelopeId, receiverId: dto.ReceiverId);
|
||||
if (acResult.IsFailed)
|
||||
return acResult.ToFail<int>().Notice(LogLevel.Error, "Therefore, access code cannot be sent");
|
||||
var accessCode = acResult.Data;
|
||||
|
||||
var placeholders = await CreatePlaceholders(accessCode: accessCode, envelopeReceiverDto: dto);
|
||||
|
||||
return await CreateWithTemplateAsync(createDto: mail,placeholders: placeholders,
|
||||
dto, dto.Envelope.User!, dto.Envelope);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, object>, IEnvelopeReceiverService
|
||||
{
|
||||
private readonly IStringLocalizer<Resource> _localizer;
|
||||
|
||||
public EnvelopeReceiverService(IEnvelopeReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
_localizer = localizer;
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true)
|
||||
{
|
||||
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||
return Result.Success(_mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false)
|
||||
{
|
||||
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||
return Result.Success(_mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
|
||||
}
|
||||
|
||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true)
|
||||
{
|
||||
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||
if (env_rcv is null)
|
||||
return Result.Fail<EnvelopeReceiverDto>()
|
||||
.Message(Key.EnvelopeReceiverNotFound);
|
||||
|
||||
return Result.Success(_mapper.MapOrThrow<EnvelopeReceiverDto>(env_rcv));
|
||||
}
|
||||
|
||||
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true)
|
||||
{
|
||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||
|
||||
if (uuid is null || signature is null)
|
||||
return Result.Fail<EnvelopeReceiverDto>()
|
||||
.Message(_localizer[Key.WrongEnvelopeReceiverId])
|
||||
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
|
||||
.Notice(LogLevel.Warning, EnvelopeFlag.WrongEnvelopeReceiverId)
|
||||
.Notice(LogLevel.Warning, Flag.PossibleSecurityBreach);
|
||||
|
||||
return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
|
||||
}
|
||||
|
||||
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode)
|
||||
{
|
||||
var er = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature);
|
||||
|
||||
if (er is null)
|
||||
return Result.Fail<bool>()
|
||||
.Message(_localizer[Key.EnvelopeOrReceiverNonexists])
|
||||
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
|
||||
.Notice(LogLevel.Warning, EnvelopeFlag.EnvelopeOrReceiverNonexists)
|
||||
.Notice(LogLevel.Warning, Flag.PossibleDataIntegrityIssue);
|
||||
|
||||
var actualAccessCode = er.AccessCode;
|
||||
|
||||
if (actualAccessCode is null)
|
||||
return Result.Fail<bool>()
|
||||
.Message(_localizer[Key.AccessCodeNull])
|
||||
.Notice(LogLevel.Critical, (uuid, signature).ToTitle())
|
||||
.Notice(LogLevel.Critical, EnvelopeFlag.AccessCodeNull)
|
||||
.Notice(LogLevel.Critical, Flag.DataIntegrityIssue);
|
||||
|
||||
else if (accessCode != actualAccessCode)
|
||||
return Result.Success(false).Message(_localizer[Key.WrongAccessCode]);
|
||||
else
|
||||
return Result.Success(true);
|
||||
}
|
||||
|
||||
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode)
|
||||
{
|
||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||
|
||||
if (uuid is null || signature is null)
|
||||
return Result.Fail<bool>()
|
||||
.Message(Key.WrongEnvelopeReceiverId)
|
||||
.Notice(LogLevel.Critical, EnvelopeFlag.WrongEnvelopeReceiverId)
|
||||
.Notice(LogLevel.Critical, Flag.SecurityBreach)
|
||||
.Notice(LogLevel.Critical, "Attempt to verify access code detected. Such actions are generally not initiated by well-intentioned users. Potential security breach suspected. Immediate investigation required.");
|
||||
|
||||
return await VerifyAccessCodeAsync(uuid: uuid, signature: signature, accessCode: accessCode);
|
||||
}
|
||||
|
||||
public async Task<DataResult<bool>> IsExisting(string envelopeReceiverId)
|
||||
{
|
||||
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||
|
||||
if (uuid is null || signature is null)
|
||||
return Result.Fail<bool>().Notice(LogLevel.Warning, EnvelopeFlag.NonDecodableEnvelopeReceiverId, "In IsExisting(string envelopeReceiverId)");
|
||||
|
||||
int count = await _repository.CountAsync(uuid:uuid, signature:signature);
|
||||
return Result.Success(count > 0);
|
||||
}
|
||||
|
||||
public async Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId)
|
||||
{
|
||||
var code = await _repository.ReadAccessCodeByIdAsync(envelopeId: envelopeId, receiverId: receiverId);
|
||||
return code is null ?
|
||||
Result.Fail<string>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"Access code is null. Envelope ID is {envelopeId} and receiver ID {receiverId}")
|
||||
: Result.Success(code);
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
|
||||
{
|
||||
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
|
||||
var dto_list = _mapper.MapOrThrow<IEnumerable<EnvelopeReceiverDto>>(er_list);
|
||||
return Result.Success(dto_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
41
EnvelopeGenerator.Application/Services/EnvelopeService.cs
Normal file
41
EnvelopeGenerator.Application/Services/EnvelopeService.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper, ILogger<EnvelopeService> logger)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
|
||||
{
|
||||
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
|
||||
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(envelopes);
|
||||
return Result.Success(readDto);
|
||||
}
|
||||
|
||||
public async Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
|
||||
{
|
||||
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement, withUser:withUser, withAll:withAll);
|
||||
|
||||
if (envelope is null)
|
||||
return Result.Fail<EnvelopeDto>();
|
||||
|
||||
var readDto = _mapper.MapOrThrow<EnvelopeDto>(envelope);
|
||||
return Result.Success(readDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
|
||||
{
|
||||
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
40
EnvelopeGenerator.Application/Services/ReceiverService.cs
Normal file
40
EnvelopeGenerator.Application/Services/ReceiverService.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using EnvelopeGenerator.Application.DTOs.Receiver;
|
||||
using DigitalData.Core.DTO;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>, IReceiverService
|
||||
{
|
||||
public ReceiverService(IReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null)
|
||||
{
|
||||
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
||||
|
||||
if (rcv is null)
|
||||
return Result.Fail<ReceiverReadDto>();
|
||||
|
||||
return Result.Success(_mapper.MapOrThrow<ReceiverReadDto>(rcv));
|
||||
}
|
||||
|
||||
public async Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null)
|
||||
{
|
||||
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
|
||||
|
||||
if (rcv is null)
|
||||
return Result.Fail();
|
||||
|
||||
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Application;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Services
|
||||
{
|
||||
public class UserReceiverService : BasicCRUDService<IUserReceiverRepository, UserReceiverDto, UserReceiver, int>, IUserReceiverService
|
||||
{
|
||||
public UserReceiverService(IUserReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
||||
: base(repository, mapper)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,31 @@
|
||||
EnvelopeCreated = 1001
|
||||
EnvelopeSaved = 1002
|
||||
EnvelopeQueued = 1003
|
||||
EnvelopeSent = 1004
|
||||
EnvelopeSent = 1004 ' Nicht verwendet
|
||||
EnvelopePartlySigned = 1005
|
||||
EnvelopeCompletelySigned = 1006
|
||||
EnvelopeArchived = 1007
|
||||
EnvelopeTransmittedDMS = 1008
|
||||
EnvelopeReportCreated = 1007
|
||||
EnvelopeArchived = 1008
|
||||
EnvelopeDeleted = 1009
|
||||
DocumentOpened = 2001
|
||||
DocumentSigned = 2002
|
||||
SignatureConfirmed = 2003
|
||||
AccessCodeRequested = 2001
|
||||
AccessCodeCorrect = 2002
|
||||
AccessCodeIncorrect = 2003
|
||||
DocumentOpened = 2004
|
||||
DocumentSigned = 2005
|
||||
SignatureConfirmed = 2006
|
||||
DocumentRejected = 2007
|
||||
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
|
||||
MessageAccessCodeSent = 3002
|
||||
MessageConfirmationSent = 3003
|
||||
MessageDeletionSent = 3004
|
||||
MessageCompletionSent = 3005
|
||||
End Enum
|
||||
|
||||
Public Enum ReferenceType
|
||||
Receiver
|
||||
Sender
|
||||
System
|
||||
Unknown
|
||||
End Enum
|
||||
|
||||
Public Enum ElementStatus
|
||||
@@ -54,13 +70,42 @@
|
||||
ReceiverColor9 = 9
|
||||
ReceiverColor10 = 10
|
||||
End Enum
|
||||
#End Region
|
||||
|
||||
Public Enum CertificationType
|
||||
ElectronicSignature = 1
|
||||
QualifiedSignature = 2
|
||||
End Enum
|
||||
|
||||
Public Enum FinalEmailType
|
||||
No = 0
|
||||
Yes = 1
|
||||
YesWithAttachment = 2
|
||||
End Enum
|
||||
|
||||
Public Enum PageOrientation
|
||||
Portrait = 0
|
||||
Landscape = 1
|
||||
End Enum
|
||||
|
||||
Public Enum EmailTemplateType
|
||||
DocumentReceived
|
||||
DocumentSigned
|
||||
DocumentDeleted
|
||||
DocumentCompleted
|
||||
DocumentAccessCodeReceived
|
||||
End Enum
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Constants"
|
||||
|
||||
Public Const DATABASE = "DATABASE"
|
||||
Public Const LOGCONFIG = "LOGCONFIG"
|
||||
Public Const GDPICTURE = "GDPICTURE"
|
||||
Public Const IGNORED_LABELS = "IgnoredLabels"
|
||||
|
||||
Public Const GREEN_300 = "#bbf7d0"
|
||||
Public Const RED_300 = "#fecaca"
|
||||
Public Const ORANGE_300 = "#fed7aa"
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
Public Class DbConfig
|
||||
Public Property ExternalProgramName As String = "Sign Flow"
|
||||
Public Property DocumentPathOrigin As String = ""
|
||||
Public Property DocumentPath As String = ""
|
||||
Public Property ExportPath As String = ""
|
||||
Public Property DocumentPath_DMZ As String = ""
|
||||
Public Property ExportPath_DMZ As String = ""
|
||||
Public Property DOCUMENT_PATH_MOVE_AFTSEND As String = ""
|
||||
Public Property FINISHED_PATH_EX_DMZ As String = ""
|
||||
Public Property EML_PATH_EX_DMZ As String = ""
|
||||
Public Property SendingProfile As Integer = 0
|
||||
Public Property SignatureHost As String = ""
|
||||
Public Property NetUse_necessary As Boolean = False
|
||||
Public Property NetUse_Finish As Boolean = False
|
||||
End Class
|
||||
|
||||
@@ -1,38 +1,64 @@
|
||||
|
||||
Public Class EmailData
|
||||
Public Property EmailAdress As String
|
||||
Public Property EmailSubject As String
|
||||
Public Property EmailBody As String
|
||||
Public Property ReferenceID As Integer
|
||||
Public Property ReferenceString As String
|
||||
Public Property EmailAdress As String = ""
|
||||
Public Property EmailSubject As String = ""
|
||||
Public Property EmailBody As String = ""
|
||||
Public Property EmailType As Constants.EnvelopeStatus = Constants.EnvelopeStatus.Invalid
|
||||
Public Property ReferenceID As Integer = 0
|
||||
Public Property ReferenceString As String = ""
|
||||
|
||||
Public Property ReceiverAccessCode As String = ""
|
||||
Public Property ReceiverName As String = ""
|
||||
Public Property SenderName As String = ""
|
||||
Public Property SenderAdress As String = ""
|
||||
|
||||
Public Property ReceiverName As String
|
||||
Public Property SenderName As String
|
||||
Public Property SenderAdress As String
|
||||
Public Property SignatureLink As String
|
||||
Public Property Message As String
|
||||
Public Property SignatureLink As String = ""
|
||||
Public Property Message As String = ""
|
||||
Public Property EnvelopeTitle As String = ""
|
||||
|
||||
Public ReadOnly Property EmailSubjectTranslated
|
||||
Get
|
||||
Return String.Format(My.Resources.Email.Sie_haben_ein_Dokument_zur_Unterschrift_erhalten___0_, EmailSubject)
|
||||
End Get
|
||||
End Property
|
||||
Public Property EmailAttachment As String = ""
|
||||
Public Property ATT1_RELATED_ID As Long
|
||||
Public Property ATT1_REL_TYPE As String = ""
|
||||
|
||||
Public Sub New(pEnvelope As Envelope, pReceiver As EnvelopeReceiver)
|
||||
''' <summary>
|
||||
''' Constructor for sending email to receiver
|
||||
''' </summary>
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pReceiver"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pStatus As Constants.EnvelopeStatus)
|
||||
EmailAdress = pReceiver.Email
|
||||
EmailSubject = pEnvelope.Subject
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
|
||||
Message = pEnvelope.Message
|
||||
ReferenceID = pEnvelope.Id
|
||||
ReferenceString = pEnvelope.Uuid
|
||||
ReceiverName = pReceiver.Name
|
||||
ReceiverAccessCode = pReceiver.AccessCode
|
||||
SenderAdress = pEnvelope.User.Email
|
||||
SenderName = pEnvelope.User.FullName
|
||||
EnvelopeTitle = pEnvelope.Title
|
||||
End Sub
|
||||
|
||||
Public Sub New()
|
||||
''' <summary>
|
||||
''' Constructor for sending email to creator
|
||||
''' </summary>
|
||||
''' <param name="pEnvelope"></param>
|
||||
''' <param name="pStatus"></param>
|
||||
Public Sub New(pEnvelope As Envelope, pStatus As Constants.EnvelopeStatus)
|
||||
EmailAdress = pEnvelope.User.Email
|
||||
EmailSubject = String.Empty
|
||||
EmailType = pStatus
|
||||
|
||||
Message = pEnvelope.Message
|
||||
ReferenceID = pEnvelope.Id
|
||||
ReferenceString = pEnvelope.Uuid
|
||||
ReceiverName = pEnvelope.User.FullName
|
||||
ReceiverAccessCode = String.Empty
|
||||
SenderAdress = pEnvelope.User.Email
|
||||
SenderName = pEnvelope.User.FullName
|
||||
EnvelopeTitle = pEnvelope.Title
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,105 +1,8 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Public Class EmailTemplate
|
||||
|
||||
Public Class EmailTemplate
|
||||
Private _DocumentReceivedBodyTemplate As List(Of String)
|
||||
Private _DocumentSignedBodyTemplate As List(Of String)
|
||||
Private _DocumentCompletedBodyTemplate As List(Of String)
|
||||
Private _DocumentDeletedBodyTemplate As List(Of String)
|
||||
Public Property Id As Integer
|
||||
Public Property Name As String
|
||||
Public Property Body As String
|
||||
Public Property Subject As String
|
||||
|
||||
Private _replaceDictionary As Dictionary(Of String, String)
|
||||
|
||||
Public Sub New()
|
||||
InitTemplates()
|
||||
End Sub
|
||||
|
||||
Private Sub InitTemplates()
|
||||
_DocumentReceivedBodyTemplate = New List(Of String) From {
|
||||
"Guten Tag, <NAME_RECEIVER>,",
|
||||
"",
|
||||
"<NAME_SENDER> hat Ihnen ein Dokument zum <SIGNATURE_TYPE> gesendet.",
|
||||
"",
|
||||
"Über den folgenden Link können Sie das Dokument einsehen: <a href=""<LINK_TO_DOCUMENT>""><LINK_TO_DOCUMENT_TEXT></a>",
|
||||
"",
|
||||
"<MESSAGE>",
|
||||
"",
|
||||
"Mit freundlichen Grüßen",
|
||||
"<NAME_SENDER>"
|
||||
}
|
||||
|
||||
_DocumentSignedBodyTemplate = New List(Of String) From {
|
||||
"Guten Tag, <NAME_RECEIVER>",
|
||||
"",
|
||||
"Ihre Unterschrift auf dem Dokument <DOCUMENT_TITLE> wurde gespeichert.",
|
||||
"",
|
||||
"Mit freundlichen Grüßen",
|
||||
"<NAME_SENDER>"
|
||||
}
|
||||
|
||||
_DocumentDeletedBodyTemplate = New List(Of String) From {
|
||||
"Guten Tag, <NAME_RECEIVER>",
|
||||
"",
|
||||
"Der User <NAME_SENDER> hat den Umschlag <DOCUMENT_TITLE> gelöscht.",
|
||||
"",
|
||||
"Mit freundlichen Grüßen",
|
||||
"<NAME_SENDER>"
|
||||
}
|
||||
|
||||
_DocumentCompletedBodyTemplate = New List(Of String) From {
|
||||
"Guten Tag, <NAME_RECEIVER>",
|
||||
"",
|
||||
"Das Dokument <DOCUMENT_TITLE> wurde von allen Beteiligten unterschrieben.",
|
||||
"",
|
||||
"Mit freundlichen Grüßen",
|
||||
"<NAME_SENDER>"
|
||||
}
|
||||
End Sub
|
||||
|
||||
Private Sub InitDictionary(pEmailData As EmailData)
|
||||
_replaceDictionary = New Dictionary(Of String, String) From {
|
||||
{"<NAME_RECEIVER>", pEmailData.ReceiverName},
|
||||
{"<NAME_SENDER>", pEmailData.SenderName},
|
||||
{"<SIGNATURE_TYPE>", "signieren"},
|
||||
{"<LINK_TO_DOCUMENT>", pEmailData.SignatureLink},
|
||||
{"<LINK_TO_DOCUMENT_TEXT>", $"{pEmailData.SignatureLink.Truncate(40)}.."},
|
||||
{"<DOCUMENT_TITLE>", pEmailData.EmailSubject},
|
||||
{"<MESSAGE>", pEmailData.Message}
|
||||
}
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentReceivedEmailBody(pEmailData As EmailData)
|
||||
FillEmailBody(pEmailData, _DocumentReceivedBodyTemplate)
|
||||
End Sub
|
||||
|
||||
Public Sub FillEnvelopeDeletedEmailBody(pEmailData As EmailData)
|
||||
FillEmailBody(pEmailData, _DocumentDeletedBodyTemplate)
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentSignedEmailBody(pEmailData As EmailData)
|
||||
FillEmailBody(pEmailData, _DocumentSignedBodyTemplate)
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentCompletedEmailBody(pEmailData As EmailData)
|
||||
FillEmailBody(pEmailData, _DocumentCompletedBodyTemplate)
|
||||
End Sub
|
||||
|
||||
Public Sub FillEmailBody(pEmailData As EmailData, pTemplate As List(Of String))
|
||||
|
||||
InitDictionary(pEmailData)
|
||||
|
||||
Dim resultBody As String = ""
|
||||
|
||||
For Each lineItem As String In pTemplate
|
||||
Dim oLineValue As String = lineItem
|
||||
For Each dictItem As KeyValuePair(Of String, String) In _replaceDictionary
|
||||
If oLineValue.Contains(dictItem.Key) Then
|
||||
oLineValue = oLineValue.Replace(dictItem.Key, dictItem.Value)
|
||||
|
||||
End If
|
||||
Next
|
||||
resultBody += oLineValue + "<br/>"
|
||||
Next
|
||||
|
||||
pEmailData.EmailBody = resultBody
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -2,11 +2,26 @@
|
||||
Public Property Id As Integer = 0
|
||||
Public Property UserId As Integer
|
||||
Public Property Title As String = ""
|
||||
Public Property ContractType As Constants.ContractType
|
||||
Public Property Status As Constants.EnvelopeStatus
|
||||
Public Property EnvelopeTypeId As Integer
|
||||
Public Property ContractType As Integer
|
||||
Public Property Status As Constants.EnvelopeStatus = Constants.EnvelopeStatus.EnvelopeCreated
|
||||
Public Property Uuid As String = Guid.NewGuid.ToString()
|
||||
Public Property UseAccessCode As Boolean = False
|
||||
Public Property Language As String = "de-DE"
|
||||
Public Property CertificationType As Constants.CertificationType = Constants.CertificationType.ElectronicSignature
|
||||
|
||||
Public Property SendReminderEmails As Boolean = False
|
||||
Public Property FirstReminderDays As Integer = 0
|
||||
Public Property ReminderIntervalDays As Integer = 0
|
||||
|
||||
Public Property ExpiresWhen As Date
|
||||
Public Property ExpiresWarningWhen As Date
|
||||
Public Property ExpiresWhenDays As Integer
|
||||
Public Property ExpiresWarningWhenDays As Integer
|
||||
|
||||
Public Property FinalEmailToCreator As Constants.FinalEmailType
|
||||
Public Property FinalEmailToReceivers As Constants.FinalEmailType
|
||||
|
||||
Public Property Subject As String = My.Resources.Envelope.You_received_a_document_to_sign_
|
||||
Public Property Message As String = My.Resources.Envelope.Please_read_and_sign_this_document
|
||||
|
||||
Public Property AddedWhen As Date
|
||||
@@ -14,6 +29,20 @@
|
||||
|
||||
Public Property Documents As New List(Of EnvelopeDocument)
|
||||
Public Property Receivers As New List(Of EnvelopeReceiver)
|
||||
Public Property History As New List(Of EnvelopeHistoryEntry)
|
||||
Public Property EnvelopeType As EnvelopeType
|
||||
Public Property DOC_RESULT As Byte()
|
||||
Public ReadOnly Property EnvelopeTypeTitle As String
|
||||
Get
|
||||
Return EnvelopeType?.Title
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsAlreadySent As Boolean
|
||||
Get
|
||||
Return Status > Constants.EnvelopeStatus.EnvelopeSaved
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StatusTranslated As String
|
||||
Get
|
||||
@@ -40,6 +69,10 @@
|
||||
oErrors.Add(My.Resources.Envelope.Missing_Receivers)
|
||||
End If
|
||||
|
||||
If Receivers.Any(Function(r) r.HasEmailAndName = False) Then
|
||||
oErrors.Add(My.Resources.Envelope.Incomplete_Receivers)
|
||||
End If
|
||||
|
||||
Return oErrors
|
||||
End Function
|
||||
|
||||
|
||||
@@ -17,4 +17,7 @@ Public Class EnvelopeDocument
|
||||
Public Property Filename As String
|
||||
|
||||
Public Property Filepath As String
|
||||
End Class
|
||||
|
||||
Public Property PageCount As Integer
|
||||
Public Property Byte_Data As Byte()
|
||||
End Class
|
||||
@@ -1,6 +1,12 @@
|
||||
Public Class EnvelopeHistoryEntry
|
||||
Public EnvelopeId As Integer
|
||||
Public UserReference As String
|
||||
Public Status As Constants.EnvelopeStatus
|
||||
Public ActionDate As Date = Now()
|
||||
Public Property EnvelopeId As Integer
|
||||
Public Property UserReference As String
|
||||
Public Property Status As Constants.EnvelopeStatus
|
||||
Public ReadOnly Property StatusTranslated As String
|
||||
Get
|
||||
Dim oStatus = Status.ToString()
|
||||
Return My.Resources.Model.ResourceManager.GetString(oStatus)
|
||||
End Get
|
||||
End Property
|
||||
Public Property ActionDate As Date = Now()
|
||||
End Class
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Runtime.Serialization
|
||||
Imports DevExpress.Utils.Svg
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Public Class EnvelopeReceiver
|
||||
Public Property Id As Integer = 0
|
||||
@@ -13,6 +15,7 @@ Public Class EnvelopeReceiver
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<JsonIgnore>
|
||||
Public ReadOnly Property Image As SvgBitmap
|
||||
Get
|
||||
Try
|
||||
@@ -26,21 +29,49 @@ Public Class EnvelopeReceiver
|
||||
|
||||
Public Property ColorType As ColorType
|
||||
|
||||
|
||||
Public Property Name As String
|
||||
|
||||
Public Property Company As String = ""
|
||||
|
||||
Public Property JobTitle As String = ""
|
||||
|
||||
Public Property Email As String
|
||||
|
||||
Public Property Status As ReceiverStatus
|
||||
|
||||
Public ReadOnly Property StatusTranslated As String
|
||||
Get
|
||||
Dim oStatus = Status.ToString()
|
||||
Return My.Resources.Model.ResourceManager.GetString(oStatus)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property SignedDate As DateTime = DateTime.MinValue
|
||||
|
||||
Public ReadOnly Property SignedDateDisplayValue As String
|
||||
Get
|
||||
If SignedDate = DateTime.MinValue Then
|
||||
Return "-"
|
||||
Else
|
||||
Return SignedDate.ToString("G")
|
||||
End If
|
||||
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property HasId As Boolean
|
||||
Get
|
||||
Return Id > 0
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property HasEmailAndName As Boolean
|
||||
Get
|
||||
Return String.IsNullOrWhiteSpace(Email) = False And
|
||||
String.IsNullOrWhiteSpace(Name) = False
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Sequence As Integer = 0
|
||||
Public Property PrivateMessage As String = ""
|
||||
Public Property AccessCode As String = ""
|
||||
|
||||
26
EnvelopeGenerator.Common/Entities/EnvelopeType.vb
Normal file
26
EnvelopeGenerator.Common/Entities/EnvelopeType.vb
Normal file
@@ -0,0 +1,26 @@
|
||||
Public Class EnvelopeType
|
||||
|
||||
Public Property Id As Integer = 0
|
||||
Public Property Title As String
|
||||
Public Property UseAccessCode As Boolean
|
||||
Public Property ContractType As Integer ' Unbenutzt
|
||||
|
||||
Public Property Language As String
|
||||
Public Property CertificationType As Constants.CertificationType = Constants.CertificationType.ElectronicSignature
|
||||
Public Property SendReminderEmails As Boolean = False
|
||||
Public Property FirstReminderDays As Integer = 0
|
||||
Public Property ReminderIntervalDays As Integer = 0
|
||||
|
||||
Public Property ExpiresWhen As Date
|
||||
Public Property ExpiresWarningWhen As Date
|
||||
Public Property ExpiresWhenDays As Integer
|
||||
Public Property ExpiresWarningWhenDays As Integer
|
||||
|
||||
Public Property FinalEmailToCreator As Constants.FinalEmailType
|
||||
Public Property FinalEmailToReceivers As Constants.FinalEmailType
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Title
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -3,6 +3,7 @@ Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class State
|
||||
Public Property UserId As Integer
|
||||
Public Property User As User
|
||||
Public Property Config As Config
|
||||
Public Property DbConfig As DbConfig
|
||||
Public Property LogConfig As LogConfig
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
Public Property Email As String
|
||||
Public Property Language As String
|
||||
|
||||
Public Property HasAccess As Boolean
|
||||
Public Property IsAdmin As Boolean
|
||||
|
||||
Public ReadOnly Property FullName() As String
|
||||
Get
|
||||
Return Prename + " " + Name
|
||||
|
||||
@@ -56,8 +56,11 @@
|
||||
<Reference Include="DevExpress.RichEdit.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.RichEdit.v21.2.Export, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Sparkline.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Xpo.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraCharts.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<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.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Modules.Base, Version=1.3.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -74,10 +77,16 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GdPicture.NET.14">
|
||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -121,27 +130,36 @@
|
||||
<Compile Include="Entities\ElementStatus.vb" />
|
||||
<Compile Include="Entities\EmailData.vb" />
|
||||
<Compile Include="Entities\EmailTemplate.vb" />
|
||||
<Compile Include="Services\TemplateService.vb" />
|
||||
<Compile Include="Entities\Envelope.vb" />
|
||||
<Compile Include="Entities\EnvelopeDocument.vb" />
|
||||
<Compile Include="Entities\EnvelopeDocumentElement.vb" />
|
||||
<Compile Include="Entities\EnvelopeHistoryEntry.vb" />
|
||||
<Compile Include="Entities\EnvelopeReceiver.vb" />
|
||||
<Compile Include="Entities\EnvelopeResponse.vb" />
|
||||
<Compile Include="Entities\EnvelopeType.vb" />
|
||||
<Compile Include="Entities\State.vb" />
|
||||
<Compile Include="Entities\User.vb" />
|
||||
<Compile Include="Helpers.vb" />
|
||||
<Compile Include="Jobs\CertificateDocumentJob.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\FinalizeDocumentExceptions.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\FinalizeDocumentJob.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\PDFBurner.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\PDFMerger.vb" />
|
||||
<Compile Include="Models\BaseModel.vb" />
|
||||
<Compile Include="Models\CertificateModel.vb" />
|
||||
<Compile Include="Models\ChartModel.vb" />
|
||||
<Compile Include="Models\ConfigModel.vb" />
|
||||
<Compile Include="Models\DocumentModel.vb" />
|
||||
<Compile Include="Models\ElementModel.vb" />
|
||||
<Compile Include="Models\DocumentStatusModel.vb" />
|
||||
<Compile Include="Models\ElementStatusModel.vb" />
|
||||
<Compile Include="Models\EmailModel.vb" />
|
||||
<Compile Include="Models\EmailTemplateModel.vb" />
|
||||
<Compile Include="Models\EnvelopeModel.vb" />
|
||||
<Compile Include="Models\HistoryModel.vb" />
|
||||
<Compile Include="Models\ReceiverModel.vb" />
|
||||
<Compile Include="Models\EnvelopeTypeModel.vb" />
|
||||
<Compile Include="Models\ReportModel.vb" />
|
||||
<Compile Include="Models\UserModel.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
@@ -159,9 +177,9 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Reports\ReportCreator.vb" />
|
||||
<Compile Include="Reports\ReportItem.vb" />
|
||||
<Compile Include="Reports\ReportSource.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\ReportCreator.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\ReportItem.vb" />
|
||||
<Compile Include="Jobs\FinalizeDocument\ReportSource.vb" />
|
||||
<Compile Include="Reports\rptEnvelopeHistory.Designer.vb">
|
||||
<DependentUpon>rptEnvelopeHistory.vb</DependentUpon>
|
||||
</Compile>
|
||||
@@ -169,6 +187,7 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Services\ActionService.vb" />
|
||||
<Compile Include="Services\BaseService.vb" />
|
||||
<Compile Include="Services\EmailService.vb" />
|
||||
<Compile Include="Services\HistoryService.vb" />
|
||||
<Compile Include="Strings\Email.en.Designer.vb">
|
||||
@@ -201,6 +220,8 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Model.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Strings\Model.vb" />
|
||||
<Compile Include="TempFiles.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\licenses.licx" />
|
||||
@@ -214,7 +235,7 @@
|
||||
<DependentUpon>rptEnvelopeHistory.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings\Email.en.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Email.en.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
@@ -222,29 +243,32 @@
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Envelope.en.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings\Envelope.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Envelope1.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings\Email.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Email.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings\Model.en.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Model.en.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Strings\Model.resx">
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Model.Designer.vb</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
@@ -260,6 +284,9 @@
|
||||
<Content Include="Images\circle.svg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<EmbeddedResource Include="Templates\document_access_code_de.html" />
|
||||
<EmbeddedResource Include="Templates\email_de.html" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -1,8 +1,28 @@
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Text
|
||||
Imports DevExpress.Utils.Svg
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
|
||||
Public Class Helpers
|
||||
Private Shared key As String = "$xzBvyPETUS&amm8)D8x#)f;4%;?[BPd" ' Passwort-Schlüssel (16, 24, or 32 bytes)
|
||||
Private Shared iv As String = "1wN&e[zrQ6_B7X/0" ' Initialisierungsvektor (16 bytes)
|
||||
|
||||
' Entschlüsselungsfunktion
|
||||
Public Shared Function Decrypt(cipherText As String) As String
|
||||
Dim aesAlg As Aes = Aes.Create()
|
||||
aesAlg.Key = Encoding.UTF8.GetBytes(key)
|
||||
aesAlg.IV = Encoding.UTF8.GetBytes(iv)
|
||||
Dim decryptor As ICryptoTransform = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV)
|
||||
Dim cipherBytes As Byte() = Convert.FromBase64String(cipherText)
|
||||
Dim msDecrypt As New IO.MemoryStream(cipherBytes)
|
||||
Using csDecrypt As New CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)
|
||||
Using srDecrypt As New IO.StreamReader(csDecrypt)
|
||||
Return srDecrypt.ReadToEnd()
|
||||
End Using
|
||||
End Using
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Encodes the EnvelopeUUID and the ReceiverSignature into an EnvelopeKey
|
||||
@@ -38,6 +58,11 @@ Public Class Helpers
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function GetAccessCode() As String
|
||||
Return Guid.NewGuid().ToString("d").Substring(1, 6).ToUpper()
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function ColorTypeToColor(pColorType As ColorType) As Color
|
||||
Select Case pColorType
|
||||
Case ColorType.ReceiverColor1
|
||||
@@ -94,4 +119,16 @@ Public Class Helpers
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Async Function CopyFileAsync(sourceFile As String, destinationFile As String) As Task
|
||||
Dim fileOptions = IO.FileOptions.Asynchronous Or IO.FileOptions.SequentialScan
|
||||
Dim bufferSize = 4096
|
||||
|
||||
Using sourceStream = New FileStream(sourceFile, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize, fileOptions)
|
||||
|
||||
Using destinationStream = New FileStream(destinationFile, FileMode.CreateNew, FileAccess.Write, FileShare.None, bufferSize, fileOptions)
|
||||
Await sourceStream.CopyToAsync(destinationStream, bufferSize).ConfigureAwait(False)
|
||||
End Using
|
||||
End Using
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Quartz
|
||||
|
||||
Public Class CertificateDocumentJob
|
||||
Implements IJob
|
||||
|
||||
Public Function Execute(context As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim connectionString As String = context.MergedJobDataMap.Item(Constants.DATABASE)
|
||||
Dim logConfig As LogConfig = context.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
||||
Dim logger As Logger = logConfig.GetLogger
|
||||
|
||||
Dim JobId = context.JobDetail.Key
|
||||
logger.Info("Starting job {0}", JobId)
|
||||
|
||||
' Do important work...
|
||||
|
||||
logger.Info("Completed job {0}", JobId)
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
End Class
|
||||
@@ -0,0 +1,52 @@
|
||||
Namespace Jobs.FinalizeDocument
|
||||
Public Class FinalizeDocumentExceptions
|
||||
|
||||
Public Class MergeDocumentException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
|
||||
Public Sub New(message As String, innerException As Exception)
|
||||
MyBase.New(message, innerException)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class BurnAnnotationException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
|
||||
Public Sub New(message As String, innerException As Exception)
|
||||
MyBase.New(message, innerException)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class CreateReportException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
|
||||
Public Sub New(message As String, innerException As Exception)
|
||||
MyBase.New(message, innerException)
|
||||
End Sub
|
||||
End Class
|
||||
Public Class ExportDocumentException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
|
||||
Public Sub New(message As String, innerException As Exception)
|
||||
MyBase.New(message, innerException)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -0,0 +1,506 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports GdPicture14
|
||||
Imports Quartz
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.IO
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace Jobs
|
||||
Public Class FinalizeDocumentJob
|
||||
Implements IJob
|
||||
|
||||
Private ReadOnly LicenseManager As New LicenseManager()
|
||||
Private GdViewer As GdViewer
|
||||
|
||||
Private LogConfig As LogConfig
|
||||
Private Logger As Logger
|
||||
Private Database As MSSQLServer
|
||||
Private Config As DbConfig
|
||||
|
||||
Private ConfigModel As ConfigModel
|
||||
Private EnvelopeModel As EnvelopeModel
|
||||
Private ReportModel As ReportModel
|
||||
|
||||
Private ActionService As ActionService
|
||||
|
||||
Private PDFBurner As PDFBurner
|
||||
Private PDFMerger As PDFMerger
|
||||
Private ReportCreator As ReportCreator
|
||||
|
||||
Private ReadOnly CompleteWaitTime As Integer = 5
|
||||
Private ParentFolderUID As String = ""
|
||||
Private myTempFiles As TempFiles
|
||||
|
||||
Private Class EnvelopeData
|
||||
Public EnvelopeId As Integer
|
||||
Public EnvelopeUUID As String
|
||||
Public DocumentPath As String
|
||||
Public AnnotationData As List(Of String)
|
||||
Public DocAsByte As Byte()
|
||||
|
||||
End Class
|
||||
|
||||
Public Function Execute(pContext As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oGdPictureKey As String = pContext.MergedJobDataMap.Item(Constants.GDPICTURE)
|
||||
LogConfig = pContext.MergedJobDataMap.Item(Constants.LOGCONFIG)
|
||||
Logger = LogConfig.GetLogger()
|
||||
myTempFiles = New TempFiles(LogConfig)
|
||||
myTempFiles.Create()
|
||||
Dim JobId = pContext.JobDetail.Key
|
||||
Logger.Info("Starting job {0}", JobId)
|
||||
|
||||
Try
|
||||
Logger.Debug("Loading GdViewer..")
|
||||
GdViewer = New GdViewer()
|
||||
LicenseManager.RegisterKEY(oGdPictureKey)
|
||||
|
||||
Logger.Debug("Loading Database..")
|
||||
Database = GetDatabase(pContext, LogConfig)
|
||||
|
||||
Logger.Debug("Loading Models & Services")
|
||||
Dim oState = GetState()
|
||||
InitializeModels(oState)
|
||||
|
||||
Logger.Debug("Loading Configuration..")
|
||||
Config = ConfigModel.LoadConfiguration()
|
||||
oState.DbConfig = Config
|
||||
|
||||
InitializeServices(oState)
|
||||
|
||||
Logger.Debug("Loading PDFBurner..")
|
||||
Dim ignoredLabels As List(Of String) = pContext.MergedJobDataMap.Item(Constants.IGNORED_LABELS)
|
||||
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey, ignoredLabels)
|
||||
|
||||
Logger.Debug("Loading PDFMerger..")
|
||||
PDFMerger = New PDFMerger(LogConfig, oGdPictureKey)
|
||||
|
||||
Logger.Debug("Loading ReportCreator..")
|
||||
ReportCreator = New ReportCreator(LogConfig, oState)
|
||||
Logger.Debug("My.Settings.RuninDMZ: [{0}]", My.Settings.RuninDMZ.ToString)
|
||||
Logger.Debug("My.Settings.NetUse_Usr: [{0}]", My.Settings.NetUse_Usr)
|
||||
|
||||
|
||||
If My.Settings.RuninDMZ = True Then
|
||||
If Config.DocumentPath_DMZ <> String.Empty Then
|
||||
Logger.Debug("RuninDMZ - Using DocumentPath_DMZ: [{0}] - Overwrite Document-Path", Config.DocumentPath_DMZ)
|
||||
Config.DocumentPath = Config.DocumentPath_DMZ
|
||||
Config.NetUse_necessary = True
|
||||
Else
|
||||
Config.DocumentPath = Config.DocumentPath
|
||||
End If
|
||||
Else
|
||||
If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
||||
Logger.Debug("Using DMZRemotePath: [{0}] - Overwrite Document-Path ...", Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
||||
Config.DocumentPath = Config.DOCUMENT_PATH_MOVE_AFTSEND
|
||||
Config.NetUse_Finish = True
|
||||
|
||||
Else
|
||||
Config.DocumentPath = Config.DocumentPath
|
||||
End If
|
||||
End If
|
||||
Logger.Debug("DocumentPath: [{0}]", Config.DocumentPath)
|
||||
|
||||
If My.Settings.RuninDMZ = True Then
|
||||
If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then
|
||||
Logger.Debug("RuninDMZ - FINISHED_PATH_EX_DMZ configured: [{0}]", Config.FINISHED_PATH_EX_DMZ)
|
||||
Config.NetUse_Finish = True
|
||||
End If
|
||||
If Config.ExportPath_DMZ <> String.Empty Then
|
||||
Logger.Debug("RuninDMZ - Using ExportPath_DMZ: [{0}] - Overwrite ExportPath", Config.ExportPath_DMZ)
|
||||
Config.ExportPath = Config.ExportPath_DMZ
|
||||
End If
|
||||
End If
|
||||
|
||||
Logger.Debug("ExportPath: [{0}]", Config.ExportPath)
|
||||
|
||||
If Config.NetUse_Finish = True Then
|
||||
If NetUse_Command(Config.DocumentPath, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) = True Then
|
||||
Logger.Debug("NetUse_Finish = successful!")
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim oCompleteStatus As Integer = Constants.EnvelopeStatus.EnvelopeCompletelySigned
|
||||
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {oCompleteStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTime} ORDER BY GUID"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Dim oEnvelopeIds As List(Of Integer) = oTable.Rows.Cast(Of DataRow).
|
||||
Select(Function(r) r.Item("GUID")).
|
||||
Cast(Of Integer).
|
||||
ToList()
|
||||
|
||||
If oEnvelopeIds.Count > 0 Then
|
||||
Logger.Info("Found [{0}] completed envelopes.", oEnvelopeIds.Count)
|
||||
End If
|
||||
|
||||
Dim oTotal As Integer = oEnvelopeIds.Count
|
||||
Dim oCurrent As Integer = 1
|
||||
|
||||
For Each oId In oEnvelopeIds
|
||||
Logger.Info("Finalizing Envelope [{0}] ({1}/{2})", oId, oCurrent, oTotal)
|
||||
Logger.Debug("Loading Envelope..")
|
||||
Try
|
||||
Dim oEnvelope = EnvelopeModel.GetById(oId)
|
||||
If oEnvelope Is Nothing Then
|
||||
Logger.Warn("Envelope could not be loaded for Id [{0}]!", oId)
|
||||
Throw New ArgumentNullException("EnvelopeData")
|
||||
End If
|
||||
Logger.Debug("Loading Envelope Data..")
|
||||
Dim oEnvelopeData = GetEnvelopeData(oId)
|
||||
|
||||
If oEnvelopeData Is Nothing Then
|
||||
Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId)
|
||||
Throw New ArgumentNullException("EnvelopeData")
|
||||
End If
|
||||
If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
||||
oEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
||||
Logger.Debug("Replaced Path in oEnvelopeData.DocumentPath!")
|
||||
End If
|
||||
Logger.Debug("Burning Annotations to pdf ...")
|
||||
Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData)
|
||||
If oBurnedDocument Is Nothing Then
|
||||
Logger.Warn("Document could not be finalized!")
|
||||
Throw New ApplicationException("Document could not be finalized")
|
||||
End If
|
||||
|
||||
If ActionService.CreateReport(oEnvelope) = False Then
|
||||
Logger.Warn("Document Report could not be created!")
|
||||
Throw New ApplicationException("Document Report could not be created")
|
||||
End If
|
||||
|
||||
Logger.Debug("Creating report..")
|
||||
Dim oReport As Byte() = ReportCreator.CreateReport(oEnvelope)
|
||||
Logger.Debug("Report created!")
|
||||
|
||||
Logger.Debug("Merging documents ...")
|
||||
Dim oMergedDocument As Byte() = PDFMerger.MergeDocuments(oBurnedDocument, oReport)
|
||||
Logger.Debug("Documents merged!")
|
||||
|
||||
Dim oOutputDirectoryPath = Path.Combine(Config.ExportPath, ParentFolderUID)
|
||||
If Not Directory.Exists(oOutputDirectoryPath) Then
|
||||
Directory.CreateDirectory(oOutputDirectoryPath)
|
||||
End If
|
||||
Dim oOutputFilePath = Path.Combine(oOutputDirectoryPath, $"{oEnvelope.Uuid}.pdf")
|
||||
Logger.Info("Writing finalized Pdf to disk..")
|
||||
Logger.Info("Output path is [{0}]", oOutputFilePath)
|
||||
|
||||
Try
|
||||
File.WriteAllBytes(oOutputFilePath, oMergedDocument)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not export final document to disk!")
|
||||
Throw New ExportDocumentException("Could not export final document to disk!", ex)
|
||||
End Try
|
||||
|
||||
If Config.NetUse_Finish = True Then
|
||||
If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then
|
||||
If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then
|
||||
Clean_DNZ_PAth(Config.FINISHED_PATH_EX_DMZ)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Logger.Info("Writing EB-bytes to database...")
|
||||
Update_File_DB(oOutputFilePath, oEnvelope.Id)
|
||||
|
||||
Logger.Info("Sending finalized report-mails..")
|
||||
If SendFinalEmails(oEnvelope) = False Then ', oOutputFilePath
|
||||
Throw New ApplicationException("Final emails could not be sent!")
|
||||
End If
|
||||
Logger.Debug("Setting envelope status..")
|
||||
If ActionService.FinalizeEnvelope(oEnvelope) = False Then
|
||||
Logger.Warn("Envelope could not be finalized!")
|
||||
Throw New ApplicationException("Envelope could not be finalized")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Warn($"Unhandled exception while working envelope [{oId}] - [{ex.Message}]")
|
||||
End Try
|
||||
|
||||
|
||||
oCurrent += 1
|
||||
Logger.Info("Envelope finalized!")
|
||||
|
||||
Next
|
||||
|
||||
Logger.Debug("Completed job {0} successfully!", JobId)
|
||||
Catch ex As MergeDocumentException
|
||||
Logger.Warn("Certificate Document job failed at step: Merging documents!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As ExportDocumentException
|
||||
Logger.Warn("Certificate Document job failed at step: Exporting document!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Certificate Document job failed!")
|
||||
Logger.Error(ex)
|
||||
Finally
|
||||
Logger.Info("Job execution for [{0}] ended", JobId)
|
||||
End Try
|
||||
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
Private Sub Update_File_DB(pFilePath As String, pEnvelopeID As Long)
|
||||
Dim SqlCom As SqlCommand
|
||||
Dim imageData As Byte()
|
||||
Dim sFileName As String
|
||||
Dim qry As String
|
||||
|
||||
Try
|
||||
'Read Image Bytes into a byte array
|
||||
'Initialize SQL Server Connection
|
||||
|
||||
'Convert File to bytes Array
|
||||
imageData = ReadFile(pFilePath)
|
||||
If Not IsNothing(imageData) Then
|
||||
sFileName = System.IO.Path.GetFileName(pFilePath)
|
||||
'Set insert query
|
||||
qry = $"UPDATE TBSIG_ENVELOPE SET DOC_RESULT = @ImageData WHERE GUID = {pEnvelopeID}"
|
||||
'Initialize SqlCommand object for insert.
|
||||
SqlCom = New SqlCommand(qry, Database.GetConnection)
|
||||
'We are passing File Name and Image byte data as sql parameters.
|
||||
SqlCom.Parameters.Add(New SqlParameter("@ImageData", DirectCast(imageData, Object)))
|
||||
'Execute the Query
|
||||
SqlCom.ExecuteNonQuery()
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
'Open file in to a filestream and read data in a byte array.
|
||||
Private Function ReadFile(ByVal sPath As String) As Byte()
|
||||
'Initialize byte array with a null value initially.
|
||||
Dim data As Byte() = Nothing
|
||||
'Use FileInfo object to get file size.
|
||||
Dim fInfo As New FileInfo(sPath)
|
||||
Dim numBytes As Long = fInfo.Length
|
||||
'Open FileStream to read file
|
||||
Dim fStream As New FileStream(sPath, FileMode.Open, FileAccess.Read)
|
||||
'Use BinaryReader to read file stream into byte array.
|
||||
Dim br As New BinaryReader(fStream)
|
||||
'When you use BinaryReader, you need to supply number of bytes to read from file.
|
||||
'In this case we want to read entire file. So supplying total number of bytes.
|
||||
data = br.ReadBytes(CInt(numBytes))
|
||||
Return data
|
||||
End Function
|
||||
Private Function NetUse_Command(pDestinationPath As String, pUsername As String, pPassword As String)
|
||||
Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW)
|
||||
Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}"
|
||||
Logger.Debug("EXECUTING NetUse_Command for " & pDestinationPath)
|
||||
Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}")
|
||||
processInfo.RedirectStandardOutput = True
|
||||
processInfo.UseShellExecute = False
|
||||
processInfo.CreateNoWindow = True
|
||||
|
||||
Using process As Process = Process.Start(processInfo)
|
||||
process.WaitForExit()
|
||||
|
||||
' Prüfe den Rückgabewert des net use Befehls
|
||||
If process.ExitCode = 0 Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Using
|
||||
End Function
|
||||
|
||||
Private Function Clean_DNZ_PAth(pSourcePath As String) As Boolean
|
||||
Dim oFilename = System.IO.Path.GetFileName(pSourcePath)
|
||||
|
||||
Logger.Debug("## Starting Clean_DNZ_PAth ...")
|
||||
Logger.Debug("## pSourcePath {0}", pSourcePath)
|
||||
|
||||
Dim oDirectorySource = Path.Combine(pSourcePath, ParentFolderUID)
|
||||
|
||||
Try
|
||||
Logger.Debug($"Deleting oDirectorySource {oDirectorySource} ...")
|
||||
Directory.Delete(oDirectorySource, True)
|
||||
Console.WriteLine($"Folder successfully deleted!")
|
||||
Logger.Debug($"...Deleted!")
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
|
||||
End Function
|
||||
Private Function SendFinalEmails(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Dim oMailToCreator = pEnvelope.FinalEmailToCreator
|
||||
Dim oMailToReceivers = pEnvelope.FinalEmailToReceivers
|
||||
|
||||
If oMailToCreator <> FinalEmailType.No Then
|
||||
Logger.Debug("Sending email to creator ...")
|
||||
SendFinalEmailToCreator(pEnvelope) ', pAttachment
|
||||
End If
|
||||
|
||||
If oMailToReceivers <> FinalEmailType.No Then
|
||||
Logger.Debug("Sending emails to receivers..")
|
||||
SendFinalEmailToReceivers(pEnvelope) ', pAttachment
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function SendFinalEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToCreator)
|
||||
' Dim oAttachment = String.Empty
|
||||
|
||||
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
||||
If oIncludeAttachment Then
|
||||
'oAttachment = pAttachment
|
||||
End If
|
||||
|
||||
If ActionService.CompleteEnvelope(pEnvelope) = False Then ', oAttachment
|
||||
Logger.Error("Envelope could not be completed for receiver [{0}]", pEnvelope.User.Email)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function SendFinalEmailToReceivers(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToReceivers)
|
||||
'Dim oAttachment = String.Empty
|
||||
|
||||
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
||||
If oIncludeAttachment Then
|
||||
|
||||
' oAttachment = pAttachment
|
||||
End If
|
||||
|
||||
For Each oReceiver In pEnvelope.Receivers
|
||||
If ActionService.CompleteEnvelope(pEnvelope, oReceiver) = False Then ', oAttachment
|
||||
Logger.Error("Envelope could not be completed for receiver [{0}]", oReceiver.Email)
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function SendFinalEmailWithAttachment(pType As FinalEmailType)
|
||||
If pType = FinalEmailType.YesWithAttachment Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function BurnAnnotationsToPdf(pEnvelopeData As EnvelopeData) As Byte()
|
||||
Dim pEnvelopeId = pEnvelopeData.EnvelopeId
|
||||
|
||||
Logger.Info($"Burning [{pEnvelopeData.AnnotationData.Count}] signatures")
|
||||
Dim oAnnotations = pEnvelopeData.AnnotationData
|
||||
Dim oInputPath = ""
|
||||
If IsNothing(pEnvelopeData.DocAsByte) Then
|
||||
If My.Settings.RuninDMZ Then
|
||||
Logger.Debug("Replacing Path in pData.DocumentPath ...")
|
||||
oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath)
|
||||
ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then
|
||||
Logger.Debug("Replacing Path in pData.DocumentPath ...")
|
||||
oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND)
|
||||
Else
|
||||
oInputPath = pEnvelopeData.DocumentPath
|
||||
End If
|
||||
Logger.Info($"Input path: [{oInputPath}]")
|
||||
Else
|
||||
Logger.Info($"we got bytes..")
|
||||
oInputPath = Config.DocumentPathOrigin
|
||||
Logger.Info($"oInputPath: {Config.DocumentPathOrigin}")
|
||||
End If
|
||||
|
||||
|
||||
If IsNothing(pEnvelopeData.DocAsByte) Then
|
||||
Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath)
|
||||
Dim split As String() = oDirectorySource.Split("\")
|
||||
ParentFolderUID = split(split.Length - 1)
|
||||
Else
|
||||
ParentFolderUID = pEnvelopeData.EnvelopeUUID
|
||||
End If
|
||||
|
||||
|
||||
Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID)
|
||||
Dim oInputDocumentBuffer As Byte()
|
||||
If Not IsNothing(pEnvelopeData.DocAsByte) Then
|
||||
oInputDocumentBuffer = pEnvelopeData.DocAsByte
|
||||
Else
|
||||
Try
|
||||
oInputDocumentBuffer = File.ReadAllBytes(oInputPath)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw New BurnAnnotationException("Source document could not be read from disk!", ex)
|
||||
End Try
|
||||
End If
|
||||
|
||||
|
||||
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
|
||||
End Function
|
||||
|
||||
Private Function GetEnvelopeData(pEnvelopeId As Integer) As EnvelopeData
|
||||
Dim oSql = $"SELECT T.GUID, T.ENVELOPE_UUID,T2.FILEPATH, T2.BYTE_DATA FROM [dbo].[TBSIG_ENVELOPE] T
|
||||
JOIN TBSIG_ENVELOPE_DOCUMENT T2 ON T.GUID = T2.ENVELOPE_ID
|
||||
WHERE T.GUID = {pEnvelopeId}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
Dim oRow As DataRow = oTable.Rows.Cast(Of DataRow).SingleOrDefault()
|
||||
If oRow Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Dim oAnnotationData = GetAnnotationData(pEnvelopeId)
|
||||
Dim oData As New EnvelopeData With {
|
||||
.EnvelopeId = pEnvelopeId,
|
||||
.DocumentPath = oRow.ItemEx("FILEPATH", ""),
|
||||
.AnnotationData = oAnnotationData,
|
||||
.DocAsByte = DirectCast(oRow.Item("BYTE_DATA"), Byte()),
|
||||
.EnvelopeUUID = oRow.ItemEx("ENVELOPE_UUID", "")
|
||||
}
|
||||
|
||||
Logger.Debug("Document path: [{0}]", oData.DocumentPath)
|
||||
|
||||
Return oData
|
||||
End Function
|
||||
|
||||
Private Function GetAnnotationData(pEnvelopeId As Integer) As List(Of String)
|
||||
Dim oSql = $"SELECT VALUE FROM TBSIG_DOCUMENT_STATUS WHERE ENVELOPE_ID = {pEnvelopeId}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable.Rows.Cast(Of DataRow).
|
||||
Select(Function(r) r.ItemEx("VALUE", String.Empty)).
|
||||
Cast(Of String).
|
||||
ToList()
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub InitializeServices(pState As State)
|
||||
ActionService = New ActionService(pState)
|
||||
End Sub
|
||||
|
||||
Private Sub InitializeModels(pState As State)
|
||||
ConfigModel = New ConfigModel(pState)
|
||||
EnvelopeModel = New EnvelopeModel(pState)
|
||||
ReportModel = New ReportModel(pState)
|
||||
End Sub
|
||||
|
||||
Private Function GetDatabase(pContext As IJobExecutionContext, pLogConfig As LogConfig) As MSSQLServer
|
||||
Dim oConnectionString As String = pContext.MergedJobDataMap.Item(Constants.DATABASE)
|
||||
Dim Database = New MSSQLServer(pLogConfig, MSSQLServer.DecryptConnectionString(oConnectionString))
|
||||
|
||||
Return Database
|
||||
End Function
|
||||
|
||||
Private Function GetState() As State
|
||||
Return New State With {
|
||||
.LogConfig = LogConfig,
|
||||
.Database = Database,
|
||||
.UserId = 0,
|
||||
.Config = Nothing,
|
||||
.DbConfig = Nothing
|
||||
}
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
222
EnvelopeGenerator.Common/Jobs/FinalizeDocument/PDFBurner.vb
Normal file
222
EnvelopeGenerator.Common/Jobs/FinalizeDocument/PDFBurner.vb
Normal file
@@ -0,0 +1,222 @@
|
||||
Imports System.Drawing
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports GdPicture14
|
||||
Imports Newtonsoft.Json
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||
|
||||
Namespace Jobs.FinalizeDocument
|
||||
Public Class PDFBurner
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Manager As AnnotationManager
|
||||
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 _ignoredLabels As List(Of String)
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, ignoredLabels As List(Of String))
|
||||
MyBase.New(pLogConfig)
|
||||
|
||||
LicenseManager = New LicenseManager()
|
||||
LicenseManager.RegisterKEY(pGDPictureLicenseKey)
|
||||
|
||||
Manager = New AnnotationManager()
|
||||
|
||||
_ignoredLabels = ignoredLabels
|
||||
End Sub
|
||||
|
||||
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
||||
Dim oResult As GdPictureStatus
|
||||
|
||||
Try
|
||||
Using oSourceStream As New MemoryStream(pSourceBuffer)
|
||||
oResult = Manager.InitFromStream(oSourceStream)
|
||||
If oResult <> GdPictureStatus.OK Then
|
||||
Throw New BurnAnnotationException($"Could not open document for burning: [{oResult}]")
|
||||
End If
|
||||
|
||||
For Each oJSON In pInstantJSONList
|
||||
If AddInstantJSONAnnotationToPDF(oJSON) = False Then
|
||||
Logger.Warn($"Error in AddInstantJSONAnnotationToPDF - oJson: ")
|
||||
Logger.Warn(oJSON)
|
||||
Throw New BurnAnnotationException($"Adding Annotation failed")
|
||||
End If
|
||||
Next
|
||||
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
||||
If oResult <> GdPictureStatus.OK Then
|
||||
Throw New BurnAnnotationException($"Could not burn annotations to file: [{oResult}]")
|
||||
End If
|
||||
|
||||
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
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function AddInstantJSONAnnotationToPDF(pInstantJSON As String) As Boolean
|
||||
Try
|
||||
Dim oAnnotationData = JsonConvert.DeserializeObject(Of AnnotationData)(pInstantJSON)
|
||||
|
||||
For Each oAnnotation In oAnnotationData.annotations
|
||||
Logger.Debug("Adding AnnotationID: " + oAnnotation.id)
|
||||
Select Case oAnnotation.type
|
||||
Case ANNOTATION_TYPE_IMAGE
|
||||
AddImageAnnotation(oAnnotation, oAnnotationData.attachments)
|
||||
|
||||
Case ANNOTATION_TYPE_INK
|
||||
AddInkAnnotation(oAnnotation)
|
||||
|
||||
Case ANNOTATION_TYPE_WIDGET
|
||||
'Add form field values
|
||||
Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id)
|
||||
If formFieldValue IsNot Nothing AndAlso Not _ignoredLabels.Contains(formFieldValue.value) Then
|
||||
AddFormFieldValue(oAnnotation, formFieldValue)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not create annotation from InstantJSON")
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function AddImageAnnotation(pAnnotation As Annotation, pAttachments As Dictionary(Of String, Attachment)) As Boolean
|
||||
Try
|
||||
Dim oAttachment = pAttachments.Where(Function(a) a.Key = pAnnotation.imageAttachmentId).
|
||||
SingleOrDefault()
|
||||
|
||||
' Convert pixels to Inches
|
||||
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
||||
|
||||
Dim oX = oBounds.Item(0)
|
||||
Dim oY = oBounds.Item(1)
|
||||
Dim oWidth = oBounds.Item(2)
|
||||
Dim oHeight = oBounds.Item(3)
|
||||
|
||||
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||
Manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.binary, oX, oY, oWidth, oHeight)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not add image annotation!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function AddInkAnnotation(pAnnotation As Annotation) As Boolean
|
||||
Try
|
||||
Dim oSegments = pAnnotation.lines.points
|
||||
Dim oColor = ColorTranslator.FromHtml(pAnnotation.strokeColor)
|
||||
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||
|
||||
For Each oSegment As List(Of List(Of Single)) In oSegments
|
||||
Dim oPoints = oSegment.
|
||||
Select(AddressOf ToPointF).
|
||||
ToArray()
|
||||
|
||||
Manager.AddFreeHandAnnot(oColor, oPoints)
|
||||
Next
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not add image annotation!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Private Function AddFormFieldValue(pAnnotation As Annotation, formFieldValue As FormFieldValue) As Boolean
|
||||
Try
|
||||
' Convert pixels to Inches
|
||||
Dim oBounds = pAnnotation.bbox.Select(AddressOf ToInches).ToList()
|
||||
|
||||
Dim oX = oBounds.Item(0)
|
||||
Dim oY = oBounds.Item(1)
|
||||
Dim oWidth = oBounds.Item(2)
|
||||
Dim oHeight = oBounds.Item(3)
|
||||
|
||||
Manager.SelectPage(pAnnotation.pageIndex + 1)
|
||||
' Add the text annotation
|
||||
Dim ant = Manager.AddTextAnnot(oX, oY, oWidth, oHeight, formFieldValue.value)
|
||||
|
||||
' Set the font properties
|
||||
ant.FontName = "Arial"
|
||||
ant.FontSize = 8
|
||||
ant.FontStyle = FontStyle.Italic
|
||||
Manager.SaveAnnotationsToPage()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not add image annotation!")
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function ToPointF(pPoints As List(Of Single)) As PointF
|
||||
Dim oPoints = pPoints.Select(AddressOf ToInches).ToList()
|
||||
Return New PointF(oPoints.Item(0), oPoints.Item(1))
|
||||
End Function
|
||||
|
||||
Private Function ToInches(pValue As Double) As Double
|
||||
Return pValue / 72
|
||||
End Function
|
||||
|
||||
Private Function ToInches(pValue As Single) As Single
|
||||
Return pValue / 72
|
||||
End Function
|
||||
|
||||
Friend Class AnnotationData
|
||||
Public Property annotations As List(Of Annotation)
|
||||
Public Property attachments As Dictionary(Of String, Attachment)
|
||||
Public Property formFieldValues As List(Of FormFieldValue)
|
||||
End Class
|
||||
|
||||
Friend Class Annotation
|
||||
Public Property id As String
|
||||
Public Property bbox As List(Of Double)
|
||||
Public Property type As String
|
||||
Public Property isSignature As Boolean
|
||||
Public Property imageAttachmentId As String
|
||||
Public Property lines As Lines
|
||||
Public Property pageIndex As Integer
|
||||
Public Property strokeColor As String
|
||||
End Class
|
||||
|
||||
Friend Class Lines
|
||||
Public Property points As List(Of List(Of List(Of Single)))
|
||||
End Class
|
||||
|
||||
Friend Class Attachment
|
||||
Public Property binary As String
|
||||
Public Property contentType As String
|
||||
End Class
|
||||
|
||||
Friend Class FormFieldValue
|
||||
Public Property name As String
|
||||
Public Property value As String
|
||||
End Class
|
||||
End Class
|
||||
End Namespace
|
||||
71
EnvelopeGenerator.Common/Jobs/FinalizeDocument/PDFMerger.vb
Normal file
71
EnvelopeGenerator.Common/Jobs/FinalizeDocument/PDFMerger.vb
Normal file
@@ -0,0 +1,71 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||
Imports GdPicture14
|
||||
Imports System.IO
|
||||
|
||||
Public Class PDFMerger
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Manager As AnnotationManager
|
||||
Private ReadOnly LicenseManager As LicenseManager
|
||||
|
||||
Private Const ALLOW_RASTERIZATION = True
|
||||
Private Const ALLOW_VECTORIZATION = True
|
||||
|
||||
Private ReadOnly PDFAConformanceLevel As PdfConversionConformance = PdfConversionConformance.PDF_A_1b
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String)
|
||||
MyBase.New(pLogConfig)
|
||||
|
||||
LicenseManager = New LicenseManager()
|
||||
LicenseManager.RegisterKEY(pGDPictureLicenseKey)
|
||||
|
||||
Manager = New AnnotationManager()
|
||||
End Sub
|
||||
|
||||
Public Function MergeDocuments(pDocument As Byte(), pReport As Byte()) As Byte()
|
||||
Using oDocumentStream As New MemoryStream(pDocument)
|
||||
Using oReportStream As New MemoryStream(pReport)
|
||||
Using oFinalStream As New MemoryStream()
|
||||
Using oDocumentPDF As New GdPicturePDF()
|
||||
Using oReportPDF As New GdPicturePDF()
|
||||
Dim oStatus As GdPictureStatus = GdPictureStatus.OK
|
||||
|
||||
' Load the source file into memory
|
||||
oDocumentPDF.LoadFromStream(oDocumentStream, True)
|
||||
|
||||
oStatus = oDocumentPDF.GetStat()
|
||||
If oStatus <> GdPictureStatus.OK Then
|
||||
Throw New MergeDocumentException($"Document could not be loaded: {oStatus}")
|
||||
End If
|
||||
|
||||
' Load the report file into memory
|
||||
oReportPDF.LoadFromStream(oReportStream, True)
|
||||
oStatus = oReportPDF.GetStat()
|
||||
If oStatus <> GdPictureStatus.OK Then
|
||||
Throw New MergeDocumentException($"Report could not be loaded: {oStatus}")
|
||||
End If
|
||||
|
||||
' Merge the documents
|
||||
Dim oMergedPDF = oDocumentPDF.Merge2Documents(oDocumentPDF, oReportPDF)
|
||||
oStatus = oMergedPDF.GetStat()
|
||||
If oStatus <> GdPictureStatus.OK Then
|
||||
Throw New MergeDocumentException($"Documents could not be merged: {oStatus}")
|
||||
End If
|
||||
|
||||
' Convert to PDF/A
|
||||
oMergedPDF.ConvertToPDFA(oFinalStream, PDFAConformanceLevel, ALLOW_VECTORIZATION, ALLOW_RASTERIZATION)
|
||||
oStatus = oDocumentPDF.GetStat()
|
||||
If oStatus <> GdPictureStatus.OK Then
|
||||
Throw New MergeDocumentException($"Document could not be converted to PDF/A: {oStatus}")
|
||||
End If
|
||||
|
||||
Return oFinalStream.ToArray()
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
End Function
|
||||
End Class
|
||||
@@ -0,0 +1,91 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
|
||||
|
||||
Public Class ReportCreator
|
||||
Inherits BaseClass
|
||||
|
||||
Private Envelope As Envelope
|
||||
Private ReadOnly ReportModel As ReportModel
|
||||
Private ReadOnly EnvelopeModel As EnvelopeModel
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pState As State)
|
||||
MyBase.New(pLogConfig)
|
||||
|
||||
ReportModel = New ReportModel(pState)
|
||||
EnvelopeModel = New EnvelopeModel(pState)
|
||||
End Sub
|
||||
|
||||
Public Function CreateReport(pEnvelope As Envelope) As Byte()
|
||||
Try
|
||||
Logger.Debug("Loading report data..")
|
||||
Dim oTable = ReportModel.List(pEnvelope.Id)
|
||||
Dim oItems = GetReportSource(oTable)
|
||||
|
||||
Envelope = pEnvelope
|
||||
|
||||
If oItems.Count = 0 Then
|
||||
Throw New CreateReportException("No report data found!")
|
||||
End If
|
||||
|
||||
Logger.Debug("Creating report with [{0}] items..", oItems.Count)
|
||||
Dim oBuffer = DoCreateReport(oItems)
|
||||
Logger.Debug("Report created!")
|
||||
|
||||
Return oBuffer
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw New CreateReportException("Could not prepare report data!", ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetReportSource(pDataTable As DataTable) As List(Of ReportItem)
|
||||
Logger.Debug("Preparing report data")
|
||||
Return pDataTable.Rows.
|
||||
Cast(Of DataRow).
|
||||
Select(AddressOf ToReportItem).
|
||||
OrderByDescending(Function(r) r.ItemDate).
|
||||
ToList()
|
||||
End Function
|
||||
|
||||
Private Function DoCreateReport(pReportItems As List(Of ReportItem)) As Byte()
|
||||
Dim oItems = pReportItems.Select(AddressOf MergeEnvelope).ToList()
|
||||
Dim oSource As New ReportSource With {.Items = oItems}
|
||||
Dim oReport As New rptEnvelopeHistory() With {.DataSource = oSource, .DataMember = "Items"}
|
||||
|
||||
Logger.Debug("Creating report in memory..")
|
||||
oReport.CreateDocument()
|
||||
|
||||
Logger.Debug("Exporting report to stream..")
|
||||
Using oStream As New MemoryStream()
|
||||
oReport.ExportToPdf(oStream)
|
||||
|
||||
Logger.Debug("Writing report to buffer..")
|
||||
Return oStream.ToArray()
|
||||
End Using
|
||||
End Function
|
||||
|
||||
Private Function MergeEnvelope(pItem As ReportItem) As ReportItem
|
||||
If pItem.Envelope Is Nothing Then
|
||||
pItem.Envelope = Envelope
|
||||
End If
|
||||
Return pItem
|
||||
End Function
|
||||
|
||||
Private Function ToReportItem(pRow As DataRow) As ReportItem
|
||||
Try
|
||||
Return New ReportItem() With {
|
||||
.EnvelopeId = pRow.Item("ENVELOPE_ID"),
|
||||
.EnvelopeTitle = pRow.ItemEx("HEAD_TITLE", String.Empty),
|
||||
.EnvelopeSubject = pRow.ItemEx("HEAD_SUBJECT", String.Empty),
|
||||
.ItemDate = pRow.ItemEx(Of Date)("POS_WHEN", Nothing),
|
||||
.ItemStatus = pRow.ItemEx("POS_STATUS", 0),
|
||||
.ItemUserReference = pRow.ItemEx("POS_WHO", "")
|
||||
}
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw New CreateReportException("Could not read data from database!", ex)
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,4 +1,6 @@
|
||||
Public Class ReportItem
|
||||
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
|
||||
|
||||
Public Class ReportItem
|
||||
|
||||
Public Property Envelope As Envelope
|
||||
Public Property EnvelopeId As Integer
|
||||
@@ -6,6 +8,13 @@
|
||||
Public Property EnvelopeSubject As String
|
||||
|
||||
Public Property ItemStatus As Constants.EnvelopeStatus
|
||||
Public ReadOnly Property ItemStatusTranslated As String
|
||||
Get
|
||||
Dim oStatus = ItemStatus.ToString()
|
||||
Return My.Resources.Model.ResourceManager.GetString(oStatus)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property ItemUserReference As String
|
||||
Public Property ItemDate As Date
|
||||
|
||||
@@ -31,7 +31,7 @@ Public Class CertificateModel
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id
|
||||
oCommand.Parameters.Add("ENVELOPE_UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
|
||||
oCommand.Parameters.Add("ENVELOPE_SUBJECT", SqlDbType.NVarChar).Value = pEnvelope.Subject
|
||||
oCommand.Parameters.Add("ENVELOPE_SUBJECT", SqlDbType.NVarChar).Value = String.Empty
|
||||
oCommand.Parameters.Add("CREATOR_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
oCommand.Parameters.Add("CREATOR_NAME", SqlDbType.NVarChar).Value = pEnvelope.User.FullName
|
||||
oCommand.Parameters.Add("CREATOR_EMAIL", SqlDbType.NVarChar).Value = pEnvelope.User.Email
|
||||
|
||||
28
EnvelopeGenerator.Common/Models/ChartModel.vb
Normal file
28
EnvelopeGenerator.Common/Models/ChartModel.vb
Normal file
@@ -0,0 +1,28 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class ChartModel
|
||||
Inherits BaseModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function LoadPIEExample() As DataTable
|
||||
Try
|
||||
Dim oSQL As String
|
||||
oSQL = " SELECT 'ALLE' as Argument, 100 as Value"
|
||||
oSQL += " UNION "
|
||||
oSQL += " SELECT 'Komplett', 33 "
|
||||
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
|
||||
Return oTable
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
@@ -13,29 +13,28 @@ Public Class ConfigModel
|
||||
Try
|
||||
Dim oSql As String = "SELECT TOP 1 * FROM TBSIG_CONFIG"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
Dim oRow = oTable.Rows.Item(0)
|
||||
Dim oRow As DataRow = oTable.Rows.Item(0)
|
||||
|
||||
Return New DbConfig() With {
|
||||
.DocumentPath = oRow.ItemEx("DOCUMENT_PATH", ""),
|
||||
.DocumentPathOrigin = oRow.ItemEx("DOCUMENT_PATH", ""),
|
||||
.DocumentPath_DMZ = oRow.ItemEx("DOCUMENT_PATH_DMZ", ""),
|
||||
.ExportPath = oRow.ItemEx("EXPORT_PATH", ""),
|
||||
.ExportPath_DMZ = oRow.ItemEx("EXPORT_PATH_DMZ", ""),
|
||||
.SendingProfile = oRow.ItemEx("SENDING_PROFILE", 0),
|
||||
.SignatureHost = oRow.ItemEx("SIGNATURE_HOST", ""),
|
||||
.ExternalProgramName = oRow.ItemEx("EXTERNAL_PROGRAM_NAME", "")
|
||||
.ExternalProgramName = oRow.ItemEx("EXTERNAL_PROGRAM_NAME", ""),
|
||||
.DOCUMENT_PATH_MOVE_AFTSEND = oRow.ItemEx("DOCUMENT_PATH_MOVE_AFTSEND", ""),
|
||||
.FINISHED_PATH_EX_DMZ = oRow.ItemEx("FINISHED_PATH_EX_DMZ", ""),
|
||||
.EML_PATH_EX_DMZ = oRow.ItemEx("EML_PATH_EX_DMZ", "")
|
||||
}
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return New DbConfig()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetUserId() As Integer
|
||||
Try
|
||||
Dim oUserId As Integer = Database.GetScalarValue($"SELECT GUID FROM TBDD_USER WHERE USERNAME = '{Environment.UserName}'")
|
||||
Return oUserId
|
||||
|
||||
Catch ex As Exception
|
||||
Return 0
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -24,7 +24,8 @@ Public Class DocumentModel
|
||||
.Filepath = pRow.ItemEx("FILEPATH", ""),
|
||||
.FileNameOriginal = pRow.ItemEx("FILENAME_ORIGINAL", ""),
|
||||
.IsTempFile = False,
|
||||
.Elements = ElementModel.List(oDocumentId, pReceiverId)
|
||||
.Elements = ElementModel.List(oDocumentId, pReceiverId),
|
||||
.Byte_Data = DirectCast(pRow.Item("BYTE_DATA"), Byte())
|
||||
}
|
||||
End Function
|
||||
|
||||
@@ -79,18 +80,21 @@ Public Class DocumentModel
|
||||
([FILENAME]
|
||||
,[FILENAME_ORIGINAL]
|
||||
,[FILEPATH]
|
||||
,[ENVELOPE_ID])
|
||||
,[ENVELOPE_ID]
|
||||
,[BYTE_DATA])
|
||||
VALUES
|
||||
(@FILENAME
|
||||
,@FILENAME_ORIGINAL
|
||||
,@FILEPATH
|
||||
,@ENVELOPE_ID)"
|
||||
,@ENVELOPE_ID
|
||||
,@BYTE_DATA)"
|
||||
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("FILENAME", SqlDbType.NVarChar).Value = pDocument.Filename
|
||||
oCommand.Parameters.Add("FILENAME_ORIGINAL", SqlDbType.NVarChar).Value = pDocument.FileNameOriginal
|
||||
oCommand.Parameters.Add("FILEPATH", SqlDbType.NVarChar).Value = pDocument.Filepath
|
||||
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pEnvelope.Id
|
||||
oCommand.Parameters.Add(New SqlParameter("@BYTE_DATA", DirectCast(pDocument.Byte_Data, Object)))
|
||||
|
||||
If Database.ExecuteNonQuery(oCommand, pTransaction) Then
|
||||
pDocument.EnvelopeId = pEnvelope.Id
|
||||
|
||||
@@ -12,18 +12,21 @@ Public Class EmailModel
|
||||
Public Function Insert(pEmail As EmailData) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] "
|
||||
oSql += " (EMAIL_ADRESS, EMAIL_SUBJ, EMAIL_BODY, ADDED_WHO, SENDING_PROFILE, REFERENCE_ID, REFERENCE_STRING, REMINDER_TYPE_ID, WF_ID) "
|
||||
oSql += " VALUES (@EMAIL_ADRESS, @EMAIL_SUBJ, @EMAIL_BODY, @ADDED_WHO, @SENDING_PROFILE, @REFERENCE_ID, @REFERENCE_STRING, @REMINDER_TYPE_ID, @WF_ID)"
|
||||
oSql += " (EMAIL_ADRESS, EMAIL_SUBJ, EMAIL_BODY, ADDED_WHO, SENDING_PROFILE, REFERENCE_ID, REFERENCE_STRING, REMINDER_TYPE_ID, WF_ID,ATT1_RELATED_ID,ATT1_REL_TYPE) "
|
||||
oSql += " VALUES (@EMAIL_ADRESS, @EMAIL_SUBJ, @EMAIL_BODY, @ADDED_WHO, @SENDING_PROFILE, @REFERENCE_ID, @REFERENCE_STRING, @REMINDER_TYPE_ID, @WF_ID,@ATT1_RELATED_ID,@ATT1_REL_TYPE)"
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("EMAIL_ADRESS", SqlDbType.NVarChar).Value = pEmail.EmailAdress
|
||||
oCommand.Parameters.Add("EMAIL_SUBJ", SqlDbType.NVarChar).Value = pEmail.EmailSubjectTranslated
|
||||
oCommand.Parameters.Add("EMAIL_SUBJ", SqlDbType.NVarChar).Value = pEmail.EmailSubject
|
||||
oCommand.Parameters.Add("EMAIL_BODY", SqlDbType.NVarChar).Value = pEmail.EmailBody
|
||||
oCommand.Parameters.Add("ADDED_WHO", SqlDbType.NVarChar).Value = "DDEnvelopGenerator"
|
||||
oCommand.Parameters.Add("SENDING_PROFILE", SqlDbType.Int).Value = State.DbConfig.SendingProfile
|
||||
oCommand.Parameters.Add("REFERENCE_ID", SqlDbType.Int).Value = pEmail.ReferenceID
|
||||
oCommand.Parameters.Add("REFERENCE_STRING", SqlDbType.NVarChar).Value = pEmail.ReferenceString
|
||||
oCommand.Parameters.Add("REMINDER_TYPE_ID", SqlDbType.Int).Value = 77
|
||||
oCommand.Parameters.Add("WF_ID", SqlDbType.Int).Value = 77
|
||||
oCommand.Parameters.Add("REMINDER_TYPE_ID", SqlDbType.Int).Value = 202377
|
||||
'oCommand.Parameters.Add("EMAIL_ATTMT1", SqlDbType.NVarChar).Value = pEmail.EmailAttachment
|
||||
oCommand.Parameters.Add("WF_ID", SqlDbType.Int).Value = pEmail.EmailType ' Wegen DB-Trigger MUSS dieser Wert gesetzt werden
|
||||
oCommand.Parameters.Add("ATT1_RELATED_ID", SqlDbType.Int).Value = pEmail.ATT1_RELATED_ID
|
||||
oCommand.Parameters.Add("ATT1_REL_TYPE", SqlDbType.NVarChar).Value = pEmail.ATT1_REL_TYPE
|
||||
|
||||
If Database.ExecuteNonQuery(oCommand) Then
|
||||
Return True
|
||||
|
||||
31
EnvelopeGenerator.Common/Models/EmailTemplateModel.vb
Normal file
31
EnvelopeGenerator.Common/Models/EmailTemplateModel.vb
Normal file
@@ -0,0 +1,31 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
|
||||
Public Class EmailTemplateModel
|
||||
Inherits BaseModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToEmailTemplate(pRow As DataRow) As EmailTemplate
|
||||
Return New EmailTemplate() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.Name = pRow.ItemEx("NAME", ""),
|
||||
.Body = pRow.ItemEx("BODY", ""),
|
||||
.Subject = pRow.ItemEx("SUBJECT", "")
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Function GetById(pEmailTemplateName As EmailTemplateType) As EmailTemplate
|
||||
Dim oSql As String = $"SELECT * FROM TBSIG_EMAIL_TEMPLATE WHERE NAME = '{pEmailTemplateName}'"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
|
||||
If oTable.Rows.Count = 0 Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Dim oRow = oTable.Rows.Item(0)
|
||||
Return ToEmailTemplate(oRow)
|
||||
End Function
|
||||
End Class
|
||||
@@ -8,7 +8,9 @@ Public Class EnvelopeModel
|
||||
|
||||
Private ReadOnly UserModel As UserModel
|
||||
Private ReadOnly ReceiverModel As ReceiverModel
|
||||
Private ReadOnly HistoryModel As HistoryModel
|
||||
Private ReadOnly DocumentModel As DocumentModel
|
||||
Private ReadOnly EnvelopeTypeModel As EnvelopeTypeModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
@@ -16,25 +18,49 @@ Public Class EnvelopeModel
|
||||
UserModel = New UserModel(pState)
|
||||
ReceiverModel = New ReceiverModel(pState)
|
||||
DocumentModel = New DocumentModel(pState)
|
||||
HistoryModel = New HistoryModel(pState)
|
||||
EnvelopeTypeModel = New EnvelopeTypeModel(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToEnvelope(pRow As DataRow) As Envelope
|
||||
Dim oEnvelope = New Envelope() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.Title = pRow.ItemEx("TITLE", ""),
|
||||
.ContractType = ObjectEx.ToEnum(Of Constants.ContractType)(pRow.ItemEx("CONTRACT_TYPE", Constants.ContractType.Contract.ToString())),
|
||||
.EnvelopeTypeId = pRow.ItemEx("ENVELOPE_TYPE", 0),
|
||||
.ContractType = pRow.ItemEx("CONTRACT_TYPE", 0),
|
||||
.Uuid = pRow.ItemEx("ENVELOPE_UUID", ""),
|
||||
.Subject = pRow.ItemEx("SUBJECT", ""),
|
||||
.Message = pRow.ItemEx("MESSAGE", ""),
|
||||
.UserId = pRow.ItemEx("USER_ID", 0),
|
||||
.Language = pRow.ItemEx("LANGUAGE", "de-DE"),
|
||||
.Status = ObjectEx.ToEnum(Of Constants.EnvelopeStatus)(pRow.ItemEx("STATUS", Constants.EnvelopeStatus.EnvelopeCreated.ToString())),
|
||||
.AddedWhen = pRow.Item("ADDED_WHEN"),
|
||||
.User = New User()
|
||||
.CertificationType = ObjectEx.ToEnum(Of Constants.CertificationType)(pRow.ItemEx("CERTIFICATION_TYPE", Constants.CertificationType.ElectronicSignature.ToString())),
|
||||
.User = New User(),
|
||||
.ExpiresWhen = pRow.ItemEx(Of Date)("EXPIRES_WHEN", Nothing),
|
||||
.ExpiresWarningWhen = pRow.ItemEx(Of Date)("EXPIRES_WARNING_WHEN", Nothing),
|
||||
.ExpiresWhenDays = pRow.ItemEx("EXPIRES_WHEN_DAYS", 0),
|
||||
.ExpiresWarningWhenDays = pRow.ItemEx("EXPIRES_WARNING_WHEN_DAYS", 0),
|
||||
.SendReminderEmails = pRow.ItemEx("SEND_REMINDER_EMAILS", False),
|
||||
.FirstReminderDays = pRow.ItemEx("FIRST_REMINDER_DAYS", 0),
|
||||
.ReminderIntervalDays = pRow.ItemEx("REMINDER_INTERVAL_DAYS", 0),
|
||||
.UseAccessCode = pRow.ItemEx("USE_ACCESS_CODE", False),
|
||||
.FinalEmailToCreator = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", Constants.FinalEmailType.No.ToString())),
|
||||
.FinalEmailToReceivers = ObjectEx.ToEnum(Of Constants.FinalEmailType)(pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", Constants.FinalEmailType.No.ToString()))
|
||||
}
|
||||
|
||||
Dim oDOC_RESULT = pRow.Item("DOC_RESULT")
|
||||
If Not IsDBNull(oDOC_RESULT) Then
|
||||
Dim oByte As Byte() = DirectCast(pRow.Item("DOC_RESULT"), Byte())
|
||||
If Not IsNothing(oByte) Then
|
||||
oEnvelope.DOC_RESULT = oByte
|
||||
End If
|
||||
Else
|
||||
oEnvelope.DOC_RESULT = Nothing
|
||||
End If
|
||||
oEnvelope.User = UserModel.SelectUser(oEnvelope.UserId)
|
||||
oEnvelope.Receivers = ReceiverModel.ListEnvelopeReceivers(oEnvelope.Id)
|
||||
oEnvelope.Documents = DocumentModel.List(oEnvelope.Id)
|
||||
oEnvelope.History = HistoryModel.List(oEnvelope.Id)
|
||||
oEnvelope.EnvelopeType = EnvelopeTypeModel.GetById(oEnvelope.EnvelopeTypeId)
|
||||
|
||||
Return oEnvelope
|
||||
End Function
|
||||
@@ -57,9 +83,9 @@ Public Class EnvelopeModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetById(pEnvelopeId As String) As Envelope
|
||||
Public Function GetById(pEnvelopeId As Integer) As Envelope
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE GUID = '{pEnvelopeId}'"
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE GUID = {pEnvelopeId}"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return ToEnvelope(oTable)
|
||||
@@ -71,7 +97,7 @@ Public Class EnvelopeModel
|
||||
|
||||
Public Function List() As IEnumerable(Of Envelope)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE USER_ID = {State.UserId} AND STATUS IN (1001,1002,1003,1004,1005)"
|
||||
Dim oSql = $"EXEC [dbo].[PRSIG_GET_ENVELOPES_FOR_USER] {State.UserId}"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
@@ -85,7 +111,7 @@ Public Class EnvelopeModel
|
||||
|
||||
Public Function ListCompleted() As IEnumerable(Of Envelope)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_ENVELOPE] WHERE USER_ID = {State.UserId} AND STATUS = 4"
|
||||
Dim oSql = $"EXEC [dbo].[PRSIG_GET_CLOSED_ENVELOPES_FOR_USER] {State.UserId}"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
@@ -116,20 +142,17 @@ Public Class EnvelopeModel
|
||||
|
||||
Public Function Insert(pEnvelope As Envelope) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE] (SUBJECT, MESSAGE, ENVELOPE_UUID, STATUS, USER_ID, TITLE, CONTRACT_TYPE) "
|
||||
oSql += " VALUES (@SUBJECT, @MESSAGE, @UUID, @STATUS, @USER_ID, @TITLE, @CONTRACT_TYPE)"
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE] (MESSAGE, ENVELOPE_UUID, STATUS, USER_ID) "
|
||||
oSql += " VALUES (@MESSAGE, @UUID, @STATUS, @USER_ID)"
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = String.Empty
|
||||
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = String.Empty
|
||||
oCommand.Parameters.Add("UUID", SqlDbType.NVarChar).Value = pEnvelope.Uuid
|
||||
oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = Constants.EnvelopeStatus.EnvelopeCreated
|
||||
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
|
||||
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.Int).Value = pEnvelope.ContractType
|
||||
|
||||
If Database.ExecuteNonQuery(oCommand) Then
|
||||
pEnvelope.Id = GetEnvelopeId(pEnvelope)
|
||||
SetEnvelopeDate(pEnvelope) 'TODO JJ fragen
|
||||
SetEnvelopeDate(pEnvelope)
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -144,22 +167,45 @@ Public Class EnvelopeModel
|
||||
Public Function Update(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
|
||||
Try
|
||||
Dim oSql = "UPDATE [dbo].[TBSIG_ENVELOPE] SET "
|
||||
oSql += " [SUBJECT] = @SUBJECT, "
|
||||
oSql += " [MESSAGE] = @MESSAGE, "
|
||||
oSql += " [STATUS] = @STATUS, "
|
||||
oSql += " [TITLE] = @TITLE, "
|
||||
oSql += " [ENVELOPE_TYPE] = @ENVELOPE_TYPE, "
|
||||
oSql += " [CONTRACT_TYPE] = @CONTRACT_TYPE, "
|
||||
oSql += " [LANGUAGE] = @LANGUAGE, "
|
||||
oSql += " [CERTIFICATION_TYPE] = @CERTIFICATION_TYPE, "
|
||||
oSql += " [EXPIRES_WHEN_DAYS] = @EXPIRES_WHEN_DAYS, "
|
||||
oSql += " [EXPIRES_WARNING_WHEN_DAYS] = @EXPIRES_WARNING_WHEN_DAYS, "
|
||||
oSql += " [FIRST_REMINDER_DAYS] = @FIRST_REMINDER_DAYS, "
|
||||
oSql += " [FINAL_EMAIL_TO_CREATOR] = @FINAL_EMAIL_TO_CREATOR, "
|
||||
oSql += " [FINAL_EMAIL_TO_RECEIVERS] = @FINAL_EMAIL_TO_RECEIVERS, "
|
||||
oSql += " [REMINDER_INTERVAL_DAYS] = @REMINDER_INTERVAL_DAYS, "
|
||||
oSql += " [SEND_REMINDER_EMAILS] = @SEND_REMINDER_EMAILS, "
|
||||
oSql += " [USE_ACCESS_CODE] = @USE_ACCESS_CODE, "
|
||||
oSql += " [CHANGED_WHEN] = GETDATE() "
|
||||
oSql += " WHERE GUID = @ID AND USER_ID = @USER_ID"
|
||||
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("SUBJECT", SqlDbType.NVarChar).Value = pEnvelope.Subject
|
||||
oCommand.Parameters.Add("ID", SqlDbType.Int).Value = pEnvelope.Id
|
||||
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
oCommand.Parameters.Add("MESSAGE", SqlDbType.NVarChar).Value = pEnvelope.Message
|
||||
oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = pEnvelope.Status
|
||||
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pEnvelope.Title
|
||||
oCommand.Parameters.Add("ENVELOPE_TYPE", SqlDbType.Int).Value = pEnvelope.EnvelopeTypeId
|
||||
oCommand.Parameters.Add("CONTRACT_TYPE", SqlDbType.Int).Value = pEnvelope.ContractType
|
||||
|
||||
oCommand.Parameters.Add("ID", SqlDbType.Int).Value = pEnvelope.Id
|
||||
oCommand.Parameters.Add("USER_ID", SqlDbType.Int).Value = pEnvelope.UserId
|
||||
If IsNothing(pEnvelope.Language) Then
|
||||
pEnvelope.Language = "de-DE"
|
||||
End If
|
||||
oCommand.Parameters.Add("LANGUAGE", SqlDbType.NVarChar).Value = pEnvelope.Language
|
||||
oCommand.Parameters.Add("CERTIFICATION_TYPE", SqlDbType.Int).Value = pEnvelope.CertificationType
|
||||
oCommand.Parameters.Add("EXPIRES_WHEN_DAYS", SqlDbType.Int).Value = pEnvelope.ExpiresWhenDays
|
||||
oCommand.Parameters.Add("EXPIRES_WARNING_WHEN_DAYS", SqlDbType.Int).Value = pEnvelope.ExpiresWarningWhenDays
|
||||
oCommand.Parameters.Add("FIRST_REMINDER_DAYS", SqlDbType.Int).Value = pEnvelope.FirstReminderDays
|
||||
oCommand.Parameters.Add("FINAL_EMAIL_TO_CREATOR", SqlDbType.Int).Value = pEnvelope.FinalEmailToCreator
|
||||
oCommand.Parameters.Add("FINAL_EMAIL_TO_RECEIVERS", SqlDbType.Int).Value = pEnvelope.FinalEmailToReceivers
|
||||
oCommand.Parameters.Add("REMINDER_INTERVAL_DAYS", SqlDbType.Int).Value = pEnvelope.ReminderIntervalDays
|
||||
oCommand.Parameters.Add("SEND_REMINDER_EMAILS", SqlDbType.Bit).Value = pEnvelope.SendReminderEmails
|
||||
oCommand.Parameters.Add("USE_ACCESS_CODE", SqlDbType.Bit).Value = pEnvelope.UseAccessCode
|
||||
|
||||
Return Database.ExecuteNonQuery(oCommand, pTransaction)
|
||||
|
||||
@@ -172,7 +218,7 @@ Public Class EnvelopeModel
|
||||
Public Function Delete(pEnvelope As Envelope, pTransaction As SqlTransaction) As Boolean
|
||||
Try
|
||||
Dim oSql = $"DELETE FROM [dbo].[TBSIG_ENVELOPE] WHERE GUID = {pEnvelope.Id}"
|
||||
'Return Database.ExecuteNonQuery(oSql, pTransaction)
|
||||
Return Database.ExecuteNonQuery(oSql, pTransaction)
|
||||
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
|
||||
49
EnvelopeGenerator.Common/Models/EnvelopeTypeModel.vb
Normal file
49
EnvelopeGenerator.Common/Models/EnvelopeTypeModel.vb
Normal file
@@ -0,0 +1,49 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Public Class EnvelopeTypeModel
|
||||
Inherits BaseModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToEnvelopeType(pRow As DataRow) As EnvelopeType
|
||||
Return New EnvelopeType() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.Title = pRow.ItemEx("TITLE", ""),
|
||||
.UseAccessCode = pRow.ItemEx("USE_ACCESS_CODE", False),
|
||||
.Language = pRow.ItemEx("LANGUAGE", "de"),
|
||||
.ExpiresWhenDays = pRow.ItemEx("EXPIRES_DAYS", 0),
|
||||
.ExpiresWarningWhenDays = pRow.ItemEx("EXPIRES_WARNING_DAYS", 0),
|
||||
.SendReminderEmails = pRow.ItemEx("SEND_REMINDER_EMAILS", 0),
|
||||
.FirstReminderDays = pRow.ItemEx("FIRST_REMINDER_DAYS", 0),
|
||||
.ReminderIntervalDays = pRow.ItemEx("REMINDER_INTERVAL_DAYS", 0),
|
||||
.FinalEmailToCreator = pRow.ItemEx("FINAL_EMAIL_TO_CREATOR", 0),
|
||||
.FinalEmailToReceivers = pRow.ItemEx("FINAL_EMAIL_TO_RECEIVERS", 0),
|
||||
.ContractType = pRow.ItemEx("CONTRACT_TYPE", 0),
|
||||
.CertificationType = pRow.ItemEx("CERTIFICATION_TYPE", 0)
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Function GetById(pEnvelopeTypeId As Integer) As EnvelopeType
|
||||
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE WHERE GUID = {pEnvelopeTypeId}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
|
||||
If oTable.Rows.Count = 0 Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Dim oRow = oTable.Rows.Item(0)
|
||||
Return ToEnvelopeType(oRow)
|
||||
End Function
|
||||
|
||||
Public Function List() As IEnumerable(Of EnvelopeType)
|
||||
Dim oSql As String = $"SELECT * FROM TBSIG_ENVELOPE_TYPE"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable.Rows.
|
||||
Cast(Of DataRow).
|
||||
Select(AddressOf ToEnvelopeType).
|
||||
ToList()
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Public Class HistoryModel
|
||||
Inherits BaseModel
|
||||
@@ -7,6 +8,37 @@ Public Class HistoryModel
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As EnvelopeHistoryEntry
|
||||
Return New EnvelopeHistoryEntry() With {
|
||||
.ActionDate = pRow.ItemEx(Of Date)("ACTION_DATE", Nothing),
|
||||
.EnvelopeId = pRow.Item("ENVELOPE_ID"),
|
||||
.Status = pRow.Item("STATUS"),
|
||||
.UserReference = pRow.ItemEx("USER_REFERENCE", "")
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Function List(pEnvelopeId As Integer) As List(Of EnvelopeHistoryEntry)
|
||||
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE_HISTORY WHERE ENVELOPE_ID = {pEnvelopeId} AND ACTION_DATE IS NOT NULL ORDER BY GUID DESC"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
Return oTable?.Rows.
|
||||
Cast(Of DataRow).
|
||||
Select(AddressOf ToEnvelopeHistoryEntry).
|
||||
ToList()
|
||||
End Function
|
||||
|
||||
Public Function HasReceiverSigned(pEnvelopeId As Integer, pReceiverId As Integer) As Boolean
|
||||
Dim oEnvelopeSigned As Integer = Constants.EnvelopeStatus.DocumentSigned
|
||||
Dim oSql = $"SELECT COUNT(T.GUID)
|
||||
FROM TBSIG_ENVELOPE_HISTORY T
|
||||
JOIN TBSIG_RECEIVER T2 ON T.USER_REFERENCE = T2.EMAIL_ADDRESS
|
||||
WHERE T.STATUS = {oEnvelopeSigned} AND
|
||||
T.ENVELOPE_ID = {pEnvelopeId} AND
|
||||
T2.GUID = {pReceiverId}"
|
||||
Dim oRowCount As Integer = Database.GetScalarValue(oSql)
|
||||
|
||||
Return oRowCount > 0
|
||||
End Function
|
||||
|
||||
Public Function Insert(pHistory As EnvelopeHistoryEntry) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY] "
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Net.Mail
|
||||
Imports DevExpress.DataProcessing
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
|
||||
@@ -12,14 +12,28 @@ Public Class ReceiverModel
|
||||
End Sub
|
||||
|
||||
Private Function ToReceiver(pRow As DataRow, pColorIndex As Integer) As EnvelopeReceiver
|
||||
Dim EmailAdress As String = pRow.ItemEx("EMAIL_ADDRESS", "")
|
||||
Dim EnvelopeId As Integer = pRow.ItemEx("ENVELOPE_ID", 0)
|
||||
Dim SignedDate As DateTime = DateTime.MinValue
|
||||
Dim ReceiverSignedStatus As ReceiverStatus = ReceiverStatus.Unsigned
|
||||
|
||||
If String.IsNullOrEmpty(EmailAdress) = False Then
|
||||
SignedDate = GetSignedDate(EmailAdress, EnvelopeId)
|
||||
If SignedDate <> DateTime.MinValue Then
|
||||
ReceiverSignedStatus = ReceiverStatus.Signed
|
||||
End If
|
||||
End If
|
||||
|
||||
Return New EnvelopeReceiver() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.Email = pRow.ItemEx("EMAIL_ADDRESS", ""),
|
||||
.Name = pRow.ItemEx("NAME", ""),
|
||||
.Sequence = pRow.ItemEx("SEQUENCE", 0),
|
||||
.Signature = pRow.ItemEx("SIGNATURE", ""),
|
||||
.Status = ReceiverStatus.Unsigned,
|
||||
.ColorType = DirectCast(pColorIndex + 1, ColorType)
|
||||
.Status = ReceiverSignedStatus,
|
||||
.ColorType = DirectCast(pColorIndex + 1, ColorType),
|
||||
.AccessCode = pRow.ItemEx("ACCESS_CODE", ""),
|
||||
.SignedDate = SignedDate
|
||||
}
|
||||
End Function
|
||||
|
||||
@@ -146,6 +160,40 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListAllEnvelopeReceiverAddresses(pUserId As Integer) As IEnumerable(Of String)
|
||||
Try
|
||||
Dim oSql = $"SELECT DISTINCT T.EMAIL_ADDRESS FROM TBSIG_RECEIVER T
|
||||
JOIN TBSIG_ENVELOPE_RECEIVER T2 ON T.GUID = T2.RECEIVER_ID
|
||||
JOIN TBSIG_ENVELOPE T3 ON T2.ENVELOPE_ID = T3.GUID
|
||||
WHERE T3.USER_ID = {pUserId}"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
Select(Function(r) r.Item("EMAIL_ADDRESS")).
|
||||
Cast(Of String).
|
||||
ToList()
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return New List(Of String)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers() As IEnumerable(Of EnvelopeReceiver)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_RECEIVER]"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToReceiver).
|
||||
ToList()
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers(pReceiversFromGrid As List(Of EnvelopeReceiver)) As IEnumerable(Of EnvelopeReceiver)
|
||||
Try
|
||||
If pReceiversFromGrid.Count = 0 Then
|
||||
@@ -180,16 +228,17 @@ Public Class ReceiverModel
|
||||
End Function
|
||||
|
||||
Public Function GetById(pReceiverId As Integer) As EnvelopeReceiver
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE GUID = {pReceiverId}"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
'Try
|
||||
' Dim oSql = $"SELECT * FROM [dbo].[VWSIG_ENVELOPE_RECEIVERS] WHERE RECEIVER_ID = {pReceiverId}"
|
||||
' Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return ToReceiver(oTable)
|
||||
' Return ToReceiver(oTable)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
'Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Return Nothing
|
||||
'End Try
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Function GetReceiverIdBySignature(pSignature As String) As Integer
|
||||
@@ -201,6 +250,23 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetLastUsedReceiverName(pEmailAddress As String, pUserId As Integer) As String
|
||||
Try
|
||||
Dim oSql As String
|
||||
oSql = "SELECT TOP 1 [NAME] FROM dbo.VWSIG_ENVELOPE_RECEIVERS "
|
||||
oSql += $" WHERE ENVELOPE_ID IN (SELECT GUID FROM dbo.TBSIG_ENVELOPE WHERE [USER_ID] = {pUserId}) "
|
||||
oSql += $" AND EMAIL_ADDRESS = '{pEmailAddress}' "
|
||||
oSql += " AND Len([NAME]) > 0 "
|
||||
oSql += " ORDER BY [ADDED_WHEN] DESC"
|
||||
|
||||
Return Database.GetScalarValue(oSql)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetReceiverIdByEmail(pEmailAddress As String, pTransaction As SqlTransaction) As Integer
|
||||
Try
|
||||
Return Database.GetScalarValue($"SELECT GUID FROM TBSIG_RECEIVER WHERE EMAIL_ADDRESS = '{pEmailAddress}'", pTransaction)
|
||||
@@ -211,5 +277,29 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetSignedDate(pEmailAddress As String, pEnvelopeId As Integer) As Date
|
||||
Try
|
||||
Dim oStatusInt As Integer = EnvelopeStatus.DocumentSigned
|
||||
Return Database.GetScalarValue($"SELECT ACTION_DATE FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY] WHERE ENVELOPE_ID = {pEnvelopeId}
|
||||
And USER_REFERENCE = '{pEmailAddress}' AND [STATUS] = {oStatusInt}")
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function AccessCodeAlreadyRequested(pEmailAddress As String, pEnvelopeId As Integer) As Boolean
|
||||
Try
|
||||
Dim oStatusInt As Integer = EnvelopeStatus.AccessCodeRequested
|
||||
Dim oResult As Integer = Database.GetScalarValue($"SELECT COUNT(*) FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY]
|
||||
WHERE ENVELOPE_ID = {pEnvelopeId} And USER_REFERENCE = '{pEmailAddress}' AND [STATUS] = {oStatusInt}")
|
||||
|
||||
Return oResult > 0
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
14
EnvelopeGenerator.Common/Models/ReportModel.vb
Normal file
14
EnvelopeGenerator.Common/Models/ReportModel.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Public Class ReportModel
|
||||
Inherits BaseModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Public Function List(pEnvelopeId As Integer) As DataTable
|
||||
Dim oSql As String = $"SELECT * FROM VWSIG_ENVELOPE_REPORT WHERE ENVELOPE_ID = {pEnvelopeId}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable
|
||||
End Function
|
||||
End Class
|
||||
@@ -21,6 +21,29 @@ Public Class UserModel
|
||||
Return oUser
|
||||
End Function
|
||||
|
||||
Public Function CheckUserLogin(pUser As User) As User
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[FNDD_LOGIN_USER_MODULE] ('{pUser.Username}', 'SIG_ENV_CR', 1)"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||
|
||||
If oTable?.Rows.Count = 0 Then
|
||||
Return pUser
|
||||
End If
|
||||
|
||||
Dim oRow = oTable.Rows.Item(0)
|
||||
Dim oHasAccess = oRow.ItemEx("MODULE_ACCESS", False)
|
||||
Dim oIsAdmin = oRow.ItemEx("IS_ADMIN", False)
|
||||
|
||||
pUser.HasAccess = oHasAccess
|
||||
pUser.IsAdmin = oIsAdmin
|
||||
|
||||
Return pUser
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return pUser
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function SelectUser() As User
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBDD_USER] WHERE GUID = {State.UserId}"
|
||||
@@ -47,4 +70,15 @@ Public Class UserModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function SelectUserId() As Integer
|
||||
Try
|
||||
Dim oUserId As Integer = Database.GetScalarValue($"SELECT GUID FROM TBDD_USER WHERE USERNAME = '{Environment.UserName}'")
|
||||
Return oUserId
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return 0
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -8,12 +8,12 @@ Imports System.Runtime.InteropServices
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("Base")>
|
||||
<Assembly: AssemblyTitle("EnvelopeGenerator.Common")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Base")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("1.3.4.0")>
|
||||
<Assembly: AssemblyProduct("EnvelopeGenerator.Common")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024")>
|
||||
<Assembly: AssemblyTrademark("1.3.6.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' indem Sie "*" wie unten gezeigt eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.3.4.0")>
|
||||
<Assembly: AssemblyFileVersion("1.3.4.0")>
|
||||
<Assembly: AssemblyVersion("1.9.1.0")>
|
||||
<Assembly: AssemblyFileVersion("1.9.1.0")>
|
||||
|
||||
@@ -59,5 +59,21 @@ Namespace My.Resources
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" lang="und" style="padding:0;Margin:0">
|
||||
'''<head>
|
||||
''' <meta http-equiv="Content-Security-Policy" content="script-src 'none'; connect-src 'none'; object-src 'none'; form-action 'none';">
|
||||
''' <meta charset="UTF-8">
|
||||
''' <meta content="width=device-width, initial-scale=1" name="viewport">
|
||||
''' <meta name="x-apple-disable-message-reformatting">
|
||||
''' <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
''' <meta cont [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property email_de() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("email_de", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
@@ -60,6 +60,7 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
@@ -68,9 +69,10 @@
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
@@ -85,9 +87,10 @@
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
@@ -109,9 +112,13 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="email_de" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Templates\email_de.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -15,7 +15,7 @@ Option Explicit On
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0"), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
@@ -53,6 +53,33 @@ Namespace My
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public ReadOnly Property RuninDMZ() As Boolean
|
||||
Get
|
||||
Return CType(Me("RuninDMZ"),Boolean)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("dd-gan\Administrator")> _
|
||||
Public ReadOnly Property NetUse_Usr() As String
|
||||
Get
|
||||
Return CType(Me("NetUse_Usr"),String)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("sY4vnATDXwosbTJGip6SqA==")> _
|
||||
Public ReadOnly Property NetUse_PW() As String
|
||||
Get
|
||||
Return CType(Me("NetUse_PW"),String)
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="RuninDMZ" Type="System.Boolean" Scope="Application">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="NetUse_Usr" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">dd-gan\Administrator</Value>
|
||||
</Setting>
|
||||
<Setting Name="NetUse_PW" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">sY4vnATDXwosbTJGip6SqA==</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -1,30 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports DevExpress.XtraPrinting
|
||||
|
||||
Public Class ReportCreator
|
||||
Private Envelope As Envelope
|
||||
|
||||
Public Sub New(pEnvelope As Envelope)
|
||||
Envelope = pEnvelope
|
||||
End Sub
|
||||
|
||||
Public Async Function CreateReport(pReportItems As List(Of ReportItem)) As Task(Of Byte())
|
||||
Dim oItems = pReportItems.Select(AddressOf MergeEnvelope).ToList()
|
||||
Dim oSource As New ReportSource With {.Items = oItems}
|
||||
Dim oReport As New rptEnvelopeHistory() With {.DataSource = oSource, .DataMember = "Items"}
|
||||
|
||||
Await oReport.CreateDocumentAsync()
|
||||
|
||||
Using oStream As New MemoryStream()
|
||||
Await oReport.ExportToPdfAsync(oStream, New PdfExportOptions)
|
||||
Return oStream.ToArray()
|
||||
End Using
|
||||
End Function
|
||||
|
||||
Private Function MergeEnvelope(pItem As ReportItem) As ReportItem
|
||||
If pItem.Envelope Is Nothing Then
|
||||
pItem.Envelope = Envelope
|
||||
End If
|
||||
Return pItem
|
||||
End Function
|
||||
End Class
|
||||
@@ -20,12 +20,33 @@ Partial Public Class rptEnvelopeHistory
|
||||
<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()
|
||||
@@ -43,19 +64,19 @@ Partial Public Class rptEnvelopeHistory
|
||||
Me.DetailData1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.DetailData3_Odd = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.PageInfo = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.XrLabel2 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel3 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.GalleryDropDown1 = New DevExpress.XtraBars.Ribbon.GalleryDropDown(Me.components)
|
||||
Me.ObjectDataSource1 = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource(Me.components)
|
||||
Me.XrLabel4 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel1 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
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
|
||||
@@ -64,42 +85,384 @@ Partial Public Class rptEnvelopeHistory
|
||||
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(470.5625!, 58.0!)
|
||||
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(1166.417!, 0!)
|
||||
Me.pageInfo2.LocationFloat = New DevExpress.Utils.PointFloat(1542.125!, 0!)
|
||||
Me.pageInfo2.Name = "pageInfo2"
|
||||
Me.pageInfo2.SizeF = New System.Drawing.SizeF(733.5833!, 58.0!)
|
||||
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.XrLabel4, Me.XrLabel3, Me.XrLabel2, Me.label1})
|
||||
Me.ReportHeader.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.label1, Me.XrTable3})
|
||||
Me.ReportHeader.Dpi = 254.0!
|
||||
Me.ReportHeader.HeightF = 293.2334!
|
||||
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.LocationFloat = New DevExpress.Utils.PointFloat(0!, 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(0, 0, 0, 0, 254.0!)
|
||||
Me.label1.SizeF = New System.Drawing.SizeF(1900.0!, 61.4536!)
|
||||
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 = "Signierungs Zertifikat"
|
||||
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 = "Email"
|
||||
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].[Email]")})
|
||||
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
|
||||
'
|
||||
@@ -126,35 +489,63 @@ Partial Public Class rptEnvelopeHistory
|
||||
'
|
||||
'tableCell1
|
||||
'
|
||||
Me.tableCell1.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||
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.Text = "Aktion"
|
||||
Me.tableCell1.Weight = 0.626953898336187R
|
||||
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.30791185539648991R
|
||||
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.Text = "Datum"
|
||||
Me.tableCell3.Weight = 0.25860160582871317R
|
||||
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 = 63.42!
|
||||
Me.Detail.HeightF = 86.174!
|
||||
Me.Detail.HierarchyPrintOptions.Indent = 50.8!
|
||||
Me.Detail.Name = "Detail"
|
||||
'
|
||||
@@ -163,7 +554,6 @@ Partial Public Class rptEnvelopeHistory
|
||||
Me.table2.Dpi = 254.0!
|
||||
Me.table2.LocationFloat = New DevExpress.Utils.PointFloat(0!, 0!)
|
||||
Me.table2.Name = "table2"
|
||||
Me.table2.OddStyleName = "DetailData3_Odd"
|
||||
Me.table2.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.tableRow2})
|
||||
Me.table2.SizeF = New System.Drawing.SizeF(1900.0!, 63.42!)
|
||||
'
|
||||
@@ -178,11 +568,11 @@ Partial Public Class rptEnvelopeHistory
|
||||
'
|
||||
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", "[ItemStatus]")})
|
||||
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.62695389177331973R
|
||||
Me.tableCell4.Weight = 0.51726482142156094R
|
||||
'
|
||||
'tableCell5
|
||||
'
|
||||
@@ -190,7 +580,7 @@ Partial Public Class rptEnvelopeHistory
|
||||
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.30791178180943785R
|
||||
Me.tableCell5.Weight = 0.45140669932916544R
|
||||
'
|
||||
'tableCell6
|
||||
'
|
||||
@@ -198,7 +588,9 @@ Partial Public Class rptEnvelopeHistory
|
||||
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.Weight = 0.25860166310065952R
|
||||
Me.tableCell6.StylePriority.UseTextAlignment = False
|
||||
Me.tableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight
|
||||
Me.tableCell6.Weight = 0.22479581593269077R
|
||||
'
|
||||
'Title
|
||||
'
|
||||
@@ -253,29 +645,10 @@ Partial Public Class rptEnvelopeHistory
|
||||
Me.PageInfo.Name = "PageInfo"
|
||||
Me.PageInfo.Padding = New DevExpress.XtraPrinting.PaddingInfo(15, 15, 0, 0, 254.0!)
|
||||
'
|
||||
'XrLabel2
|
||||
'GalleryDropDown1
|
||||
'
|
||||
Me.XrLabel2.Dpi = 254.0!
|
||||
Me.XrLabel2.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[User].[FullName]")})
|
||||
Me.XrLabel2.LocationFloat = New DevExpress.Utils.PointFloat(0!, 139.8528!)
|
||||
Me.XrLabel2.Multiline = True
|
||||
Me.XrLabel2.Name = "XrLabel2"
|
||||
Me.XrLabel2.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254.0!)
|
||||
Me.XrLabel2.SizeF = New System.Drawing.SizeF(857.2501!, 51.94089!)
|
||||
Me.XrLabel2.StylePriority.UsePadding = False
|
||||
Me.XrLabel2.Text = "XrLabel1"
|
||||
'
|
||||
'XrLabel3
|
||||
'
|
||||
Me.XrLabel3.Dpi = 254.0!
|
||||
Me.XrLabel3.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Envelope].[User].[Email]")})
|
||||
Me.XrLabel3.LocationFloat = New DevExpress.Utils.PointFloat(0!, 191.7937!)
|
||||
Me.XrLabel3.Multiline = True
|
||||
Me.XrLabel3.Name = "XrLabel3"
|
||||
Me.XrLabel3.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254.0!)
|
||||
Me.XrLabel3.SizeF = New System.Drawing.SizeF(857.2501!, 51.94089!)
|
||||
Me.XrLabel3.StylePriority.UsePadding = False
|
||||
Me.XrLabel3.Text = "XrLabel1"
|
||||
Me.GalleryDropDown1.Manager = Nothing
|
||||
Me.GalleryDropDown1.Name = "GalleryDropDown1"
|
||||
'
|
||||
'ObjectDataSource1
|
||||
'
|
||||
@@ -283,32 +656,6 @@ Partial Public Class rptEnvelopeHistory
|
||||
Me.ObjectDataSource1.DataSource = GetType(EnvelopeGenerator.Common.ReportSource)
|
||||
Me.ObjectDataSource1.Name = "ObjectDataSource1"
|
||||
'
|
||||
'XrLabel4
|
||||
'
|
||||
Me.XrLabel4.Dpi = 254.0!
|
||||
Me.XrLabel4.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel4.LocationFloat = New DevExpress.Utils.PointFloat(0!, 87.9119!)
|
||||
Me.XrLabel4.Name = "XrLabel4"
|
||||
Me.XrLabel4.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254.0!)
|
||||
Me.XrLabel4.SizeF = New System.Drawing.SizeF(426.2708!, 51.94094!)
|
||||
Me.XrLabel4.StyleName = "Title"
|
||||
Me.XrLabel4.StylePriority.UseFont = False
|
||||
Me.XrLabel4.StylePriority.UsePadding = False
|
||||
Me.XrLabel4.Text = "Ersteller:"
|
||||
'
|
||||
'XrLabel1
|
||||
'
|
||||
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(470.5626!, 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(695.8539!, 58.0!)
|
||||
Me.XrLabel1.StyleName = "Title"
|
||||
Me.XrLabel1.StylePriority.UseFont = False
|
||||
Me.XrLabel1.StylePriority.UsePadding = False
|
||||
Me.XrLabel1.Text = "Erstellt mit SignFlow"
|
||||
'
|
||||
'rptEnvelopeHistory
|
||||
'
|
||||
Me.Bands.AddRange(New DevExpress.XtraReports.UI.Band() {Me.TopMargin, Me.BottomMargin, Me.ReportHeader, Me.GroupHeader1, Me.Detail})
|
||||
@@ -316,7 +663,7 @@ Partial Public Class rptEnvelopeHistory
|
||||
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, 100, 100)
|
||||
Me.Margins = New System.Drawing.Printing.Margins(100, 100, 191, 100)
|
||||
Me.PageHeight = 2970
|
||||
Me.PageWidth = 2100
|
||||
Me.PaperKind = System.Drawing.Printing.PaperKind.A4
|
||||
@@ -324,8 +671,12 @@ Partial Public Class rptEnvelopeHistory
|
||||
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()
|
||||
|
||||
@@ -355,8 +706,25 @@ Partial Public Class rptEnvelopeHistory
|
||||
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 XrLabel3 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel2 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel4 As DevExpress.XtraReports.UI.XRLabel
|
||||
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
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,9 @@
|
||||
Imports DevExpress.DataAccess.Native.Web
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports EnvelopeGenerator.Common.My.Resources
|
||||
|
||||
Public Class ActionService
|
||||
Inherits BaseClass
|
||||
Inherits BaseService
|
||||
|
||||
Private ReadOnly EmailService As EmailService
|
||||
Private ReadOnly HistoryService As HistoryService
|
||||
@@ -11,7 +12,7 @@ Public Class ActionService
|
||||
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState.LogConfig)
|
||||
MyBase.New(pState)
|
||||
|
||||
EmailService = New EmailService(pState)
|
||||
HistoryService = New HistoryService(pState)
|
||||
@@ -33,24 +34,24 @@ Public Class ActionService
|
||||
|
||||
Return True
|
||||
End Function
|
||||
Public Function ResendReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
EmailService.SendDocumentReceivedEmail(pEnvelope, pReceiver)
|
||||
End Function
|
||||
|
||||
Public Function DeleteEnvelope(pEnvelope As Envelope) As Boolean
|
||||
|
||||
Public Function DeleteEnvelope(pEnvelope As Envelope, pReason As String) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeDeleted, pEnvelope.User.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim oSendResult = pEnvelope.Receivers.
|
||||
Select(Function(r) EmailService.SendEnvelopeDeletedEmail(pEnvelope, r)).
|
||||
Select(Function(r) EmailService.SendEnvelopeDeletedEmail(pEnvelope, r, pReason)).
|
||||
All(Function(r) r = True)
|
||||
|
||||
If oSendResult = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
For Each oReceiver As EnvelopeReceiver In pEnvelope.Receivers
|
||||
EmailService.SendEnvelopeDeletedEmail(pEnvelope, oReceiver)
|
||||
Next
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -64,6 +65,36 @@ Public Class ActionService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function RequestAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeRequested, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function EnterCorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeCorrect, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function EnterIncorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeIncorrect, oUserReference) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SignEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oUserReference = pReceiver.Email
|
||||
|
||||
@@ -74,6 +105,36 @@ Public Class ActionService
|
||||
Return EmailService.SendSignedEmail(pEnvelope, pReceiver)
|
||||
End Function
|
||||
|
||||
Public Function FinalizeEnvelope(pEnvelope As Envelope) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeArchived, "System") = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function CompleteEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pReceiver.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return EmailService.SendDocumentCompletedEmailToReceiver(pEnvelope, pReceiver) ', pAttachment
|
||||
End Function
|
||||
|
||||
Public Function CompleteEnvelope(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent, pEnvelope.User.Email) = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return EmailService.SendDocumentCompletedEmailToCreator(pEnvelope) ', pAttachment
|
||||
End Function
|
||||
|
||||
Public Function CreateReport(pEnvelope As Envelope) As Boolean
|
||||
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.EnvelopeReportCreated, "System") = False Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Class
|
||||
13
EnvelopeGenerator.Common/Services/BaseService.vb
Normal file
13
EnvelopeGenerator.Common/Services/BaseService.vb
Normal file
@@ -0,0 +1,13 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Public Class BaseService
|
||||
Inherits BaseClass
|
||||
|
||||
Friend Property State As State
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState.LogConfig)
|
||||
|
||||
State = pState
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,35 +1,29 @@
|
||||
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common.My.Resources
|
||||
|
||||
Public Class EmailService
|
||||
Inherits BaseClass
|
||||
Inherits BaseService
|
||||
|
||||
Private ReadOnly State As State
|
||||
|
||||
Private ReadOnly EnvelopeModel As EnvelopeModel
|
||||
Private ReadOnly ReceiverModel As ReceiverModel
|
||||
Private ReadOnly EmailModel As EmailModel
|
||||
|
||||
Private ReadOnly EmailTemplate As EmailTemplate
|
||||
Private ReadOnly EmailTemplate As TemplateService
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState.LogConfig)
|
||||
MyBase.New(pState)
|
||||
|
||||
State = pState
|
||||
EnvelopeModel = New EnvelopeModel(pState)
|
||||
ReceiverModel = New ReceiverModel(pState)
|
||||
EmailModel = New EmailModel(pState)
|
||||
EmailTemplate = New EmailTemplate()
|
||||
EmailTemplate = New TemplateService(pState)
|
||||
End Sub
|
||||
|
||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver) With
|
||||
Public Function SendEnvelopeDeletedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pReason As String) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageDeletionSent) With
|
||||
{
|
||||
.SignatureLink = ""
|
||||
}
|
||||
|
||||
EmailTemplate.FillEnvelopeDeletedEmailBody(oEmailData)
|
||||
EmailTemplate.FillEnvelopeDeletedEmailBody(oEmailData, pReason)
|
||||
|
||||
If EmailModel.Insert(oEmailData) = False Then
|
||||
Logger.Error("EMail data could not be inserted.")
|
||||
@@ -40,7 +34,8 @@ Public Class EmailService
|
||||
End Function
|
||||
|
||||
Public Function SendDocumentReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver) With
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature)
|
||||
}
|
||||
@@ -55,8 +50,35 @@ Public Class EmailService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function GetReceiverUrl(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As String
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageInvitationSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature)
|
||||
}
|
||||
Return oEmailData.SignatureLink
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageAccessCodeSent) With
|
||||
{
|
||||
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature)
|
||||
}
|
||||
|
||||
EmailTemplate.FillDocumentAccessCodeReceivedEmailBody(oEmailData)
|
||||
|
||||
If EmailModel.Insert(oEmailData) = False Then
|
||||
Logger.Error("EMail data could not be inserted.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver) With
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageConfirmationSent) With
|
||||
{
|
||||
.SignatureLink = ""
|
||||
}
|
||||
@@ -71,5 +93,45 @@ Public Class EmailService
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
.ATT1_REL_TYPE = "EnvelopeResult"
|
||||
}
|
||||
' .EmailAttachment = pAttachment,
|
||||
Logger.Debug("Sending mail to receiver: [{0}]", oEmailData.EmailAdress)
|
||||
|
||||
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
||||
|
||||
If EmailModel.Insert(oEmailData) = False Then
|
||||
Logger.Error("EMail data could not be inserted.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope) As Boolean ', pAttachment As String
|
||||
Logger.Debug("Creating email data object.")
|
||||
Dim oEmailData = New EmailData(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent) With
|
||||
{
|
||||
.SignatureLink = "",
|
||||
.ATT1_RELATED_ID = pEnvelope.Id,
|
||||
.ATT1_REL_TYPE = "EnvelopeResult"
|
||||
}
|
||||
'.EmailAttachment = pAttachment,
|
||||
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
||||
|
||||
If EmailModel.Insert(oEmailData) = False Then
|
||||
Logger.Error("EMail data could not be inserted.")
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -4,18 +4,15 @@ Imports DigitalData.Modules.Logging
|
||||
Imports EnvelopeGenerator.Common.Constants
|
||||
|
||||
Public Class HistoryService
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly State As State
|
||||
Inherits BaseService
|
||||
|
||||
Private ReadOnly EnvelopeModel As EnvelopeModel
|
||||
Private ReadOnly ReceiverModel As ReceiverModel
|
||||
Private ReadOnly HistoryModel As HistoryModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState.LogConfig)
|
||||
MyBase.New(pState)
|
||||
|
||||
State = pState
|
||||
EnvelopeModel = New EnvelopeModel(pState)
|
||||
ReceiverModel = New ReceiverModel(pState)
|
||||
HistoryModel = New HistoryModel(pState)
|
||||
|
||||
89
EnvelopeGenerator.Common/Services/TemplateService.vb
Normal file
89
EnvelopeGenerator.Common/Services/TemplateService.vb
Normal file
@@ -0,0 +1,89 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class TemplateService
|
||||
Inherits BaseService
|
||||
|
||||
Private _replaceDictionary As Dictionary(Of String, String)
|
||||
|
||||
Private ReadOnly DbConfig As DbConfig
|
||||
Private ReadOnly EmailHtmlTemplateModel As EmailTemplateModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
|
||||
DbConfig = pState.DbConfig
|
||||
EmailHtmlTemplateModel = New EmailTemplateModel(pState)
|
||||
End Sub
|
||||
|
||||
Private Sub InitDictionary(pEmailData As EmailData, Optional pReason As String = "")
|
||||
Logger.Debug("Initializing dictionary..")
|
||||
|
||||
_replaceDictionary = New Dictionary(Of String, String) From {
|
||||
{"[NAME_RECEIVER]", pEmailData.ReceiverName},
|
||||
{"[NAME_SENDER]", pEmailData.SenderName},
|
||||
{"[NAME_PORTAL]", DbConfig.ExternalProgramName},
|
||||
{"[SIGNATURE_TYPE]", "signieren"},
|
||||
{"[LINK_TO_DOCUMENT]", pEmailData.SignatureLink},
|
||||
{"[LINK_TO_DOCUMENT_TEXT]", $"{pEmailData.SignatureLink.Truncate(40)}.."},
|
||||
{"[DOCUMENT_TITLE]", pEmailData.EnvelopeTitle},
|
||||
{"[MESSAGE]", pEmailData.Message},
|
||||
{"[DOCUMENT_ACCESS_CODE]", pEmailData.ReceiverAccessCode},
|
||||
{"[REASON]", pReason}
|
||||
}
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentReceivedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentReceived)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
End Sub
|
||||
|
||||
Public Sub FillEnvelopeDeletedEmailBody(pEmailData As EmailData, pReason As String)
|
||||
InitDictionary(pEmailData, pReason)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentDeleted)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body, pReason)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentSignedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentSigned)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentCompletedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentCompleted)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
End Sub
|
||||
|
||||
Public Sub FillDocumentAccessCodeReceivedEmailBody(pEmailData As EmailData)
|
||||
InitDictionary(pEmailData)
|
||||
Dim oTemplate = EmailHtmlTemplateModel.GetById(Constants.EmailTemplateType.DocumentAccessCodeReceived)
|
||||
|
||||
pEmailData.EmailBody = FillTemplate(oTemplate.Body)
|
||||
pEmailData.EmailSubject = FillTemplate(oTemplate.Subject)
|
||||
End Sub
|
||||
|
||||
Private Function FillTemplate(pTemplate As String, Optional pReason As String = "") As String
|
||||
Dim oText As String = pTemplate
|
||||
|
||||
For Each dictItem As KeyValuePair(Of String, String) In _replaceDictionary
|
||||
If oText.Contains(dictItem.Key) Then
|
||||
|
||||
oText = oText.Replace(dictItem.Key, dictItem.Value)
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Return oText
|
||||
End Function
|
||||
End Class
|
||||
@@ -25,7 +25,7 @@ Namespace My.Resources
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Class Email
|
||||
Public Class Email
|
||||
|
||||
Private Shared resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
@@ -40,7 +40,7 @@ Namespace My.Resources
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EnvelopeGenerator.Common.Email", GetType(Email).Assembly)
|
||||
@@ -55,7 +55,7 @@ Namespace My.Resources
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Shared Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Public Shared Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
@@ -67,7 +67,7 @@ Namespace My.Resources
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Zeichenfolge, die Sie haben ein Dokument zur Unterschrift erhalten: {0} ähnelt.
|
||||
'''</summary>
|
||||
Friend Shared ReadOnly Property Sie_haben_ein_Dokument_zur_Unterschrift_erhalten___0_() As String
|
||||
Public Shared ReadOnly Property Sie_haben_ein_Dokument_zur_Unterschrift_erhalten___0_() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("Sie haben ein Dokument zur Unterschrift erhalten: {0}", resourceCulture)
|
||||
End Get
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user