Compare commits
362 Commits
f3eef04a09
...
upgrade-to
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec151f9ee3 | ||
|
|
497be9b86c | ||
|
|
e2221a8de0 | ||
|
|
f5bc859b11 | ||
|
|
f88130b3f5 | ||
|
|
7895925d66 | ||
|
|
a3307e0952 | ||
|
|
250a718a60 | ||
|
|
f0dde4a0db | ||
|
|
32f117015f | ||
|
|
3d40ce8289 | ||
|
|
eef65a8c1a | ||
|
|
33114c2032 | ||
|
|
b88a486952 | ||
|
|
69acb5467b | ||
|
|
93839cac69 | ||
|
|
8c6ff433ee | ||
|
|
2b9a9720e7 | ||
|
|
c7c48394d5 | ||
|
|
337ece3ebe | ||
|
|
b997b48237 | ||
|
|
22b7b39e45 | ||
|
|
a7fba174d3 | ||
|
|
33ee95ebbe | ||
|
|
6b615c9b7b | ||
|
|
848a7ed72c | ||
|
|
b980e2f308 | ||
|
|
c0a858b51d | ||
|
|
87be4b42a6 | ||
|
|
321977e3e8 | ||
|
|
1e6ad8221d | ||
|
|
a382eabe1f | ||
|
|
f3b6be555b | ||
|
|
b58881835d | ||
|
|
9f657b26c1 | ||
|
|
4fe1ac2a01 | ||
|
|
392e5cf8fd | ||
|
|
d9fb54071a | ||
|
|
368100f2e7 | ||
|
|
dee7259870 | ||
|
|
ad6bfea0f4 | ||
|
|
59be68d008 | ||
|
|
1de9d6c0d7 | ||
|
|
cf63145b90 | ||
|
|
9f7053a48d | ||
|
|
f03d910d20 | ||
|
|
ffa6416929 | ||
|
|
3e29b5ee68 | ||
|
|
6d50cad7f7 | ||
|
|
b125569f38 | ||
|
|
ed1dd2eca6 | ||
|
|
f07ceee1f4 | ||
|
|
8df1e72f8e | ||
|
|
2d570fb8c0 | ||
|
|
ddbd4ee954 | ||
|
|
4425b64573 | ||
|
|
c2c7b61f12 | ||
|
|
3cb223bccf | ||
|
|
77c4170c12 | ||
|
|
53b29c6732 | ||
|
|
e40eb5811a | ||
|
|
ad7a96b3a8 | ||
|
|
d74fe29763 | ||
|
|
026b53dc2a | ||
|
|
4b703a7593 | ||
|
|
6487517c51 | ||
|
|
9ac3f8a5c5 | ||
|
|
169dba6b42 | ||
|
|
58139a38bc | ||
|
|
da41799e6b | ||
|
|
0467fc2ee6 | ||
|
|
b6543c82b8 | ||
|
|
0eeeaee4d5 | ||
|
|
4e527c9cbb | ||
|
|
47dc1366f4 | ||
|
|
1d9a076e87 | ||
|
|
777e75a611 | ||
|
|
682b712ed0 | ||
|
|
e14470d568 | ||
|
|
2c80c5f451 | ||
|
|
0c7293f6cf | ||
|
|
404a6d0125 | ||
|
|
affe75db24 | ||
|
|
06cb346d10 | ||
|
|
c846d78792 | ||
|
|
ecc5eec327 | ||
|
|
601150e99b | ||
|
|
58864bd163 | ||
|
|
73d337d1de | ||
|
|
cc59555f5f | ||
|
|
bcb60d2456 | ||
|
|
7acd642859 | ||
|
|
8f058647e0 | ||
|
|
05ea9cb25b | ||
|
|
6940b01038 | ||
|
|
2a99128352 | ||
|
|
617b0b1577 | ||
|
|
6e755e9295 | ||
|
|
2fec382c3e | ||
|
|
ebbd35c404 | ||
|
|
2cb036db0c | ||
|
|
67a5c6e5c1 | ||
|
|
1d5eaeb7aa | ||
|
|
c48937a10e | ||
|
|
73a935a055 | ||
|
|
d37fd71c90 | ||
|
|
f5113f7669 | ||
|
|
144b5b1c0d | ||
|
|
154cdc62fd | ||
|
|
d8b3780731 | ||
|
|
ac729926c8 | ||
|
|
20177c2d68 | ||
|
|
a65dd9fc83 | ||
|
|
af9d63d17c | ||
|
|
da954a3416 | ||
|
|
978551c1e2 | ||
|
|
cfc6c9bdbe | ||
|
|
9e9420ce41 | ||
|
|
f232926c57 | ||
|
|
fc82554b66 | ||
|
|
7921fceb63 | ||
|
|
b64695cefc | ||
|
|
d2da8c6594 | ||
|
|
5490269951 | ||
|
|
d817522df3 | ||
|
|
56476ebd2f | ||
|
|
f339d8ffc1 | ||
|
|
2943124b53 | ||
|
|
789a87dac4 | ||
|
|
75930d5a03 | ||
|
|
37a439d337 | ||
|
|
df84046d78 | ||
|
|
4827ee1ce4 | ||
|
|
bf7b200ee9 | ||
|
|
2d8801c179 | ||
|
|
456a25e193 | ||
|
|
3e87702c5d | ||
|
|
e2fe059470 | ||
|
|
a87937e1ad | ||
|
|
318be76451 | ||
|
|
473e63b247 | ||
|
|
8ab83894fd | ||
|
|
f84e60bf24 | ||
|
|
447e8226d1 | ||
|
|
4e3d66cfc1 | ||
|
|
86cdbd06df | ||
|
|
3b5137cb46 | ||
|
|
8107d9fe81 | ||
|
|
06e796f54f | ||
|
|
bbe372377a | ||
|
|
7b91aac5e9 | ||
|
|
ceb688fc3f | ||
|
|
aa5742a529 | ||
|
|
79267e6bd9 | ||
|
|
cf63fd8c39 | ||
|
|
ec3a677ca8 | ||
|
|
48406884ca | ||
| 204aaaeb4e | |||
| ec378ba3b4 | |||
| 35b19cde82 | |||
|
|
f7c0a29676 | ||
| 9ae5465c48 | |||
| 82139fc30d | |||
| f4ba4d9e1d | |||
| 0aabc12f49 | |||
| adbd0fe99b | |||
| 2d6a2df48a | |||
| e7ccb74828 | |||
| 05355c93a5 | |||
| 2007bb91f3 | |||
| d7d2ecf8a0 | |||
| 447c7ea600 | |||
| 32bb14db06 | |||
| a5226a8101 | |||
| b534c4c799 | |||
| dc80138311 | |||
| 477bb511c4 | |||
| 0b66b80591 | |||
| 5fd924d413 | |||
| e8ebc30225 | |||
| 262805d112 | |||
| 623807c55d | |||
| aee7997cb3 | |||
| 82a95faaaf | |||
| af7534df48 | |||
| fa2c2a6417 | |||
| 390a524736 | |||
| 0ed996100d | |||
| 2e0ae13a77 | |||
| 267e038725 | |||
| 2673755b14 | |||
| 5052ce4f14 | |||
| 717909d7e8 | |||
| 04a408ab97 | |||
| face3c76fb | |||
| 2d3a1cd25c | |||
| 43e95a20b9 | |||
| 05d0bd60ab | |||
| 7e70c059b6 | |||
|
|
0261d237b6 | ||
| ea7fe74e89 | |||
|
|
f7f4b05df5 | ||
|
|
766737b4b5 | ||
|
|
ffa8850bf1 | ||
|
|
2991b52c17 | ||
| df04b0a706 | |||
| ce65276084 | |||
| 17d5acee9d | |||
| c7afa2f754 | |||
| 4d5ab64904 | |||
| f4c3e9b3e1 | |||
| 9d76b17b1d | |||
| 2ec92511cb | |||
| 8e1b9d21f3 | |||
| 7ac596b930 | |||
| cf9650be50 | |||
|
|
fa00f2ab54 | ||
|
|
5774eb7686 | ||
|
|
ceb618dc57 | ||
|
|
66328bb243 | ||
|
|
ecfe669938 | ||
|
|
5af75cc553 | ||
|
|
c402467b38 | ||
|
|
a420c1a618 | ||
|
|
7ef808d221 | ||
|
|
d09d728f7f | ||
| 7602f2c870 | |||
|
|
c74b778227 | ||
|
|
11b7a196dd | ||
|
|
4c113f19e8 | ||
|
|
a6d3781781 | ||
|
|
d4ce8e2891 | ||
|
|
8c829d490f | ||
|
|
6fb82c20ee | ||
|
|
7c473b9a27 | ||
| b5c470e1b9 | |||
| 4ab924907a | |||
| 32f87e25f5 | |||
|
|
3d388362ec | ||
|
|
bbd97acfc5 | ||
| 35d8021278 | |||
| 7e9ed47ad9 | |||
| 13ff63d6e0 | |||
| 6bcb4dd609 | |||
| f3b370c26f | |||
|
|
bf8a2971ec | ||
|
|
67e6e68394 | ||
| 7100503c4f | |||
| 6c78d6bcc2 | |||
|
|
54ee51b0de | ||
|
|
70765af22b | ||
| c803b4532d | |||
| 47b54562c8 | |||
| 5290d442f9 | |||
| 83c2374b90 | |||
|
|
99f954d406 | ||
|
|
6515e1811b | ||
|
|
6a051f7a92 | ||
|
|
70febee15d | ||
| e420931351 | |||
| b7c172c382 | |||
| 3e2606a582 | |||
|
|
954df832ed | ||
|
|
ccba559f73 | ||
|
|
b572639805 | ||
| bb7ed1bdd8 | |||
| 9957465f59 | |||
| eab2fb0880 | |||
| 80d4efd8ba | |||
| b0bc5113ef | |||
| 976da9a153 | |||
| 3ddb98c3d8 | |||
| 4d7cb6ad4f | |||
| c9c6cc668d | |||
| d24ed1884f | |||
| 50e1cd0f1c | |||
|
|
34ffec6272 | ||
|
|
a17eccfb99 | ||
|
|
daadc7771a | ||
| f64ad40572 | |||
| ce7213146d | |||
|
|
6b92832dce | ||
|
|
41af4b0506 | ||
| 78667a83f1 | |||
| 9683ec9643 | |||
| 622538225c | |||
| b0d02497eb | |||
| c52c00ac04 | |||
| 237cad3a7a | |||
| 53768edb23 | |||
| 9ed521738b | |||
| acb7db6f9d | |||
| e911d97966 | |||
| 60ce9ab4f8 | |||
| 96c8ad7bf6 | |||
| 1aed9a51f7 | |||
| 5a9a30d6f1 | |||
| 30a6356565 | |||
| 3046b7d203 | |||
| 09b52f441b | |||
| 5fb0b2b817 | |||
| 03b374ba17 | |||
| d54001d73b | |||
| 948c499b9d | |||
| b7f7cd7e91 | |||
| 516f5040f6 | |||
| 80712801b3 | |||
| 82a4ddee1a | |||
| 3d01f24c1f | |||
| 7c93fa62fb | |||
| a478636ded | |||
| 3987634848 | |||
| a1609ee3c7 | |||
| 1784f69041 | |||
| 6d60327489 | |||
| fb801297c5 | |||
| 99b2a5a53b | |||
| c0d2e25437 | |||
| 93a3051027 | |||
| 15e67f1e4c | |||
| 35aa5a8975 | |||
| 7254ca24c8 | |||
| 32346c075a | |||
| f07fe32131 | |||
| c8d0cb184a | |||
| ed0fc3539d | |||
| 95a40c9f4d | |||
| 4814758a49 | |||
| cb0f32f809 | |||
| 6be92ae0f2 | |||
| c79707f1e1 | |||
| 76ce9c075d | |||
| 42b08eba7a | |||
| c83d24a086 | |||
| 36e8c8a9b9 | |||
| c30f11b82e | |||
| e22b108514 | |||
| 8d672b4b49 | |||
| ec876ca518 | |||
| cf2e2161cf | |||
| 180642bfb9 | |||
| 2350620223 | |||
|
|
21ec149baa | ||
|
|
6e5706acba | ||
|
|
9ac9895ed4 | ||
| 3a1678e742 | |||
| c968831209 | |||
|
|
c3fccc3c20 | ||
|
|
97c1fb4803 | ||
|
|
808cdea86a | ||
|
|
c048b6ad6b | ||
| a5b9579b79 | |||
| c2d87c3e25 | |||
|
|
0a6a2093d5 | ||
| c4df4a2f5c | |||
|
|
d040da3277 | ||
|
|
64e92f7a39 | ||
|
|
1d2aecf4fb | ||
|
|
b38a88d5f9 | ||
|
|
e85379dcf5 | ||
|
|
9f9feff2fd | ||
|
|
8362e1885d |
183
.github/upgrades/dotnet-upgrade-plan.md
vendored
Normal file
183
.github/upgrades/dotnet-upgrade-plan.md
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
# .NET 8.0 Upgrade Plan
|
||||
|
||||
## Execution Steps
|
||||
|
||||
Execute steps below sequentially one by one in the order they are listed.
|
||||
|
||||
1. Validate that an .NET 8.0 SDK required for this upgrade is installed on the machine and if not, help to get it installed.
|
||||
2. Ensure that the SDK version specified in global.json files is compatible with the .NET 8.0 upgrade.
|
||||
3. Upgrade Logging\Logging.vbproj.
|
||||
4. Upgrade Encryption\Encryption.vbproj.
|
||||
5. Upgrade Base\Base.vbproj.
|
||||
6. Upgrade ZooFlow\ZooFlow.vbproj.
|
||||
7. Upgrade Interfaces\Interfaces.vbproj.
|
||||
8. Upgrade Database\Database.vbproj.
|
||||
9. Upgrade Config\Config.vbproj.
|
||||
10. Upgrade Filesystem\Filesystem.vbproj.
|
||||
11. Upgrade Messaging\Messaging.vbproj.
|
||||
12. Upgrade Windream\Windream.vbproj.
|
||||
13. Upgrade Windows\Windows.vbproj.
|
||||
14. Upgrade Patterns\Patterns.vbproj.
|
||||
15. Upgrade License\License.vbproj.
|
||||
16. Upgrade Jobs\Jobs.vbproj.
|
||||
17. Upgrade EDMIAPI\EDMI.API.vbproj.
|
||||
|
||||
## Settings
|
||||
|
||||
This section contains settings and data used by execution steps.
|
||||
|
||||
### Excluded projects
|
||||
|
||||
Keine Projekte ausgeschlossen.
|
||||
|
||||
### Aggregate NuGet packages modifications across all projects
|
||||
|
||||
NuGet packages used across all selected projects or their dependencies that need version update in projects that reference them.
|
||||
|
||||
| Package Name | Current Version | New Version | Description |
|
||||
|:-------------------------------------------|:---------------:|:-----------:|:----------------------------------------------------------------------------|
|
||||
| DigitalData.Modules.Logging | 2.6.5 | | No supported .NET 8 compatible package available; evaluate replacement. |
|
||||
| EntityFramework | 6.4.4 | 6.5.1 | Required newer EF 6.5.1 for .NET 8 compatibility and LTS support. |
|
||||
| EntityFramework.Firebird | 6.4.0 | 10.1.0 | Update to Firebird 10.1.0 for .NET 8 compatibility. |
|
||||
| GdPicture | 14.3.18 | 14.2.100 | Use 14.2.100 as recommended compatible build. |
|
||||
| Microsoft.Identity.Client | 4.55.0 | 4.79.2 | Security vulnerability fix and current MSAL LTS recommendation. |
|
||||
| Microsoft.IdentityModel.Abstractions | 6.22.0 | 8.15.0 | Move to latest IdentityModel LTS version. |
|
||||
| Microsoft.VisualBasic | 10.3.0 | | Functionality provided by .NET 8 framework reference; remove package. |
|
||||
| Newtonsoft.Json | 13.0.3 | 13.0.4 | Bring Newtonsoft.Json to supported patch level. |
|
||||
| S22.Imap | 3.6.0.0 | | No supported .NET 8 compatible package available; evaluate alternative. |
|
||||
| System.Buffers | 4.6.0 | | Functionality provided by .NET 8 framework reference; remove package. |
|
||||
| System.Data.Odbc | 6.0.1 | 8.0.1 | Update to provider version aligned with .NET 8. |
|
||||
| System.Memory | 4.6.0 | | Functionality provided by .NET 8 framework reference; remove package. |
|
||||
| System.Numerics.Vectors | 4.6.0 | | Functionality provided by .NET 8 framework reference; remove package. |
|
||||
| System.Runtime.CompilerServices.Unsafe | 6.1.0 | 6.1.2 | Align with latest patch to match .NET 8 dependencies. |
|
||||
| System.Threading.Tasks.Extensions | 4.5.4 | | Functionality provided by .NET 8 framework reference; remove package. |
|
||||
| System.ValueTuple | 4.5.0 | | Functionality provided by .NET 8 framework reference; remove package. |
|
||||
|
||||
### Project upgrade details
|
||||
|
||||
#### Logging/Logging.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
#### Encryption/Encryption.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
#### Base/Base.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0-windows`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
#### ZooFlow/ZooFlow.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0-windows`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
#### Interfaces/Interfaces.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- Update `GdPicture` from `14.3.18` to `14.2.100` (compatibility recommendation).
|
||||
- Update `Newtonsoft.Json` from `13.0.3` to `13.0.4`.
|
||||
- Update `System.Runtime.CompilerServices.Unsafe` from `6.1.0` to `6.1.2`.
|
||||
- Remove `Microsoft.VisualBasic`, `System.Buffers`, `System.Memory`, `System.Numerics.Vectors`, `System.Threading.Tasks.Extensions`, and `System.ValueTuple` because their APIs are provided by the .NET 8 framework.
|
||||
|
||||
#### Database/Database.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- Update `EntityFramework.Firebird` from `6.4.0` to `10.1.0`.
|
||||
- Update `EntityFramework` from `6.4.4` to `6.5.1`.
|
||||
- Update `System.Data.Odbc` from `6.0.1` to `8.0.1`.
|
||||
|
||||
#### Config/Config.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0-windows`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- Update `EntityFramework.Firebird` from `6.4.0` to `10.1.0`.
|
||||
- Update `EntityFramework` from `6.4.4` to `6.5.1`.
|
||||
- Update `System.Data.Odbc` from `6.0.1` to `8.0.1`.
|
||||
|
||||
#### Filesystem/Filesystem.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
#### Messaging/Messaging.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0-windows`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- `DigitalData.Modules.Logging` 2.6.5 has no supported .NET 8 version; evaluate migrating to an updated logging package.
|
||||
- `S22.Imap` 3.6.0.0 has no supported .NET 8 version; evaluate replacement.
|
||||
- Update `Microsoft.Identity.Client` from `4.55.0` to `4.79.2` (security fix).
|
||||
- Update `Microsoft.IdentityModel.Abstractions` from `6.22.0` to `8.15.0`.
|
||||
|
||||
#### Windream/Windream.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- `DigitalData.Modules.Logging` 2.6.5 has no supported .NET 8 version; evaluate migrating to an updated logging package.
|
||||
|
||||
#### Windows/Windows.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0-windows`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- `DigitalData.Modules.Logging` 2.6.5 has no supported .NET 8 version; evaluate migrating to an updated logging package.
|
||||
|
||||
#### Patterns/Patterns.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0-windows`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- `DigitalData.Modules.Logging` 2.6.5 has no supported .NET 8 version; evaluate migrating to an updated logging package.
|
||||
|
||||
#### License/License.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
#### Jobs/Jobs.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
|
||||
NuGet packages changes:
|
||||
- Update `GdPicture` from `14.3.18` to `14.2.100`.
|
||||
- Update `Newtonsoft.Json` from `13.0.3` to `13.0.4`.
|
||||
- Update `System.Runtime.CompilerServices.Unsafe` from `6.1.0` to `6.1.2`.
|
||||
- Remove `Microsoft.VisualBasic`, `System.Buffers`, `System.Memory`, `System.Numerics.Vectors`, `System.Threading.Tasks.Extensions`, and `System.ValueTuple` because their APIs are provided by the .NET 8 framework.
|
||||
|
||||
#### EDMIAPI/EDMI.API.vbproj modifications
|
||||
|
||||
Project properties changes:
|
||||
- Target framework should be changed from `.NETFramework,Version=v4.6.2` to `net8.0`.
|
||||
- Convert the project file to SDK-style format.
|
||||
132
Base/Base.vbproj
132
Base/Base.vbproj
@@ -1,149 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}</ProjectGuid>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.Base</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.Base</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
<AssemblyTitle>Modules.Base</AssemblyTitle>
|
||||
<Description>basisfunktionalitäten für DigitalData Anwendungen</Description>
|
||||
<Company>Digital Data GmbH</Company>
|
||||
<Product>Modules.</Product>
|
||||
<Copyright>Copyright © 2025</Copyright>
|
||||
<AssemblyVersion>1.3.9.0</AssemblyVersion>
|
||||
<FileVersion>1.3.9.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Base.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Base.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<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>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="NuGet.CommandLine" Version="6.13.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SystemWebAdapters" Version="2.2.1" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="CoreWCF.Primitives" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.ConfigurationManager" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.Http" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="DigitalData.Modules.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Base\BaseClass.vb" />
|
||||
<Compile Include="Base\BaseUtils.vb" />
|
||||
<Compile Include="Encryption\Compression.vb" />
|
||||
<Compile Include="Encryption\Encryption.vb" />
|
||||
<Compile Include="Encryption\EncryptionLegacy.vb" />
|
||||
<Compile Include="DatabaseEx.vb" />
|
||||
<Compile Include="FilesystemEx.vb" />
|
||||
<Compile Include="FileWatcher\FileWatcher.vb" />
|
||||
<Compile Include="FileWatcher\FileWatcherFilters.vb" />
|
||||
<Compile Include="FileWatcher\FileWatcherProperties.vb" />
|
||||
<Compile Include="IDB\Constants.vb" />
|
||||
<Compile Include="MimeEx.vb" />
|
||||
<Compile Include="WindowsEx.vb" />
|
||||
<Compile Include="ModuleExtensions.vb" />
|
||||
<Compile Include="FileEx.vb" />
|
||||
<Compile Include="NativeMethods.vb" />
|
||||
<Compile Include="ObjectEx.vb" />
|
||||
<Compile Include="GraphicsEx.vb" />
|
||||
<Compile Include="LanguageEx.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<Compile Update="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<Compile Update="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<Compile Update="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ScreenEx.vb" />
|
||||
<Compile Include="StringEx.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<None Update="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="README.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
8
Base/ECM/ECM.vb
Normal file
8
Base/ECM/ECM.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
Public Class ECM
|
||||
Public Enum Product
|
||||
taskFLOW
|
||||
easyFLOW
|
||||
fileFLOW
|
||||
signFLOW
|
||||
End Enum
|
||||
End Class
|
||||
@@ -177,7 +177,6 @@ Public Class FilesystemEx
|
||||
''' somestring~3 --> somestring~3 --> ['somestring', '3'] --> version 3
|
||||
''' </example>
|
||||
''' <param name="pString">The string to versioned</param>
|
||||
''' <param name="pSeparator">The character to split at</param>
|
||||
''' <returns>Tuple of string and version</returns>
|
||||
Public Function GetVersionedString(pString As String) As Tuple(Of String, Integer)
|
||||
Dim oSplitString = pString.Split(VERSION_SEPARATOR).ToList()
|
||||
@@ -265,7 +264,7 @@ Public Class FilesystemEx
|
||||
_Logger.Warn("Deleting files was aborted at file {0}.", oFile.FullName)
|
||||
Return False
|
||||
End If
|
||||
oUnableToDeleteCounter = oUnableToDeleteCounter + 1
|
||||
oUnableToDeleteCounter += 1
|
||||
_Logger.Warn("File {0} could not be deleted!")
|
||||
End Try
|
||||
Next
|
||||
|
||||
@@ -65,6 +65,30 @@ Public Module ModuleExtensions
|
||||
Return (pString.Trim().ToLower() = "true") OrElse (pString.Trim() = "1")
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Checks if a string is null or empty
|
||||
''' </summary>
|
||||
''' <param name="pString">The input string</param>
|
||||
''' <returns>True string is null or empty, otherwise false.</returns>
|
||||
<Extension()>
|
||||
Public Function IsNullOrEmpty(pString As String) As Boolean
|
||||
Return String.IsNullOrEmpty(pString)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Checks if a string is NOT null or empty
|
||||
''' </summary>
|
||||
''' <param name="pString">The input string</param>
|
||||
''' <returns>True string is null or empty, otherwise false.</returns>
|
||||
<Extension()>
|
||||
Public Function IsNotNullOrEmpty(pString As String) As Boolean
|
||||
If String.IsNullOrEmpty(pString) Then
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
' ======================================================
|
||||
' === DICTIONARY
|
||||
' ======================================================
|
||||
|
||||
@@ -1,35 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("Base")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Base")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("1.3.6.0")>
|
||||
<Assembly: AssemblyTrademark("1.3.9.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("f097830c-82fe-4cd0-8df6-e458522c1ddd")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' indem Sie "*" wie unten gezeigt eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.3.6.0")>
|
||||
<Assembly: AssemblyFileVersion("1.3.6.0")>
|
||||
|
||||
64
Base/StringFunctions.vb
Normal file
64
Base/StringFunctions.vb
Normal file
@@ -0,0 +1,64 @@
|
||||
Imports System.Globalization
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class StringFunctions
|
||||
Public Shared Function SplitText_Length(ByVal input As String, ByVal maxLength As Integer) As List(Of String)
|
||||
Dim result As New List(Of String)
|
||||
|
||||
For i As Integer = 0 To input.Length - 1 Step maxLength
|
||||
' Textabschnitt extrahieren
|
||||
Dim chunk As String = input.Substring(i, Math.Min(maxLength, input.Length - i))
|
||||
result.Add(chunk)
|
||||
Next
|
||||
|
||||
Return result
|
||||
End Function
|
||||
Public Shared Function SplitTextByNewLine(text As String) As List(Of String)
|
||||
If String.IsNullOrEmpty(text) Then
|
||||
Return New List(Of String)()
|
||||
End If
|
||||
|
||||
' Zerlege den Text anhand von Zeilenumbrüchen
|
||||
Dim lines As List(Of String) = text.Split({vbCrLf, vbLf, vbCr}, StringSplitOptions.None).ToList()
|
||||
Return lines
|
||||
End Function
|
||||
|
||||
Public Shared Function DatetimeStringToGermanStringConverter(pDatetimeString As String, pLogger As Logger) As String
|
||||
|
||||
If pDatetimeString.IsNullOrEmpty() = True Then
|
||||
' Wenn nichts kommt, kommt nichts zurueck
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
Dim formatList As List(Of String) = New List(Of String) From {
|
||||
"yyyyMMdd",
|
||||
"MM/dd/yyyy", "M/d/yyyy", "MM/d/yyyy", "M/dd/yyyy",
|
||||
"yyyy-MM-dd", "yyyy-M-d", "yyyy-MM-d", "yyyy-M-dd",
|
||||
"dd.MM.yyyy", "d.M.yyyy", "d.MM.yyyy", "dd.M.yyyy"
|
||||
}
|
||||
|
||||
Dim dateStringResult As Date = Date.MinValue
|
||||
Dim oConvertResult As Boolean = False
|
||||
|
||||
For Each formatStringItem In formatList
|
||||
Try
|
||||
dateStringResult = DateTime.ParseExact(pDatetimeString, formatStringItem, CultureInfo.InvariantCulture)
|
||||
oConvertResult = True
|
||||
Exit For
|
||||
Catch ex As FormatException
|
||||
oConvertResult = False
|
||||
pLogger?.Debug("DatetimeStringToGermanStringConverter() - Could not parse date string {0} ({1})", pDatetimeString, formatStringItem)
|
||||
End Try
|
||||
Next
|
||||
|
||||
If oConvertResult = True Then
|
||||
' In deutsches Format umwandeln (dd.MM.yyyy)
|
||||
Dim germanDateFormat As String = dateStringResult.ToString("dd.MM.yyyy")
|
||||
Return germanDateFormat
|
||||
Else
|
||||
' Wenn nichts konvertiert werden konnte, geben wir den ursprünglichen Wert zurück
|
||||
Return pDatetimeString
|
||||
End If
|
||||
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,6 +1,5 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base.NativeMethods
|
||||
|
||||
Public Class WindowsEx
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||
</packages>
|
||||
22
Config/App.config
Normal file
22
Config/App.config
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
<provider invariantName="FirebirdSql.Data.FirebirdClient" type="EntityFramework.Firebird.FbProviderServices, EntityFramework.Firebird" />
|
||||
</providers>
|
||||
<defaultConnectionFactory type="EntityFramework.Firebird.FbConnectionFactory, EntityFramework.Firebird" />
|
||||
</entityFramework>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,132 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{44982F9B-6116-44E2-85D0-F39650B1EF99}</ProjectGuid>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.Config</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.Config</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<MyType>Empty</MyType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
<AssemblyTitle>Modules.Config</AssemblyTitle>
|
||||
<Description>Stellt Module für die Konfiguration von Produkten bereit</Description>
|
||||
<Company>Digital Data GmbH, Heuchelheim</Company>
|
||||
<Product>Modules.Config</Product>
|
||||
<Copyright>Copyright © 2025</Copyright>
|
||||
<AssemblyVersion>1.3.0.0</AssemblyVersion>
|
||||
<FileVersion>1.3.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Config.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Config.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DigitalData.Modules.Base">
|
||||
<HintPath>..\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<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>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<PackageReference Include="EntityFramework" Version="6.5.1" />
|
||||
<PackageReference Include="EntityFramework.Firebird" Version="10.1.0" />
|
||||
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="10.3.2" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="System.Data.Odbc" Version="8.0.1" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="CoreWCF.Primitives" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.ConfigurationManager" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.Http" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="DigitalData.Modules.Logging" />
|
||||
<Import Include="DigitalData.Modules.Base" />
|
||||
<Import Include="DigitalData.Modules.Database" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ConfigAttributes.vb" />
|
||||
<Compile Include="ConfigManager.vb" />
|
||||
<Compile Include="ConfigSample.vb" />
|
||||
<Compile Include="ConfigUtils.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Remove="My Project\Application.Designer.vb" />
|
||||
<Compile Remove="My Project\Resources.Designer.vb" />
|
||||
<Compile Remove="My Project\Settings.Designer.vb" />
|
||||
<EmbeddedResource Remove="My Project\Resources.resx" />
|
||||
<None Remove="My Project\Application.myapp" />
|
||||
<None Remove="My Project\Settings.settings" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
<ProjectReference Include="..\Base\Base.vbproj" />
|
||||
<ProjectReference Include="..\Database\Database.vbproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Encryption\Encryption.vbproj">
|
||||
<Project>{8a8f20fc-c46e-41ac-bee7-218366cfff99}</Project>
|
||||
<Name>Encryption</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
54
Config/ConfigDbFunct.vb
Normal file
54
Config/ConfigDbFunct.vb
Normal file
@@ -0,0 +1,54 @@
|
||||
Imports NLog
|
||||
Imports DigitalData.Modules.Database
|
||||
|
||||
|
||||
Public Class ConfigDbFunct
|
||||
|
||||
''' <summary>
|
||||
''' Ermittelt die aktuelle Lizenz für das gewünschte Produkt
|
||||
''' aus der DB-Tabelle TBDD_3RD_PARTY_MODULES
|
||||
''' </summary>
|
||||
'''
|
||||
''' <param name="pLogConfig">An instance of LogConfig</param>
|
||||
''' <param name="pConnectionString">Initial connectionstring for connecting to DD_ECM database.</param>
|
||||
''' <returns>LicenseKey, if found, otherwise String.Empty</returns>
|
||||
Public Shared Function GetProductLicense(pProductName As String, pVersion As String, pLogConfig As Object, pConnectionString As String) As String
|
||||
|
||||
Dim oLogger As Logger = pLogConfig.GetLogger()
|
||||
|
||||
If (String.IsNullOrEmpty(pProductName)) Then
|
||||
oLogger.Error("Parameter pProductName is null or empty")
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
If (String.IsNullOrEmpty(pVersion)) Then
|
||||
oLogger.Error("Parameter pVersion is null or empty")
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
If (String.IsNullOrEmpty(pConnectionString)) Then
|
||||
oLogger.Error("Parameter pConnectionString is null or empty")
|
||||
Return String.Empty
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim oDecryptedConnectionString As String = MSSQLServer.DecryptConnectionString(pConnectionString)
|
||||
Dim oDatabase As MSSQLServer = New MSSQLServer(pLogConfig, oDecryptedConnectionString)
|
||||
|
||||
Dim oSql As String = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = '" + pProductName + "' AND ACTIVE = 1 AND VERSION = '" + pVersion + "'"
|
||||
oLogger.Debug(String.Format("oSql in GetProductLicense: {0}", oSql))
|
||||
Return String.Empty
|
||||
Dim oLicenseString As String = oDatabase.GetScalarValue(oSql)
|
||||
|
||||
Return oLicenseString
|
||||
|
||||
Catch ex As Exception
|
||||
oLogger.Error("Exception occured in ConfigDbFunct.GetProductLicense()")
|
||||
oLogger.Error(ex)
|
||||
End Try
|
||||
|
||||
Return String.Empty
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -1,9 +1,13 @@
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports System.Xml.Serialization
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Config.ConfigAttributes
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports ConnectionStringAttribute = DigitalData.Modules.Config.ConfigAttributes.ConnectionStringAttribute
|
||||
Imports ConnectionStringAppServerAttribute = DigitalData.Modules.Config.ConfigAttributes.ConnectionStringAppServerAttribute
|
||||
Imports ConnectionStringTestAttribute = DigitalData.Modules.Config.ConfigAttributes.ConnectionStringTestAttribute
|
||||
Imports EDMIAppServerAttribute = DigitalData.Modules.Config.ConfigAttributes.EDMIAppServerAttribute
|
||||
Imports GlobalSettingAttribute = DigitalData.Modules.Config.ConfigAttributes.GlobalSettingAttribute
|
||||
|
||||
Public Class ConfigManager(Of T)
|
||||
Public Const USER_CONFIG_NAME As String = "UserConfig.xml"
|
||||
@@ -26,6 +30,7 @@ Public Class ConfigManager(Of T)
|
||||
Private ReadOnly _Blueprint As T
|
||||
Private ReadOnly _BlueprintType As Type
|
||||
Private ReadOnly _Serializer As XmlSerializer
|
||||
Private _Config As T
|
||||
|
||||
Private ReadOnly _ExcludedAttributes = New List(Of Type) From {
|
||||
GetType(ConnectionStringAttribute),
|
||||
@@ -61,6 +66,10 @@ Public Class ConfigManager(Of T)
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public ReadOnly Property Config As T
|
||||
Get
|
||||
Return _Config
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Path to the current user config.
|
||||
@@ -102,18 +111,21 @@ Public Class ConfigManager(Of T)
|
||||
''' <param name="ApplicationStartupPath">The path to check for a third config file. This is useful when running the Application in an environment where AppData/ProgramData directories are not available</param>
|
||||
''' <param name="ForceUserConfig">Override values from ComputerConfig with UserConfig</param>
|
||||
Public Sub New(LogConfig As LogConfig, UserConfigPath As String, ComputerConfigPath As String, Optional ApplicationStartupPath As String = "", Optional ForceUserConfig As Boolean = False)
|
||||
If LogConfig Is Nothing Then Throw New ArgumentNullException(NameOf(LogConfig))
|
||||
If String.IsNullOrWhiteSpace(UserConfigPath) Then Throw New ArgumentException("UserConfigPath must be provided", NameOf(UserConfigPath))
|
||||
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_File = New FilesystemEx(_LogConfig)
|
||||
|
||||
_Blueprint = Activator.CreateInstance(Of T)
|
||||
_BlueprintType = _Blueprint.GetType
|
||||
_Blueprint = Activator.CreateInstance(Of T)()
|
||||
_BlueprintType = _Blueprint.GetType()
|
||||
_Serializer = New XmlSerializer(_BlueprintType)
|
||||
|
||||
_UserDirectory = _File.CreateDirectory(UserConfigPath)
|
||||
_UserConfigPath = Path.Combine(_UserDirectory, USER_CONFIG_NAME)
|
||||
|
||||
If ComputerConfigPath <> String.Empty Then
|
||||
If Not String.IsNullOrWhiteSpace(ComputerConfigPath) Then
|
||||
If IO.File.Exists(ComputerConfigPath) Then
|
||||
_ComputerDirectory = _File.CreateDirectory(ComputerConfigPath, False)
|
||||
Else
|
||||
@@ -122,9 +134,9 @@ Public Class ConfigManager(Of T)
|
||||
_ComputerConfigPath = Path.Combine(_ComputerDirectory, COMPUTER_CONFIG_NAME)
|
||||
End If
|
||||
|
||||
If ApplicationStartupPath <> String.Empty Then
|
||||
_AppConfigDirectory = ApplicationStartupPath
|
||||
If Not String.IsNullOrWhiteSpace(ApplicationStartupPath) Then
|
||||
_AppConfigPath = Path.Combine(ApplicationStartupPath, APP_CONFIG_NAME)
|
||||
|
||||
End If
|
||||
|
||||
_WriteAllValuesToUserConfig = ForceUserConfig
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports NLog
|
||||
|
||||
Public Class ConfigUtils
|
||||
Private ReadOnly _Logger As Logger
|
||||
Private ReadOnly _File As FilesystemEx
|
||||
' Private ReadOnly _File As FilesystemEx
|
||||
|
||||
Private Const MIGRATE_DIRECTORY As String = "Migrate"
|
||||
|
||||
Public Sub New(LogConfig As LogConfig)
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_File = New FilesystemEx(LogConfig)
|
||||
Public Sub New(Logger As NLog.Logger)
|
||||
_Logger = Logger
|
||||
' _File = New FilesystemEx(LogConfig)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
|
||||
13
Config/My Project/Application.Designer.vb
generated
13
Config/My Project/Application.Designer.vb
generated
@@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
@@ -1,35 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("Modules.Config")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Modules.Config")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("6e67fba4-81d1-44bb-81f4-16ad52822192")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.2.2.0")>
|
||||
<Assembly: AssemblyFileVersion("1.2.2.0")>
|
||||
|
||||
63
Config/My Project/Resources.Designer.vb
generated
63
Config/My Project/Resources.Designer.vb
generated
@@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend 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("DigitalData.Modules.Config.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,117 +0,0 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.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>
|
||||
</resheader>
|
||||
</root>
|
||||
73
Config/My Project/Settings.Designer.vb
generated
73
Config/My Project/Settings.Designer.vb
generated
@@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Automatische My.Settings-Speicherfunktion"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.DigitalData.Modules.Config.My.MySettings
|
||||
Get
|
||||
Return Global.DigitalData.Modules.Config.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,7 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,70 +0,0 @@
|
||||
Imports Config
|
||||
Imports NLog
|
||||
|
||||
''' <summary>
|
||||
''' Sample Config Class inheriting from BaseConfig
|
||||
'''
|
||||
'''
|
||||
'''
|
||||
''' Things this class should do:
|
||||
'''
|
||||
''' - Provide defaults for all values
|
||||
''' - Load the current config using the LoadConfig method of BaseConfig
|
||||
''' - If no configfile was found, it should create a new datatable with only default values
|
||||
''' - If a configfile was found, it should merge the values from this file with the defaults from this class
|
||||
''' - For each propertyname defined in PropertyNames
|
||||
''' - Check for existing value in datatable
|
||||
''' - If a value is present, use it
|
||||
''' - If no value is exists, use the default value
|
||||
''' - Assign the resulting values to class properties
|
||||
''' - Save the new config to disk
|
||||
''' </summary>
|
||||
Public Class SampleConfig
|
||||
Inherits BaseConfig
|
||||
|
||||
Private _logger As Logger
|
||||
|
||||
Public ReadOnly ConnectionString As String
|
||||
Public ReadOnly UniversalViewer As String
|
||||
|
||||
Public Overloads ReadOnly Property PropertyNames As Dictionary(Of String, String)
|
||||
Get
|
||||
Return New Dictionary(Of String, String) From {
|
||||
{"ConnectionString", ""},
|
||||
{"UniversalViewer", ""}
|
||||
}
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(LogFactory As LogFactory)
|
||||
MyBase.New(LogFactory)
|
||||
|
||||
_logger = LogFactory.GetCurrentClassLogger()
|
||||
|
||||
' Load the existing values from the config file into PropertyNames
|
||||
' overwriting the default values
|
||||
Dim oDataTable = LoadConfig()
|
||||
|
||||
For Each oRow As DataRow In oDataTable.Rows
|
||||
Dim oValue = oRow.Item(_configValue)
|
||||
Dim oKey = oRow.Item(_configKey)
|
||||
|
||||
PropertyNames.Item(oKey) = oValue
|
||||
Next
|
||||
|
||||
' Assign the merged properties to class properties, optionally converting them beforehand
|
||||
For Each oProperty As KeyValuePair(Of String, String) In PropertyNames
|
||||
Select Case oProperty.Key
|
||||
Case "ConnectionString"
|
||||
ConnectionString = oProperty.Value
|
||||
Case "UniversalViewer"
|
||||
UniversalViewer = oProperty.Value
|
||||
Case Else
|
||||
_logger.Warn("Property {0} was found in PropertyNames but was not assigned to a config property", oProperty.Key)
|
||||
End Select
|
||||
Next
|
||||
|
||||
' Convert the dictionary back to a datatable and save it
|
||||
SaveConfig(ConvertToDataTable(PropertyNames))
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data
|
||||
|
||||
''' <summary>
|
||||
''' MODULE: Firebird
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Encryption
|
||||
Imports DigitalData.Modules.Logging
|
||||
@@ -148,7 +149,24 @@ Public Class MSSQLServer
|
||||
Public Function GetConnectionStringForId(pConnectionId As Integer) As String
|
||||
Return Get_ConnectionStringforID(pConnectionId)
|
||||
End Function
|
||||
|
||||
Public Function GetGDPictureString() As String
|
||||
Using oConnection As SqlConnection = GetSQLConnection()
|
||||
Dim oSQL = Queries.DD_ECM.ThirdPartyModules.GdPictureLicense
|
||||
Dim oGDPicture = GetScalarValueWithConnectionObject(oSQL, oConnection)
|
||||
If oGDPicture = String.Empty Then
|
||||
oSQL = Queries.DD_ECM.ThirdPartyModules.GdPictureLicense_REGULAR
|
||||
oGDPicture = GetScalarValueWithConnectionObject(oSQL, oConnection)
|
||||
End If
|
||||
Return oGDPicture
|
||||
End Using
|
||||
End Function
|
||||
Public Function GetDDCatalog() As DataTable
|
||||
Using oConnection As SqlConnection = GetSQLConnection()
|
||||
Dim oSQL = Queries.DD_ECM.DD_SELECTS.TBDD_CATALOG
|
||||
Dim oDT_CATALOG As DataTable = GetDatatable(oSQL)
|
||||
Return oDT_CATALOG
|
||||
End Using
|
||||
End Function
|
||||
Public Function Get_ConnectionStringforID(pConnectionId As Integer) As String
|
||||
Dim oConnectionString As String = String.Empty
|
||||
|
||||
@@ -462,7 +480,8 @@ Public Class MSSQLServer
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error("ExecuteNonQueryWithConnectionObject: Error in ExecuteNonQueryWithConnectionObject while executing command: [{0}]", pSqlCommandObject.CommandText)
|
||||
Dim omsg = $"Unexpected Error in ExecuteNonQueryWithConnectionObject while executing command: [{pSqlCommandObject.CommandText}]"
|
||||
Logger.Warn(omsg)
|
||||
Logger.Error(ex)
|
||||
|
||||
Return False
|
||||
@@ -634,6 +653,11 @@ Public Class MSSQLServer
|
||||
Select(Function(p) $"({p.ParameterName}={p.Value})").
|
||||
ToList()
|
||||
|
||||
Return String.Join(",", oList)
|
||||
Dim oParamString = String.Join(",", oList)
|
||||
If oParamString.Length > 1000 Then
|
||||
oParamString = oParamString.Substring(1, 1000)
|
||||
End If
|
||||
Return oParamString
|
||||
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
Imports System.Data.Odbc
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports System.Data
|
||||
Imports NLog
|
||||
|
||||
Public Class ODBC
|
||||
Private _Logger As Logger
|
||||
Private _LogConfig As LogConfig
|
||||
|
||||
Private _connectionDatasource As String
|
||||
Private _connectionUsername As String
|
||||
Private _connectionPassword As String
|
||||
Private _connectionString As String
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Datasource As String, User As String, Password As String)
|
||||
Public Sub New(Datasource As String, User As String, Password As String)
|
||||
Try
|
||||
_LogConfig = LogConfig
|
||||
_Logger = _LogConfig.GetLogger()
|
||||
_Logger = LogManager.GetCurrentClassLogger()
|
||||
|
||||
_connectionDatasource = Datasource
|
||||
_connectionPassword = Password
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports DigitalData.Modules.Encryption
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Oracle.ManagedDataAccess.Client
|
||||
Imports System.Data
|
||||
|
||||
Public Class Oracle
|
||||
Implements IDatabase
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="EntityFramework.Firebird.FbConnectionFactory, EntityFramework.Firebird"/>
|
||||
<defaultConnectionFactory type="EntityFramework.Firebird.FbConnectionFactory, EntityFramework.Firebird" />
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
|
||||
<provider invariantName="FirebirdSql.Data.FirebirdClient" type="EntityFramework.Firebird.FbProviderServices, EntityFramework.Firebird"/>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
<provider invariantName="FirebirdSql.Data.FirebirdClient" type="EntityFramework.Firebird.FbProviderServices, EntityFramework.Firebird" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0"/>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup></configuration>
|
||||
|
||||
@@ -1,167 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</ProjectGuid>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.Database</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.Database</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile />
|
||||
<MyType>Empty</MyType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
<AssemblyTitle>Modules.Database</AssemblyTitle>
|
||||
<Description>Stellt Funktionen für den Datenbankzugriff zur Verfügung</Description>
|
||||
<Company>Digital Data</Company>
|
||||
<Product>Modules.Database</Product>
|
||||
<Copyright>Copyright © 2025</Copyright>
|
||||
<AssemblyVersion>2.3.6.0</AssemblyVersion>
|
||||
<FileVersion>2.3.6.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Database.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Database.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.Firebird, Version=6.4.0.0, Culture=neutral, PublicKeyToken=42d22d092898e5f8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.Firebird.6.4.0\lib\net452\EntityFramework.Firebird.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=7.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<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>
|
||||
<Reference Include="Oracle.ManagedDataAccess">
|
||||
<HintPath>P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.Odbc, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<PackageReference Include="EntityFramework" Version="6.5.1" />
|
||||
<PackageReference Include="EntityFramework.Firebird" Version="10.1.0" />
|
||||
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="10.3.2" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="System.Data.Odbc" Version="8.0.1" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="CoreWCF.Primitives" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.ConfigurationManager" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.Http" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
|
||||
<PackageReference Include="Oracle.ManagedDataAccess" Version="23.4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="DigitalData.Modules.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ConnectionString.vb" />
|
||||
<Compile Include="Constants.vb" />
|
||||
<Compile Include="Dispatcher.vb" />
|
||||
<Compile Include="Exceptions.vb" />
|
||||
<Compile Include="Adapters\Firebird.vb" />
|
||||
<Compile Include="IDatabase.vb" />
|
||||
<Compile Include="Adapters\ODBC.vb" />
|
||||
<Compile Include="Adapters\Oracle.vb" />
|
||||
<Compile Include="Adapters\MSSQLServer.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Queries.vb" />
|
||||
<Compile Remove="My Project\Application.Designer.vb" />
|
||||
<Compile Remove="My Project\Resources.Designer.vb" />
|
||||
<Compile Remove="My Project\Settings.Designer.vb" />
|
||||
<EmbeddedResource Remove="My Project\Resources.resx" />
|
||||
<None Remove="My Project\Application.myapp" />
|
||||
<None Remove="My Project\Settings.settings" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
<ProjectReference Include="..\Encryption\Encryption.vbproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Encryption\Encryption.vbproj">
|
||||
<Project>{8a8f20fc-c46e-41ac-bee7-218366cfff99}</Project>
|
||||
<Name>Encryption</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
</Project>
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Oracle.ManagedDataAccess.Client
|
||||
Imports System.Data
|
||||
|
||||
Public Class Dispatcher
|
||||
Public ReadOnly Property Connections As New List(Of DispatcherConnection)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Data.Common
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Interface IDatabase
|
||||
|
||||
13
Database/My Project/Application.Designer.vb
generated
13
Database/My Project/Application.Designer.vb
generated
@@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
@@ -1,35 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("Modules.Database")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("Modules.Database")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024")>
|
||||
<Assembly: AssemblyTrademark("2.3.4.0")>
|
||||
<Assembly: AssemblyTrademark("2.3.6.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("b5cdfd4f-609f-41e1-adf0-663de9636ff5")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.4.0")>
|
||||
<Assembly: AssemblyFileVersion("2.3.4.0")>
|
||||
|
||||
63
Database/My Project/Resources.Designer.vb
generated
63
Database/My Project/Resources.Designer.vb
generated
@@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend 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("DigitalData.Modules.Database.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,117 +0,0 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.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>
|
||||
</resheader>
|
||||
</root>
|
||||
73
Database/My Project/Settings.Designer.vb
generated
73
Database/My Project/Settings.Designer.vb
generated
@@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Automatische My.Settings-Speicherfunktion"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.DigitalData.Modules.Database.My.MySettings
|
||||
Get
|
||||
Return Global.DigitalData.Modules.Database.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,7 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,11 +1,15 @@
|
||||
Public Class Queries
|
||||
Public Class DD_ECM
|
||||
Public Class ThirdPartyModules
|
||||
Public Const GdPictureLicense As String = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'"
|
||||
Public Const GdPictureLicense As String = "SELECT COALESCE(MAX(LICENSE),'') FROM TBDD_3RD_PARTY_MODULES WHERE ACTIVE = 1 AND NAME = 'GDPICTURE' AND [VERSION] = '11.2024'"
|
||||
Public Const GdPictureLicense_REGULAR As String = "SELECT COALESCE(MAX(LICENSE),'') FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE' AND ACTIVE = 1"
|
||||
End Class
|
||||
Public Class DD_SELECTS
|
||||
Public Const TBDD_CATALOG As String = "SELECT * FROM TBDD_CATALOG"
|
||||
End Class
|
||||
|
||||
Public Class Connections
|
||||
Public Const AllConnections As String = "SELECT * FROM TBDD_CONNECTION"
|
||||
Public Const AllConnections As String = "SELECT * FROM TBDD_CONNECTION AND AKTIV = 1"
|
||||
End Class
|
||||
End Class
|
||||
End Class
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net461" />
|
||||
<package id="EntityFramework.Firebird" version="6.4.0" targetFramework="net461" />
|
||||
<package id="FirebirdSql.Data.FirebirdClient" version="7.5.0" targetFramework="net461" />
|
||||
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||
<package id="System.Data.Odbc" version="6.0.1" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.ServiceModel
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.EDMI.API.Constants
|
||||
|
||||
@@ -3109,18 +3109,6 @@ Namespace EDMIServiceReference
|
||||
MyBase.New
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal endpointConfigurationName As String)
|
||||
MyBase.New(endpointConfigurationName)
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String)
|
||||
MyBase.New(endpointConfigurationName, remoteAddress)
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
|
||||
MyBase.New(endpointConfigurationName, remoteAddress)
|
||||
End Sub
|
||||
|
||||
Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress)
|
||||
MyBase.New(binding, remoteAddress)
|
||||
End Sub
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports System.Data
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.EDMI.API
|
||||
Imports DigitalData.Modules.EDMI.API.Constants
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Language.Utils
|
||||
|
||||
Public Class DatabaseWithFallback
|
||||
Private ReadOnly _Logger As Logger
|
||||
|
||||
@@ -1,122 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{25017513-0D97-49D3-98D7-BA76D9B251B0}</ProjectGuid>
|
||||
<TargetFramework>net8.0-windows7.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.EDMI.API</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.EDMI.API</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
<AssemblyTitle>EDMIAPI</AssemblyTitle>
|
||||
<Company>Digital Data</Company>
|
||||
<Product>EDMIAPI</Product>
|
||||
<Copyright>Copyright © 2023</Copyright>
|
||||
<AssemblyVersion>1.6.1.1</AssemblyVersion>
|
||||
<FileVersion>1.6.1.1</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.EDMI.API.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.EDMI.API.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<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>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="System.ServiceModel.Duplex" Version="6.0.0" />
|
||||
<PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" />
|
||||
<PackageReference Include="System.ServiceModel.Http" Version="8.0.0" />
|
||||
<PackageReference Include="System.ServiceModel.NetTcp" Version="8.0.0" />
|
||||
<PackageReference Include="System.ServiceModel.Security" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Client\Connection.vb" />
|
||||
<Compile Include="Client\NewFile.vb" />
|
||||
<Compile Include="Client\Options.vb" />
|
||||
<Compile Include="Client\Rights.vb" />
|
||||
<Compile Include="Client\Channel.vb" />
|
||||
<Compile Include="Client\ServerAddressStruct.vb" />
|
||||
<Compile Include="Modules\BaseMethod.vb" />
|
||||
<Compile Include="Modules\Globix\ImportFile.vb" />
|
||||
<Compile Include="Helpers.vb" />
|
||||
<Compile Include="Modules\IDB\CheckOutFile.vb" />
|
||||
<Compile Include="Modules\IDB\CheckInFile.vb" />
|
||||
<Compile Include="Modules\IDB\ImportFile.vb" />
|
||||
<Compile Include="Modules\IDB\NewFile.vb" />
|
||||
<Compile Include="Modules\IDB\SetAttributeValue.vb" />
|
||||
<Compile Include="Modules\IDB\SetObjectState.vb" />
|
||||
<Compile Include="Modules\IDB\UpdateFile.vb" />
|
||||
<Compile Include="Modules\ZooFlow\GetFileObject.vb" />
|
||||
<Compile Include="Connected Services\EDMIServiceReference\Reference.vb">
|
||||
<Compile Update="Connected Services\EDMIServiceReference\Reference.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Client.vb" />
|
||||
<Compile Include="Constants.vb" />
|
||||
<Compile Include="DatabaseWithFallback.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<Compile Update="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<Compile Update="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<Compile Update="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<EmbeddedResource Update="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
@@ -124,158 +63,153 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="Connected Services\EDMIServiceReference\Arrays.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\Arrays.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.CheckInOutFileResponse.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.CheckInOutFileResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentInfoResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentInfoResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentListResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.DocumentStreamResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ExecuteNonQueryResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ExecuteNonQueryResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetAttributeValueResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetAttributeValueResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetClientConfigResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetClientConfigResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetDatatableResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetDatatableResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetFileObjectResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetFileObjectResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetScalarValueResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.GetScalarValueResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.Globix_ImportFileResponse.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.Globix_ImportFileResponse.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ImportFileResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ImportFileResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.NewFileResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.NewFileResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.NonQueryResult1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.NonQueryResult1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.RightsAccessRight1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.RightsAccessRight1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ScalarResult1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ScalarResult1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.SetAttributeValueResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.SetAttributeValueResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.TableResult1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.TableResult1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.TestObjectIdExistsResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.TestObjectIdExistsResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.UpdateFileResponse1.datasource">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.UpdateFileResponse1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.ZooFlow.State.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Modules.ZooFlow.State.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Exceptions.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Exceptions.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Messages.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Messages.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Base.GetClientConfig.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Base.GetClientConfig.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.ExecuteNonQuery.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.ExecuteNonQuery.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.GetDatatable.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.GetDatatable.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.GetScalarValue.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.GetScalarValue.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.Database.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.GlobalIndexer.ImportFile.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.GlobalIndexer.ImportFile.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.CheckInOutFile.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.CheckInOutFile.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.GetAttributeValue.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.GetAttributeValue.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.GetFileObject.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.GetFileObject.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.ImportFile.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.ImportFile.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.NewFile.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.NewFile.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.SetAttributeValue.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.SetAttributeValue.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.UpdateFile.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.UpdateFile.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Methods.IDB.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.wsdl" />
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService1.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService1.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\Message.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\Message.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\service.wsdl" />
|
||||
<None Include="Connected Services\EDMIServiceReference\service.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\service.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\System.Data.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\System.Data.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\System.IO.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\System.IO.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Connected Services\EDMIServiceReference\System.xsd">
|
||||
<None Update="Connected Services\EDMIServiceReference\System.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<None Update="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\DataSources\System.Data.DataTable.datasource" />
|
||||
<None Include="My Project\Settings.settings">
|
||||
<None Update="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
@@ -284,34 +218,15 @@
|
||||
<WCFMetadataStorage Include="Connected Services\EDMIServiceReference\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Connected Services\EDMIServiceReference\configuration91.svcinfo" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Connected Services\EDMIServiceReference\configuration.svcinfo" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Connected Services\EDMIServiceReference\Reference.svcmap">
|
||||
<None Update="Connected Services\EDMIServiceReference\Reference.svcmap">
|
||||
<Generator>WCF Proxy Generator</Generator>
|
||||
<LastGenOutput>Reference.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Base\Base.vbproj">
|
||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
||||
<Name>Base</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Config\Config.vbproj">
|
||||
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Database\Database.vbproj">
|
||||
<Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project>
|
||||
<Name>Database</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Base\Base.vbproj" />
|
||||
<ProjectReference Include="..\Config\Config.vbproj" />
|
||||
<ProjectReference Include="..\Database\Database.vbproj" />
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -1,35 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("EDMIAPI")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("EDMIAPI")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("1.6.1.1")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("a4ecd56e-dc85-471e-b190-f3f2e3f4b7b0")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.6.1.1")>
|
||||
<Assembly: AssemblyFileVersion("1.6.1.1")>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.diagnostics>
|
||||
<sources>
|
||||
<!-- Dieser Abschnitt definiert die Protokollierungskonfiguration für My.Application.Log -->
|
||||
<source name="DefaultSource" switchName="DefaultSwitch">
|
||||
<listeners>
|
||||
<add name="FileLog"/>
|
||||
<add name="FileLog" />
|
||||
<!-- Auskommentierung des nachfolgenden Abschnitts aufheben, um in das Anwendungsereignisprotokoll zu schreiben -->
|
||||
<!--<add name="EventLog"/>-->
|
||||
</listeners>
|
||||
</source>
|
||||
</sources>
|
||||
<switches>
|
||||
<add name="DefaultSwitch" value="Information"/>
|
||||
<add name="DefaultSwitch" value="Information" />
|
||||
</switches>
|
||||
<sharedListeners>
|
||||
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
|
||||
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" />
|
||||
<!-- Auskommentierung des nachfolgenden Abschnitts aufheben und APPLICATION_NAME durch den Namen der Anwendung ersetzen, um in das Anwendungsereignisprotokoll zu schreiben -->
|
||||
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
|
||||
</sharedListeners>
|
||||
@@ -25,7 +25,7 @@
|
||||
<netTcpBinding>
|
||||
<binding name="NetTcpBinding_IEDMIService" transferMode="Streamed">
|
||||
<security>
|
||||
<transport sslProtocols="None"/>
|
||||
<transport sslProtocols="None" />
|
||||
</security>
|
||||
</binding>
|
||||
</netTcpBinding>
|
||||
@@ -33,7 +33,7 @@
|
||||
<client>
|
||||
<endpoint address="net.tcp://localhost:9000/DigitalData/Services/Main" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IEDMIService" contract="EDMIServiceReference.IEDMIService" name="NetTcpBinding_IEDMIService">
|
||||
<identity>
|
||||
<userPrincipalName value="Administrator@dd-san01.dd-gan.local.digitaldata.works"/>
|
||||
<userPrincipalName value="Administrator@dd-san01.dd-gan.local.digitaldata.works" />
|
||||
</identity>
|
||||
</endpoint>
|
||||
</client>
|
||||
@@ -41,9 +41,9 @@
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0"/>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup></configuration>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -1,9 +1,10 @@
|
||||
Imports System.IO
|
||||
Imports System.IO.Compression
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports NLog
|
||||
|
||||
Public Class Compression
|
||||
Private ReadOnly _logger As Logger
|
||||
Private ReadOnly _logger As NLog.Logger
|
||||
|
||||
Public Sub New(LogConfig As LogConfig)
|
||||
_logger = LogConfig.GetLogger()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Text.Encoding
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports NLog
|
||||
|
||||
''' <summary>
|
||||
''' https://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp
|
||||
|
||||
@@ -1,124 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8A8F20FC-C46E-41AC-BEE7-218366CFFF99}</ProjectGuid>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.Encryption</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.Encryption</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
<MyType>Empty</MyType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AssemblyTitle>DDModules.DDEncryption</AssemblyTitle>
|
||||
<Description>Stellt Funktionen zur Entschlüsselung bereit</Description>
|
||||
<Company>Digital Data Gmbh, Heuchelheim</Company>
|
||||
<Product>DDModules.Encryption</Product>
|
||||
<Copyright>Copyright © 2021</Copyright>
|
||||
<AssemblyVersion>1.3.1.0</AssemblyVersion>
|
||||
<FileVersion>1.3.1.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Encryption.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Encryption.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<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>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="CoreWCF.Primitives" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.ConfigurationManager" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.Http" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="DigitalData.Modules.Logging" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Compression.vb" />
|
||||
<Compile Include="Encryption.vb" />
|
||||
<Compile Include="EncryptionLegacy.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Remove="My Project\Application.Designer.vb" />
|
||||
<Compile Remove="My Project\Resources.Designer.vb" />
|
||||
<Compile Remove="My Project\Settings.Designer.vb" />
|
||||
<EmbeddedResource Remove="My Project\Resources.resx" />
|
||||
<None Remove="My Project\Application.myapp" />
|
||||
<None Remove="My Project\Settings.settings" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
13
Encryption/My Project/Application.Designer.vb
generated
13
Encryption/My Project/Application.Designer.vb
generated
@@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
@@ -1,35 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("Encryption")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Encryption")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2021")>
|
||||
<Assembly: AssemblyTrademark("1.2.0.0")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("e92901a1-8e87-482d-b63f-f20292d38f1e")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' indem Sie "*" wie unten gezeigt eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.2.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.2.0.0")>
|
||||
|
||||
63
Encryption/My Project/Resources.Designer.vb
generated
63
Encryption/My Project/Resources.Designer.vb
generated
@@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend 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("DigitalData.Modules.Encryption.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,117 +0,0 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.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>
|
||||
</resheader>
|
||||
</root>
|
||||
73
Encryption/My Project/Settings.Designer.vb
generated
73
Encryption/My Project/Settings.Designer.vb
generated
@@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "Automatische My.Settings-Speicherfunktion"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.DigitalData.Modules.Encryption.My.MySettings
|
||||
Get
|
||||
Return Global.DigitalData.Modules.Encryption.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,7 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||
</packages>
|
||||
487
Filesystem/File.vb
Normal file
487
Filesystem/File.vb
Normal file
@@ -0,0 +1,487 @@
|
||||
Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Text
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
''' <module>File</module>
|
||||
''' <version>0.0.0.1</version>
|
||||
''' <date>11.10.2018</date>
|
||||
''' <summary>
|
||||
''' Module that provides variouse File operations
|
||||
''' </summary>
|
||||
''' <dependencies>
|
||||
''' NLog, >= 4.5.8
|
||||
''' </dependencies>
|
||||
''' <params>
|
||||
''' LogConfig, DigitalData.Module.Logging.LogConfig
|
||||
''' A LogConfig object
|
||||
''' </params>
|
||||
''' <props>
|
||||
''' </props>
|
||||
''' <example>
|
||||
''' </example>
|
||||
''' <remarks>
|
||||
''' </remarks>
|
||||
Public Class File
|
||||
Private ReadOnly _Logger As Logger
|
||||
Private ReadOnly _LogConfig As LogConfig
|
||||
|
||||
Private ReadOnly _invalidFilenameChars As String
|
||||
Private ReadOnly _invalidPathChars As String
|
||||
|
||||
Private Const REGEX_CLEAN_FILENAME As String = "[\\/:""<>|\b\0\r\n\t]"
|
||||
Private Const REGEX_CLEAN_PATH As String = "[""<>|\b\0\r\n\t]"
|
||||
|
||||
' The limit enforced by windows for filenpaths is 260,
|
||||
' so we use a slightly smaller number to have some Error margin.
|
||||
'
|
||||
' Source: https://docs.microsoft.com/de-de/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#maximum-path-length-limitation
|
||||
Private Const MAX_FILE_PATH_LENGTH = 250
|
||||
|
||||
Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt"
|
||||
|
||||
Public Sub New(LogConfig As LogConfig)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
|
||||
_invalidFilenameChars = String.Join("", Path.GetInvalidFileNameChars())
|
||||
_invalidPathChars = String.Join("", Path.GetInvalidPathChars())
|
||||
End Sub
|
||||
|
||||
Public Function GetCleanFilename(FileName As String) As String
|
||||
_Logger.Debug("Filename before cleaning: [{0}]", FileName)
|
||||
|
||||
Dim oCleanName As String = FileName
|
||||
oCleanName = Regex.Replace(oCleanName, _invalidFilenameChars, String.Empty)
|
||||
oCleanName = Regex.Replace(oCleanName, REGEX_CLEAN_FILENAME, String.Empty, RegexOptions.Singleline)
|
||||
oCleanName = Regex.Replace(oCleanName, "\s{2,}", " ")
|
||||
oCleanName = Regex.Replace(oCleanName, "\.{2,}", ".")
|
||||
|
||||
_Logger.Debug("Filename after cleaning: [{0}]", oCleanName)
|
||||
|
||||
Return oCleanName
|
||||
End Function
|
||||
|
||||
Public Function GetCleanPath(FilePath As String) As String
|
||||
_Logger.Debug("Path before cleaning: [{0}]", FilePath)
|
||||
|
||||
Dim oCleanName As String = FilePath
|
||||
oCleanName = Regex.Replace(oCleanName, _invalidPathChars, String.Empty)
|
||||
oCleanName = Regex.Replace(oCleanName, REGEX_CLEAN_PATH, String.Empty, RegexOptions.Singleline)
|
||||
|
||||
_Logger.Debug("Path after cleaning: [{0}]", oCleanName)
|
||||
|
||||
Return oCleanName
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Reads the file at `FilePath` and computes a SHA256 Hash from its contents
|
||||
''' </summary>
|
||||
''' <param name="FilePath"></param>
|
||||
''' <returns></returns>
|
||||
Public Function GetChecksum(FilePath As String) As String
|
||||
Try
|
||||
Using oFileStream = IO.File.OpenRead(FilePath)
|
||||
Using oStream As New BufferedStream(oFileStream, 1200000)
|
||||
Dim oChecksum() As Byte = SHA256.Create.ComputeHash(oStream)
|
||||
Return FormatHash(oChecksum)
|
||||
End Using
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetChecksumFromString(pStringToCheck As String) As String
|
||||
Dim oBytes() As Byte = Encoding.UTF8.GetBytes(pStringToCheck)
|
||||
Dim oChecksum() As Byte = SHA256.Create.ComputeHash(oBytes)
|
||||
Return FormatHash(oChecksum)
|
||||
End Function
|
||||
|
||||
Private Function FormatHash(pChecksum)
|
||||
Return BitConverter.
|
||||
ToString(pChecksum).
|
||||
Replace("-", String.Empty)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Adds file version string to given filename `Destination` if that file already exists.
|
||||
''' </summary>
|
||||
''' <param name="Destination"></param>
|
||||
''' <returns></returns>
|
||||
Public Function GetVersionedFilename(Destination As String) As String
|
||||
Try
|
||||
Dim oFileName As String = Destination
|
||||
Dim oFinalFileName = oFileName
|
||||
|
||||
Dim oDestinationDir = Path.GetDirectoryName(oFileName)
|
||||
Dim oExtension = Path.GetExtension(oFileName)
|
||||
|
||||
Dim oVersionSeparator As Char = "~"c
|
||||
|
||||
' Split Filename without extension at version separator to:
|
||||
' - Check if file is already versioned
|
||||
' - Get the file version of an already versioned file
|
||||
'
|
||||
' Example:
|
||||
' test1.pdf --> test1 --> ['test1'] --> no fileversion
|
||||
' test1~2.pdf --> test1~2 --> ['test1', '2'] --> version 2
|
||||
' test1~12345~2.pdf --> test1~12345~2 --> ['test1', '12345', '2'] --> still version 2
|
||||
'Dim oFileNameWithoutExtension = Path.GetFileNameWithoutExtension(oFileName)
|
||||
'Dim oSplitFilename = oFileNameWithoutExtension.Split(oVersionSeparator).ToList()
|
||||
|
||||
' if file is already versioned, extract file version
|
||||
' else just use the filename and set version to 1
|
||||
'If oSplitFilename.Count > 1 Then
|
||||
' Dim oVersion As Integer = 1
|
||||
' Try
|
||||
' oVersion = Integer.Parse(oSplitFilename.Last())
|
||||
' oFileNameWithoutExtension = String.Join("", oSplitFilename.Take(oSplitFilename.Count - 1))
|
||||
' Catch ex As Exception
|
||||
' ' oFilenameWithoutExtension does NOT change
|
||||
' oFileNameWithoutExtension = oFileNameWithoutExtension
|
||||
' Finally
|
||||
' oFileVersion = oVersion
|
||||
' End Try
|
||||
'Else
|
||||
' oFileVersion = 1
|
||||
'End If
|
||||
|
||||
Dim oFileNameWithoutExtension = Path.GetFileNameWithoutExtension(oFileName)
|
||||
Dim oSplitResult = GetVersionedString(oFileNameWithoutExtension, oVersionSeparator)
|
||||
|
||||
oFileNameWithoutExtension = oSplitResult.Item1
|
||||
Dim oFileVersion = oSplitResult.Item2
|
||||
|
||||
' Shorten the filename (only filename, without extension or version)
|
||||
' by cutting the length in half. This should work no matter how long the path and/or filename are.
|
||||
If oFileName.Length > MAX_FILE_PATH_LENGTH Then
|
||||
_Logger.Info("Filename is too long. Filename will be cut to prevent further errors.")
|
||||
_Logger.Info("Original Filename is: {0}", oFileNameWithoutExtension)
|
||||
Dim oNewLength As Integer = Math.Round(oFileNameWithoutExtension.Length / 2)
|
||||
Dim oNewFileNameWithoutExtension = oFileNameWithoutExtension.Substring(0, oNewLength)
|
||||
_Logger.Info("New Filename will be: {0}", oNewFileNameWithoutExtension)
|
||||
|
||||
oFileNameWithoutExtension = oNewFileNameWithoutExtension
|
||||
End If
|
||||
|
||||
' while file exists, increment version
|
||||
Do
|
||||
oFinalFileName = Path.Combine(oDestinationDir, GetFilenameWithVersion(oFileNameWithoutExtension, oVersionSeparator, oFileVersion, oExtension))
|
||||
_Logger.Debug("Intermediate Filename is {0}", oFinalFileName)
|
||||
_Logger.Debug("File version: {0}", oFileVersion)
|
||||
oFileVersion += 1
|
||||
Loop While (IO.File.Exists(oFinalFileName))
|
||||
|
||||
_Logger.Debug("Final Filename is {0}", oFinalFileName)
|
||||
|
||||
Return oFinalFileName
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("Filename {0} could not be versioned. Original filename will be returned!", Destination)
|
||||
_Logger.Error(ex)
|
||||
Return Destination
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Split String at version separator to:
|
||||
''' check if string is already versioned,
|
||||
''' get the string version of an already versioned string
|
||||
''' </summary>
|
||||
''' <example>
|
||||
''' Examples:
|
||||
''' test1.pdf --> test1 --> ['test1'] --> no fileversion
|
||||
''' test1~2.pdf --> test1~2 --> ['test1', '2'] --> version 2
|
||||
''' test1~12345~2.pdf --> test1~12345~2 --> ['test1', '12345', '2'] --> still version 2
|
||||
''' somestring~3 --> somestring~3 --> ['somestring', '3'] --> version 3
|
||||
''' </example>
|
||||
''' <param name="pString">The string to versioned</param>
|
||||
''' <param name="pSeparator">The character to split at</param>
|
||||
''' <returns>Tuple of string and version</returns>
|
||||
Public Function GetVersionedString(pString As String, pSeparator As Char) As Tuple(Of String, Integer)
|
||||
Dim oSplitString = pString.Split(pSeparator).ToList()
|
||||
Dim oStringVersion As Integer
|
||||
|
||||
' if string is already versioned, extract string version
|
||||
' else just use the string and set version to 1
|
||||
If oSplitString.Count > 1 Then
|
||||
Dim oVersion As Integer = 1
|
||||
Try
|
||||
oVersion = Integer.Parse(oSplitString.Last())
|
||||
pString = String.Join("", oSplitString.Take(oSplitString.Count - 1))
|
||||
Catch ex As Exception
|
||||
' pString does NOT change
|
||||
pString = pString
|
||||
Finally
|
||||
oStringVersion = oVersion
|
||||
End Try
|
||||
Else
|
||||
oStringVersion = 1
|
||||
End If
|
||||
|
||||
Return New Tuple(Of String, Integer)(pString, oStringVersion)
|
||||
End Function
|
||||
|
||||
Public Function GetAppDataPath(CompanyName As String, ProductName As String)
|
||||
Dim oLocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
|
||||
Return Path.Combine(oLocalAppData, CompanyName, ProductName)
|
||||
End Function
|
||||
|
||||
Private Function GetFilenameWithVersion(FileNameWithoutExtension As String, VersionSeparator As Char, FileVersion As Integer, Extension As String) As String
|
||||
If FileVersion <= 1 Then
|
||||
Return $"{FileNameWithoutExtension}{Extension}"
|
||||
Else
|
||||
Return $"{FileNameWithoutExtension}{VersionSeparator}{FileVersion}{Extension}"
|
||||
End If
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Removes files in a directory filtered by filename, extension and last write date
|
||||
''' </summary>
|
||||
''' <param name="Path">The directory in which files will be deleted</param>
|
||||
''' <param name="FileKeepTime">Only delete files which are older than x days. Must be between 0 and 1000 days.</param>
|
||||
''' <param name="FileBaseName">A filename filter which will be checked</param>
|
||||
''' <param name="FileExtension">A file extension which will be checked</param>
|
||||
''' <param name="ContinueOnError">Should the function continue with deleting when a file could not be deleted?</param>
|
||||
''' <returns>True if all files were deleted or if no files were deleted, otherwise false</returns>
|
||||
Public Function RemoveFiles(Path As String, FileKeepTime As Integer, FileBaseName As String, Optional FileExtension As String = "log", Optional ContinueOnError As Boolean = True) As Boolean
|
||||
If Not TestPathIsDirectory(Path) Then
|
||||
Throw New ArgumentException($"Path {Path} is not a directory!")
|
||||
End If
|
||||
|
||||
If Not Directory.Exists(Path) Then
|
||||
Throw New DirectoryNotFoundException($"Path {Path} does not exist!")
|
||||
End If
|
||||
|
||||
If FileKeepTime < 0 Or FileKeepTime > 1000 Then
|
||||
Throw New ArgumentOutOfRangeException("FileKeepTime must be an integer between 0 and 1000!")
|
||||
End If
|
||||
|
||||
Dim oUnableToDeleteCounter = 0
|
||||
Dim oDirectory As New DirectoryInfo(Path)
|
||||
Dim oDateLimit As DateTime = DateTime.Now.AddDays(FileKeepTime)
|
||||
Dim oFiles As List(Of FileInfo) = oDirectory.
|
||||
EnumerateFiles($"*{FileBaseName}*").
|
||||
Where(Function(oFileInfo As FileInfo)
|
||||
Return oFileInfo.Extension = FileExtension And oFileInfo.LastWriteTime < oDateLimit
|
||||
End Function).
|
||||
ToList()
|
||||
|
||||
If oFiles.Count = 0 Then
|
||||
_Logger.Debug("No files found that match the criterias.")
|
||||
Return True
|
||||
End If
|
||||
|
||||
_Logger.Debug("Deleting old files (Found {0}).", oFiles.Count)
|
||||
|
||||
For Each oFile As FileInfo In oFiles
|
||||
Try
|
||||
oFile.Delete()
|
||||
Catch ex As Exception
|
||||
If ContinueOnError = False Then
|
||||
_Logger.Warn("Deleting files was aborted at file {0}.", oFile.FullName)
|
||||
Return False
|
||||
End If
|
||||
oUnableToDeleteCounter = oUnableToDeleteCounter + 1
|
||||
_Logger.Warn("File {0} could not be deleted!")
|
||||
End Try
|
||||
Next
|
||||
|
||||
If oUnableToDeleteCounter > 0 Then
|
||||
_Logger.Debug("Old files partially removed. {0} files could not be removed.", oUnableToDeleteCounter)
|
||||
Else
|
||||
_Logger.Debug("Old files removed.")
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Sub MoveTo(FilePath As String, Directory As String)
|
||||
Dim oFileInfo As New FileInfo(FilePath)
|
||||
IO.File.Move(FilePath, Path.Combine(Directory, oFileInfo.Name))
|
||||
End Sub
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Sub MoveTo(FilePath As String, NewFileName As String, Directory As String)
|
||||
IO.File.Move(FilePath, Path.Combine(Directory, NewFileName))
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Copied from https://docs.microsoft.com/en-us/dotnet/standard/io/how-to-copy-directories
|
||||
''' </summary>
|
||||
''' <param name="SourceDirName"></param>
|
||||
''' <param name="DestDirName"></param>
|
||||
''' <param name="CopySubDirs"></param>
|
||||
Public Sub CopyDirectory(ByVal SourceDirName As String, ByVal DestDirName As String, ByVal CopySubDirs As Boolean)
|
||||
Dim oDirectory As DirectoryInfo = New DirectoryInfo(SourceDirName)
|
||||
|
||||
If Not oDirectory.Exists Then
|
||||
Throw New DirectoryNotFoundException("Source directory does not exist or could not be found: " & SourceDirName)
|
||||
End If
|
||||
|
||||
Dim oDirectories As DirectoryInfo() = oDirectory.GetDirectories()
|
||||
Directory.CreateDirectory(DestDirName)
|
||||
Dim oFiles As FileInfo() = oDirectory.GetFiles()
|
||||
|
||||
For Each oFile As FileInfo In oFiles
|
||||
Dim tempPath As String = Path.Combine(DestDirName, oFile.Name)
|
||||
oFile.CopyTo(tempPath, False)
|
||||
Next
|
||||
|
||||
If CopySubDirs Then
|
||||
For Each oSubDirectory As DirectoryInfo In oDirectories
|
||||
Dim oTempPath As String = Path.Combine(DestDirName, oSubDirectory.Name)
|
||||
CopyDirectory(oSubDirectory.FullName, oTempPath, CopySubDirs)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Tries to create a directory and returns its path.
|
||||
''' Returns a temp path if `DirectoryPath` can not be created or written to.
|
||||
''' </summary>
|
||||
''' <param name="DirectoryPath">The directory to create</param>
|
||||
''' <param name="TestWriteAccess">Should a write access test be performed?</param>
|
||||
''' <returns>The used path</returns>
|
||||
Public Function CreateDirectory(DirectoryPath As String, Optional TestWriteAccess As Boolean = True) As String
|
||||
Dim oFinalPath As String
|
||||
If Directory.Exists(DirectoryPath) Then
|
||||
_Logger.Debug("Directory {0} already exists. Skipping.", DirectoryPath)
|
||||
oFinalPath = DirectoryPath
|
||||
Else
|
||||
Try
|
||||
Directory.CreateDirectory(DirectoryPath)
|
||||
oFinalPath = DirectoryPath
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn("Directory {0} could not be created. Temp path will be used instead.", DirectoryPath)
|
||||
oFinalPath = Path.GetTempPath()
|
||||
End Try
|
||||
End If
|
||||
|
||||
If TestWriteAccess AndAlso Not TestPathIsWritable(DirectoryPath) Then
|
||||
_Logger.Warn("Directory {0} is not writable. Temp path will be used instead.", DirectoryPath)
|
||||
oFinalPath = Path.GetTempPath()
|
||||
Else
|
||||
oFinalPath = DirectoryPath
|
||||
End If
|
||||
|
||||
_Logger.Debug("Using path {0}", oFinalPath)
|
||||
|
||||
Return oFinalPath
|
||||
End Function
|
||||
|
||||
Public Function TestPathIsWritable(DirectoryPath As String) As Boolean
|
||||
Try
|
||||
Dim fileAccessPath = Path.Combine(DirectoryPath, FILE_NAME_ACCESS_TEST)
|
||||
Using fs As FileStream = IO.File.Create(fileAccessPath)
|
||||
fs.WriteByte(0)
|
||||
End Using
|
||||
|
||||
IO.File.Delete(fileAccessPath)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Checks if a file is locked, ie. in use by another process.
|
||||
''' </summary>
|
||||
''' <remarks>
|
||||
''' https://docs.microsoft.com/en-us/dotnet/standard/io/handling-io-errors
|
||||
''' https://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use
|
||||
''' </remarks>
|
||||
Public Function TestFileIsLocked(pFilePath As String) As Boolean
|
||||
Try
|
||||
Using stream As FileStream = IO.File.Open(pFilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
|
||||
stream.Close()
|
||||
End Using
|
||||
Catch ex As Exception When ((ex.HResult And &HFFFF) = 32)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Return True
|
||||
End Try
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function TestPathIsDirectory(Path As String) As Boolean
|
||||
If Not Directory.Exists(Path) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim oIsDirectory As Boolean = (System.IO.File.GetAttributes(Path) And FileAttributes.Directory) = FileAttributes.Directory
|
||||
Return oIsDirectory
|
||||
End Function
|
||||
|
||||
Public Function GetDateDirectory(pBaseDirectory As String, pDate As Date) As String
|
||||
Dim oDateDirectory = GetDateString(pDate)
|
||||
Dim oFinalDirectory As String = IO.Path.Combine(pBaseDirectory, oDateDirectory)
|
||||
Return oFinalDirectory
|
||||
End Function
|
||||
|
||||
Public Function GetDateDirectory(pBaseDirectory As String) As String
|
||||
Return GetDateDirectory(pBaseDirectory, Now)
|
||||
End Function
|
||||
|
||||
Public Function CreateDateDirectory(pBaseDirectory As String, pDate As Date) As String
|
||||
Dim oDateDirectory = GetDateString(pDate)
|
||||
Dim oFinalDirectory As String = IO.Path.Combine(pBaseDirectory, oDateDirectory)
|
||||
|
||||
If IO.Directory.Exists(oFinalDirectory) = False Then
|
||||
_Logger.Debug("Path does not exist, creating: [{0}]", oFinalDirectory)
|
||||
Try
|
||||
Directory.CreateDirectory(oFinalDirectory)
|
||||
_Logger.Debug("Created folder [{0}]", oFinalDirectory)
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("Final path [{0}] could not be created!", oFinalDirectory)
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
|
||||
Return oFinalDirectory
|
||||
End Function
|
||||
|
||||
Public Function CreateDateDirectory(pBaseDirectory As String) As String
|
||||
Return CreateDateDirectory(pBaseDirectory, Now)
|
||||
End Function
|
||||
|
||||
Public Function GetDateString() As String
|
||||
Return $"{Now:yyyy\\MM\\dd}"
|
||||
End Function
|
||||
|
||||
Public Function GetDateString(pDate As Date) As String
|
||||
Return $"{pDate:yyyy\\MM\\dd}"
|
||||
End Function
|
||||
|
||||
Public Function GetDateTimeString() As String
|
||||
Return $"{Now:yyyy-MM-dd_hh-mm-ffff}"
|
||||
End Function
|
||||
|
||||
Public Function GetDateTimeString(pDate As Date) As String
|
||||
Return $"{pDate:yyyy-MM-dd_hh-mm-ffff}"
|
||||
End Function
|
||||
|
||||
Public Function GetFilenameWithSuffix(pFilePath As String, pSuffix As String)
|
||||
Dim oFileInfo = New IO.FileInfo(pFilePath)
|
||||
Return GetFilenameWithSuffix(IO.Path.GetFileNameWithoutExtension(pFilePath), pSuffix, oFileInfo.Extension.Substring(1))
|
||||
End Function
|
||||
|
||||
Public Function GetFilenameWithSuffix(pBaseString As String, pSuffix As String, pExtension As String)
|
||||
Return $"{pBaseString}-{pSuffix}.{pExtension}"
|
||||
End Function
|
||||
|
||||
Public Function GetFilenameWithPrefix(pFilePath As String, pPrefix As String)
|
||||
Dim oFileInfo = New IO.FileInfo(pFilePath)
|
||||
Return GetFilenameWithSuffix(IO.Path.GetFileNameWithoutExtension(pFilePath), pPrefix, oFileInfo.Extension.Substring(1))
|
||||
End Function
|
||||
|
||||
Public Function GetFilenameWithPrefix(pBaseString As String, pPrefix As String, pExtension As String)
|
||||
Return $"{pPrefix}-{pBaseString}.{pExtension}"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
18
Filesystem/FileContainer/DocumentObject.vb
Normal file
18
Filesystem/FileContainer/DocumentObject.vb
Normal file
@@ -0,0 +1,18 @@
|
||||
Imports System.Runtime.Serialization
|
||||
|
||||
<Serializable>
|
||||
Public Class DocumentObject
|
||||
|
||||
<DataMember(Name:="FileName")>
|
||||
Public ReadOnly FileName As String
|
||||
<DataMember(Name:="ContainerId")>
|
||||
Public ReadOnly ContainerId As String
|
||||
<DataMember(Name:="DocumentId")>
|
||||
Public ReadOnly DocumentId As Int64
|
||||
|
||||
Public Sub New(ContainerId As String, DocumentId As Int64, FileName As String)
|
||||
Me.ContainerId = ContainerId
|
||||
Me.DocumentId = DocumentId
|
||||
Me.FileName = FileName
|
||||
End Sub
|
||||
End Class
|
||||
193
Filesystem/FileContainer/FileContainer.vb
Normal file
193
Filesystem/FileContainer/FileContainer.vb
Normal file
@@ -0,0 +1,193 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Encryption
|
||||
Imports ProtoBuf
|
||||
|
||||
''' <module>FileContainer</module>
|
||||
''' <version>0.0.0.2</version>
|
||||
''' <date>21.11.2018</date>
|
||||
''' <summary>
|
||||
''' File Container for securely saving files
|
||||
''' </summary>
|
||||
''' <dependencies>
|
||||
''' NLog, >= 4.5.8
|
||||
''' </dependencies>
|
||||
''' <params>
|
||||
''' LogConfig, DigitalData.Module.Logging.LogConfig
|
||||
''' A LogConfig object
|
||||
''' Password, String
|
||||
''' The Password to Encrypt
|
||||
''' Path, String
|
||||
''' The Path to save/load the container
|
||||
''' </params>
|
||||
''' <example>
|
||||
''' dim oContainer = Container.Create(logConfig, "pass", "E:\some.container")
|
||||
''' dim oContainer = Container.Load(logConfig, "pass", "E:\some.container")
|
||||
'''
|
||||
''' dim oContainer = new Container(logConfig, "pass", "E:\some.container")
|
||||
''' oContainer.Save()
|
||||
'''
|
||||
''' dim oContainer = new Container(logConfig, "pass", "E:\some.container")
|
||||
''' oContainer.Contents = oSomeData
|
||||
''' oContainer.Save()
|
||||
'''
|
||||
''' dim oContainer = new Container(logConfig, "pass", "E:\some.container")
|
||||
''' oContainer.Load()
|
||||
''' dim oContents = oContainer.Contents
|
||||
'''
|
||||
''' dim oContainer = new Container(logConfig, "pass", "E:\some.container")
|
||||
''' oContainer.Load()
|
||||
''' oContainer.Contents = oSomeOtherData
|
||||
''' oContainer.Save()
|
||||
''' oContainer.SaveAs("E:\some2.container")
|
||||
''' </example>
|
||||
Public Class FileContainer
|
||||
Private _crypto As Encryption.Encryption
|
||||
Private _compression As Compression
|
||||
Private _inner As FileContainerInner
|
||||
Private _logger As Logger
|
||||
Private _logConfig As LogConfig
|
||||
Private _path As String
|
||||
|
||||
Public Property Contents As Byte()
|
||||
Get
|
||||
Return _inner.Contents
|
||||
End Get
|
||||
Set(value As Byte())
|
||||
_inner.Contents = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ContainerId As String
|
||||
Get
|
||||
Return _inner.FileId
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property CreatedAt As String
|
||||
Get
|
||||
Return _inner.CreatedAt
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property UpdatedAt As String
|
||||
Get
|
||||
Return _inner.UpdatedAt
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared Function Create(LogConfig As LogConfig, Password As String) As FileContainer
|
||||
Dim oContainer = New FileContainer(LogConfig, Password)
|
||||
Return oContainer
|
||||
End Function
|
||||
|
||||
Public Shared Function Load(LogConfig As LogConfig, Password As String, Path As String) As FileContainer
|
||||
Dim oContainer = New FileContainer(LogConfig, Password, Path)
|
||||
oContainer.Load()
|
||||
Return oContainer
|
||||
End Function
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Password As String)
|
||||
_logger = LogConfig.GetLogger()
|
||||
_crypto = New Encryption.Encryption(LogConfig, Password)
|
||||
_compression = New Compression(LogConfig)
|
||||
_inner = New FileContainerInner()
|
||||
End Sub
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Password As String, Path As String)
|
||||
MyClass.New(LogConfig, Password)
|
||||
_path = Path
|
||||
End Sub
|
||||
|
||||
Public Sub SetFile(Contents As Byte(), FileName As String)
|
||||
_inner.Contents = Contents
|
||||
_inner.UpdatedAt = Date.Now
|
||||
_inner.FileName = FileName
|
||||
End Sub
|
||||
|
||||
Public Function GetFile() As FileContainerInner
|
||||
Return _inner
|
||||
End Function
|
||||
|
||||
Public Sub Save()
|
||||
If IsNothing(_path) Then
|
||||
Throw New ArgumentException("Path not set")
|
||||
End If
|
||||
|
||||
SaveAs(_path)
|
||||
End Sub
|
||||
|
||||
Public Sub SaveAs(Path As String)
|
||||
Try
|
||||
WriteBytesToFile(TransformToBytes(_inner), Path)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub Load()
|
||||
If IsNothing(_path) Then
|
||||
Throw New ArgumentException("Path not set")
|
||||
End If
|
||||
|
||||
LoadFrom(_path)
|
||||
End Sub
|
||||
|
||||
Public Sub LoadFrom(Path As String)
|
||||
Try
|
||||
_inner = TransformToObject(ReadBytesFromFile(_path))
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Function TransformToBytes([Object] As FileContainerInner) As Byte()
|
||||
Dim oBytes = Serialize([Object])
|
||||
Dim oCompressed = _compression.Compress(oBytes)
|
||||
Dim oEncrypted = _crypto.Encrypt(oCompressed)
|
||||
Return oEncrypted
|
||||
End Function
|
||||
|
||||
Private Function TransformToObject(Bytes As Byte()) As FileContainerInner
|
||||
Dim oDecrypted = _crypto.Decrypt(Bytes)
|
||||
Dim oDecompressed = _compression.Decompress(oDecrypted)
|
||||
Dim oObject = Deserialize(oDecompressed)
|
||||
Return oObject
|
||||
End Function
|
||||
|
||||
Private Function Serialize(InnerData As FileContainerInner) As Byte()
|
||||
Dim oBinaryData As Byte()
|
||||
|
||||
Using oStream As New MemoryStream
|
||||
Serializer.Serialize(oStream, InnerData)
|
||||
oBinaryData = oStream.ToArray()
|
||||
End Using
|
||||
|
||||
Return oBinaryData
|
||||
End Function
|
||||
|
||||
Private Function Deserialize(InnerData As Byte()) As FileContainerInner
|
||||
Dim oObject As FileContainerInner
|
||||
|
||||
Using oStream As New MemoryStream(InnerData)
|
||||
oObject = Serializer.Deserialize(Of FileContainerInner)(oStream)
|
||||
End Using
|
||||
|
||||
Return oObject
|
||||
End Function
|
||||
|
||||
Private Sub WriteBytesToFile(Data As Byte(), FilePath As String)
|
||||
Using oSourceStream As New FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None)
|
||||
oSourceStream.Write(Data, 0, Data.Length)
|
||||
oSourceStream.Flush()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Private Function ReadBytesFromFile(FilePath As String) As Byte()
|
||||
Using oFileStream = New FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096)
|
||||
Dim oBuffer As Byte() = New Byte(oFileStream.Length - 1) {}
|
||||
oFileStream.Read(oBuffer, 0, oFileStream.Length)
|
||||
oFileStream.Close()
|
||||
Return oBuffer
|
||||
End Using
|
||||
End Function
|
||||
End Class
|
||||
23
Filesystem/FileContainer/FileContainerInner.vb
Normal file
23
Filesystem/FileContainer/FileContainerInner.vb
Normal file
@@ -0,0 +1,23 @@
|
||||
Imports ProtoBuf
|
||||
|
||||
<Serializable>
|
||||
<ProtoContract>
|
||||
Public Class FileContainerInner
|
||||
<ProtoMember(1)>
|
||||
Public FileId As String
|
||||
<ProtoMember(2)>
|
||||
Public Contents As Byte()
|
||||
<ProtoMember(3)>
|
||||
Public CreatedAt As DateTime
|
||||
<ProtoMember(4)>
|
||||
Public UpdatedAt As DateTime
|
||||
<ProtoMember(5)>
|
||||
Public FileName As String
|
||||
|
||||
Public Sub New()
|
||||
FileId = Guid.NewGuid().ToString
|
||||
CreatedAt = Date.Now
|
||||
UpdatedAt = Date.Now
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
132
Filesystem/FileWatcher/FileWatcher.vb
Normal file
132
Filesystem/FileWatcher/FileWatcher.vb
Normal file
@@ -0,0 +1,132 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
Imports DigitalData.Modules.Filesystem.FileWatcherFilters
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
|
||||
Public Class FileWatcher
|
||||
' Internals
|
||||
Private ReadOnly _Logger As Logger
|
||||
Private ReadOnly _Watchers As List(Of FileSystemWatcher)
|
||||
Private ReadOnly _Files As Dictionary(Of String, FileWatcherProperties)
|
||||
Private ReadOnly _Filters As List(Of BaseFileFilter)
|
||||
|
||||
' Options
|
||||
Private _Path As String
|
||||
|
||||
' Public Events
|
||||
Public Event FileSaved(ByVal FullName As String, ByVal IsSpecial As Boolean)
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Path As String, Optional Filters As List(Of BaseFileFilter) = Nothing)
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Files = New Dictionary(Of String, FileWatcherProperties)
|
||||
_Watchers = New List(Of FileSystemWatcher)
|
||||
_Filters = IIf(IsNothing(Filters), GetDefaultFilters(), Filters)
|
||||
_Path = Path
|
||||
|
||||
For Each oFilePath In Directory.EnumerateFiles(_Path)
|
||||
Try
|
||||
If IO.File.Exists(oFilePath) Then
|
||||
_Files.Add(oFilePath, New FileWatcherProperties With {
|
||||
.CreatedAt = DateTime.Now,
|
||||
.ChangedAt = Nothing
|
||||
})
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn("File {0} cannot be watched!")
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub Add(Filter As String)
|
||||
_Watchers.Add(CreateWatcher(Filter))
|
||||
End Sub
|
||||
|
||||
Public Sub Start()
|
||||
For Each oWatcher In _Watchers
|
||||
oWatcher.EnableRaisingEvents = True
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub [Stop]()
|
||||
For Each oWatcher In _Watchers
|
||||
If Not IsNothing(oWatcher) Then
|
||||
oWatcher.EnableRaisingEvents = False
|
||||
oWatcher.Dispose()
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Function GetDefaultFilters()
|
||||
Return New List(Of BaseFileFilter) From {
|
||||
New TempFileFilter,
|
||||
New OfficeFileFilter
|
||||
}
|
||||
End Function
|
||||
|
||||
Private Function CreateWatcher(Filter As String)
|
||||
Dim oWatcher = New FileSystemWatcher() With {
|
||||
.Path = _Path,
|
||||
.Filter = Filter,
|
||||
.NotifyFilter = NotifyFilters.LastAccess _
|
||||
Or NotifyFilters.LastWrite _
|
||||
Or NotifyFilters.FileName _
|
||||
Or NotifyFilters.Size _
|
||||
Or NotifyFilters.FileName _
|
||||
Or NotifyFilters.Attributes
|
||||
}
|
||||
|
||||
AddHandler oWatcher.Created, AddressOf HandleFileCreated
|
||||
AddHandler oWatcher.Changed, AddressOf HandleFileChanged
|
||||
AddHandler oWatcher.Deleted, AddressOf HandleFileDeleted
|
||||
AddHandler oWatcher.Renamed, AddressOf HandleFileRenamed
|
||||
|
||||
Return oWatcher
|
||||
End Function
|
||||
|
||||
Private Sub HandleFileCreated(sender As Object, e As FileSystemEventArgs)
|
||||
_Files.Add(e.FullPath, New FileWatcherProperties())
|
||||
_Logger.Debug("[Created] " & e.FullPath)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' This may fire twice for a single save operation,
|
||||
''' see: https://blogs.msdn.microsoft.com/oldnewthing/20140507-00/?p=1053/
|
||||
''' </summary>
|
||||
Private Sub HandleFileChanged(sender As Object, e As FileSystemEventArgs)
|
||||
_Files.Item(e.FullPath).ChangedAt = DateTime.Now
|
||||
_Logger.Debug("[Changed] " & e.FullPath)
|
||||
|
||||
Dim oShouldRaiseSave As Boolean = Not _Filters.Any(Function(oFilter)
|
||||
Return oFilter.ShouldFilter(e)
|
||||
End Function)
|
||||
|
||||
If oShouldRaiseSave Then
|
||||
RaiseEvent FileSaved(e.FullPath, False)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub HandleFileDeleted(sender As Object, e As FileSystemEventArgs)
|
||||
_Files.Remove(e.FullPath)
|
||||
_Logger.Debug("[Removed] " & e.FullPath)
|
||||
End Sub
|
||||
|
||||
Private Sub HandleFileRenamed(sender As Object, e As RenamedEventArgs)
|
||||
Dim oProperties = _Files.Item(e.OldFullPath)
|
||||
_Files.Remove(e.OldFullPath)
|
||||
_Files.Add(e.FullPath, oProperties)
|
||||
' Soll eine umbenannte datei als NEU gelten?
|
||||
|
||||
Dim oShouldRaiseSave = _Filters.Any(Function(oFilter)
|
||||
Return oFilter.ShouldRaiseSave(e)
|
||||
End Function)
|
||||
|
||||
If oShouldRaiseSave Then
|
||||
RaiseEvent FileSaved(e.OldFullPath, True)
|
||||
End If
|
||||
|
||||
_Logger.Debug("[Renamed] {0} --> {1}", e.OldFullPath, e.FullPath)
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
61
Filesystem/FileWatcher/FileWatcherFilters.vb
Normal file
61
Filesystem/FileWatcher/FileWatcherFilters.vb
Normal file
@@ -0,0 +1,61 @@
|
||||
Imports System.IO
|
||||
|
||||
''' <summary>
|
||||
''' Built-in filters for FileWatcher that are useful for correctly detecting changes on Office documents (currently Office 2016)
|
||||
''' </summary>
|
||||
Public Class FileWatcherFilters
|
||||
''' <summary>
|
||||
''' Base Filter that all filters must inherit from
|
||||
''' Provides two functions that may be overridden and some useful file extension lists
|
||||
''' </summary>
|
||||
Public MustInherit Class BaseFileFilter
|
||||
Public TempFiles As New List(Of String) From {".tmp", ""}
|
||||
|
||||
Public Overridable Function ShouldFilter(e As FileSystemEventArgs) As Boolean
|
||||
Return False
|
||||
End Function
|
||||
Public Overridable Function ShouldRaiseSave(e As RenamedEventArgs) As Boolean
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
|
||||
''' <summary>
|
||||
''' Simple Filter that filters changes made on temporary files
|
||||
''' </summary>
|
||||
Public Class TempFileFilter
|
||||
Inherits BaseFileFilter
|
||||
|
||||
Public Overrides Function ShouldFilter(e As FileSystemEventArgs) As Boolean
|
||||
Dim oFileInfo As New FileInfo(e.FullPath)
|
||||
Return TempFiles.Contains(oFileInfo.Extension)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
''' <summary>
|
||||
''' Filter to detect changes on Office files
|
||||
''' </summary>
|
||||
Public Class OfficeFileFilter
|
||||
Inherits BaseFileFilter
|
||||
|
||||
Public OfficeFiles As New List(Of String) From {".docx", ".pptx", ".xlsx"}
|
||||
|
||||
Public Overrides Function ShouldFilter(e As FileSystemEventArgs) As Boolean
|
||||
Dim oFileInfo As New FileInfo(e.FullPath)
|
||||
Return OfficeFiles.Contains(oFileInfo.Extension) And oFileInfo.Name.StartsWith("~")
|
||||
End Function
|
||||
|
||||
Public Overrides Function ShouldRaiseSave(e As RenamedEventArgs) As Boolean
|
||||
Dim oIsTransform = OfficeFiles.Any(Function(Extension As String)
|
||||
Return e.OldName.EndsWith(Extension)
|
||||
End Function)
|
||||
|
||||
' Check if it is renamed to a temp file
|
||||
Dim oIsTempFile = TempFiles.Any(Function(Extension)
|
||||
Return e.Name.EndsWith(Extension)
|
||||
End Function)
|
||||
|
||||
|
||||
Return oIsTransform And oIsTempFile
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
10
Filesystem/FileWatcher/FileWatcherProperties.vb
Normal file
10
Filesystem/FileWatcher/FileWatcherProperties.vb
Normal file
@@ -0,0 +1,10 @@
|
||||
Public Class FileWatcherProperties
|
||||
Public Property CreatedAt As DateTime
|
||||
Public Property ChangedAt As DateTime
|
||||
Public ReadOnly Property HasChanged As Boolean
|
||||
Public Sub New()
|
||||
CreatedAt = DateTime.Now
|
||||
ChangedAt = Nothing
|
||||
HasChanged = False
|
||||
End Sub
|
||||
End Class
|
||||
49
Filesystem/Filesystem.vbproj
Normal file
49
Filesystem/Filesystem.vbproj
Normal file
@@ -0,0 +1,49 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.Filesystem</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.Filesystem</AssemblyName>
|
||||
<MyType>Empty</MyType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AssemblyTitle>Modules.Filesystem</AssemblyTitle>
|
||||
<Description>Stellt Funktionen für das Filesystem und Container zur Verfügung</Description>
|
||||
<Company>Digital Data</Company>
|
||||
<Product>Modules.Filesystem</Product>
|
||||
<Copyright>Copyright © 2022</Copyright>
|
||||
<AssemblyVersion>1.3.3.0</AssemblyVersion>
|
||||
<FileVersion>1.3.3.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DocumentationFile>DigitalData.Modules.Filesystem.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DocumentationFile>DigitalData.Modules.Filesystem.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="NuGet.CommandLine" Version="6.13.2" />
|
||||
<PackageReference Include="protobuf-net" Version="2.4.0" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="CoreWCF.Primitives" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.ConfigurationManager" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.Http" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="My Project\Application.Designer.vb" />
|
||||
<Compile Remove="My Project\Resources.Designer.vb" />
|
||||
<Compile Remove="My Project\Settings.Designer.vb" />
|
||||
<EmbeddedResource Remove="My Project\Resources.resx" />
|
||||
<None Remove="My Project\Application.myapp" />
|
||||
<None Remove="My Project\Settings.settings" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Encryption\Encryption.vbproj" />
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
9
Filesystem/My Project/AssemblyInfo.vb
Normal file
9
Filesystem/My Project/AssemblyInfo.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyTrademark("1.3.1.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("2787495c-e65f-4730-be0c-af87bede4b11")>
|
||||
@@ -37,23 +37,22 @@ Public Class ActiveDirectoryInterface
|
||||
_logger.Info("Using RootPath {0}", _rootPath)
|
||||
End Sub
|
||||
|
||||
Public Function SyncUsersForGroup(GroupName As String, Firebird As Firebird, MSSQL As MSSQLServer) As List(Of ADUser)
|
||||
Public Function SyncUsersForGroup(GroupName As String, MSSQL As MSSQLServer) As List(Of ADUser)
|
||||
Try
|
||||
Return SyncUsersForGroup(GroupName, New List(Of AttributeMapping), Firebird, MSSQL)
|
||||
Return SyncUsersForGroup(GroupName, New List(Of AttributeMapping), MSSQL)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function SyncUsersForGroup(GroupName As String, AttributeMappings As List(Of AttributeMapping), Firebird As Firebird, MSSQL As MSSQLServer, Optional Filter As String = DEFAULT_USER_FILTER) As List(Of ADUser)
|
||||
Public Function SyncUsersForGroup(GroupName As String, AttributeMappings As List(Of AttributeMapping), MSSQL As MSSQLServer, Optional Filter As String = DEFAULT_USER_FILTER) As List(Of ADUser)
|
||||
Dim oUsers As New List(Of ADUser)
|
||||
Dim oSyncedUsers As New List(Of ADUser)
|
||||
Dim oGroupId As Int64 = Nothing
|
||||
|
||||
Dim oFirebirdSync As New SyncUsers.SyncUsersFirebird(_logConfig, Firebird)
|
||||
Dim oSQLSync As New SyncUsers.SyncUsersMSSQL(_logConfig, MSSQL)
|
||||
Dim oSyncedUsersFirebird, oSyncedUsersMSSQL As List(Of ADUser)
|
||||
Dim oSyncedUsersMSSQL As List(Of ADUser)
|
||||
|
||||
Try
|
||||
_logger.Debug("Fetching users from ActiveDirectory")
|
||||
@@ -64,16 +63,6 @@ Public Class ActiveDirectoryInterface
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
' Do the actual sync into firebird
|
||||
If Firebird IsNot Nothing Then
|
||||
oSyncedUsersFirebird = oFirebirdSync.SyncUsers(GroupName, oUsers, AttributeMappings)
|
||||
If oSyncedUsersFirebird.Count > 0 Then
|
||||
_logger.Debug("Synced {0} users to Firebird", oSyncedUsersFirebird.Count)
|
||||
End If
|
||||
Else
|
||||
_logger.Debug("SyncUsersForGroup: _firebird is nothing. ")
|
||||
End If
|
||||
|
||||
' Do the actual sync into MSSQL
|
||||
If MSSQL IsNot Nothing Then
|
||||
oSyncedUsersMSSQL = oSQLSync.SyncUsers(GroupName, oUsers, AttributeMappings)
|
||||
@@ -81,7 +70,7 @@ Public Class ActiveDirectoryInterface
|
||||
_logger.Debug("Synced {0} users to MSSQLServer", oSyncedUsersMSSQL.Count)
|
||||
End If
|
||||
Else
|
||||
_logger.Debug("SyncUsersForGroup: _mssql is nothing. ")
|
||||
_logger.Debug("SyncUsersForGroup: _mssql is nothing.")
|
||||
End If
|
||||
|
||||
Return oUsers
|
||||
@@ -231,10 +220,23 @@ Public Class ActiveDirectoryInterface
|
||||
Return oUsers
|
||||
End Try
|
||||
End Function
|
||||
Private Function GetPartFromFirstOU(dnString As String) As String
|
||||
Dim keyword As String = "OU="
|
||||
Dim index As Integer = dnString.IndexOf(keyword)
|
||||
|
||||
Public Function FindUserWithFilter(User As UserPrincipalEx, Filter As String) As Boolean
|
||||
If index <> -1 Then
|
||||
Return dnString.Substring(index)
|
||||
Else
|
||||
Return "No_Result_from_GetPartFromFirstOU"
|
||||
End If
|
||||
End Function
|
||||
Public Function FindUserWithFilter(pUser As UserPrincipalEx, pFilter As String) As Boolean
|
||||
Try
|
||||
Dim oRootPath = String.Join(","c, User.DistinguishedName.Split(","c).Skip(1))
|
||||
'Dim oRootPath = String.Join(","c, pUser.DistinguishedName.Split(","c).Skip(1))
|
||||
Dim oRootPath = GetPartFromFirstOU(pUser.DistinguishedName)
|
||||
_logger.Debug("FindUserWithFilter: pUser.DistinguishedName: [{0}]", pUser.DistinguishedName)
|
||||
_logger.Debug("FindUserWithFilter: oRootPath from User.DistinguishedName: [{0}]", oRootPath)
|
||||
|
||||
Dim oPlaceholder = "@SAMACCOUNTNAME"
|
||||
Dim oProtocol = "LDAP://"
|
||||
Dim oEntry As New DirectoryEntry(oProtocol & oRootPath) With {
|
||||
@@ -242,22 +244,25 @@ Public Class ActiveDirectoryInterface
|
||||
.Password = Nothing,
|
||||
.AuthenticationType = AuthenticationTypes.Secure
|
||||
}
|
||||
|
||||
If Filter = String.Empty Then
|
||||
_logger.Debug("FindUserWithFilter: Filter was empty, returning True for User [{0}]", User.SamAccountName)
|
||||
_logger.Debug("FindUserWithFilter: got oDirectoryEntry (Path): [{0}]", oProtocol & oRootPath)
|
||||
If pFilter = String.Empty Then
|
||||
_logger.Debug("FindUserWithFilter: Filter was empty, returning True for User [{0}]", pUser.SamAccountName)
|
||||
Return True
|
||||
End If
|
||||
|
||||
If Filter.Contains(oPlaceholder) Then
|
||||
Filter = Filter.Replace(oPlaceholder, User.SamAccountName)
|
||||
If pFilter.Contains(oPlaceholder) Then
|
||||
pFilter = pFilter.Replace(oPlaceholder, pUser.SamAccountName)
|
||||
_logger.Debug("FindUserWithFilter: Filter.Contains(oPlaceholder) [{0}]", pFilter)
|
||||
Else
|
||||
_logger.Warn("FindUserWithFilter: Placeholder [{0}] was not found in filter. Results may not be correct.")
|
||||
End If
|
||||
|
||||
Dim oSearcher As New DirectorySearcher(oEntry, Filter)
|
||||
Dim oSearcher As New DirectorySearcher(oEntry, pFilter)
|
||||
_logger.Debug("FindUserWithFilter: oSearcher created! Now executing DirectoryServices.SearchResult with .FindOne ...")
|
||||
Dim oResult As SearchResult = oSearcher.FindOne()
|
||||
|
||||
If oResult IsNot Nothing AndAlso oResult.Path.Replace(oProtocol, String.Empty) = User.DistinguishedName Then
|
||||
If oResult IsNot Nothing AndAlso oResult.Path.Replace(oProtocol, String.Empty) = pUser.DistinguishedName Then
|
||||
_logger.Debug("FindUserWithFilter: We have an oResult - oResult.Path: [{0}]", oResult.Path)
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Namespace SyncUsers
|
||||
Public Class SyncUsersFirebird
|
||||
Implements ISyncUsers
|
||||
|
||||
Private ReadOnly _logConfig As LogConfig
|
||||
Private ReadOnly _logger As Logger
|
||||
Private ReadOnly _firebird As Database.Firebird
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Database.Firebird)
|
||||
_logConfig = LogConfig
|
||||
_logger = LogConfig.GetLogger()
|
||||
_firebird = Firebird
|
||||
End Sub
|
||||
|
||||
Public Function SyncUsers(GroupName As String, Users As List(Of ADUser), PropertyMapping As List(Of AttributeMapping)) As List(Of ADUser) Implements ISyncUsers.SyncUsers
|
||||
Dim oGroupId As Integer
|
||||
Dim oSyncedUsers As New List(Of ADUser)
|
||||
|
||||
Try
|
||||
_logger.Debug("Getting group Id for group [{0}]", GroupName)
|
||||
oGroupId = GetGroupId(GroupName)
|
||||
|
||||
If oGroupId = 0 Then
|
||||
_logger.Debug("Group [{0}] does not exist in database or is not enabled for sync.", GroupName)
|
||||
Return oSyncedUsers
|
||||
End If
|
||||
|
||||
_logger.Debug("Using group Id [{0}]", oGroupId)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Return oSyncedUsers
|
||||
End Try
|
||||
|
||||
For Each oUser In Users
|
||||
Dim oUserId As Int64
|
||||
Dim oUserExists As Boolean = False
|
||||
|
||||
' Check if user already exists
|
||||
Try
|
||||
_logger.Debug("Checking if user [{0}] exists", oUser)
|
||||
oUserId = GetUserId(oUser.samAccountName)
|
||||
oUserExists = Not IsNothing(oUserId)
|
||||
_logger.Debug("User [{0}] exists in database: ", oUser, oUserExists)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
_logger.Warn("Could not get UserId for user. Skipping")
|
||||
Continue For
|
||||
End Try
|
||||
|
||||
' I user does not exist, create a new user
|
||||
Try
|
||||
If Not oUserExists Then
|
||||
_logger.Debug("Creating new user for [{0}]", oUser)
|
||||
oUserId = CreateUser(oUser)
|
||||
_logger.Debug("User created with Id [{0}]", oUserId)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
_logger.Warn("Could not create user. Skipping")
|
||||
Continue For
|
||||
End Try
|
||||
|
||||
' Add the user to group
|
||||
Try
|
||||
AddUserToGroup(oUserId, oGroupId)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
_logger.Warn("Could not add user to group. Skipping")
|
||||
Continue For
|
||||
End Try
|
||||
|
||||
oSyncedUsers.Add(oUser)
|
||||
Next
|
||||
|
||||
Return oSyncedUsers
|
||||
End Function
|
||||
|
||||
Private Function AddUserToGroup(UserId As Integer, GroupId As Integer) As Boolean Implements ISyncUsers.AddUserToGroup
|
||||
Try
|
||||
Dim oSQL = $"SELECT FNICM_RADM_NEW_USER2GROUP({UserId}, {GroupId}, 'AD-Sync') from RDB$DATABASE"
|
||||
Dim oRecordId = _firebird.GetScalarValue(oSQL)
|
||||
|
||||
If IsDBNull(oRecordId) Then
|
||||
_logger.Warn("UserId {0} - GroupId {1} relation already exists.", UserId, GroupId)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
Private Function GetGroupId(GroupName As String) As Integer Implements ISyncUsers.GetGroupId
|
||||
Try
|
||||
Dim oSQL As String = $"SELECT FNICM_GET_RECORD4SYSKEY('{GroupName}','002-NAME') from RDB$DATABASE"
|
||||
Dim oGroupId = _firebird.GetScalarValue(oSQL)
|
||||
|
||||
If IsDBNull(oGroupId) OrElse oGroupId = 0 Then
|
||||
_logger.Debug("Group {0} not found in database", GroupName)
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Return oGroupId
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
Private Function GetUserId(UserName As String) As Integer Implements ISyncUsers.GetUserId
|
||||
Try
|
||||
Dim oSQL As String = $"SELECT FNICM_GET_RECORD4SYSKEY('{UserName}','001-USRNAME') from RDB$DATABASE"
|
||||
Dim oResult = _firebird.GetScalarValue(oSQL)
|
||||
|
||||
If IsDBNull(oResult) Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Return oResult
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
Private Function CreateUser(User As ADUser) As Integer Implements ISyncUsers.CreateUser
|
||||
Try
|
||||
Dim oSQL = $"SELECT FNICM_RADM_NEW_USER('{User?.GivenName}', '{User?.Surname}', '{User?.samAccountName}', 'AD-Sync') from RDB$DATABASE"
|
||||
Dim oUserId As Integer = _firebird.GetScalarValue(oSQL)
|
||||
|
||||
Return oUserId
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Sub AddCustomAttributesToUser(User As ADUser, UserId As Integer) Implements ISyncUsers.AddCustomAttributesToUser
|
||||
Throw New NotImplementedException()
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -198,10 +198,10 @@ Namespace SyncUsers
|
||||
_logger.Debug("UserId of User [{0}] is [{1}]", User, oUserId)
|
||||
|
||||
If oUserId = 0 Then
|
||||
Dim oPrename = User.GivenName.EscapeForSQL()
|
||||
Dim oSurname = User.Surname.EscapeForSQL()
|
||||
Dim oUsername = User.samAccountName.EscapeForSQL()
|
||||
Dim oEmail = User.Email.EscapeForSQL()
|
||||
Dim oPrename = User.GivenName
|
||||
Dim oSurname = User.Surname
|
||||
Dim oUsername = User.samAccountName
|
||||
Dim oEmail = User.Email
|
||||
|
||||
Dim oSQL As String = $"INSERT INTO TBDD_USER (PRENAME, NAME, USERNAME, EMAIL, ADDED_WHO) VALUES ('{oPrename}', '{oSurname}', UPPER('{oUsername}'), '{oEmail}', '{ADDED_WHO}')"
|
||||
Dim oResult = _mssql.ExecuteNonQuery(oSQL)
|
||||
@@ -237,9 +237,9 @@ Namespace SyncUsers
|
||||
Dim oUserId As Integer = GetUserId(User.samAccountName)
|
||||
If Not IsNothing(oUserId) Then
|
||||
If oUserId > 0 Then
|
||||
Dim oPrename = User.GivenName.EscapeForSQL()
|
||||
Dim oSurname = User.Surname.EscapeForSQL()
|
||||
Dim oEmail = User.Email.EscapeForSQL()
|
||||
Dim oPrename = User.GivenName
|
||||
Dim oSurname = User.Surname
|
||||
Dim oEmail = User.Email
|
||||
|
||||
Dim oSQL As String = $"UPDATE TBDD_USER SET PRENAME = '{oPrename}', NAME = '{oSurname}', EMAIL = '{oEmail}', CHANGED_WHO = '{ADDED_WHO}' WHERE GUID = {oUserId}"
|
||||
Dim oResult = _mssql.ExecuteNonQuery(oSQL)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.DirectoryServices.AccountManagement
|
||||
Imports System.DirectoryServices.AccountManagement.UserPrincipal
|
||||
|
||||
<DirectoryRdnPrefix("CN")>
|
||||
<DirectoryObjectClass("Person")>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,173 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AB6F09BF-E794-4F6A-94BB-C97C0BA84D64}</ProjectGuid>
|
||||
<TargetFramework>net8.0-windows7.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.Modules.Interfaces</RootNamespace>
|
||||
<AssemblyName>DigitalData.Modules.Interfaces</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
<AssemblyTitle>Modules.Interfaces</AssemblyTitle>
|
||||
<Company>Digital Data</Company>
|
||||
<Product>Modules.Interfaces</Product>
|
||||
<Copyright>Copyright © 2025</Copyright>
|
||||
<AssemblyVersion>2.4.0.0</AssemblyVersion>
|
||||
<FileVersion>2.4.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Interfaces.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>DigitalData.Modules.Interfaces.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<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="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.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>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.DirectoryServices.AccountManagement" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<PackageReference Include="BouncyCastle.Cryptography" Version="2.5.0" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.2.0" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml.Framework" Version="3.2.0" />
|
||||
<PackageReference Include="GdPicture" Version="14.3.22" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
|
||||
<PackageReference Include="NLog" Version="5.0.5" />
|
||||
<PackageReference Include="OpenMcdf" Version="2.4.1" />
|
||||
<PackageReference Include="protobuf-net" Version="3.2.46" />
|
||||
<PackageReference Include="protobuf-net.Core" Version="3.2.46" />
|
||||
<PackageReference Include="RtfPipe" Version="2.0.7677.4303" />
|
||||
<PackageReference Include="System.CodeDom" Version="8.0.0" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
|
||||
<PackageReference Include="System.IO.Packaging" Version="8.0.1" />
|
||||
<PackageReference Include="System.Management" Version="8.0.0" />
|
||||
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />
|
||||
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
|
||||
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
|
||||
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.6" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.1" />
|
||||
<PackageReference Include="CoreWCF.Primitives" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.ConfigurationManager" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.Http" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.WebHttp" Version="1.8.0" />
|
||||
<PackageReference Include="CoreWCF.NetTcp" Version="1.8.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ActiveDirectoryInterface.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\ActiveDirectoryGroup.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\ActiveDirectoryUser.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\AttributeMap.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\ISyncUsers.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\SyncUsers.Firebird.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\SyncUsers.MSSQL.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\UserEqualityComparer.vb" />
|
||||
<Compile Include="ActiveDirectoryInterface\UserPrincipalEx.vb" />
|
||||
<Compile Include="GraphQLInterface.vb" />
|
||||
<Compile Include="GrapQLInterface\LoginData.vb" />
|
||||
<Compile Include="GrapQLInterface\LogoutData.vb" />
|
||||
<Compile Include="GrapQLInterface\QueryData.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\Exceptions.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<Compile Update="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<Compile Update="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<Compile Update="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ZUGFeRDInterface\PDFConverter.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\Validator.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\Version1.0\CrossIndustryDocumentType.vb" />
|
||||
<Compile Include="ZUGFeRDInterface.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\FileGroups.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\PDFEmbeds.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\PropertyValues.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\Version2.0\CrossIndustryInvoiceType.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\Version2.1.1\CrossIndustryInvoiceType.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\Version2.2_FacturX\CrossIndustryInvoiceType.vb" />
|
||||
<Compile Include="ZUGFeRDInterface\XmlItemProperty.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="My Project\Application.myapp">
|
||||
<None Update="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="GdPicture.NET.14.filters.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</AdditionalFiles>
|
||||
<AdditionalFiles Include="GdPicture.NET.14.image.gdimgplug.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</AdditionalFiles>
|
||||
<AdditionalFiles Include="GdPicture.NET.14.Imaging.Rendering.Skia.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</AdditionalFiles>
|
||||
<ProjectReference Include="..\Base\Base.vbproj" />
|
||||
<ProjectReference Include="..\Database\Database.vbproj" />
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Base\Base.vbproj">
|
||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
||||
<Name>Base</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Database\Database.vbproj">
|
||||
<Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project>
|
||||
<Name>Database</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -1,35 +1,9 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
' die einer Assembly zugeordnet sind.
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("Modules.Interfaces")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("Modules.Interfaces")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024")>
|
||||
<Assembly: AssemblyTrademark("1.12.1.0")>
|
||||
<Assembly: AssemblyTrademark("2.3.7.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird.
|
||||
<Assembly: Guid("f0de0536-a336-40cb-bb8b-957942174eed")>
|
||||
|
||||
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
'
|
||||
' Hauptversion
|
||||
' Nebenversion
|
||||
' Buildnummer
|
||||
' Revision
|
||||
'
|
||||
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.12.1.0")>
|
||||
<Assembly: AssemblyFileVersion("1.12.1.0")>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.IO
|
||||
Imports System.Reflection.Emit
|
||||
Imports System.IO
|
||||
Imports System.Xml
|
||||
Imports System.Xml.Serialization
|
||||
Imports System.Xml.XPath
|
||||
Imports System.Xml.Xsl
|
||||
Imports DigitalData.Modules.Interfaces.Exceptions
|
||||
Imports DigitalData.Modules.Interfaces.PDFEmbeds
|
||||
Imports DigitalData.Modules.Interfaces.ZUGFeRD
|
||||
Imports DigitalData.Modules.Interfaces.ZUGFeRDInterface
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports GdPicture14
|
||||
|
||||
@@ -23,6 +19,21 @@ Public Class ZUGFeRDInterface
|
||||
Public Const ZUGFERD_SPEC_DEFAULT = "DEFAULT"
|
||||
Public Const ZUGFERD_SPEC_10 = "ZUGFERD_10"
|
||||
Public Const ZUGFERD_SPEC_2x = "ZUGFERD_2x"
|
||||
Public Const ZUGFERD_SPEC_2_3x = "ZUGFERD_2_3x"
|
||||
|
||||
Public Const UBL_SPEC_21 = "UBL_21"
|
||||
|
||||
Public Const XMLSCHEMA_ZUGFERD_10 = "Version1_0"
|
||||
Public Const XMLSCHEMA_ZUGFERD_20 = "Version2_0"
|
||||
Public Const XMLSCHEMA_ZUGFERD_211 = "Version2_1_1"
|
||||
Public Const XMLSCHEMA_ZUGFERD_22 = "Version2_2_FacturX"
|
||||
Public Const XMLSCHEMA_ZUGFERD_23 = "Version2_3_FacturX"
|
||||
Public Const XMLSCHEMA_ZUGFERD_233 = "Version2_3_3_FacturX"
|
||||
Public Const XMLSCHEMA_UBL_21_INVOICE = "UBL2_1_INVOICE"
|
||||
Public Const XMLSCHEMA_UBL_21_CREDITNOTE = "UBL2_1_CREDITNOTE"
|
||||
|
||||
Public Const RECEIPT_TYPE_XML = "XML"
|
||||
Public Const RECEIPT_TYPE_PDF = "PDF"
|
||||
|
||||
Private ReadOnly ValidFilenames As New List(Of String) From {
|
||||
PDFEmbeds.ZUGFERD_XML_FILENAME.ToUpper,
|
||||
@@ -40,6 +51,7 @@ Public Class ZUGFeRDInterface
|
||||
UnsupportedFormat
|
||||
FileTooBig
|
||||
UnknownError
|
||||
NotInUse
|
||||
End Enum
|
||||
|
||||
Public ReadOnly Property FileGroup As FileGroups
|
||||
@@ -50,6 +62,8 @@ Public Class ZUGFeRDInterface
|
||||
Public Property AllowXRechnung_Filename As Boolean = True
|
||||
Public Property AllowZugferd_1_0_Schema As Boolean = True
|
||||
Public Property AllowZugferd_2_x_Schema As Boolean = True
|
||||
Public Property AllowZugferd_2_3_x_Schema As Boolean = True
|
||||
Public Property AllowPeppol_3_x_Schema As Boolean = False
|
||||
End Class
|
||||
|
||||
Public Class ZugferdResult
|
||||
@@ -57,6 +71,11 @@ Public Class ZUGFeRDInterface
|
||||
Public Property XElementObject As XElement
|
||||
Public Property SchemaObject As Object
|
||||
Public Property Specification As String
|
||||
Public Property UsedXMLSchema As String
|
||||
''' <summary>
|
||||
''' Dateityp des Belegs: PDF oder XML
|
||||
''' </summary>
|
||||
Public Property ReceiptFileType As String
|
||||
Public Property ValidationErrors As New List(Of ZugferdValidationError)
|
||||
End Class
|
||||
|
||||
@@ -64,6 +83,7 @@ Public Class ZUGFeRDInterface
|
||||
Public ElementName As String
|
||||
Public ElementValue As String
|
||||
Public ErrorMessage As String
|
||||
Public ErrorMessageDE As String
|
||||
End Class
|
||||
|
||||
''' <summary>
|
||||
@@ -113,27 +133,86 @@ Public Class ZUGFeRDInterface
|
||||
AllowedFilenames = oAllowedFilenames
|
||||
End Sub
|
||||
|
||||
Public Function FilterPropertyMap(pPropertyMap As Dictionary(Of String, XmlItemProperty), pSpecification As String) As Dictionary(Of String, XmlItemProperty)
|
||||
_logger.Debug("Filtering Property map for Specification [{0}]", pSpecification)
|
||||
Public Function FilterPropertyMap(pPropertyMapList As List(Of XmlItemProperty), pSpecification As String) As Dictionary(Of String, XmlItemProperty)
|
||||
_logger.Debug("Filtering Property map list for Specification [{0}]", pSpecification)
|
||||
|
||||
If pSpecification = ZUGFERD_SPEC_10 Then
|
||||
_logger.Debug("Special Case [{0}], including [{1}]", ZUGFERD_SPEC_10, ZUGFERD_SPEC_DEFAULT)
|
||||
Return pPropertyMap.
|
||||
Where(Function(kv) kv.Value.Specification = pSpecification Or kv.Value.Specification = ZUGFERD_SPEC_DEFAULT).
|
||||
ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value)
|
||||
Try
|
||||
|
||||
_logger.Debug("Special Case [{0}], including [{1}]", ZUGFERD_SPEC_10, ZUGFERD_SPEC_DEFAULT)
|
||||
|
||||
Dim countElements As Integer = pPropertyMapList.Where(Function(x) x.Specification = pSpecification Or x.Specification = ZUGFERD_SPEC_DEFAULT).Count
|
||||
_logger.Debug("Property map list contains [{0}] elements for specification [{1}]", countElements, pSpecification)
|
||||
|
||||
Return pPropertyMapList.
|
||||
Where(Function(kv) kv.Specification = pSpecification Or kv.Specification = ZUGFERD_SPEC_DEFAULT).
|
||||
ToDictionary(Function(kv) kv.XMLPath, Function(kv) kv)
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
Else
|
||||
_logger.Debug("Using Specification [{0}]", pSpecification)
|
||||
Return pPropertyMap.
|
||||
Where(Function(kv) kv.Value.Specification = pSpecification).
|
||||
ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value)
|
||||
|
||||
Try
|
||||
|
||||
Dim countElements As Integer = pPropertyMapList.Where(Function(x) x.Specification = pSpecification).Count
|
||||
_logger.Debug("Property map list contains [{0}] elements for specification [{1}]", countElements, pSpecification)
|
||||
|
||||
Return pPropertyMapList.
|
||||
Where(Function(kv) kv.Specification = pSpecification).
|
||||
ToDictionary(Function(kv) kv.XMLPath, Function(kv) kv)
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Function GetSerializedXMLContentFromFile(oFileInfo As FileInfo) As ZugferdResult
|
||||
Dim oResult = New ZugferdResult()
|
||||
Dim oMessage As String = String.Empty
|
||||
|
||||
Try
|
||||
Dim oFileSize As Integer = oFileInfo.Length
|
||||
Dim oFileData As Byte() = File.ReadAllBytes(oFileInfo.FullName)
|
||||
|
||||
Dim oXmlFile As EmbeddedFile = New EmbeddedFile() With {
|
||||
.FileName = oFileInfo.Name,
|
||||
.FileContents = oFileData
|
||||
}
|
||||
|
||||
Using oStream As New MemoryStream(oXmlFile.FileContents)
|
||||
oResult = New ZugferdResult With {
|
||||
.DataFileName = oXmlFile.FileName,
|
||||
.XElementObject = XElement.Load(oStream)
|
||||
}
|
||||
End Using
|
||||
|
||||
Catch ex As ZUGFeRDExecption
|
||||
' Don't log ZUGFeRD Exceptions here, they should be handled by the calling code.
|
||||
' It also produces misleading error messages when checking if an attachment is a zugferd file.
|
||||
Throw ex
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.UnsupportedFerdException, "Datei ist eine ungültige XML Datei.")
|
||||
End Try
|
||||
|
||||
If oResult.ValidationErrors.Any() Then
|
||||
Throw New ValidationException() With {
|
||||
.ValidationErrors = oResult.ValidationErrors
|
||||
}
|
||||
End If
|
||||
|
||||
Return SerializeZUGFeRDDocument(oResult)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="Path"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
Public Function ExtractZUGFeRDFileWithGDPicture(Path As String) As ZugferdResult
|
||||
Dim oResult = ValidateZUGFeRDFileWithGDPicture(Path)
|
||||
oResult = ValidateZUGFeRDDocument(oResult)
|
||||
@@ -151,7 +230,6 @@ Public Class ZUGFeRDInterface
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="Stream"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
Public Function ExtractZUGFeRDFileWithGDPicture(Stream As Stream) As ZugferdResult
|
||||
Dim oResult = ValidateZUGFeRDFileWithGDPicture(Stream)
|
||||
oResult = ValidateZUGFeRDDocument(oResult)
|
||||
@@ -174,7 +252,6 @@ Public Class ZUGFeRDInterface
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="pStream"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
''' <returns>The embedded xml data as an XPath document</returns>
|
||||
Public Function ValidateZUGFeRDFileWithGDPicture(pStream As Stream) As ZugferdResult
|
||||
Dim oEmbedExtractor = New PDFEmbeds(_logConfig)
|
||||
@@ -193,7 +270,7 @@ Public Class ZUGFeRDInterface
|
||||
Throw ex
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Error while validating ZUGFeRD file with GDPicture")
|
||||
_logger.Warn("Error while validating eInvoice file with GDPicture")
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
@@ -203,18 +280,23 @@ Public Class ZUGFeRDInterface
|
||||
''' Validates a ZUGFeRD File and extracts the XML Document from it
|
||||
''' </summary>
|
||||
''' <param name="pPath"></param>
|
||||
''' <exception cref="ZUGFeRDExecption"></exception>
|
||||
''' <returns>The embedded xml data as an XPath document</returns>
|
||||
Public Function ValidateZUGFeRDFileWithGDPicture(pPath As String) As ZugferdResult
|
||||
Public Function ValidateZUGFeRDFileWithGDPicture(pPath As String, Optional Validate As Boolean = False) As ZugferdResult
|
||||
Dim oEmbedExtractor = New PDFEmbeds(_logConfig)
|
||||
|
||||
Try
|
||||
' Extract XML attachments only!
|
||||
Dim oFiles = oEmbedExtractor.Extract(pPath, New List(Of String) From {"xml"})
|
||||
If Validate Then
|
||||
Dim oZugferdResult = HandleEmbeddedFiles(oFiles)
|
||||
Return _Validator.ValidateZUGFeRDDocument(oZugferdResult)
|
||||
Else
|
||||
' Attachments are in this case the files that are embedded into a pdf file,
|
||||
' like for example the zugferd-invoice.xml file
|
||||
Return HandleEmbeddedFiles(oFiles)
|
||||
End If
|
||||
|
||||
|
||||
' Attachments are in this case the files that are embedded into a pdf file,
|
||||
' like for example the zugferd-invoice.xml file
|
||||
Return HandleEmbeddedFiles(oFiles)
|
||||
|
||||
Catch ex As ZUGFeRDExecption
|
||||
' Don't log ZUGFeRD Exceptions here, they should be handled by the calling code.
|
||||
@@ -222,19 +304,15 @@ Public Class ZUGFeRDInterface
|
||||
Throw ex
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Error while validating ZUGFeRD file with GDPicture")
|
||||
_logger.Warn("Error while validating eInvoice file with GDPicture")
|
||||
_logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function HandleEmbeddedFiles(pResults As List(Of PDFEmbeds.EmbeddedFile)) As ZugferdResult
|
||||
If pResults Is Nothing Then
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei, weil die Attachments nicht gelesen werden konnten.")
|
||||
End If
|
||||
|
||||
If pResults.Count = 0 Then
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei, weil sie keine Attachments enthält.")
|
||||
If pResults Is Nothing OrElse pResults.Count = 0 Then
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.InvalidFerdNoXMLAttachmentFound, "Die Datei ist keine gültige ZUGFeRD-Datei, es wurde kein passender XML-Anhang gefunden.")
|
||||
End If
|
||||
|
||||
' Find the first file which filename matches the valid filenames for embedded invoice files
|
||||
@@ -243,7 +321,7 @@ Public Class ZUGFeRDInterface
|
||||
FirstOrDefault()
|
||||
|
||||
If oValidResult Is Nothing Then
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoZugferd, "Datei ist keine ZUGFeRD Datei, weil keine entsprechende XML-Datei gefunden wurde.")
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.InvalidFerdNoXMLAttachmentFound, "Die Datei ist keine ZUGFeRD Datei, weil keine passende XML-Datei gefunden wurde.")
|
||||
End If
|
||||
|
||||
' Search the embedded files for the ones which are allowed as per the configuration.
|
||||
@@ -253,7 +331,7 @@ Public Class ZUGFeRDInterface
|
||||
FirstOrDefault()
|
||||
|
||||
If oAllowedResult Is Nothing Then
|
||||
Throw New ZUGFeRDExecption(ErrorType.UnsupportedFormat, "Datei ist eine ZUGFeRD Datei, aber das Format wird nicht unterstützt.", oAllowedResult.FileName)
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.InvalidFerdNoXMLAttachmentFound, "Datei enthält einen XML-Anhang mit einem ungültigen Dateinamen.", oAllowedResult.FileName)
|
||||
End If
|
||||
|
||||
Try
|
||||
@@ -271,13 +349,14 @@ Public Class ZUGFeRDInterface
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoValidZugferd, "Datei ist eine ungültige ZUGFeRD Datei.")
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.InvalidFerdException, "XML-Datei konnte nicht gelesen werden.")
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Class AllowedType
|
||||
Public SchemaType As Type
|
||||
Public Specification As String
|
||||
Public XMLSchema As String
|
||||
End Class
|
||||
|
||||
Public Function ValidateZUGFeRDDocument(pResult As ZugferdResult) As ZugferdResult
|
||||
@@ -290,29 +369,66 @@ Public Class ZUGFeRDInterface
|
||||
|
||||
Dim oObject As Object = Nothing
|
||||
Dim oSpecification As String = Nothing
|
||||
Dim oUsedXMLSchema As String = Nothing
|
||||
|
||||
Dim oAllowedTypes As New List(Of AllowedType)
|
||||
|
||||
If _Options.AllowZugferd_1_0_Schema Then
|
||||
oAllowedTypes.Add(New AllowedType With {
|
||||
.SchemaType = GetType(Version1_0.CrossIndustryDocumentType),
|
||||
.Specification = ZUGFERD_SPEC_10
|
||||
.Specification = ZUGFERD_SPEC_10,
|
||||
.XMLSchema = XMLSCHEMA_ZUGFERD_10
|
||||
})
|
||||
End If
|
||||
|
||||
'' Reihenfolge 2.0 muss unverändert bleiben. Älteste Version immer zuerst!
|
||||
If _Options.AllowZugferd_2_x_Schema Then
|
||||
oAllowedTypes.AddRange(New List(Of AllowedType) From {
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(Version2_0.CrossIndustryInvoiceType),
|
||||
.Specification = ZUGFERD_SPEC_2x
|
||||
.Specification = ZUGFERD_SPEC_2x,
|
||||
.XMLSchema = XMLSCHEMA_ZUGFERD_20
|
||||
},
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(Version2_1_1.CrossIndustryInvoiceType),
|
||||
.Specification = ZUGFERD_SPEC_2x
|
||||
.Specification = ZUGFERD_SPEC_2x,
|
||||
.XMLSchema = XMLSCHEMA_ZUGFERD_211
|
||||
},
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(Version2_2_FacturX.CrossIndustryInvoiceType),
|
||||
.Specification = ZUGFERD_SPEC_2x
|
||||
.Specification = ZUGFERD_SPEC_2x,
|
||||
.XMLSchema = XMLSCHEMA_ZUGFERD_22
|
||||
}
|
||||
})
|
||||
End If
|
||||
|
||||
'' Reihenfolge ab 2.3 geändert. Neuste Version immer zuerst
|
||||
If _Options.AllowZugferd_2_3_x_Schema Then
|
||||
oAllowedTypes.AddRange(New List(Of AllowedType) From {
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(Version2_3_3_FacturX.CrossIndustryInvoiceType),
|
||||
.Specification = ZUGFERD_SPEC_2_3x,
|
||||
.XMLSchema = XMLSCHEMA_ZUGFERD_233
|
||||
},
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(Version2_3_FacturX.CrossIndustryInvoiceType),
|
||||
.Specification = ZUGFERD_SPEC_2_3x,
|
||||
.XMLSchema = XMLSCHEMA_ZUGFERD_23
|
||||
}
|
||||
})
|
||||
End If
|
||||
|
||||
If _Options.AllowPeppol_3_x_Schema Then
|
||||
oAllowedTypes.AddRange(New List(Of AllowedType) From {
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(UBL_21_Invoice.InvoiceType),
|
||||
.Specification = UBL_SPEC_21,
|
||||
.XMLSchema = XMLSCHEMA_UBL_21_INVOICE
|
||||
},
|
||||
New AllowedType With {
|
||||
.SchemaType = GetType(UBL_21_CreditNote.CreditNoteType),
|
||||
.Specification = UBL_SPEC_21,
|
||||
.XMLSchema = XMLSCHEMA_UBL_21_CREDITNOTE
|
||||
}
|
||||
})
|
||||
End If
|
||||
@@ -326,6 +442,7 @@ Public Class ZUGFeRDInterface
|
||||
oReader = pResult.XElementObject.CreateReader()
|
||||
oObject = oSerializer.Deserialize(oReader)
|
||||
oSpecification = oType.Specification
|
||||
oUsedXMLSchema = oType.XMLSchema
|
||||
|
||||
_logger.Debug("Serializing with type [{0}] succeeded", oTypeName)
|
||||
Exit For
|
||||
@@ -339,11 +456,11 @@ Public Class ZUGFeRDInterface
|
||||
Next
|
||||
|
||||
If oObject Is Nothing Then
|
||||
'Throw New ApplicationException("No Types matched the given document. Document could not be serialized.")
|
||||
Throw New ZUGFeRDExecption(ErrorType.UnsupportedFormat, "Unsupported Format")
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.UnsupportedFerdException, "Unsupported Format")
|
||||
End If
|
||||
|
||||
pResult.Specification = oSpecification
|
||||
pResult.UsedXMLSchema = oUsedXMLSchema
|
||||
pResult.SchemaObject = oObject
|
||||
|
||||
Return pResult
|
||||
@@ -354,8 +471,8 @@ Public Class ZUGFeRDInterface
|
||||
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
Dim oMessage = "Datei ist eine ungültige ZUGFeRD Datei oder das Format wird nicht unterstüzt, oder das Format ist deaktiviert."
|
||||
Throw New ZUGFeRDExecption(ErrorType.NoValidZugferd, oMessage)
|
||||
Dim oMessage = "Datei ist eine ungültige Datei oder das Format wird nicht unterstüzt, oder das Format ist deaktiviert."
|
||||
Throw New ZUGFeRDExecption(ErrorCodes.UnsupportedFerdException, oMessage)
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
14
Interfaces/ZUGFeRDInterface/Enums/ErrorCodes.vb
Normal file
14
Interfaces/ZUGFeRDInterface/Enums/ErrorCodes.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Public Enum ErrorCodes
|
||||
NotInUse = 0
|
||||
ValidationException = 20001
|
||||
MD5HashException = 20002
|
||||
UnsupportedFerdException = 20003
|
||||
InvalidFerdException = 20004
|
||||
TooMuchFerdsException = 20005
|
||||
InvalidFerdNoXMLAttachmentFound = 20006
|
||||
MissingValueException = 20007
|
||||
FileSizeLimitReachedException = 20008
|
||||
OutOfMemoryException = 20009
|
||||
UnhandledException = 20010
|
||||
FileMoveException = 200011
|
||||
End Enum
|
||||
8
Interfaces/ZUGFeRDInterface/Enums/Item_Types.vb
Normal file
8
Interfaces/ZUGFeRDInterface/Enums/Item_Types.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
Public Enum Item_Types
|
||||
StringType '0
|
||||
DateType '1
|
||||
MoneyType '2
|
||||
FileType '3
|
||||
ListType '4 - vgl. Währung
|
||||
|
||||
End Enum
|
||||
@@ -4,7 +4,11 @@ Public Class Exceptions
|
||||
Public Class ZUGFeRDExecption
|
||||
Inherits ApplicationException
|
||||
|
||||
Public ReadOnly Property ErrorType() As ZUGFeRDInterface.ErrorType
|
||||
Public ReadOnly Property ErrorCode() As ErrorCodes
|
||||
|
||||
Public ReadOnly Property Param1 As String = String.Empty
|
||||
|
||||
Public ReadOnly Property Param2 As String = String.Empty
|
||||
|
||||
''' <summary>
|
||||
''' Contains the name of the extracted xml file if already extracted.
|
||||
@@ -12,18 +16,37 @@ Public Class Exceptions
|
||||
''' <returns>A filename like zugferd-invoice.xml</returns>
|
||||
Public ReadOnly Property XmlFile As String = String.Empty
|
||||
|
||||
Public Sub New(ErrorType As ZUGFeRDInterface.ErrorType, Message As String)
|
||||
Public Sub New(pErrorCode As ErrorCodes, Message As String)
|
||||
MyBase.New(Message)
|
||||
|
||||
_ErrorType = ErrorType
|
||||
_ErrorCode = pErrorCode
|
||||
End Sub
|
||||
|
||||
Public Sub New(ErrorType As ZUGFeRDInterface.ErrorType, Message As String, pXmlFileName As String)
|
||||
Public Sub New(pErrorCode As ErrorCodes, Message As String, pXmlFileName As String)
|
||||
MyBase.New(Message)
|
||||
|
||||
_ErrorType = ErrorType
|
||||
_ErrorCode = pErrorCode
|
||||
_XmlFile = pXmlFileName
|
||||
End Sub
|
||||
|
||||
Public Sub New(pErrorCode As ErrorCodes, Param1 As String, Param2 As String, Message As String)
|
||||
MyBase.New(Message)
|
||||
|
||||
_ErrorCode = pErrorCode
|
||||
_Param1 = Param1
|
||||
_Param2 = Param2
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub New(pErrorCode As ErrorCodes, Param1 As String, Param2 As String, Message As String, pXmlFileName As String)
|
||||
MyBase.New(Message)
|
||||
|
||||
_ErrorCode = pErrorCode
|
||||
_Param1 = Param1
|
||||
_Param2 = Param2
|
||||
_XmlFile = pXmlFileName
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class ValidationException
|
||||
@@ -31,8 +54,13 @@ Public Class Exceptions
|
||||
|
||||
Public ValidationErrors As List(Of ZugferdValidationError)
|
||||
|
||||
Public ReadOnly Property ErrorCode() As ErrorCodes
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New("ZUGFeRD document found but validation failed!")
|
||||
|
||||
_ErrorCode = ErrorCodes.ValidationException
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.Remoting.Messaging
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports GdPicture14
|
||||
|
||||
@@ -72,7 +69,8 @@ Public Class PDFEmbeds
|
||||
Public Function Extract(Stream As Stream, AllowedExtensions As List(Of String)) As List(Of EmbeddedFile)
|
||||
Dim oResults As New List(Of EmbeddedFile)
|
||||
Dim oExtensions = AllowedExtensions.Select(Function(ext) ext.ToUpper).ToList()
|
||||
|
||||
Dim oLicenseManager As New LicenseManager
|
||||
oLicenseManager.RegisterKEY("LICENSE_KEY")
|
||||
Logger.Debug("Extracting embedded files from stream")
|
||||
|
||||
Try
|
||||
@@ -149,6 +147,7 @@ Public Class PDFEmbeds
|
||||
GDPicturePDF.DeleteEmbeddedFile(0)
|
||||
End While
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function DoExtract(GDPicturePDF As GdPicturePDF, pExtensions As List(Of String)) As List(Of EmbeddedFile)
|
||||
@@ -184,7 +183,7 @@ Public Class PDFEmbeds
|
||||
|
||||
Dim oFileData As Byte() = New Byte(oFileSize) {}
|
||||
Dim oStatus As GdPictureStatus = GDPicturePDF.ExtractEmbeddedFile(oIndex, oFileData)
|
||||
|
||||
'MsgBox($"FileSize of filename: {oFileName} is bytes: {oFileData.Length}/Filesize: {oFileSize}")
|
||||
If oStatus = GdPictureStatus.OK Then
|
||||
Logger.Debug("Embedded file [{0}] extracted sucessfully!", oFileName)
|
||||
|
||||
|
||||
42562
Interfaces/ZUGFeRDInterface/Peppol_UBL2.1/CreditNoteType.vb
Normal file
42562
Interfaces/ZUGFeRDInterface/Peppol_UBL2.1/CreditNoteType.vb
Normal file
File diff suppressed because it is too large
Load Diff
42601
Interfaces/ZUGFeRDInterface/Peppol_UBL2.1/InvoiceType.vb
Normal file
42601
Interfaces/ZUGFeRDInterface/Peppol_UBL2.1/InvoiceType.vb
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
Imports System.Reflection
|
||||
Imports System.Globalization
|
||||
Imports System.Reflection
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
@@ -15,7 +16,7 @@ Public Class PropertyValues
|
||||
End Sub
|
||||
|
||||
Public Class CheckPropertyValuesResult
|
||||
Public MissingProperties As New List(Of String)
|
||||
Public MissingProperties As New List(Of MissingProperty)
|
||||
Public ValidProperties As New List(Of ValidProperty)
|
||||
End Class
|
||||
|
||||
@@ -27,11 +28,25 @@ Public Class PropertyValues
|
||||
Public IsRequired As Boolean
|
||||
Public GroupCounter As Integer = -1
|
||||
|
||||
Public EN16931_ID As String
|
||||
Public Description As String
|
||||
Public Value As String
|
||||
Public XMLPath As String
|
||||
|
||||
Public ItemType As Integer = 0
|
||||
End Class
|
||||
|
||||
Public Function CheckPropertyValues(Document As Object, PropertyMap As Dictionary(Of String, XmlItemProperty), MessageId As String) As CheckPropertyValuesResult
|
||||
Public Class MissingProperty
|
||||
Public EN16931_ID As String
|
||||
Public Description As String
|
||||
Public XMLPath As String
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return XMLPath
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Public Function CheckPropertyValues(pDocument As Object, PropertyMap As Dictionary(Of String, XmlItemProperty), MessageId As String) As CheckPropertyValuesResult
|
||||
Dim oGlobalGroupCounter = 0
|
||||
Dim oMissingProperties As New List(Of String)
|
||||
Dim oResult As New CheckPropertyValuesResult()
|
||||
@@ -42,7 +57,7 @@ Public Class PropertyValues
|
||||
ToDictionary(Function(Item) Item.Key,
|
||||
Function(Item) Item.Value)
|
||||
|
||||
_logger.Debug("Found {0} default properties.", oDefaultProperties.Count)
|
||||
_logger.Debug("Found {0} ungrouped properties.", oDefaultProperties.Count)
|
||||
|
||||
' PropertyMap items with `IsGrouped = True` are grouped by group scope
|
||||
Dim oGroupedProperties = PropertyMap.
|
||||
@@ -56,7 +71,7 @@ Public Class PropertyValues
|
||||
Dim oGroupScope As String = oGroup.Key
|
||||
|
||||
Dim oPropertyList As New Dictionary(Of XmlItemProperty, List(Of Object))
|
||||
Dim oRowCount = 0
|
||||
Dim oRowCount = 0 ' TODO - Es wird anhand der Anzahl XML-Knoten ermittelt wieviele Rows gelesen werden???????
|
||||
|
||||
_logger.Debug($"Fetching Property values for group [{oGroupScope}].")
|
||||
|
||||
@@ -65,23 +80,23 @@ Public Class PropertyValues
|
||||
Dim oPropertyValues As List(Of Object)
|
||||
_logger.Debug($"Fetching value for itemSpecification [{oProperty.Value.TableColumn}].")
|
||||
Try
|
||||
oPropertyValues = GetPropValue(Document, oProperty.Key)
|
||||
oPropertyValues = GetPropValue(pDocument, oProperty.Key)
|
||||
Catch ex As Exception
|
||||
_logger.Warn($"{MessageId} - Unknown error occurred while fetching property/TColumn [{0}] in group [{1}]:", oProperty.Value.TableColumn, oGroupScope)
|
||||
_logger.Error(ex)
|
||||
oPropertyValues = New List(Of Object)
|
||||
End Try
|
||||
|
||||
' check the first batch of values to determine the row count
|
||||
If oRowCount = 0 Then '08.04.2025 MS Added as Workaround for Positions Or oGroupScope = "POSITIONS" !
|
||||
oRowCount = oPropertyValues.Count
|
||||
End If
|
||||
|
||||
' Flatten result value
|
||||
oPropertyValues = GetFinalPropValue(oPropertyValues)
|
||||
|
||||
' Add to list
|
||||
oPropertyList.Add(oProperty.Value, oPropertyValues)
|
||||
|
||||
' check the first batch of values to determine the row count
|
||||
If oRowCount = 0 Then
|
||||
oRowCount = oPropertyValues.Count
|
||||
End If
|
||||
Next
|
||||
|
||||
' Structure of oPropertyList
|
||||
@@ -98,25 +113,57 @@ Public Class PropertyValues
|
||||
Dim oTableColumn As String = oColumn.Key.TableColumn
|
||||
Dim oIsRequired As Boolean = oColumn.Key.IsRequired
|
||||
Dim oPropertyDescription As String = oColumn.Key.Description
|
||||
Dim oPropertyPath As String = oColumn.Key.XMLPath
|
||||
Dim oItemType As Integer = oColumn.Key.ItemType
|
||||
Dim oEN16931Value As String = oColumn.Key.EN16931_ID
|
||||
|
||||
Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1
|
||||
|
||||
' Returns nothing if oColumn.Value contains an empty list
|
||||
Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex)
|
||||
|
||||
_logger.Debug("Processing itemSpecification *TableColumn* [{0}].", oTableColumn)
|
||||
|
||||
_logger.Debug("Processing itemColumn *TableColumn* [{0}].", oTableColumn)
|
||||
If oTableColumn = "INVOICE_SELLER_EMAIL" Then
|
||||
Console.WriteLine("INVOICE_SELLER_EMAIL")
|
||||
ElseIf oTableColumn = "INVOICE_POSITION_ARTICLE" Then
|
||||
Console.WriteLine("INVOICE_POSITION_ARTICLE")
|
||||
End If
|
||||
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
|
||||
If oColumn.Key.IsRequired Then
|
||||
_logger.Warn($"{MessageId} # oPropertyValue for specification [{oTableColumn}] is empty or not found but is required. Continuing with Empty String.")
|
||||
oResult.MissingProperties.Add(oPropertyDescription)
|
||||
_logger.Warn($"{MessageId} - oPropertyValue for column [{oTableColumn}] is empty or not found but is required. Continuing with Empty String.")
|
||||
Dim oMissingProperty = New MissingProperty() With {
|
||||
.EN16931_ID = oEN16931Value,
|
||||
.Description = oPropertyDescription,
|
||||
.XMLPath = oPropertyPath
|
||||
}
|
||||
oResult.MissingProperties.Add(oMissingProperty)
|
||||
Else
|
||||
_logger.Debug($"{MessageId} # oPropertyValue for specification [{oTableColumn}] is empty or not found. Continuing with Empty String.")
|
||||
_logger.Debug($"{MessageId} - oPropertyValue for column [{oTableColumn}] is empty or not found. Continuing with Empty String.")
|
||||
End If
|
||||
|
||||
oPropertyValue = String.Empty
|
||||
End If
|
||||
|
||||
_logger.Debug("ItemSpecification [{0}] has value '{1}'", oTableColumn, oPropertyValue)
|
||||
If (oPropertyValue IsNot Nothing) Then
|
||||
Dim logValue As String = oPropertyValue.ToString()
|
||||
If logValue.Length > 50 Then
|
||||
_logger.Debug("Item [{0}] has value '{1}...'", oTableColumn, logValue.Substring(1, 50))
|
||||
Else
|
||||
_logger.Debug("Item [{0}] has value '{1}'", oTableColumn, oPropertyValue)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If oTableColumn = "INVOICE_CURRENCY" Or oItemType = 4 Then
|
||||
Dim oValuestring = oPropertyValue.ToString()
|
||||
|
||||
' Bei Listenelementen entfernen wir den String Item, um den Wert zu erhalten
|
||||
If oValuestring.Contains("Item") Then
|
||||
oValuestring = oValuestring.Replace("Item", "")
|
||||
End If
|
||||
|
||||
oPropertyValue = oValuestring
|
||||
End If
|
||||
|
||||
oResult.ValidProperties.Add(New ValidProperty() With {
|
||||
.MessageId = MessageId,
|
||||
@@ -125,7 +172,10 @@ Public Class PropertyValues
|
||||
.GroupCounter = oRowCounter,
|
||||
.TableName = oTableName,
|
||||
.TableColumn = oTableColumn,
|
||||
.IsRequired = oIsRequired
|
||||
.IsRequired = oIsRequired,
|
||||
.XMLPath = oPropertyPath,
|
||||
.ItemType = oItemType,
|
||||
.EN16931_ID = oEN16931Value
|
||||
})
|
||||
Next
|
||||
Next
|
||||
@@ -138,14 +188,19 @@ Public Class PropertyValues
|
||||
Dim oPropertyValueList As List(Of Object)
|
||||
Dim oTableColumn As String = oItem.Value.TableColumn
|
||||
Dim oPropertyDescription As String = oItem.Value.Description
|
||||
Dim oPropertyPath As String = oItem.Value.XMLPath
|
||||
Dim oPropertyValue As Object = Nothing
|
||||
Dim oTableName = oItem.Value.TableName
|
||||
Dim oIsRequired = oItem.Value.IsRequired
|
||||
Dim oDescription = oItem.Value.Description
|
||||
Dim oItemType = oItem.Value.ItemType
|
||||
Dim oEN16931_ID = oItem.Value.EN16931_ID
|
||||
|
||||
Try
|
||||
oPropertyValueList = GetPropValue(Document, oItem.Key)
|
||||
oPropertyValueList = GetPropValue(pDocument, oItem.Key)
|
||||
Catch ex As Exception
|
||||
_logger.Warn("{2} # Unknown error occurred while fetching specification [{0}] in group [{1}]:", oPropertyDescription, oItem.Value.GroupScope, MessageId)
|
||||
_logger.Warn("{2} - Unknown error occurred while fetching specification [{0}] in group [{1}]:", oTableColumn, oItem.Value.GroupScope, MessageId)
|
||||
_logger.Warn("ERROR-MESSAGE [{0}]", ex.Message)
|
||||
_logger.Error(ex)
|
||||
oPropertyValueList = New List(Of Object)
|
||||
End Try
|
||||
@@ -163,36 +218,56 @@ Public Class PropertyValues
|
||||
|
||||
' This should hopefully show config errors
|
||||
If TypeOf oPropertyValue Is List(Of Object) Then
|
||||
_logger.Warn("Item with specification [{0}] may be configured incorrectly", oPropertyDescription)
|
||||
_logger.Warn("Item with specification [{0}] may be configured incorrectly", oTableColumn)
|
||||
oPropertyValue = Nothing
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Unknown error occurred while processing specification [{0}]:", oPropertyDescription)
|
||||
_logger.Warn("Unknown error occurred while processing specification [{0}]:", oTableColumn)
|
||||
_logger.Error(ex)
|
||||
oPropertyValue = Nothing
|
||||
End Try
|
||||
|
||||
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
|
||||
If oItem.Value.IsRequired Then
|
||||
_logger.Warn("{0} # Specification [{1}] is empty, but marked as required! Skipping.", MessageId, oPropertyDescription)
|
||||
oResult.MissingProperties.Add(oPropertyDescription)
|
||||
_logger.Warn("Specification [{0}] is empty, but marked as required! Skipping.", oTableColumn)
|
||||
Dim oMissingProperty = New MissingProperty With
|
||||
{
|
||||
.Description = oPropertyDescription,
|
||||
.XMLPath = oPropertyPath
|
||||
}
|
||||
oResult.MissingProperties.Add(oMissingProperty)
|
||||
Continue For
|
||||
Else
|
||||
_logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oPropertyDescription)
|
||||
_logger.Debug("oPropertyValue for specification [{0}] is empty or not found. Skipping.", oTableColumn)
|
||||
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
|
||||
' Statt dem Zahlenwert des Enums, wollen wir die Währungsbezeichnung
|
||||
If oTableColumn = "INVOICE_CURRENCY" Or oItemType = 4 Then
|
||||
Dim oValuestring = oPropertyValue.ToString()
|
||||
|
||||
' Bei Listenelementen entfernen wir den String Item, um den Wert zu erhalten
|
||||
If oValuestring.Contains("Item") Then
|
||||
oValuestring = oValuestring.Replace("Item", "")
|
||||
End If
|
||||
|
||||
oPropertyValue = oValuestring
|
||||
End If
|
||||
|
||||
oResult.ValidProperties.Add(New ValidProperty() With {
|
||||
.MessageId = MessageId,
|
||||
.Description = oDescription,
|
||||
.Value = oPropertyValue,
|
||||
.TableName = oTableName,
|
||||
.TableColumn = oTableColumn,
|
||||
.IsRequired = oIsRequired
|
||||
.IsRequired = oIsRequired,
|
||||
.XMLPath = oPropertyPath,
|
||||
.ItemType = oItemType,
|
||||
.EN16931_ID = oEN16931_ID
|
||||
})
|
||||
Next
|
||||
|
||||
@@ -239,17 +314,11 @@ Public Class PropertyValues
|
||||
|
||||
Obj = oInfo.GetValue(Obj, Nothing)
|
||||
|
||||
' TODO: This code should check for array properties by itself
|
||||
' and should not rely on the user to
|
||||
'If oInfo.PropertyType.IsArray Then
|
||||
' Obj = Obj(0)
|
||||
'End If
|
||||
|
||||
If oHasIndex Then
|
||||
Obj = Obj(0)
|
||||
End If
|
||||
|
||||
If IsArray(Obj) And Not oHasIndex Then
|
||||
If IsArray(Obj) And Not oHasIndex And oPart <> "Value" Then
|
||||
Dim oCurrentPart As String = oPart
|
||||
Dim oSplitString As String() = New String() {oCurrentPart & "."}
|
||||
Dim oPathFragments = PropertyName.Split(oSplitString, StringSplitOptions.None)
|
||||
@@ -269,9 +338,56 @@ Public Class PropertyValues
|
||||
Next
|
||||
|
||||
Return oResults
|
||||
Else
|
||||
If oPart = "Value" AndAlso Obj IsNot Nothing Then
|
||||
' Der Name des gefundenen Datentyps
|
||||
Dim oObjType = oInfo.PropertyType.FullName
|
||||
|
||||
If oObjType.Equals("System.DateTime", StringComparison.OrdinalIgnoreCase) Then
|
||||
|
||||
Dim d As Date
|
||||
Dim s As String
|
||||
Dim oResult As String
|
||||
|
||||
s = Convert.ToString(Obj)
|
||||
|
||||
If IsDate(s) = True Then
|
||||
' Hier wird das DEFAULT-Format auf yyyyMMdd gesetzt
|
||||
Dim dtfi As DateTimeFormatInfo = CultureInfo.CreateSpecificCulture(CultureInfo.InvariantCulture.Name).DateTimeFormat
|
||||
dtfi.DateSeparator = ""
|
||||
dtfi.ShortDatePattern = "yyyyMMdd"
|
||||
|
||||
d = CDate(s)
|
||||
oResult = d.ToString("d", dtfi)
|
||||
|
||||
'Return New List(Of Object) From {oResult}
|
||||
Dim oRetValue As List(Of Object) = New List(Of Object) From {
|
||||
oResult
|
||||
}
|
||||
|
||||
Return oRetValue
|
||||
|
||||
End If
|
||||
ElseIf oObjType.Equals("System.Decimal", StringComparison.OrdinalIgnoreCase) Then
|
||||
|
||||
Dim oResult As String
|
||||
|
||||
If IsNumeric(Obj) = True Then
|
||||
Dim decValue As Decimal = CDec(Obj)
|
||||
' Es wird immer ein . als Dezimaltrenner verwendet, falls nötig
|
||||
oResult = decValue.ToString(CultureInfo.InvariantCulture)
|
||||
|
||||
'Return New List(Of Object) From {oResult}
|
||||
Dim oRetValue As List(Of Object) = New List(Of Object) From {
|
||||
oResult
|
||||
}
|
||||
|
||||
Return oRetValue
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
Return New List(Of Object) From {Obj}
|
||||
@@ -299,13 +415,31 @@ Public Class PropertyValues
|
||||
Select Case oCount
|
||||
Case 0
|
||||
Return Nothing
|
||||
Case 1
|
||||
Dim firstElement As Object
|
||||
firstElement = oList.FirstOrDefault()
|
||||
If firstElement IsNot Nothing AndAlso IsArray(firstElement) Then
|
||||
|
||||
' Attachments sind Byte-Arrays und müssen umgewandelt werden
|
||||
Return Convert.ToBase64String(firstElement)
|
||||
|
||||
Else
|
||||
Return DoGetFinalPropValue(oList.First())
|
||||
End If
|
||||
Case Else
|
||||
Return DoGetFinalPropValue(oList.First())
|
||||
|
||||
End Select
|
||||
|
||||
Return DoGetFinalPropValue(Value)
|
||||
Else
|
||||
Return Value.ToString
|
||||
' Nothing kann auch der Default-Wert der Variablen bedeuten. Also auch 0.00
|
||||
If IsNothing(Value) Then
|
||||
Return String.Empty
|
||||
Else
|
||||
Return Value.ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
8
Interfaces/ZUGFeRDInterface/RejectionStringRow.vb
Normal file
8
Interfaces/ZUGFeRDInterface/RejectionStringRow.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
Public Class RejectionStringRow
|
||||
Public ModuleName As String
|
||||
Public Title As String
|
||||
Public Caption As String
|
||||
Public Language As String
|
||||
Public String1 As String
|
||||
|
||||
End Class
|
||||
@@ -14,6 +14,7 @@ Public Class Validator
|
||||
ValidateDecimalNodes(pResult)
|
||||
ValidateCurrencyNodes(pResult)
|
||||
|
||||
'TODO Validate Datumsfelder
|
||||
Return pResult
|
||||
End Function
|
||||
|
||||
@@ -28,7 +29,8 @@ Public Class Validator
|
||||
pResult.ValidationErrors.Add(New ZugferdValidationError() With {
|
||||
.ElementName = oNode.Name.LocalName,
|
||||
.ElementValue = oNode.Value,
|
||||
.ErrorMessage = "Value could not be parsed as Decimal"
|
||||
.ErrorMessage = "Value could not be parsed as Decimal.",
|
||||
.ErrorMessageDE = "Der Wert ist keine Dezimalzahl."
|
||||
})
|
||||
End If
|
||||
Next
|
||||
@@ -50,7 +52,8 @@ Public Class Validator
|
||||
pResult.ValidationErrors.Add(New ZugferdValidationError() With {
|
||||
.ElementName = oNode.Name.LocalName,
|
||||
.ElementValue = oNode.Value,
|
||||
.ErrorMessage = "Invalid CurrencyCode. Only 3-Character codes are allowed."
|
||||
.ErrorMessage = "Invalid CurrencyCode. Only 3-Character codes are allowed.",
|
||||
.ErrorMessageDE = "Ungültiger Währungscode. Es sind nur 3-stellige Codes erlaubt."
|
||||
})
|
||||
End If
|
||||
Next
|
||||
@@ -76,7 +79,8 @@ Public Class Validator
|
||||
pResult.ValidationErrors.Add(New ZugferdValidationError() With {
|
||||
.ElementName = oNode.Name.LocalName,
|
||||
.ElementValue = oCurrencyID,
|
||||
.ErrorMessage = "Invalid currencyID. Only 3-Character codes or empty values are allowed."
|
||||
.ErrorMessage = "Invalid currencyID. Only 3-Character codes or empty values are allowed.",
|
||||
.ErrorMessageDE = "Ungültige WährungsID. Es sind nur 3-Zeichen lange Codes oder ein leerer Wert erlaubt."
|
||||
})
|
||||
End If
|
||||
Next
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -11,4 +11,25 @@
|
||||
''' Document version, eg. ZUGFeRD Schema version
|
||||
''' </summary>
|
||||
Public Specification As String
|
||||
|
||||
''' <summary>
|
||||
''' XML Pfad, für Anzeige in Ablehnungsmail
|
||||
''' </summary>
|
||||
Public XMLPath As String
|
||||
|
||||
''' <summary>
|
||||
''' (Daten-)Typ des Knoten
|
||||
''' 0 = Default / Text
|
||||
''' 1 = Datum
|
||||
''' 2 = Gleitkomma
|
||||
''' 3 = Attachment-Felder
|
||||
''' 4 = Elemente einer Liste, vgl Currency
|
||||
''' </summary>
|
||||
Public ItemType As Integer
|
||||
|
||||
''' <summary>
|
||||
''' BT-Feld-Bezeichnung
|
||||
''' </summary>
|
||||
Public EN16931_ID As String
|
||||
|
||||
End Class
|
||||
@@ -1,11 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0"/>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Cryptography.Pkcs" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Packaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.6" newVersion="8.0.0.6" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup></configuration>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" />
|
||||
<package id="NLog" version="5.0.5" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -8,8 +8,8 @@ Public Class ADSyncJob
|
||||
Inherits JobBase
|
||||
Implements IJob(Of ADSyncArgs)
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Firebird, MSSQL As MSSQLServer)
|
||||
MyBase.New(LogConfig, Firebird, MSSQL)
|
||||
Public Sub New(LogConfig As LogConfig, MSSQL As MSSQLServer)
|
||||
MyBase.New(LogConfig, MSSQL)
|
||||
End Sub
|
||||
|
||||
Public Sub Start(Arguments As ADSyncArgs) Implements IJob(Of ADSyncArgs).Start
|
||||
@@ -31,7 +31,7 @@ Public Class ADSyncJob
|
||||
|
||||
For Each oGroup In oGroups
|
||||
_Logger.Debug("Syncing Group [{0}]", oGroup)
|
||||
Dim oSyncedUsers = oSync.SyncUsersForGroup(oGroup, oAttributeMappings, _Firebird, _MSSQL, Arguments.UserFilter)
|
||||
Dim oSyncedUsers = oSync.SyncUsersForGroup(oGroup, oAttributeMappings, _MSSQL, Arguments.UserFilter)
|
||||
|
||||
If oSyncedUsers Is Nothing Then
|
||||
_Logger.Warn("Group [{0}] could not be synced!", oGroup)
|
||||
|
||||
@@ -1,13 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity name="GdPicture.NET.14" publicKeyToken="f52a2e60ad468dbb" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-14.3.9.0" newVersion="14.3.9.0" />
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0"/>
|
||||
<assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.0.0" newVersion="7.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Cryptography.Pkcs" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Packaging" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.6" newVersion="8.0.0.6" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="GdPicture.NET.14.Common" publicKeyToken="f52a2e60ad468dbb" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-14.3.18.0" newVersion="14.3.18.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Interfaces.PropertyValues
|
||||
Imports DigitalData.Modules.Interfaces.ZUGFeRDInterface
|
||||
|
||||
Public Class Exceptions
|
||||
@@ -7,9 +8,9 @@ Public Class Exceptions
|
||||
Inherits ApplicationException
|
||||
|
||||
Public ReadOnly File As FileInfo
|
||||
Public ReadOnly MissingProperties As List(Of String)
|
||||
Public ReadOnly MissingProperties As List(Of MissingProperty)
|
||||
|
||||
Public Sub New(pFile As FileInfo, pMissingProperties As List(Of String))
|
||||
Public Sub New(pFile As FileInfo, pMissingProperties As List(Of MissingProperty))
|
||||
MyBase.New($"Missing values in [{pFile.Name}]")
|
||||
|
||||
Me.File = pFile
|
||||
|
||||
@@ -1,38 +1,45 @@
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Linq
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Jobs.GraphQL
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Public Class GraphQLJob
|
||||
Inherits JobBase
|
||||
Implements IJob(Of GraphQLArgs)
|
||||
|
||||
Private _GraphQL As GraphQLInterface = Nothing
|
||||
Private _Model As GraphQLModel
|
||||
Private _Writer As GraphQLWriter
|
||||
|
||||
Private Const PLACEHOLDER_STATIC = "STATIC:"
|
||||
Private Const JOB_NAME = "GraphQL Job"
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, MSSQL As MSSQLServer)
|
||||
MyBase.New(LogConfig, Nothing, MSSQL)
|
||||
MyBase.New(LogConfig, MSSQL)
|
||||
End Sub
|
||||
|
||||
Public Sub Start(Args As GraphQLArgs) Implements IJob(Of GraphQLArgs).Start
|
||||
Try
|
||||
Dim oConfigPath As String = Args.QueryConfigPath
|
||||
Dim oConfigManager As New ConfigManager(Of GraphQLConfig)(_LogConfig, oConfigPath)
|
||||
' ConfigManager is missing, so we manually load the config
|
||||
Dim oConfig As GraphQLConfig = Nothing
|
||||
If File.Exists(oConfigPath) Then
|
||||
' Simple deserialization from JSON, assuming config is stored as JSON
|
||||
Dim json As String = File.ReadAllText(oConfigPath)
|
||||
oConfig = System.Text.Json.JsonSerializer.Deserialize(Of GraphQLConfig)(json)
|
||||
Else
|
||||
Throw New FileNotFoundException($"Config file not found: {oConfigPath}")
|
||||
End If
|
||||
|
||||
With oConfigManager.Config
|
||||
With oConfig
|
||||
_GraphQL = New GraphQLInterface(_LogConfig, .BaseUrl, .Email, .Password, .CertificateFingerprint)
|
||||
End With
|
||||
_Logger.Info($"baseUrl is: {oConfig.BaseUrl}")
|
||||
_Model = New GraphQLModel(_LogConfig, _MSSQL)
|
||||
_Writer = New GraphQLWriter(_LogConfig, _MSSQL)
|
||||
|
||||
' Login to get cookie
|
||||
_Logger.Debug("Logging in")
|
||||
@@ -43,41 +50,7 @@ Public Class GraphQLJob
|
||||
|
||||
_Logger.Debug("Loading Queries")
|
||||
|
||||
' Load query data from TBCUST_JOBRUNNER_QUERY
|
||||
Dim oQueryTable As DataTable = _MSSQL.GetDatatable("SELECT * FROM TBCUST_JOBRUNNER_QUERY ORDER BY SEQUENCE")
|
||||
Dim oQueryList As New List(Of Query)
|
||||
|
||||
' Save query data to business objects
|
||||
For Each oRow As DataRow In oQueryTable.Rows
|
||||
Dim oQuery As New Query With {
|
||||
.Id = oRow.Item("GUID"),
|
||||
.Name = oRow.Item("TITLE"),
|
||||
.ClearBeforeFill = oRow.ItemEx("CLEAR_BEFORE_FILL", False),
|
||||
.ConnectionId = oRow.ItemEx("CON_ID", 1), ' TODO: Connection String?
|
||||
.DestinationTable = oRow.ItemEx("DESTINATION_TABLE", String.Empty),
|
||||
.OperationName = oRow.ItemEx("OPERATION_NAME", String.Empty),
|
||||
.MappingBasePath = oRow.ItemEx("MAPPING_BASE_PATH", String.Empty),
|
||||
.QueryString = oRow.ItemEx("QUERY_STRING", String.Empty)
|
||||
}
|
||||
|
||||
If oQuery.DestinationTable = String.Empty Then
|
||||
_Logger.Warn("Value [DestinationTable] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
If oQuery.OperationName = String.Empty Then
|
||||
_Logger.Warn("Value [OperationName] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
If oQuery.MappingBasePath = String.Empty Then
|
||||
_Logger.Warn("Value [MappingBasePath] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
If oQuery.QueryString = String.Empty Then
|
||||
_Logger.Warn("Value [QueryString] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
oQueryList.Add(oQuery)
|
||||
Next
|
||||
Dim oQueryList = _Model.GetQueryList()
|
||||
|
||||
_Logger.Debug("Running [{0}] queries.", oQueryList.Count)
|
||||
|
||||
@@ -119,13 +92,17 @@ Public Class GraphQLJob
|
||||
|
||||
' Clear Table before inserting
|
||||
If pQuery.ClearBeforeFill = True Then
|
||||
If DeleteWithQueryName(pQuery) = False Then
|
||||
If DeleteHistoryTable(pQuery) = False Then
|
||||
Throw New ApplicationException($"Error while dropping history table before fill for Query [{pQuery.Name}]")
|
||||
End If
|
||||
|
||||
If CreateHistoryTable(pQuery) = False Then
|
||||
Throw New ApplicationException($"Error while creating history table before fill for Query [{pQuery.Name}]")
|
||||
End If
|
||||
|
||||
If TruncateTable(pQuery) = False Then
|
||||
Throw New ApplicationException($"Error while truncating table before fill for Query [{pQuery.Name}]")
|
||||
End If
|
||||
End If
|
||||
|
||||
' Reset all records to status = 0
|
||||
@@ -137,31 +114,22 @@ Public Class GraphQLJob
|
||||
End If
|
||||
|
||||
' get the data from GraphQL
|
||||
_Logger.Info("Getting data..", pQuery.Name)
|
||||
_Logger.Info("Getting data from GraphQL..", pQuery.Name)
|
||||
Dim oDataResponse = _GraphQL.GetData(pQuery.QueryString, pQuery.OperationName)
|
||||
Dim oResult As String
|
||||
Dim oJsonResult As String
|
||||
|
||||
' write data to string
|
||||
Using oStream = oDataResponse.GetResponseStream()
|
||||
Using oReader As New StreamReader(oStream)
|
||||
oResult = oReader.ReadToEnd()
|
||||
oJsonResult = oReader.ReadToEnd()
|
||||
End Using
|
||||
End Using
|
||||
|
||||
' Fill the query object with field mapping data from TBCUST_JOBRUNNER_QUERY_MAPPING
|
||||
Dim oSQL As String = "SELECT t2.* FROM TBCUST_JOBRUNNER_QUERY_MAPPING t
|
||||
JOIN TBCUST_JOBRUNNER_MAPPING t2 ON t.MAPPING_ID = t2.GUID
|
||||
WHERE t.QUERY_ID = {0}"
|
||||
Dim oMappingTable As DataTable = _MSSQL.GetDatatable(String.Format(oSQL, pQuery.Id))
|
||||
For Each oMapping As DataRow In oMappingTable.Rows
|
||||
pQuery.MappingFields.Add(New GraphQL.FieldMapping With {
|
||||
.DestinationColumn = oMapping.Item("DestinationColumn"),
|
||||
.SourcePath = oMapping.Item("SourcePath")
|
||||
})
|
||||
Next
|
||||
_Logger.Debug("Writing JSON data to database..")
|
||||
|
||||
' Handle the response from GraphQL and insert Data
|
||||
Dim oWriteDataResult As GraphQL.Query = WriteNewQueryData(oResult, pQuery, oDatabase)
|
||||
'Dim oWriteDataResult As Query = WriteNewQueryData(oResult, pQuery, oDatabase)
|
||||
Dim oWriteDataResult As Query = _Writer.WriteNewQueryData(oJsonResult, pQuery, JOB_NAME)
|
||||
|
||||
If IsNothing(oWriteDataResult) Then
|
||||
Throw New ApplicationException($"Error while handling Result of Query [{pQuery.Name}]")
|
||||
@@ -200,7 +168,7 @@ Public Class GraphQLJob
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function DeleteWithQueryName(pQuery As GraphQL.Query) As Boolean
|
||||
Private Function DeleteHistoryTable(pQuery As Query) As Boolean
|
||||
Dim oHistoryTableName = $"{pQuery.DestinationTable}_HISTORY"
|
||||
Dim oDeleteHistorySQL = $"
|
||||
IF (EXISTS (SELECT *
|
||||
@@ -214,6 +182,12 @@ Public Class GraphQLJob
|
||||
Return _MSSQL.ExecuteNonQuery(oDeleteHistorySQL)
|
||||
End Function
|
||||
|
||||
Private Function TruncateTable(pQuery As Query)
|
||||
Dim oDeleteTableSQL = $"TRUNCATE TABLE {pQuery.DestinationTable}"
|
||||
|
||||
Return _MSSQL.ExecuteNonQuery(oDeleteTableSQL)
|
||||
End Function
|
||||
|
||||
Private Function CreateHistoryTable(pQuery As Query) As Boolean
|
||||
Dim oHistoryTableName = $"{pQuery.DestinationTable}_HISTORY"
|
||||
Dim oFillHistorySQL = $"SELECT * INTO {oHistoryTableName} FROM {pQuery.DestinationTable}"
|
||||
@@ -231,72 +205,6 @@ Public Class GraphQLJob
|
||||
Return _MSSQL.ExecuteNonQuery(oResetSQL)
|
||||
End Function
|
||||
|
||||
Private Function WriteNewQueryData(JsonString As String, QueryData As GraphQL.Query, DB As Database.MSSQLServer) As GraphQL.Query
|
||||
Dim oObj As JObject = JObject.Parse(JsonString)
|
||||
Dim oResultList As JToken
|
||||
|
||||
If _GraphQL.ReadJSONPathFragmented(oObj, QueryData.MappingBasePath) = False Then
|
||||
_Logger.Warn("There is an error in the MappingBasePath [{1}] configuration of query [{0}]", QueryData.Name, QueryData.MappingBasePath)
|
||||
End If
|
||||
|
||||
Try
|
||||
oResultList = oObj.SelectToken(QueryData.MappingBasePath, errorWhenNoMatch:=True)
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("WriteNewQueryData: Could not find BasePath: [{0}] for query [{1}]", QueryData.MappingBasePath, QueryData.Name)
|
||||
_Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
If oResultList Is Nothing Then
|
||||
_Logger.Warn("WriteNewQueryData: Could not find BasePath: [{0}] for query [{1}]", QueryData.MappingBasePath, QueryData.Name)
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
_Logger.Info("WriteNewQueryData: Processing Queue [{0}] with [{1}] Items", QueryData.Name, oResultList.Count)
|
||||
|
||||
For Each oResultItem As JToken In oResultList
|
||||
Try
|
||||
' ADDED_WHO, ADDED_QUERY_ID are system fields which are used to correctly fill
|
||||
' and delete rows in the destination table without touching rows from other queries
|
||||
Dim oKeys As New List(Of String) From {"ADDED_WHO", "ADDED_QUERY_ID", "STATUS"}
|
||||
Dim oValues As New List(Of String) From {JOB_NAME, QueryData.Id, "1"}
|
||||
|
||||
For Each oMapping In QueryData.MappingFields
|
||||
Dim oValue As String = String.Empty
|
||||
|
||||
If oMapping.SourcePath.StartsWith(PLACEHOLDER_STATIC) Then
|
||||
oValue = oMapping.SourcePath.Replace(PLACEHOLDER_STATIC, String.Empty)
|
||||
Else
|
||||
Dim oToken = oResultItem.SelectToken(oMapping.SourcePath)
|
||||
|
||||
If oToken Is Nothing Then
|
||||
_Logger.Warn("WriteNewQueryData: Could not find value at SourcePath: {0}", oMapping.SourcePath)
|
||||
oValue = String.Empty
|
||||
Else
|
||||
oValue = oToken.ToString
|
||||
End If
|
||||
End If
|
||||
|
||||
oValues.Add(oValue)
|
||||
oKeys.Add(oMapping.DestinationColumn)
|
||||
Next
|
||||
|
||||
Dim oColumnString = String.Join(",", oKeys.ToArray)
|
||||
|
||||
Dim oValueList = oValues.Select(Function(Value) $"'{Value.EscapeForSQL}'").ToList()
|
||||
Dim oValueString = String.Join(",", oValueList)
|
||||
|
||||
Dim oSQL As String = $"INSERT INTO {QueryData.DestinationTable} ({oColumnString}) VALUES ({oValueString})"
|
||||
|
||||
DB.ExecuteNonQuery(oSQL)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
Next
|
||||
|
||||
Return QueryData
|
||||
End Function
|
||||
|
||||
Public Function ShouldStart(Arguments As GraphQLArgs) As Boolean Implements IJob(Of GraphQLArgs).ShouldStart
|
||||
Return Arguments.Enabled
|
||||
End Function
|
||||
|
||||
86
Jobs/GraphQL/GraphQLModel.vb
Normal file
86
Jobs/GraphQL/GraphQLModel.vb
Normal file
@@ -0,0 +1,86 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Data
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Jobs.GraphQL
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class GraphQLModel
|
||||
Private Database As MSSQLServer
|
||||
Private LogConfig As LogConfig
|
||||
Private Logger As Logger
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
|
||||
Database = pDatabase
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
End Sub
|
||||
|
||||
Public Function GetQueryList() As List(Of Query)
|
||||
Try
|
||||
Dim oQueryTable As DataTable = Database.GetDatatable("SELECT * FROM TBCUST_JOBRUNNER_QUERY WHERE ACTIVE = 1 ORDER BY SEQUENCE")
|
||||
Dim oQueryList As New List(Of Query)
|
||||
|
||||
For Each oRow As DataRow In oQueryTable.Rows
|
||||
Dim oQuery As New Query With {
|
||||
.Id = oRow.Item("GUID"),
|
||||
.Name = oRow.Item("TITLE"),
|
||||
.ClearBeforeFill = oRow.ItemEx("CLEAR_BEFORE_FILL", False),
|
||||
.ConnectionId = oRow.ItemEx("CON_ID", 1), ' TODO: Connection String?
|
||||
.DestinationTable = oRow.ItemEx("DESTINATION_TABLE", String.Empty),
|
||||
.OperationName = oRow.ItemEx("OPERATION_NAME", String.Empty),
|
||||
.MappingBasePath = oRow.ItemEx("MAPPING_BASE_PATH", String.Empty),
|
||||
.QueryString = oRow.ItemEx("QUERY_STRING", String.Empty)
|
||||
}
|
||||
|
||||
If oQuery.DestinationTable = String.Empty Then
|
||||
Logger.Warn("Value [DestinationTable] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
If oQuery.OperationName = String.Empty Then
|
||||
Logger.Warn("Value [OperationName] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
If oQuery.MappingBasePath = String.Empty Then
|
||||
Logger.Warn("Value [MappingBasePath] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
If oQuery.QueryString = String.Empty Then
|
||||
Logger.Warn("Value [QueryString] could not be read. Configuration incomplete.")
|
||||
End If
|
||||
|
||||
oQuery.MappingFields = GetQueryMapping(oQuery.Id)
|
||||
|
||||
oQueryList.Add(oQuery)
|
||||
Next
|
||||
|
||||
Return oQueryList
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return New List(Of Query)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetQueryMapping(pQueryId As Integer) As List(Of FieldMapping)
|
||||
Try
|
||||
Dim oSQL As String = "SELECT t2.* FROM TBCUST_JOBRUNNER_QUERY_MAPPING t
|
||||
JOIN TBCUST_JOBRUNNER_MAPPING t2 ON t.MAPPING_ID = t2.GUID
|
||||
WHERE t.QUERY_ID = {0}"
|
||||
Dim oMappingTable As DataTable = Database.GetDatatable(String.Format(oSQL, pQueryId))
|
||||
Dim oMappings As New List(Of FieldMapping)
|
||||
|
||||
For Each oMapping As DataRow In oMappingTable.Rows
|
||||
oMappings.Add(New FieldMapping With {
|
||||
.DestinationColumn = oMapping.Item("DestinationColumn"),
|
||||
.SourcePath = oMapping.Item("SourcePath")
|
||||
})
|
||||
Next
|
||||
|
||||
Return oMappings
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return New List(Of FieldMapping)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
178
Jobs/GraphQL/GraphQLWriter.vb
Normal file
178
Jobs/GraphQL/GraphQLWriter.vb
Normal file
@@ -0,0 +1,178 @@
|
||||
Imports System
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Linq
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Jobs.GraphQL
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Public Class GraphQLWriter
|
||||
Private ReadOnly Database As MSSQLServer
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
Private ReadOnly Logger As Logger
|
||||
|
||||
Private Const PLACEHOLDER_STATIC = "STATIC:"
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
|
||||
Database = pDatabase
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
End Sub
|
||||
|
||||
Public Function WriteNewQueryData(pJsonString As String, pQueryData As Query, pJobName As String) As GraphQL.Query
|
||||
Try
|
||||
Logger.Debug("Parsing JSON...")
|
||||
|
||||
Dim oObj As JObject = JObject.Parse(pJsonString)
|
||||
Dim oResultList As JToken
|
||||
|
||||
If ValidateJSONPath(oObj, pQueryData.MappingBasePath) = False Then
|
||||
Logger.Warn("There is an error in the MappingBasePath [{1}] configuration of query [{0}]", pQueryData.Name, pQueryData.MappingBasePath)
|
||||
End If
|
||||
|
||||
Try
|
||||
oResultList = oObj.SelectToken(pQueryData.MappingBasePath, errorWhenNoMatch:=True)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not find BasePath: [{0}] for query [{1}]", pQueryData.MappingBasePath, pQueryData.Name)
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
If oResultList Is Nothing Then
|
||||
Logger.Warn("Could not find BasePath: [{0}] for query [{1}]", pQueryData.MappingBasePath, pQueryData.Name)
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Logger.Info("Processing Query [{0}] with [{1}] Items", pQueryData.Name, oResultList.Count)
|
||||
|
||||
Dim oTable As New DataTable
|
||||
Dim oColumnList = pQueryData.MappingFields.Select(Function(f) f.DestinationColumn).ToList()
|
||||
|
||||
For Each oColumnName In oColumnList
|
||||
oTable.Columns.Add(oColumnName)
|
||||
Next
|
||||
|
||||
oTable.Columns.Add("ADDED_WHO")
|
||||
oTable.Columns.Add("ADDED_QUERY_ID")
|
||||
oTable.Columns.Add("STATUS")
|
||||
|
||||
Logger.Debug("Creating DataTable..")
|
||||
|
||||
For Each oResultItem As JToken In oResultList
|
||||
Dim oRow = FillRowFromJson(pQueryData, oResultItem, pJobName, oTable)
|
||||
|
||||
If oRow Is Nothing Then
|
||||
Logger.Error("DataRow could not be created!")
|
||||
Continue For
|
||||
End If
|
||||
|
||||
oTable.Rows.Add(oRow)
|
||||
Next
|
||||
oTable.AcceptChanges()
|
||||
|
||||
Logger.Debug("Starting Bulk Insert..")
|
||||
|
||||
'Bulk insert
|
||||
Dim oBulkResult = BulkInsert(oTable, pQueryData.DestinationTable, oColumnList)
|
||||
|
||||
If oBulkResult = False Then
|
||||
Logger.Error("Bulk Insert for Query [{0}] failed!", pQueryData.Name)
|
||||
End If
|
||||
|
||||
Logger.Info("Bulk Insert finished. [{0}] rows inserted.", oTable.Rows.Count)
|
||||
|
||||
Return pQueryData
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function FillRowFromJson(pQueryData As Query, pToken As JToken, pJobName As String, pTable As DataTable) As DataRow
|
||||
Try
|
||||
Dim oValuesNew As New Dictionary(Of String, String)
|
||||
Dim oRow As DataRow = pTable.NewRow()
|
||||
|
||||
For Each oMapping In pQueryData.MappingFields
|
||||
Dim oValue As String = String.Empty
|
||||
|
||||
If oMapping.SourcePath.StartsWith(PLACEHOLDER_STATIC) Then
|
||||
oValue = oMapping.SourcePath.Replace(PLACEHOLDER_STATIC, String.Empty)
|
||||
Else
|
||||
Dim oToken = pToken.SelectToken(oMapping.SourcePath)
|
||||
|
||||
If oToken Is Nothing Then
|
||||
Logger.Warn("WriteNewQueryData: Could not find value at SourcePath: {0}", oMapping.SourcePath)
|
||||
oValue = String.Empty
|
||||
Else
|
||||
oValue = oToken.ToString
|
||||
End If
|
||||
End If
|
||||
|
||||
oValuesNew.Add(oMapping.DestinationColumn, oValue)
|
||||
Next
|
||||
|
||||
oValuesNew.Add("ADDED_WHO", pJobName)
|
||||
oValuesNew.Add("ADDED_QUERY_ID", pQueryData.Id)
|
||||
oValuesNew.Add("STATUS", "1")
|
||||
|
||||
For Each oColumn As DataColumn In pTable.Columns
|
||||
oRow.Item(oColumn.ColumnName) = oValuesNew.Item(oColumn.ColumnName)
|
||||
Next
|
||||
|
||||
Return oRow
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function BulkInsert(pTable As DataTable, pDestinationTable As String, pColumns As List(Of String)) As Boolean
|
||||
Using oConnection = Database.GetConnection()
|
||||
Using oBulkCopy = New SqlBulkCopy(oConnection)
|
||||
|
||||
oBulkCopy.DestinationTableName = pDestinationTable
|
||||
For Each oColumn In pColumns
|
||||
oBulkCopy.ColumnMappings.Add(New SqlBulkCopyColumnMapping(oColumn, oColumn))
|
||||
Next
|
||||
|
||||
Try
|
||||
oBulkCopy.WriteToServer(pTable)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Using
|
||||
End Using
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function ValidateJSONPath(pObject As Newtonsoft.Json.Linq.JObject, pJsonPath As String) As Boolean
|
||||
Dim oSplitPath As List(Of String) = pJsonPath.Split(".").ToList()
|
||||
Dim oCurrentPath As String = String.Empty
|
||||
|
||||
For Each oPart In oSplitPath
|
||||
If oCurrentPath = String.Empty Then
|
||||
oCurrentPath = oPart
|
||||
Else
|
||||
oCurrentPath &= "." & oPart
|
||||
End If
|
||||
|
||||
Logger.Debug("Selecting Path Fragment [{0}]", oCurrentPath)
|
||||
|
||||
Try
|
||||
pObject.SelectToken(oCurrentPath, errorWhenNoMatch:=True)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Path Fragment [{0}] did not return a valid token", oCurrentPath)
|
||||
Return False
|
||||
End Try
|
||||
Next
|
||||
|
||||
Return True
|
||||
End Function
|
||||
End Class
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user