Compare commits
403 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e945aad224 | |||
| 8510731366 | |||
| 5df4195e6c | |||
| a3dc1e1657 | |||
| 27149e2131 | |||
| 91be755781 | |||
| 84f6730023 | |||
| b51c2679e4 | |||
| 9d7502d1a4 | |||
| d3b8160634 | |||
| 601c817aa2 | |||
| d0d30bd1c3 | |||
| 0e9e7f3dda | |||
| e518c17db2 | |||
| 0a281827f9 | |||
| 141473ce28 | |||
| 45af089e3f | |||
| 4e4387620b | |||
| 8c2c48a63f | |||
| 534a668496 | |||
| eed45695e8 | |||
| ff2fbe0c34 | |||
| 3324c736c6 | |||
| 0a6a0bc5cb | |||
| e18e0ddff3 | |||
| 580a498238 | |||
| c97557722e | |||
| c17fa17d76 | |||
| 5b054ee2ec | |||
| 2771d9957d | |||
| 5893152761 | |||
| b7d57e935a | |||
| 61b613a8fb | |||
| d2fef81f55 | |||
| cd7a8ccad8 | |||
| 08079d3e0e | |||
| 8156828ec3 | |||
| 9bb95c5a49 | |||
| 7ba3aeb65d | |||
| 6ea938a91a | |||
| 92c196023d | |||
| 10d9625b6d | |||
| 5f955499e2 | |||
| 716813abe1 | |||
| 6f0d0419c5 | |||
| 300c2dc294 | |||
| fddfbb6dfa | |||
| b2858c9c8a | |||
| 68404c928a | |||
| ca16c3a1b0 | |||
| c11163896c | |||
| 891def5bcd | |||
| 65aa95d1e7 | |||
| 1b20cd8ef5 | |||
| 11934fcae2 | |||
| 687a254a8d | |||
| 25f274d4d6 | |||
| 0ec3a4c31a | |||
| 1b89501529 | |||
| 191b23ee7d | |||
| ae39db267d | |||
| 7cc25ac9be | |||
| 5c30c8a1ba | |||
| d5777c0020 | |||
| f5bbcae0db | |||
| 1efd5f5a4b | |||
| 47ddab4e67 | |||
| 07c58c5738 | |||
| fcf1ec5ea9 | |||
| 673eb62d8c | |||
| 6790088950 | |||
| d46f3fd38d | |||
| 0fe40dacc7 | |||
| 0c01e93ff3 | |||
| 6da702e31f | |||
| ce92f70eb0 | |||
| 37a62a34ae | |||
| c138ea3143 | |||
| 4e11685415 | |||
| 32398cd7fb | |||
| d5f2ed3950 | |||
| f120bb6c28 | |||
| 7abd135f30 | |||
| bae58ec4bb | |||
| f44838d235 | |||
| 9c11e877aa | |||
| 5fdd74ae9a | |||
| b838e95c28 | |||
| 0e2036cb42 | |||
| b29bac08a2 | |||
| 5559e7daa8 | |||
| d3fb78810e | |||
| 30dac79e7c | |||
| bf8f7b8fa3 | |||
| 5915e5f532 | |||
| 658488fe0e | |||
| 5f8e60b4ba | |||
| fff3659939 | |||
| 385c5cf7ea | |||
| 31ed8b2edb | |||
| 0ef6d161d5 | |||
| a0b88fd157 | |||
| ed93a04fd0 | |||
| 00a0fc81ce | |||
| 681aa44b32 | |||
| 9d43a221ed | |||
| 53a7630d97 | |||
| 7317fa58b4 | |||
| dd56701b5b | |||
| 014bed96f9 | |||
| ac196be0b7 | |||
| a77862b372 | |||
| ed5b55cf77 | |||
| aec6271f5a | |||
| 62359ac858 | |||
| 73df595421 | |||
| 2cd1d57cd3 | |||
| 8934c86f7b | |||
| cee1718208 | |||
| 9407b451c7 | |||
| 66469b9df7 | |||
| 57833b368d | |||
| 634f5f7120 | |||
| 0e376c070c | |||
| 387df699b0 | |||
| 2016379205 | |||
| 0ad15c90c3 | |||
| 190e572bce | |||
| 02e7b7c4e7 | |||
| e03b590844 | |||
| 4ee291c12d | |||
| 81c04ef70b | |||
| 19b89db170 | |||
| 623ecd6308 | |||
| c5e598a0d6 | |||
| a46dc9cb32 | |||
| 3634f85359 | |||
| 54d2cd634c | |||
| 4cd61462c0 | |||
| 5444722c25 | |||
| d5d47076df | |||
| 612c3c95f7 | |||
| dddac15b52 | |||
| a315e4f0ef | |||
| d71e9465e5 | |||
| 876197b0ac | |||
| cd07a940d0 | |||
| d2f7dd53f3 | |||
| 8c75556240 | |||
| a025057865 | |||
| c5ebcd5b40 | |||
| df1526d522 | |||
| fb88e6e30d | |||
| e83945488d | |||
| 23835d330d | |||
| b57885576e | |||
| 417ea1a77d | |||
| 335fdf78f0 | |||
| d50e5a6860 | |||
| 86d28f1901 | |||
| 202c5f6faf | |||
| e2947d1017 | |||
| 55faefcb9a | |||
| 1e5f894fd9 | |||
| cf8baa054f | |||
| 871a0c8ca5 | |||
| 78cb17d8fc | |||
| 22ff799204 | |||
| a26408a21c | |||
| ee043f81be | |||
| 97741b4973 | |||
| 544c977740 | |||
| dc38127291 | |||
| 8e7bdf2b77 | |||
| 7e922555b1 | |||
| acbbd5c9e6 | |||
| 77f06c465e | |||
| 4bfba522ce | |||
| cbbdc8e8d8 | |||
| e8e3d63d09 | |||
| 9dc73936da | |||
| a2afeab317 | |||
| 2c62abdf73 | |||
| d17cb03c7b | |||
| c749f10a8a | |||
| f2973cb0be | |||
| 8f2afd8ab5 | |||
| 1d46b75608 | |||
| 7c28833874 | |||
| 1a019f1c72 | |||
| cae553c47f | |||
| 7634fc42ba | |||
| c24935afce | |||
| 2c4ce635c0 | |||
| a4b01773ea | |||
| b076148e65 | |||
| 02369f87f7 | |||
| 4b04feedff | |||
| e99def8664 | |||
| a8744cfc56 | |||
| 03761b81ec | |||
| dd4f403b7a | |||
| c7d1ca046c | |||
| 2c3494f9f0 | |||
| 7dc0aef175 | |||
| e2afe6a586 | |||
| e3ed9a7f35 | |||
| db003d2bc3 | |||
| c203ab6eb3 | |||
| c10633b6f1 | |||
| a9fd0e2f83 | |||
| 112c73aea1 | |||
| 9e8e885ef9 | |||
| 1f964ded92 | |||
| eeba41cb5c | |||
| c418812ba2 | |||
| 6169d8cfcc | |||
| 75596c61bc | |||
| b51e164c18 | |||
| c35d625c36 | |||
| c893ce4d44 | |||
| c47fb1787c | |||
| aca61c24dc | |||
| 167c9d89d4 | |||
| 2295f12958 | |||
| 9762628abc | |||
| a7918e1a89 | |||
| 7a8e05462c | |||
| aaeae6e99e | |||
| 533f3f4f8f | |||
| 5135987f1b | |||
| 458d788a13 | |||
| e842228baf | |||
| 25d2ada96e | |||
| f22933f925 | |||
| 009b5f6452 | |||
| 94c72b7e11 | |||
| 11a1925660 | |||
| 6ce8386248 | |||
| 1739dcf38a | |||
| 1a42d581d4 | |||
| 625433a3af | |||
| 782a01a4b0 | |||
| e65105b305 | |||
| 0429ad398a | |||
| 268ee1e2e0 | |||
| d19dc0edb5 | |||
| bd770dcffb | |||
| d99f2d2144 | |||
| f47cc1f505 | |||
| edad6f24c0 | |||
| a296908697 | |||
| 04d0b7e9a2 | |||
| 5e6da5faa9 | |||
| 63947b6662 | |||
| da39149575 | |||
| 99e6973695 | |||
| 60db6422e8 | |||
| e642d29605 | |||
| 7a89db055c | |||
| 703337fa9a | |||
| 54fab44687 | |||
| 3b2b097626 | |||
| b9a115bb13 | |||
| 011fbe52d3 | |||
| 84875e5c30 | |||
| 69ce7b5a0b | |||
| 31c142efa4 | |||
| 116ec93bb6 | |||
| e5ac829bd8 | |||
| 703bae704f | |||
| fd63226051 | |||
| d3e7c224d3 | |||
| dc53a6f439 | |||
| 519c8d2130 | |||
| f28f7ee815 | |||
| 1848fef640 | |||
| 48d34590e4 | |||
| 25505ad6d5 | |||
| 997c870bcc | |||
| 8f9ddc738b | |||
| 275b349c99 | |||
| 2a921eca4f | |||
| bbf7c78e28 | |||
| 048be7b2c4 | |||
| 3598051cb2 | |||
| dbebd11c14 | |||
| 8c9027581e | |||
| 75122f8ee1 | |||
| 04a1f34aba | |||
| e458de6f21 | |||
| caadb95c91 | |||
| 6cfeea6fac | |||
| 124e6cdf61 | |||
| d20767ec7e | |||
| 2e2639b94f | |||
| efa11f9452 | |||
| a8fefca15f | |||
| 3e5a36311c | |||
| f0fa776829 | |||
| a3a8c0ffaf | |||
| f16d3a3275 | |||
| 0e8fa72f36 | |||
| ac0ef3f62a | |||
| 557a9510d6 | |||
| 349758a289 | |||
| 5541d0dc83 | |||
| 0798679629 | |||
| 0a26d475f9 | |||
| 8e5a392c8c | |||
| f0beaaacc8 | |||
| 0847014108 | |||
| d6c226ae1a | |||
| 6d6bf242dd | |||
| b760d4fa1a | |||
| aa65d48f5f | |||
| f1f5287d74 | |||
| 94d0de796e | |||
| 70901c259b | |||
| f22bd910a2 | |||
| b85ed12f1c | |||
| fef6d4ccfc | |||
| e345e61d8a | |||
| 4d2dc10579 | |||
| 9c98ee945a | |||
| 01270d6254 | |||
| 485cecc1a0 | |||
| be9cf76253 | |||
| f89dc62a5b | |||
| 182d3c82f1 | |||
| 091d542084 | |||
| c92b92b795 | |||
| 80837628ad | |||
| fa0c622c66 | |||
| 7403002350 | |||
| aa0aeb1552 | |||
| 3d183abf41 | |||
| ce5e3c45c7 | |||
| 9974cbb8b4 | |||
| 279ef9d302 | |||
| cc21f4b719 | |||
| 98d32300cf | |||
| a77e88ca88 | |||
| 0b9211d26a | |||
| a6279ca047 | |||
| 2cc8da110d | |||
| 985e429d34 | |||
| 1b95fa8d91 | |||
| a9dadb9d9c | |||
| c358bddd36 | |||
| eca2aaae30 | |||
| a1b035c00a | |||
| d702234b9c | |||
| 9d4b93b4ab | |||
| 9cc4a5544c | |||
| 23455acd67 | |||
| b7bd3d77ad | |||
| 8e235aa282 | |||
| a3a0f72b02 | |||
| 362c526459 | |||
| 46874d42d0 | |||
| 39efd30bae | |||
| b259a94ca8 | |||
| 4dbf8a6611 | |||
| 7e06abd521 | |||
| 6c3f35f64b | |||
| e21b7b9eee | |||
| 7d6bef1a32 | |||
| c297416f6c | |||
| 027a0b4b4c | |||
| db5500b3a7 | |||
| 8947a03e5a | |||
| 08188ca2a0 | |||
| f9f3dd56bd | |||
| d81f448b08 | |||
| 1f48aad618 | |||
| b802a9b914 | |||
| 407308f26f | |||
| 833e55ec20 | |||
| f6ecbb94f3 | |||
| d59ad82c87 | |||
| 03a3c78176 | |||
| 9377d704e6 | |||
| a1ccaafcc6 | |||
| ab3c3c2122 | |||
| 4468bdabb9 | |||
| f9929d0b73 | |||
| 226b26be5e | |||
| 5190b5d62d | |||
| 5805a3685a | |||
| f89faccdf4 | |||
| 7c760e5f18 | |||
| 79fa14549c | |||
| 11a4293138 | |||
| c1c5f2e16e | |||
| faba3fbe60 | |||
| c911373036 | |||
| e9b283b910 | |||
| fc20464958 | |||
| 22e02bdd9e | |||
| f0bbeaff26 | |||
| 7861609072 | |||
| c440c86068 |
@@ -346,3 +346,4 @@ Backup*/
|
|||||||
UpgradeLog*.XML
|
UpgradeLog*.XML
|
||||||
|
|
||||||
MP.Prog/Shared/MainLayout.razor
|
MP.Prog/Shared/MainLayout.razor
|
||||||
|
MP.Stats/temp/*.csv
|
||||||
|
|||||||
+468
-67
@@ -1,24 +1,28 @@
|
|||||||
variables:
|
variables:
|
||||||
NUGET_PATH: 'C:\Tools\nuget.exe'
|
|
||||||
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
|
|
||||||
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
|
|
||||||
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\MP-CORE\Release'
|
|
||||||
DEPLOY_FOLDER: 'c:\Projects\Deploy\MP-CORE\Builds'
|
|
||||||
VERS_MAIN: '1.1'
|
|
||||||
# VERS_FULL: '0.0.0.0'
|
|
||||||
NEXUS_PATH: 'MP-STATS'
|
NEXUS_PATH: 'MP-STATS'
|
||||||
|
PROJ_PATH: ''
|
||||||
APP_NAME: 'MP.Stats'
|
APP_NAME: 'MP.Stats'
|
||||||
|
SOL_NAME: 'MP-STATS'
|
||||||
|
|
||||||
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
|
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
|
||||||
.nuget-fix: &nuget-fix
|
.nuget-fix: &nuget-fix
|
||||||
- |
|
- |
|
||||||
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
|
echo "esecuzione Nuget FIX steps"
|
||||||
if ($hasSource -eq 0) {
|
dotnet nuget list source
|
||||||
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
|
||||||
} else {
|
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||||
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
dotnet nuget remove source "`"Steamware Nexus Proxy`""
|
||||||
}
|
}
|
||||||
echo $hasSource
|
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
|
||||||
|
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||||
|
dotnet nuget remove source "`"Steamware Nexus`""
|
||||||
|
}
|
||||||
|
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
|
||||||
|
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||||
|
dotnet nuget remove source nexus-proxy-v3
|
||||||
|
}
|
||||||
|
dotnet nuget add source https://nexus.steamware.net/repository/nuget-proxy-v3/index.json -n nexus-proxy-v3 -u nugetUser -p viaDante16 --store-password-in-clear-text
|
||||||
|
echo "Has Source: $hasSource"
|
||||||
|
|
||||||
# helper creazione hash files x IIS
|
# helper creazione hash files x IIS
|
||||||
.hashBuild: &hashBuild
|
.hashBuild: &hashBuild
|
||||||
@@ -37,8 +41,6 @@ variables:
|
|||||||
.nexusUpload: &nexusUpload
|
.nexusUpload: &nexusUpload
|
||||||
- |
|
- |
|
||||||
Set-Alias mCurl C:\Windows\system32\curl.exe
|
Set-Alias mCurl C:\Windows\system32\curl.exe
|
||||||
$currentDate = get-date -format yyMM;
|
|
||||||
$currentTime = get-date -format ddHH;
|
|
||||||
$fileVers = $env:APP_NAME + "\Resources\VersNum.txt"
|
$fileVers = $env:APP_NAME + "\Resources\VersNum.txt"
|
||||||
$VersNumb = Get-Content $fileVers
|
$VersNumb = Get-Content $fileVers
|
||||||
echo "Curr Version: $VersNumb"
|
echo "Curr Version: $VersNumb"
|
||||||
@@ -58,10 +60,8 @@ variables:
|
|||||||
}
|
}
|
||||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
|
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
|
||||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
|
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
|
||||||
|
|
||||||
|
|
||||||
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
|
|
||||||
|
|
||||||
|
# Stages previsti
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
@@ -73,142 +73,395 @@ LAND:build:
|
|||||||
stage: build
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Land
|
||||||
|
SOL_NAME: MP-LAND
|
||||||
before_script:
|
before_script:
|
||||||
- *nuget-fix
|
- *nuget-fix
|
||||||
- dotnet restore MP-LAND.sln
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
script:
|
script:
|
||||||
- dotnet build MP.Land/MP.Land.csproj
|
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
PROG:build:
|
PROG:build:
|
||||||
stage: build
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Prog
|
||||||
|
SOL_NAME: MP-PROG
|
||||||
before_script:
|
before_script:
|
||||||
- *nuget-fix
|
- *nuget-fix
|
||||||
- dotnet restore MP-PROG.sln
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
script:
|
script:
|
||||||
- dotnet build MP.Prog/MP.Prog.csproj
|
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
STAT:build:
|
STAT:build:
|
||||||
stage: build
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Stats
|
||||||
|
SOL_NAME: MP-STATS
|
||||||
before_script:
|
before_script:
|
||||||
- *nuget-fix
|
- *nuget-fix
|
||||||
- dotnet restore MP-STATS.sln
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
script:
|
script:
|
||||||
- dotnet build MP.Stats/MP.Stats.csproj
|
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
MON:build:
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Mon
|
||||||
|
SOL_NAME: MP-MON
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
script:
|
||||||
|
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
SPEC:build:
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.SPEC
|
||||||
|
SOL_NAME: MP-SPEC
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
script:
|
||||||
|
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
# WAMON:build:
|
||||||
|
# stage: build
|
||||||
|
# tags:
|
||||||
|
# - win
|
||||||
|
# variables:
|
||||||
|
# PROJ_PATH: MP.WASM.Mon\Server
|
||||||
|
# APP_NAME: MP.WASM.Mon.Server
|
||||||
|
# SOL_NAME: MP-WAMON
|
||||||
|
# before_script:
|
||||||
|
# - *nuget-fix
|
||||||
|
# - dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
# script:
|
||||||
|
# - dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||||
|
|
||||||
LAND:test:
|
LAND:test:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Land
|
||||||
|
SOL_NAME: MP-LAND
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["LAND:build"]
|
needs: ["LAND:build"]
|
||||||
script:
|
script:
|
||||||
- dotnet test MP.Land/MP.Land.csproj
|
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
PROG:test:
|
PROG:test:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Prog
|
||||||
|
SOL_NAME: MP-PROG
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["PROG:build"]
|
needs: ["PROG:build"]
|
||||||
script:
|
script:
|
||||||
- dotnet test MP.Prog/MP.Prog.csproj
|
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
STAT:test:
|
STAT:test:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Stats
|
||||||
|
SOL_NAME: MP-STATS
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["STAT:build"]
|
needs: ["STAT:build"]
|
||||||
script:
|
script:
|
||||||
- dotnet test MP.Stats/MP.Stats.csproj
|
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
MON:test:
|
||||||
|
stage: test
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Mon
|
||||||
|
SOL_NAME: MP-MON
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
needs: ["MON:build"]
|
||||||
|
script:
|
||||||
|
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
# WAMON:test:
|
||||||
|
# stage: test
|
||||||
|
# tags:
|
||||||
|
# - win
|
||||||
|
# variables:
|
||||||
|
# PROJ_PATH: MP.WASM.Mon\Server
|
||||||
|
# APP_NAME: MP.WASM.Mon.Server
|
||||||
|
# SOL_NAME: MP-WAMON
|
||||||
|
# before_script:
|
||||||
|
# - *nuget-fix
|
||||||
|
# - dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
# only:
|
||||||
|
# - develop
|
||||||
|
# needs: ["WAMON:build"]
|
||||||
|
# script:
|
||||||
|
# - dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
SPEC:test:
|
||||||
|
stage: test
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.SPEC
|
||||||
|
SOL_NAME: MP-SPEC
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
needs: ["SPEC:build"]
|
||||||
|
script:
|
||||||
|
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
LAND:IIS01:deploy:
|
LAND:IIS01:deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Land
|
||||||
|
SOL_NAME: MP-LAND
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["LAND:test"]
|
needs: ["LAND:test"]
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
|
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
PROG:IIS01:deploy:
|
PROG:IIS01:deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Prog
|
||||||
|
SOL_NAME: MP-PROG
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["PROG:test"]
|
needs: ["PROG:test"]
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
|
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
|
||||||
STAT:IIS01:deploy:
|
STAT:IIS01:deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Stats
|
||||||
|
SOL_NAME: MP-STATS
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["STAT:test"]
|
needs: ["STAT:test"]
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
|
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
MON:IIS01:deploy:
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Mon
|
||||||
|
SOL_NAME: MP-MON
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
needs: ["MON:test"]
|
||||||
|
script:
|
||||||
|
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
# WAMON:IIS01:deploy:
|
||||||
|
# stage: deploy
|
||||||
|
# tags:
|
||||||
|
# - win
|
||||||
|
# variables:
|
||||||
|
# PROJ_PATH: MP.WASM.Mon\Server
|
||||||
|
# APP_NAME: MP.WASM.Mon.Server
|
||||||
|
# SOL_NAME: MP-WAMON
|
||||||
|
# before_script:
|
||||||
|
# - *nuget-fix
|
||||||
|
# - dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
# only:
|
||||||
|
# - develop
|
||||||
|
# needs: ["WAMON:test"]
|
||||||
|
# script:
|
||||||
|
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
SPEC:IIS01:deploy:
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.SPEC
|
||||||
|
SOL_NAME: MP-SPEC
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
needs: ["SPEC:test"]
|
||||||
|
script:
|
||||||
|
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
LAND:IIS02:deploy:
|
LAND:IIS02:deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Land
|
||||||
|
SOL_NAME: MP-LAND
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
needs: ["LAND:build"]
|
needs: ["LAND:build"]
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
|
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
|
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
PROG:IIS02:deploy:
|
PROG:IIS02:deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Prog
|
||||||
|
SOL_NAME: MP-PROG
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
needs: ["PROG:build"]
|
needs: ["PROG:build"]
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
|
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
|
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
STAT:IIS02:deploy:
|
STAT:IIS02:deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Stats
|
||||||
|
SOL_NAME: MP-STATS
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
needs: ["STAT:build"]
|
needs: ["STAT:build"]
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
|
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
|
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
MON:IIS02:deploy:
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Mon
|
||||||
|
SOL_NAME: MP-MON
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
needs: ["MON:build"]
|
||||||
|
script:
|
||||||
|
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
# WAMON:IIS02:deploy:
|
||||||
|
# stage: deploy
|
||||||
|
# tags:
|
||||||
|
# - win
|
||||||
|
# variables:
|
||||||
|
# PROJ_PATH: MP.WASM.Mon\Server
|
||||||
|
# APP_NAME: MP.WASM.Mon.Server
|
||||||
|
# SOL_NAME: MP-WAMON
|
||||||
|
# before_script:
|
||||||
|
# - *nuget-fix
|
||||||
|
# - dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
# only:
|
||||||
|
# - master
|
||||||
|
# needs: ["WAMON:build"]
|
||||||
|
# script:
|
||||||
|
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||||
|
# - dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
SPEC:IIS02:deploy:
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.SPEC
|
||||||
|
SOL_NAME: MP-SPEC
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
needs: ["SPEC:build"]
|
||||||
|
script:
|
||||||
|
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
LAND:installer:
|
LAND:installer:
|
||||||
stage: installer
|
stage: installer
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Land
|
||||||
|
SOL_NAME: MP-LAND
|
||||||
|
NEXUS_PATH: MP-LAND
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
- master
|
- master
|
||||||
needs: ["LAND:build"]
|
needs: ["LAND:build"]
|
||||||
variables:
|
|
||||||
APP_NAME: MP.Land
|
|
||||||
NEXUS_PATH: MP-LAND
|
|
||||||
before_script:
|
|
||||||
# - *nuget-fix
|
|
||||||
# - dotnet restore
|
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Land/MP.Land.csproj -o:publish
|
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
|
||||||
# qui il deploy su nexus...
|
# qui il deploy su nexus...
|
||||||
- *hashBuild
|
- *hashBuild
|
||||||
- *nexusUpload
|
- *nexusUpload
|
||||||
@@ -217,18 +470,19 @@ PROG:installer:
|
|||||||
stage: installer
|
stage: installer
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Prog
|
||||||
|
SOL_NAME: MP-PROG
|
||||||
|
NEXUS_PATH: MP-PROG
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
- master
|
- master
|
||||||
needs: ["PROG:build"]
|
needs: ["PROG:build"]
|
||||||
variables:
|
|
||||||
APP_NAME: MP.Prog
|
|
||||||
NEXUS_PATH: MP-PROG
|
|
||||||
before_script:
|
|
||||||
# - *nuget-fix
|
|
||||||
# - dotnet restore
|
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Prog/MP.Prog.csproj -o:publish
|
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
|
||||||
# qui il deploy su nexus...
|
# qui il deploy su nexus...
|
||||||
- *hashBuild
|
- *hashBuild
|
||||||
- *nexusUpload
|
- *nexusUpload
|
||||||
@@ -237,27 +491,98 @@ STAT:installer:
|
|||||||
stage: installer
|
stage: installer
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Stats
|
||||||
|
SOL_NAME: MP-STATS
|
||||||
|
NEXUS_PATH: MP-STATS
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
- master
|
- master
|
||||||
needs: ["STAT:build"]
|
needs: ["STAT:build"]
|
||||||
variables:
|
|
||||||
APP_NAME: MP.Stats
|
|
||||||
NEXUS_PATH: MP-STATS
|
|
||||||
before_script:
|
|
||||||
# - *nuget-fix
|
|
||||||
# - dotnet restore
|
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Stats/MP.Stats.csproj -o:publish
|
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
|
||||||
|
# qui il deploy su nexus...
|
||||||
|
- *hashBuild
|
||||||
|
- *nexusUpload
|
||||||
|
|
||||||
|
MON:installer:
|
||||||
|
stage: installer
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Mon
|
||||||
|
SOL_NAME: MP-MON
|
||||||
|
NEXUS_PATH: MP-MON
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
needs: ["MON:build"]
|
||||||
|
script:
|
||||||
|
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
|
||||||
|
# qui il deploy su nexus...
|
||||||
|
- *hashBuild
|
||||||
|
- *nexusUpload
|
||||||
|
|
||||||
|
# WAMON:installer:
|
||||||
|
# stage: installer
|
||||||
|
# tags:
|
||||||
|
# - win
|
||||||
|
# variables:
|
||||||
|
# PROJ_PATH: MP.WASM.Mon\Server
|
||||||
|
# APP_NAME: MP.WASM.Mon.Server
|
||||||
|
# SOL_NAME: MP-WAMON
|
||||||
|
# NEXUS_PATH: MP-WAMON
|
||||||
|
# before_script:
|
||||||
|
# - *nuget-fix
|
||||||
|
# - dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
# only:
|
||||||
|
# - develop
|
||||||
|
# - master
|
||||||
|
# needs: ["WAMON:build"]
|
||||||
|
# script:
|
||||||
|
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
|
||||||
|
# # qui il deploy su nexus...
|
||||||
|
# - *hashBuild
|
||||||
|
# - *nexusUpload
|
||||||
|
|
||||||
|
SPEC:installer:
|
||||||
|
stage: installer
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.SPEC
|
||||||
|
SOL_NAME: MP-SPEC
|
||||||
|
NEXUS_PATH: MP-SPEC
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
needs: ["SPEC:build"]
|
||||||
|
script:
|
||||||
|
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
|
||||||
# qui il deploy su nexus...
|
# qui il deploy su nexus...
|
||||||
- *hashBuild
|
- *hashBuild
|
||||||
- *nexusUpload
|
- *nexusUpload
|
||||||
|
|
||||||
|
|
||||||
LAND:release:
|
LAND:release:
|
||||||
stage: release
|
stage: release
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Land
|
||||||
|
SOL_NAME: MP-LAND
|
||||||
|
NEXUS_PATH: MP-LAND
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
#- feature/Deploy_CI_CD
|
#- feature/Deploy_CI_CD
|
||||||
# - master
|
# - master
|
||||||
@@ -269,13 +594,19 @@ LAND:release:
|
|||||||
paths:
|
paths:
|
||||||
- publish/
|
- publish/
|
||||||
script:
|
script:
|
||||||
- dotnet publish -c Release -o ./publish MP.Land/MP.Land.csproj
|
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
|
||||||
PROG:release:
|
PROG:release:
|
||||||
stage: release
|
stage: release
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Prog
|
||||||
|
SOL_NAME: MP-PROG
|
||||||
|
NEXUS_PATH: MP-PROG
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
#- feature/Deploy_CI_CD
|
#- feature/Deploy_CI_CD
|
||||||
# - master
|
# - master
|
||||||
@@ -287,13 +618,19 @@ PROG:release:
|
|||||||
paths:
|
paths:
|
||||||
- publish/
|
- publish/
|
||||||
script:
|
script:
|
||||||
- dotnet publish -c Release -o ./publish MP.Prog/MP.Prog.csproj
|
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
|
||||||
STAT:release:
|
STAT:release:
|
||||||
stage: release
|
stage: release
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Stats
|
||||||
|
SOL_NAME: MP-STATS
|
||||||
|
NEXUS_PATH: MP-STATS
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
only:
|
only:
|
||||||
#- feature/Deploy_CI_CD
|
#- feature/Deploy_CI_CD
|
||||||
# - master
|
# - master
|
||||||
@@ -305,8 +642,72 @@ STAT:release:
|
|||||||
paths:
|
paths:
|
||||||
- publish/
|
- publish/
|
||||||
script:
|
script:
|
||||||
- dotnet publish -c Release -o ./publish MP.Land/MP.Land.csproj
|
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
- dotnet publish -c Release -o ./publish MP.Prog/MP.Prog.csproj
|
|
||||||
- dotnet publish -c Release -o ./publish MP.Stats/MP.Stats.csproj
|
|
||||||
|
|
||||||
|
MON:release:
|
||||||
|
stage: release
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.Mon
|
||||||
|
SOL_NAME: MP-MON
|
||||||
|
NEXUS_PATH: MP-MON
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
except:
|
||||||
|
- branches
|
||||||
|
needs: ["MON:build"]
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- publish/
|
||||||
|
script:
|
||||||
|
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
# WAMON:release:
|
||||||
|
# stage: release
|
||||||
|
# tags:
|
||||||
|
# - win
|
||||||
|
# variables:
|
||||||
|
# PROJ_PATH: MP.WASM.Mon\Server
|
||||||
|
# APP_NAME: MP.WASM.Mon.Server
|
||||||
|
# SOL_NAME: MP-WAMON
|
||||||
|
# NEXUS_PATH: MP-WAMON
|
||||||
|
# before_script:
|
||||||
|
# - *nuget-fix
|
||||||
|
# - dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
# only:
|
||||||
|
# - tags
|
||||||
|
# except:
|
||||||
|
# - branches
|
||||||
|
# needs: ["WAMON:build"]
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - publish/
|
||||||
|
# script:
|
||||||
|
# - dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
SPEC:release:
|
||||||
|
stage: release
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
|
variables:
|
||||||
|
APP_NAME: MP.SPEC
|
||||||
|
SOL_NAME: MP-SPEC
|
||||||
|
NEXUS_PATH: MP-SPEC
|
||||||
|
before_script:
|
||||||
|
- *nuget-fix
|
||||||
|
- dotnet restore "$env:SOL_NAME.sln"
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
except:
|
||||||
|
- branches
|
||||||
|
needs: ["SPEC:build"]
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- publish/
|
||||||
|
script:
|
||||||
|
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "build",
|
"preLaunchTask": "build",
|
||||||
// If you have changed target frameworks, make sure to update the program path.
|
// If you have changed target frameworks, make sure to update the program path.
|
||||||
"program": "${workspaceFolder}/MP.Stats/bin/Debug/net5.0/MP.Stats.dll",
|
"program": "${workspaceFolder}/MP.Stats/bin/Debug/net6.0/MP.Stats.dll",
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}/MP.Stats",
|
"cwd": "${workspaceFolder}/MP.Stats",
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ ExecuteLog "7z x ""$SourceDir\$ZipFile"" "
|
|||||||
|
|
||||||
# step 3 : replica applicazione
|
# step 3 : replica applicazione
|
||||||
Write-Host "START copy step"
|
Write-Host "START copy step"
|
||||||
ExecuteLog "robocopy '$utilDir\publish\net5.0\' '$DestDir' /MIR /Z /LOG:'$logMirror'"
|
ExecuteLog "robocopy '$utilDir\publish\net6.0\' '$DestDir' /MIR /Z /LOG:'$logMirror'"
|
||||||
Write-Host "END copy step"
|
Write-Host "END copy step"
|
||||||
|
|
||||||
# step 4 : riavvio pool
|
# step 4 : riavvio pool
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,220 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Egw.Core
|
||||||
|
{
|
||||||
|
public class LiManObj
|
||||||
|
{
|
||||||
|
#region Public Enums
|
||||||
|
|
||||||
|
public enum StatoRichiesta
|
||||||
|
{
|
||||||
|
ND = 0,
|
||||||
|
|
||||||
|
Richiesta,
|
||||||
|
|
||||||
|
Valutazione,
|
||||||
|
|
||||||
|
Approvata,
|
||||||
|
|
||||||
|
Rifiutata
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TipoLicenza
|
||||||
|
{
|
||||||
|
ND = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Licenza LEgacy Steamware
|
||||||
|
/// </summary>
|
||||||
|
GLS,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Master Key License, che ha una data di scadenza globale ed un token = numero di utenti/token massimi associati
|
||||||
|
/// </summary>
|
||||||
|
MasterKey,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// UserKey License (licenza che consuma un token utente della licenza master) - es GPW
|
||||||
|
/// </summary>
|
||||||
|
UserKey,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiave tiupo Checksum basata su licenza masster + checksum MD5 di una serie di dati (child licenses)
|
||||||
|
/// </summary>
|
||||||
|
CheckSumKey
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Enums
|
||||||
|
|
||||||
|
#region Public Classes
|
||||||
|
|
||||||
|
public class ApplicativoDTO
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string Chiave { get; set; } = "";
|
||||||
|
public string CodApp { get; set; } = "";
|
||||||
|
public string CodInst { get; set; } = "";
|
||||||
|
public DateTime DataEnigma { get; set; } = DateTime.Today.AddYears(-1);
|
||||||
|
public string Descrizione { get; set; } = "";
|
||||||
|
public string Enigma { get; set; } = "";
|
||||||
|
public int IdxLic { get; set; } = 0;
|
||||||
|
|
||||||
|
public bool IsActive
|
||||||
|
{
|
||||||
|
get => (Scadenza.Subtract(DateTime.Today).TotalDays > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Locked { get; set; } = false;
|
||||||
|
public int NumLicenze { get; set; } = 0;
|
||||||
|
public int NumLicenzeAttive { get; set; } = 0;
|
||||||
|
public string Payload { get; set; } = "";
|
||||||
|
public DateTime Scadenza { get; set; } = DateTime.Today.AddYears(-1);
|
||||||
|
public TipoLicenza Tipo { get; set; } = TipoLicenza.ND;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AttivazioneDTO
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string Chiave { get; set; } = "";
|
||||||
|
public string CodApp { get; set; } = "";
|
||||||
|
public string CodImpiego { get; set; } = "";
|
||||||
|
public string CodInst { get; set; } = "";
|
||||||
|
public string Descrizione { get; set; } = "";
|
||||||
|
public int IdxLic { get; set; } = 0;
|
||||||
|
public int IdxSubLic { get; set; } = 0;
|
||||||
|
public TipoLicenza Tipo { get; set; } = TipoLicenza.UserKey;
|
||||||
|
public DateTime VetoUnlock { get; set; } = DateTime.Today.AddMonths(2);
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LicenseCoord
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string CodApp { get; set; } = "";
|
||||||
|
public string CodInst { get; set; } = "";
|
||||||
|
public string Enigma { get; set; } = "";
|
||||||
|
public string MasterKey { get; set; } = "";
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SupportRequest
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string CodApp { get; set; } = "";
|
||||||
|
public string CodImp { get; set; } = "";
|
||||||
|
public string CodInst { get; set; } = "";
|
||||||
|
public string ContactEmail { get; set; } = "";
|
||||||
|
public string ContactName { get; set; } = "";
|
||||||
|
public string ContactPhone { get; set; } = "";
|
||||||
|
public int idxSubLic { get; set; } = 0;
|
||||||
|
|
||||||
|
public bool IsValid
|
||||||
|
{
|
||||||
|
get => !string.IsNullOrEmpty(MasterKey) && !string.IsNullOrEmpty(ContactName) && !string.IsNullOrEmpty(ContactEmail) && !string.IsNullOrEmpty(CodInst) && !string.IsNullOrEmpty(CodApp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string MasterKey { get; set; } = "";
|
||||||
|
public string ReqBody { get; set; } = "";
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto Ticket
|
||||||
|
/// </summary>
|
||||||
|
public class TicketDTO
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice univoco della sub licenza (opzionale)
|
||||||
|
/// </summary>
|
||||||
|
public string CodImpiego { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contatto email del cliente richiedente
|
||||||
|
/// </summary>
|
||||||
|
public string ContactEmail { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contatto del cliente richiedente
|
||||||
|
/// </summary>
|
||||||
|
public string ContactName { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contatto telefonico del cliente richiedente
|
||||||
|
/// </summary>
|
||||||
|
public string ContactPhone { get; set; } = "";
|
||||||
|
|
||||||
|
public DateTime DtReq { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IDX licenza master
|
||||||
|
/// </summary>
|
||||||
|
public int IdxLic { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IDX licenza child (opzionale)
|
||||||
|
/// </summary>
|
||||||
|
public int IdxSubLic { get; set; } = 0;
|
||||||
|
|
||||||
|
public int IdxTicket { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Motivazione della richiesta
|
||||||
|
/// </summary>
|
||||||
|
public string ReqBody { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato richiesta
|
||||||
|
/// </summary>
|
||||||
|
public StatoRichiesta Status { get; set; } = StatoRichiesta.ND;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Risposta alla richiesta
|
||||||
|
/// </summary>
|
||||||
|
public string SupplAnsw { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Email del responsabile dell'azione (interno - supplier)
|
||||||
|
/// </summary>
|
||||||
|
public string SupplEmail { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cod dell'user responsabile dell'azione (interno - supplier)
|
||||||
|
/// </summary>
|
||||||
|
public string SupplUserCode { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipologia di licenza gestita
|
||||||
|
/// </summary>
|
||||||
|
public TipoLicenza Tipo { get; set; } = TipoLicenza.UserKey;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserLicenseRequest
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string MasterKey { get; set; } = "";
|
||||||
|
public Dictionary<string, string> ParamDict { get; set; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Classes
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Egw.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// utils x cifrature e Crypto
|
||||||
|
/// </summary>
|
||||||
|
public class SteamCrypto
|
||||||
|
{
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// decifra un messaggio con una password
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Message"></param>
|
||||||
|
/// <param name="Passphrase"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string DecryptString(string Message, string Passphrase)
|
||||||
|
{
|
||||||
|
string answ = Message;
|
||||||
|
byte[] Results = null;
|
||||||
|
UTF8Encoding UTF8 = new UTF8Encoding();
|
||||||
|
|
||||||
|
// Step 1. We hash the passphrase using MD5
|
||||||
|
// We use the MD5 hash generator as the result is a 128 bit byte array
|
||||||
|
// which is a valid length for the TripleDES encoder we use below
|
||||||
|
|
||||||
|
MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider();
|
||||||
|
byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
|
||||||
|
|
||||||
|
// Step 2. Create a new TripleDESCryptoServiceProvider object
|
||||||
|
TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider();
|
||||||
|
|
||||||
|
// Step 3. Setup the decoder
|
||||||
|
TDESAlgorithm.Key = TDESKey;
|
||||||
|
TDESAlgorithm.Mode = CipherMode.ECB;
|
||||||
|
TDESAlgorithm.Padding = PaddingMode.PKCS7;
|
||||||
|
|
||||||
|
// Step 4. Convert the input string to a byte[]
|
||||||
|
byte[] DataToDecrypt = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DataToDecrypt = Convert.FromBase64String(Message);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
if (DataToDecrypt != null)
|
||||||
|
{
|
||||||
|
// Step 5. Attempt to decrypt the string
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ICryptoTransform Decryptor = TDESAlgorithm.CreateDecryptor();
|
||||||
|
Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// Clear the TripleDes and Hashprovider services of any sensitive information
|
||||||
|
TDESAlgorithm.Clear();
|
||||||
|
HashProvider.Clear();
|
||||||
|
}
|
||||||
|
// Step 6. Return the decrypted string in UTF8 format
|
||||||
|
answ = UTF8.GetString(Results);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// cifra un messaggio con una password
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Message"></param>
|
||||||
|
/// <param name="Passphrase"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string EncryptString(string Message, string Passphrase)
|
||||||
|
{
|
||||||
|
byte[] Results;
|
||||||
|
UTF8Encoding UTF8 = new UTF8Encoding();
|
||||||
|
|
||||||
|
// Step 1. We hash the passphrase using MD5
|
||||||
|
// We use the MD5 hash generator as the result is a 128 bit byte array
|
||||||
|
// which is a valid length for the TripleDES encoder we use below
|
||||||
|
|
||||||
|
MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider();
|
||||||
|
byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
|
||||||
|
|
||||||
|
// Step 2. Create a new TripleDESCryptoServiceProvider object
|
||||||
|
TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider();
|
||||||
|
|
||||||
|
// Step 3. Setup the encoder
|
||||||
|
TDESAlgorithm.Key = TDESKey;
|
||||||
|
TDESAlgorithm.Mode = CipherMode.ECB;
|
||||||
|
TDESAlgorithm.Padding = PaddingMode.PKCS7;
|
||||||
|
|
||||||
|
// Step 4. Convert the input string to a byte[]
|
||||||
|
byte[] DataToEncrypt = UTF8.GetBytes(Message);
|
||||||
|
|
||||||
|
// Step 5. Attempt to encrypt the string
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ICryptoTransform Encryptor = TDESAlgorithm.CreateEncryptor();
|
||||||
|
Results = Encryptor.TransformFinalBlock(DataToEncrypt, 0, DataToEncrypt.Length);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// Clear the TripleDes and Hashprovider services of any sensitive information
|
||||||
|
TDESAlgorithm.Clear();
|
||||||
|
HashProvider.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 6. Return the encrypted string as a base64 encoded string
|
||||||
|
return Convert.ToBase64String(Results);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// genera hash di una stringa in MD5 (es x hash gravatar)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Message"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string getHashStringMD5(string Message)
|
||||||
|
{
|
||||||
|
string hash = "";
|
||||||
|
using (MD5 md5Hash = MD5.Create())
|
||||||
|
{
|
||||||
|
hash = GetMd5Hash(md5Hash, Message);
|
||||||
|
}
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Crea un hash MD5
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="md5Hash"></param>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetMd5Hash(MD5 md5Hash, string input)
|
||||||
|
{
|
||||||
|
// Convert the input string to a byte array and compute the hash.
|
||||||
|
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
|
||||||
|
|
||||||
|
// Create a new Stringbuilder to collect the bytes
|
||||||
|
// and create a string.
|
||||||
|
StringBuilder sBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
// Loop through each byte of the hashed data
|
||||||
|
// and format each one as a hexadecimal string.
|
||||||
|
for (int i = 0; i < data.Length; i++)
|
||||||
|
{
|
||||||
|
sBuilder.Append(data[i].ToString("x2"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the hexadecimal string.
|
||||||
|
return sBuilder.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verify a hash against a string.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="md5Hash"></param>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <param name="hash"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool VerifyMd5Hash(MD5 md5Hash, string input, string hash)
|
||||||
|
{
|
||||||
|
// Hash the input.
|
||||||
|
string hashOfInput = GetMd5Hash(md5Hash, input);
|
||||||
|
|
||||||
|
// Create a StringComparer an compare the hashes.
|
||||||
|
StringComparer comparer = StringComparer.OrdinalIgnoreCase;
|
||||||
|
|
||||||
|
if (0 == comparer.Compare(hashOfInput, hash))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Egw.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gestione licenze applicativi GLS (Legacy SteamWare)
|
||||||
|
/// </summary>
|
||||||
|
public class licenseManGLS
|
||||||
|
{
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce data decodificata da authKey + applicazione + cliente...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cliente">The cliente.</param>
|
||||||
|
/// <param name="applicativo">The applicativo.</param>
|
||||||
|
/// <param name="licenze">The licenze.</param>
|
||||||
|
/// <param name="authKey">The authentication key.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DateTime expiryDateByAuthKey(string cliente, string applicativo, int licenze, string authKey)
|
||||||
|
{
|
||||||
|
DateTime answ = DateTime.Today.AddYears(-10);
|
||||||
|
|
||||||
|
string plainAuthKey = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string passPhrase = string.Format("{0}|{1}", cliente.PadLeft(50, ':'), applicativo);
|
||||||
|
plainAuthKey = SteamCrypto.DecryptString(authKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
|
||||||
|
string datePart = plainAuthKey.Replace($"{cliente}#{applicativo.PadLeft(20, '-')}-", "").Replace($"%{licenze}%", "");
|
||||||
|
//string datePart = plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), "");
|
||||||
|
// se non avesse "bonificato" la parte num licenze (es non corrisponde al max) forzo il trim
|
||||||
|
if (datePart.Contains("%"))
|
||||||
|
{
|
||||||
|
datePart = datePart.Substring(0, datePart.IndexOf("%"));
|
||||||
|
}
|
||||||
|
answ = Convert.ToDateTime(datePart);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
//logger.lg.scriviLog(string.Format("Errore decodifica auth key:{0}AuthKey: {1}{0}cliente:{2}{0}applicativo:{3}{0}errore:{4}", Environment.NewLine, authKey, cliente, applicativo, exc), tipoLog.EXCEPTION);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fornisce chiave MD5 x un cliente/applicativo/expiryDate
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cliente"></param>
|
||||||
|
/// <param name="applicativo"></param>
|
||||||
|
/// <param name="licenze"></param>
|
||||||
|
/// <param name="expiryDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string getAuthKey(string cliente, string applicativo, int licenze, DateTime expiryDate)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
// algoritmo MD5 formato cliente#applicativo#expDate, via SQLdiventa
|
||||||
|
// SELECT CONVERT(VARCHAR(32), HashBytes('MD5', 'ETS#GPW#2013/12/31'), 2)
|
||||||
|
string plainAuthKey = string.Format("{0}#{1}-{2}%{3}%", cliente, applicativo.PadLeft(20, '-'), expiryDate.ToString("yyyy/MM/dd"), licenze);
|
||||||
|
string passPhrase = string.Format("{0}|{1}", cliente.PadLeft(50, ':'), applicativo);
|
||||||
|
answ = SteamCrypto.EncryptString(plainAuthKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fornisce chiave MD5 x una chiave secondaria/di checksum data dai parametri in ingresso
|
||||||
|
/// MasterKey/string[] chiavi singole child/expiryDate
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MasterKey">Chiave master da cui si parte</param>
|
||||||
|
/// <param name="Payload">Payload che contiene le chiavi SUB (child) riferite alla master in formato JSon (compresso/no indent)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string getChecksumKey(string MasterKey, string Payload)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
answ = SteamCrypto.EncryptString(Payload, MasterKey);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// numero di licenze attive per cliente/applicativo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cliente"></param>
|
||||||
|
/// <param name="applicativo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int getLicenseNum(string cliente, string applicativo)
|
||||||
|
{
|
||||||
|
// !!!FARE!!! chiamata a webservice 1/mese
|
||||||
|
int answ = 1;
|
||||||
|
// molto hard-coded e discutibile... licenze "perenni"
|
||||||
|
switch (cliente)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
answ = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
+8
-2
@@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.31229.75
|
VisualStudioVersion = 17.0.32112.339
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Land", "MP.Land\MP.Land.csproj", "{D949AB45-9B65-4594-A97E-182BC3831707}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Land", "MP.Land\MP.Land.csproj", "{D949AB45-9B65-4594-A97E-182BC3831707}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.AppAuth", "MP.AppAuth\MP.AppAuth.csproj", "{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.AppAuth", "MP.AppAuth\MP.AppAuth.csproj", "{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Egw.Core", "Egw.Core\Egw.Core.csproj", "{D3D348EF-1313-43DF-94FB-28CD38B68212}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -21,6 +23,10 @@ Global
|
|||||||
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.32126.317
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Mon", "MP.Mon\MP.Mon.csproj", "{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.32126.317
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.SPEC", "MP.SPEC\MP.SPEC.csproj", "{C777A098-6F91-45AF-A85E-0AD08CBCAC52}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.31229.75
|
VisualStudioVersion = 17.0.32126.317
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Stats", "MP.Stats\MP.Stats.csproj", "{D9901B50-E61C-400C-B62C-FA060CF72C29}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Stats", "MP.Stats\MP.Stats.csproj", "{D9901B50-E61C-400C-B62C-FA060CF72C29}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.32126.317
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Mon", "MP.Mon\MP.Mon.csproj", "{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.WASM.Mon.Server", "MP.WASM.Mon\Server\MP.WASM.Mon.Server.csproj", "{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.WASM.Mon.Client", "MP.WASM.Mon\Client\MP.WASM.Mon.Client.csproj", "{9BF7BDE7-016A-458C-8791-494FD4204301}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{9BF7BDE7-016A-458C-8791-494FD4204301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9BF7BDE7-016A-458C-8791-494FD4204301}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9BF7BDE7-016A-458C-8791-494FD4204301}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9BF7BDE7-016A-458C-8791-494FD4204301}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -3,10 +3,6 @@ using Microsoft.Extensions.Configuration;
|
|||||||
using MP.AppAuth.Models;
|
using MP.AppAuth.Models;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace MP.AppAuth
|
namespace MP.AppAuth
|
||||||
{
|
{
|
||||||
@@ -58,9 +54,10 @@ namespace MP.AppAuth
|
|||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
public virtual DbSet<AnagraficaGruppi> DbSetAnagraficaGruppi { get; set; }
|
||||||
public virtual DbSet<AnagraficaOperatori> DbSetAnagOpr { get; set; }
|
public virtual DbSet<AnagraficaOperatori> DbSetAnagOpr { get; set; }
|
||||||
|
public virtual DbSet<Gruppi2Operatori> DbSetGruppi2Oper { get; set; }
|
||||||
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
|
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
|
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
@@ -108,6 +105,37 @@ namespace MP.AppAuth
|
|||||||
.HasMaxLength(500);
|
.HasMaxLength(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<AnagraficaGruppi>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.CodGruppo);
|
||||||
|
|
||||||
|
entity.ToTable("AnagraficaGruppi");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodGruppo).HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.DescrGruppo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasDefaultValueSql("('')");
|
||||||
|
|
||||||
|
entity.Property(e => e.SelEnabled).HasComment("Indica se sia selezionabile a livello di tendina x inserimento BCode");
|
||||||
|
|
||||||
|
entity.Property(e => e.TipoGruppo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasDefaultValueSql("('REPARTO')")
|
||||||
|
.HasComment("tipo gruppo: reparto (es x gestione operatori assegnati), GRUPPO FASE (es macchien che fanno lo stesso tipo di lavoro), ...");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Gruppi2Operatori>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => new { e.MatrOpr, e.CodGruppo });
|
||||||
|
|
||||||
|
entity.ToTable("Gruppi2Operatori");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodGruppo).HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
modelBuilder.Seed();
|
modelBuilder.Seed();
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,38 @@ namespace MP.AppAuth.Controllers
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Record x Gruppi
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Models.AnagraficaGruppi> AnagGruppiFilt(string codTipo)
|
||||||
|
{
|
||||||
|
List<Models.AnagraficaGruppi> dbResult = new List<Models.AnagraficaGruppi>();
|
||||||
|
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.DbSetAnagraficaGruppi
|
||||||
|
.Where(x => x.TipoGruppo == codTipo)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Record x Gruppi
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Models.AnagraficaGruppi> AnagGruppiGetAll()
|
||||||
|
{
|
||||||
|
List<Models.AnagraficaGruppi> dbResult = new List<Models.AnagraficaGruppi>();
|
||||||
|
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.DbSetAnagraficaGruppi
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
|
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
|
||||||
{
|
{
|
||||||
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
||||||
@@ -53,6 +85,41 @@ namespace MP.AppAuth.Controllers
|
|||||||
// ritorno
|
// ritorno
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
public List<Models.AnagraficaOperatori> AnagOpByGruppoGetFilt(string codGruppo, string searchVal)
|
||||||
|
{
|
||||||
|
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
||||||
|
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(searchVal))
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.DbSetGruppi2Oper
|
||||||
|
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
|
||||||
|
.Join(
|
||||||
|
localDbCtx.DbSetAnagOpr.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal)),
|
||||||
|
gruppo => gruppo.MatrOpr,
|
||||||
|
operatore => operatore.MatrOpr,
|
||||||
|
(gruppo, operatore) => operatore
|
||||||
|
)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.DbSetGruppi2Oper
|
||||||
|
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
|
||||||
|
.Join(
|
||||||
|
localDbCtx.DbSetAnagOpr,
|
||||||
|
gruppo => gruppo.MatrOpr,
|
||||||
|
operatore => operatore.MatrOpr,
|
||||||
|
(gruppo, operatore) => operatore
|
||||||
|
)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ritorno
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
@@ -99,6 +166,7 @@ namespace MP.AppAuth.Controllers
|
|||||||
{
|
{
|
||||||
dbResult = localDbCtx
|
dbResult = localDbCtx
|
||||||
.DbSetUpdMan
|
.DbSetUpdMan
|
||||||
|
.OrderBy(x => x.Ordinal)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
@@ -114,8 +182,8 @@ namespace MP.AppAuth.Controllers
|
|||||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||||
{
|
{
|
||||||
dbResult = localDbCtx
|
dbResult = localDbCtx
|
||||||
.DbSetVocabolario
|
.DbSetVocabolario
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace MP.AppAuth.Controllers
|
||||||
|
{
|
||||||
|
public class MPController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Fields
|
||||||
|
|
||||||
|
public static AppAuth.Controllers.MPController dbController;
|
||||||
|
|
||||||
|
#endregion Public Fields
|
||||||
|
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MPController(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
Log.Info("Avviata classe MpController");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Record x AnagKeyValue
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Models.AnagKeyValueModel> AnagKeyValuesGetAll()
|
||||||
|
{
|
||||||
|
List<Models.AnagKeyValueModel> dbResult = new List<Models.AnagKeyValueModel>();
|
||||||
|
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.DbSetAnagKeyValues
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
// Clear database controller
|
||||||
|
dbController.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static IConfiguration _configuration;
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -9,18 +9,22 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="NLog" Version="4.7.11" />
|
<PackageReference Include="NLog" Version="5.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Egw.Core\Egw.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,19 +1,26 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace MP.AppAuth.Models
|
namespace MP.AppAuth.Models
|
||||||
{
|
{
|
||||||
public partial class AnagKeyValue
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
[Table("AnagKeyValue")]
|
||||||
|
public partial class AnagKeyValueModel
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
public string Descrizione { get; set; }
|
[Key]
|
||||||
public string NomeVar { get; set; }
|
public string NomeVar { get; set; }
|
||||||
public double? ValFloat { get; set; }
|
|
||||||
public int? ValInt { get; set; }
|
public int? ValInt { get; set; }
|
||||||
|
public double? ValFloat { get; set; }
|
||||||
public string ValString { get; set; }
|
public string ValString { get; set; }
|
||||||
|
public string Descrizione { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.AppAuth.Models
|
||||||
|
{
|
||||||
|
public partial class AnagraficaGruppi
|
||||||
|
{
|
||||||
|
public string CodGruppo { get; set; }
|
||||||
|
public string TipoGruppo { get; set; }
|
||||||
|
public string DescrGruppo { get; set; }
|
||||||
|
public bool SelEnabled { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.AppAuth.Models
|
||||||
|
{
|
||||||
|
public partial class Gruppi2Operatori
|
||||||
|
{
|
||||||
|
public int MatrOpr { get; set; }
|
||||||
|
public string CodGruppo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ namespace MP.AppAuth.Models
|
|||||||
public string LicenseKey { get; set; }
|
public string LicenseKey { get; set; }
|
||||||
public string LocalRepo { get; set; }
|
public string LocalRepo { get; set; }
|
||||||
public string ManifestUrl { get; set; }
|
public string ManifestUrl { get; set; }
|
||||||
|
public int Ordinal { get; set; } = 1;
|
||||||
public string PackName { get; set; }
|
public string PackName { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|||||||
@@ -1,23 +1,53 @@
|
|||||||
using System;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using MP.AppAuth.Models;
|
using MP.AppAuth.Models;
|
||||||
|
using NLog;
|
||||||
#nullable disable
|
using System;
|
||||||
|
|
||||||
namespace MP.AppAuth
|
namespace MP.AppAuth
|
||||||
{
|
{
|
||||||
public partial class MoonProContext : DbContext
|
public partial class MoonProContext : DbContext
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
private IConfiguration _configuration;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
|
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
||||||
public MoonProContext()
|
public MoonProContext()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public MoonProContext(DbContextOptions<MoonProContext> options)
|
public MoonProContext(IConfiguration configuration)
|
||||||
: base(options)
|
|
||||||
{
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// se non ci fosse... crea o migra!
|
||||||
|
Database.Migrate();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error(exc, "Exception during context initialization 01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoonProContext(DbContextOptions<MoonProContext> options) : base(options)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// se non ci fosse... crea o migra!
|
||||||
|
Database.Migrate();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error(exc, "Exception during context initialization 02");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -26,7 +56,6 @@ namespace MP.AppAuth
|
|||||||
|
|
||||||
public virtual DbSet<AnagArticoli> AnagArticolis { get; set; }
|
public virtual DbSet<AnagArticoli> AnagArticolis { get; set; }
|
||||||
public virtual DbSet<AnagClassiTempo> AnagClassiTempos { get; set; }
|
public virtual DbSet<AnagClassiTempo> AnagClassiTempos { get; set; }
|
||||||
public virtual DbSet<AnagKeyValue> AnagKeyValues { get; set; }
|
|
||||||
public virtual DbSet<AnagraficaCausaliScarto> AnagraficaCausaliScartos { get; set; }
|
public virtual DbSet<AnagraficaCausaliScarto> AnagraficaCausaliScartos { get; set; }
|
||||||
public virtual DbSet<AnagraficaFlussi> AnagraficaFlussis { get; set; }
|
public virtual DbSet<AnagraficaFlussi> AnagraficaFlussis { get; set; }
|
||||||
public virtual DbSet<AnagraficaIngressi> AnagraficaIngressis { get; set; }
|
public virtual DbSet<AnagraficaIngressi> AnagraficaIngressis { get; set; }
|
||||||
@@ -34,6 +63,7 @@ namespace MP.AppAuth
|
|||||||
public virtual DbSet<AnagraficaOperatori> AnagraficaOperatoris { get; set; }
|
public virtual DbSet<AnagraficaOperatori> AnagraficaOperatoris { get; set; }
|
||||||
public virtual DbSet<Config> Configs { get; set; }
|
public virtual DbSet<Config> Configs { get; set; }
|
||||||
public virtual DbSet<DatiMacchine> DatiMacchines { get; set; }
|
public virtual DbSet<DatiMacchine> DatiMacchines { get; set; }
|
||||||
|
public virtual DbSet<AnagKeyValueModel> DbSetAnagKeyValues { get; set; }
|
||||||
public virtual DbSet<FamigliaTipoIngressi> FamigliaTipoIngressis { get; set; }
|
public virtual DbSet<FamigliaTipoIngressi> FamigliaTipoIngressis { get; set; }
|
||||||
public virtual DbSet<FamiglieMacchine> FamiglieMacchines { get; set; }
|
public virtual DbSet<FamiglieMacchine> FamiglieMacchines { get; set; }
|
||||||
public virtual DbSet<KeepAlive> KeepAlives { get; set; }
|
public virtual DbSet<KeepAlive> KeepAlives { get; set; }
|
||||||
@@ -41,7 +71,7 @@ namespace MP.AppAuth
|
|||||||
public virtual DbSet<ListValue> ListValues { get; set; }
|
public virtual DbSet<ListValue> ListValues { get; set; }
|
||||||
public virtual DbSet<Macchine> Macchines { get; set; }
|
public virtual DbSet<Macchine> Macchines { get; set; }
|
||||||
public virtual DbSet<UpdMan> UpdMan { get; set; }
|
public virtual DbSet<UpdMan> UpdMan { get; set; }
|
||||||
public virtual DbSet<Vocabolario> Vocabolario { get; set; }
|
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
@@ -57,7 +87,15 @@ namespace MP.AppAuth
|
|||||||
{
|
{
|
||||||
if (!optionsBuilder.IsConfigured)
|
if (!optionsBuilder.IsConfigured)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseSqlServer("Data Source=SQL2016DEV;Initial Catalog=MoonPro;Trusted_Connection=True;");
|
string connString = _configuration.GetConnectionString("MP.Land");
|
||||||
|
if (!string.IsNullOrEmpty(connString))
|
||||||
|
{
|
||||||
|
optionsBuilder.UseSqlServer(connString);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +151,7 @@ namespace MP.AppAuth
|
|||||||
entity.Property(e => e.Descrizione).HasMaxLength(500);
|
entity.Property(e => e.Descrizione).HasMaxLength(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<AnagKeyValue>(entity =>
|
modelBuilder.Entity<AnagKeyValueModel>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.NomeVar);
|
entity.HasKey(e => e.NomeVar);
|
||||||
|
|
||||||
@@ -465,6 +503,8 @@ namespace MP.AppAuth
|
|||||||
.HasMaxLength(500);
|
.HasMaxLength(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OnModelCreatingPartial(modelBuilder);
|
OnModelCreatingPartial(modelBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MP.Data.Conf
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Struttura conf del file conf TAG x IOB
|
||||||
|
/// </summary>
|
||||||
|
public class IobTags
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto dizionario di configurazione x IOB
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, List<TagData>> IobSetup = new Dictionary<string, List<TagData>>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MP.Data.Conf
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Item da mostrare nei blocchi MON degli impianti come override ai dati MSE
|
||||||
|
/// </summary>
|
||||||
|
public class TagData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indice della colonna (ordine) del dato
|
||||||
|
/// </summary>
|
||||||
|
public int ColNum { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Indice della riga del dato
|
||||||
|
/// </summary>
|
||||||
|
public int RowNum { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Override CSS (es fontSmall)
|
||||||
|
/// </summary>
|
||||||
|
public string TagCss { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// Etichetta da mostrare
|
||||||
|
/// </summary>
|
||||||
|
public string TagName { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// Indicazione della chiave REDIS dove recuperare il tag indicato (già in formato string)
|
||||||
|
/// </summary>
|
||||||
|
public string TagLocation { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clone dell'oggetto
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public TagData Clone()
|
||||||
|
{
|
||||||
|
return (TagData)this.MemberwiseClone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MP.Data
|
||||||
|
{
|
||||||
|
public class Constants
|
||||||
|
{
|
||||||
|
|
||||||
|
// dati conf REDIS Cache
|
||||||
|
public static readonly string BASE_HASH = "MAPO";
|
||||||
|
|
||||||
|
// REDIS KEY Dati correnti
|
||||||
|
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
|
||||||
|
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
|
||||||
|
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
using Microsoft.Data.SqlClient;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace MP.Data.Controllers
|
||||||
|
{
|
||||||
|
public class MpMonController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MpMonController(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
Log.Info("Avviata classe MpMonController");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco tabella Articoli da filtro
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="numRecord"></param>
|
||||||
|
/// <param name="searchVal"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||||
|
{
|
||||||
|
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetStatArticoli
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||||
|
.OrderBy(x => x.CodArticolo)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco da tabella Macchine
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||||
|
{
|
||||||
|
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetConfig
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.Chiave)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco da tabella Macchine
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.Macchine> MacchineGetAll()
|
||||||
|
{
|
||||||
|
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetMacchine
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.IdxMacchina)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco da tabella MappaStatoExpl
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.MappaStatoExpl> MseGetAll(int maxAge = 2000)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.MappaStatoExpl> dbResult = new List<DatabaseModels.MappaStatoExpl>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
var maxAgeSec = new SqlParameter("@maxAgeSec", maxAge);
|
||||||
|
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetMSE
|
||||||
|
.FromSqlRaw("EXEC stp_MSE_getData @maxAgeSec", maxAgeSec)
|
||||||
|
.AsNoTracking()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Annulla modifiche su una specifica entity (cancel update)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool RollBackEntity(object item)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
|
||||||
|
{
|
||||||
|
dbCtx.Entry(item).Reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static IConfiguration _configuration;
|
||||||
|
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,618 @@
|
|||||||
|
using Microsoft.Data.SqlClient;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MP.Data.Controllers
|
||||||
|
{
|
||||||
|
public class MpSpecController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MpSpecController(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
Log.Info("Avviata classe MpSpecController");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Gruppi tipo Azienda
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagGruppi> AnagGruppiAziende()
|
||||||
|
{
|
||||||
|
return AnagGruppiGetTipo("AZIENDA");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Gruppi tipo Fasi
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagGruppi> AnagGruppiFase()
|
||||||
|
{
|
||||||
|
return AnagGruppiGetTipo("FASE");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Gruppi
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagGruppi> AnagGruppiGetAll()
|
||||||
|
{
|
||||||
|
List<DatabaseModels.AnagGruppi> dbResult = new List<DatabaseModels.AnagGruppi>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetAnagGruppi
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.CodGruppo)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gruppi x tipo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tipoGruppo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagGruppi> AnagGruppiGetTipo(string tipoGruppo)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.AnagGruppi> dbResult = new List<DatabaseModels.AnagGruppi>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetAnagGruppi
|
||||||
|
.Where(x => x.TipoGruppo == tipoGruppo)
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.CodGruppo)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco valori ammessi x Stati commessa (es Yacht Baglietto)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.ListValues> AnagStatiComm()
|
||||||
|
{
|
||||||
|
return ListValuesFilt("PODL", "StatoComm");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco valori ammessi x Tipo articoli
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.ListValues> AnagTipoArtLV()
|
||||||
|
{
|
||||||
|
return ListValuesFilt("AnagArticoli", "Tipo");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eliminazione Record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> ArticoliDeleteRecord(DatabaseModels.AnagArticoli currRec)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currVal = dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.Where(x => x.CodArticolo == currRec.CodArticolo)
|
||||||
|
.FirstOrDefault();
|
||||||
|
dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.Remove(currVal);
|
||||||
|
await dbCtx.SaveChangesAsync();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante ArticoliDeleteRecord{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco tabella Articoli da filtro
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="numRecord"></param>
|
||||||
|
/// <param name="searchVal"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||||
|
{
|
||||||
|
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||||
|
.OrderBy(x => x.CodArticolo)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco tabella Articoli da filtro
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="numRecord"></param>
|
||||||
|
/// <param name="azienda"></param>
|
||||||
|
/// <param name="searchVal"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string azienda = "*", string searchVal = "")
|
||||||
|
{
|
||||||
|
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => (x.Azienda == azienda || azienda == "*") && (x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal)))
|
||||||
|
.OrderBy(x => x.CodArticolo)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco tabella Articoli IMPIEGATI (da stored stp_ART_getUsed)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.AnagArticoli> ArticoliGetUsed()
|
||||||
|
{
|
||||||
|
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.FromSqlRaw("EXEC stp_ART_getUsed")
|
||||||
|
.AsNoTracking()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> ArticoliUpdateRecord(DatabaseModels.AnagArticoli editRec)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currRec = dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.Where(x => x.CodArticolo == editRec.CodArticolo)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
currRec.Disegno = editRec.Disegno;
|
||||||
|
currRec.DescArticolo = editRec.DescArticolo;
|
||||||
|
currRec.Tipo = editRec.Tipo;
|
||||||
|
currRec.Azienda = editRec.Azienda;
|
||||||
|
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbCtx
|
||||||
|
.DbSetArticoli
|
||||||
|
.Add(editRec);
|
||||||
|
}
|
||||||
|
await dbCtx.SaveChangesAsync();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante ArticoliUpdateRecord{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco da tabella Config
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||||
|
{
|
||||||
|
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetConfig
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.Chiave)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update record config
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool ConfigUpdate(DatabaseModels.ConfigModel updRec)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
DatabaseModels.ConfigModel dbResult = new DatabaseModels.ConfigModel();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetConfig
|
||||||
|
.Where(x => x.Chiave == updRec.Chiave)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (dbResult != null)
|
||||||
|
{
|
||||||
|
dbResult.Valore = updRec.Valore;
|
||||||
|
dbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
|
||||||
|
/// macchina (ordinato x data registrazione)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||||
|
/// <param name="DtRef">Data di riferimento (Massima) per estrazioen records</param>
|
||||||
|
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.Dossiers> DossiersGetLastFilt(string IdxMacchina, DateTime DtRef, int MaxRec)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.Dossiers> dbResult = new List<DatabaseModels.Dossiers>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetDossiers
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && x.DtRif <= DtRef)
|
||||||
|
.OrderByDescending(x => x.DtRif)
|
||||||
|
.Take(MaxRec)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool DossiersTakeParamsSnapshot(string idxMacchina, int maxSec)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||||
|
var pMaxSec = new SqlParameter("@MaxSec", maxSec);
|
||||||
|
|
||||||
|
var dbResult = dbCtx
|
||||||
|
.Database
|
||||||
|
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshot @IdxMacchina,@MaxSec", pIdxMacchina, pMaxSec);
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco valori link (x home e navMenu laterale)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.LinkMenu> ElencoLink()
|
||||||
|
{
|
||||||
|
return ListLinkFilt("SpecLink");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||||
|
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
|
||||||
|
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.FluxLog> FluxLogGetLastFilt(string IdxMacchina, string CodFlux, int MaxRec)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.FluxLog> dbResult = new List<DatabaseModels.FluxLog>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetFluxLog
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodFlux == "*" || x.CodFlux == CodFlux))
|
||||||
|
.OrderByDescending(x => x.dtEvento)
|
||||||
|
.Take(MaxRec)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DatabaseModels.LinkMenu> ListLinkFilt(string tipoLink)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.LinkMenu> dbResult = new List<DatabaseModels.LinkMenu>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetLinkMenu
|
||||||
|
.Where(x => x.TipoLink == tipoLink)
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.ordine)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco ODL filtrati x stato, articolo, KeyRich (che contiene stato)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
|
||||||
|
/// <param name="codArt">Cod articolo</param>
|
||||||
|
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.ODLModel> ListODLFilt(bool inCorso, string codArt, string keyRichPart)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.ODLModel> dbResult = new List<DatabaseModels.ODLModel>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetODL
|
||||||
|
.Where(x => ((inCorso && x.DataFine == null) || (!inCorso && x.DataFine != null)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.IdxOdl)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codArt">Cod articolo</param>
|
||||||
|
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.PODLModel> ListPODLFilt(string codArt, string keyRichPart)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.PODLModel> dbResult = new List<DatabaseModels.PODLModel>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.Where(x => (x.IdxOdl == 0) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.InsertDate)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco valori ammessi x tabella/colonna
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tabName"></param>
|
||||||
|
/// <param name="fieldName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.ListValues> ListValuesFilt(string tabName, string fieldName)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.ListValues> dbResult = new List<DatabaseModels.ListValues>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetListValues
|
||||||
|
.Where(x => x.TableName == tabName && x.FieldName == fieldName)
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.ordinal)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco da tabella Macchine
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.Macchine> MacchineGetAll()
|
||||||
|
{
|
||||||
|
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetMacchine
|
||||||
|
.AsNoTracking()
|
||||||
|
.OrderBy(x => x.IdxMacchina)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco id Macchine che abbiano dati FLuxLog
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<string> MacchineWithFlux()
|
||||||
|
{
|
||||||
|
List<string> dbResult = new List<string>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetFluxLog
|
||||||
|
.AsNoTracking()
|
||||||
|
.Select(i => i.IdxMacchina)
|
||||||
|
.Distinct()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco da tabella MappaStatoExpl
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<DatabaseModels.MappaStatoExpl> MseGetAll(int maxAge = 2000)
|
||||||
|
{
|
||||||
|
List<DatabaseModels.MappaStatoExpl> dbResult = new List<DatabaseModels.MappaStatoExpl>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
var maxAgeSec = new SqlParameter("@maxAgeSec", maxAge);
|
||||||
|
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetMSE
|
||||||
|
.FromSqlRaw("EXEC stp_MSE_getData @maxAgeSec", maxAgeSec)
|
||||||
|
.AsNoTracking()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco parametri validi x una data macchina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="IdxMacchina"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<string> ParametriGetFilt(string IdxMacchina)
|
||||||
|
{
|
||||||
|
List<string> dbResult = new List<string>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetFluxLog
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina))
|
||||||
|
.Select(i => i.CodFlux)
|
||||||
|
.Distinct()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eliminazione Record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> PODLDeleteRecord(DatabaseModels.PODLModel currRec)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currVal = dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.Where(x => x.IdxPromessa == currRec.IdxPromessa)
|
||||||
|
.FirstOrDefault();
|
||||||
|
dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.Remove(currVal);
|
||||||
|
await dbCtx.SaveChangesAsync();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante PODLDeleteRecord{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> PODLUpdateRecord(DatabaseModels.PODLModel editRec)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currRec = dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
currRec.CodGruppo = editRec.CodGruppo;
|
||||||
|
currRec.CodArticolo = editRec.CodArticolo;
|
||||||
|
currRec.IdxMacchina = editRec.IdxMacchina;
|
||||||
|
currRec.KeyBCode = editRec.KeyBCode;
|
||||||
|
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||||
|
currRec.NumPezzi = editRec.NumPezzi;
|
||||||
|
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||||
|
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.Add(editRec);
|
||||||
|
}
|
||||||
|
await dbCtx.SaveChangesAsync();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante PODLUpdateRecord{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Annulla modifiche su una specifica entity (cancel update)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool RollBackEntity(object item)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
|
||||||
|
{
|
||||||
|
dbCtx.Entry(item).Reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static IConfiguration _configuration;
|
||||||
|
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,10 @@
|
|||||||
using System;
|
using Microsoft.Data.SqlClient;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Configuration;
|
|
||||||
using NLog;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Data.SqlClient;
|
|
||||||
|
|
||||||
namespace MP.Data.Controllers
|
namespace MP.Data.Controllers
|
||||||
{
|
{
|
||||||
@@ -16,7 +13,7 @@ namespace MP.Data.Controllers
|
|||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private static IConfiguration _configuration;
|
private static IConfiguration _configuration;
|
||||||
private static MoonPro_STATSContext dbCtx;
|
|
||||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
@@ -26,7 +23,6 @@ namespace MP.Data.Controllers
|
|||||||
public MpStatsController(IConfiguration configuration)
|
public MpStatsController(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
dbCtx = new MoonPro_STATSContext(configuration);
|
|
||||||
Log.Info("Avviata classe MpStatsController");
|
Log.Info("Avviata classe MpStatsController");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,11 +37,12 @@ namespace MP.Data.Controllers
|
|||||||
public List<DatabaseModels.AzioniUL> ActionsGetAll()
|
public List<DatabaseModels.AzioniUL> ActionsGetAll()
|
||||||
{
|
{
|
||||||
List<DatabaseModels.AzioniUL> dbResult = new List<DatabaseModels.AzioniUL>();
|
List<DatabaseModels.AzioniUL> dbResult = new List<DatabaseModels.AzioniUL>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
dbResult = dbCtx
|
{
|
||||||
.DbSetAzioniUL
|
dbResult = dbCtx
|
||||||
.ToList();
|
.DbSetAzioniUL
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,17 +52,18 @@ namespace MP.Data.Controllers
|
|||||||
/// <param name="numRecord"></param>
|
/// <param name="numRecord"></param>
|
||||||
/// <param name="searchVal"></param>
|
/// <param name="searchVal"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||||
{
|
{
|
||||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
dbResult = dbCtx
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
.DbSetArticoli
|
.DbSetArticoli
|
||||||
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||||
.OrderBy(x => x.CodArticolo)
|
.OrderBy(x => x.CodArticolo)
|
||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,48 +73,42 @@ namespace MP.Data.Controllers
|
|||||||
/// <param name="numRecord"></param>
|
/// <param name="numRecord"></param>
|
||||||
/// <param name="searchVal"></param>
|
/// <param name="searchVal"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<DatabaseModels.ODL> CommesseGetSearch(int numRecord, string searchVal = "")
|
public List<DatabaseModels.StatsODL> CommesseGetSearch(int numRecord, string searchVal = "")
|
||||||
{
|
{
|
||||||
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
|
List<DatabaseModels.StatsODL> dbResult = new List<DatabaseModels.StatsODL>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
dbResult = dbCtx
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
.DbSetODL
|
.DbSetODL
|
||||||
.Where(x => x.KeyRichiesta.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
.Where(x => x.KeyRichiesta.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||||
.OrderBy(x => x.KeyRichiesta)
|
.OrderBy(x => x.KeyRichiesta)
|
||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
// Clear database context
|
|
||||||
dbCtx.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco tabella Macchine
|
/// Elenco da tabella Macchine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<DatabaseModels.Macchine> MacchineGetAll()
|
public List<DatabaseModels.Macchine> MacchineGetAll()
|
||||||
{
|
{
|
||||||
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
dbResult = dbCtx
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
.DbSetMacchine
|
.DbSetMacchine
|
||||||
.OrderBy(x => x.IdxMacchina)
|
.OrderBy(x => x.IdxMacchina)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetController()
|
|
||||||
{
|
|
||||||
dbCtx = new MoonPro_STATSContext(_configuration);
|
|
||||||
Log.Info("Effettuato reset MpStatsController");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Annulla modifiche su una specifica entity (cancel update)
|
/// Annulla modifiche su una specifica entity (cancel update)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -125,16 +117,19 @@ namespace MP.Data.Controllers
|
|||||||
public bool RollBackEntity(object item)
|
public bool RollBackEntity(object item)
|
||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
try
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
{
|
{
|
||||||
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
|
try
|
||||||
{
|
{
|
||||||
dbCtx.Entry(item).Reload();
|
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
|
||||||
|
{
|
||||||
|
dbCtx.Entry(item).Reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -148,19 +143,20 @@ namespace MP.Data.Controllers
|
|||||||
public List<DatabaseModels.ResControlli> StatControlliGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
public List<DatabaseModels.ResControlli> StatControlliGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||||
{
|
{
|
||||||
List<DatabaseModels.ResControlli> dbResult = new List<DatabaseModels.ResControlli>();
|
List<DatabaseModels.ResControlli> dbResult = new List<DatabaseModels.ResControlli>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
|
{
|
||||||
|
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||||
|
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||||
|
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||||
|
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
||||||
|
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
||||||
|
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
||||||
|
|
||||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
dbResult = dbCtx
|
||||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
.DbSetControlli
|
||||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
.FromSqlRaw("EXEC stp_UI_RC_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
||||||
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
.ToList();
|
||||||
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
}
|
||||||
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
|
||||||
|
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetControlli
|
|
||||||
.FromSqlRaw("EXEC stp_UI_RC_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,21 +175,22 @@ namespace MP.Data.Controllers
|
|||||||
public List<DatabaseModels.DdbTurni> StatDdbGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo, int FirstRecord, int NumRecord)
|
public List<DatabaseModels.DdbTurni> StatDdbGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo, int FirstRecord, int NumRecord)
|
||||||
{
|
{
|
||||||
List<DatabaseModels.DdbTurni> dbResult = new List<DatabaseModels.DdbTurni>();
|
List<DatabaseModels.DdbTurni> dbResult = new List<DatabaseModels.DdbTurni>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
|
{
|
||||||
|
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||||
|
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||||
|
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||||
|
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
||||||
|
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
||||||
|
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
||||||
|
var firstRecord = new SqlParameter("@FirstRecord", FirstRecord);
|
||||||
|
var numRecord = new SqlParameter("@NumRecord", NumRecord);
|
||||||
|
|
||||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
dbResult = dbCtx
|
||||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
.DbSetDdbTurni
|
||||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
.FromSqlRaw("EXEC stp_UI_DDBTurni_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo,@FirstRecord,@NumRecord", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo, firstRecord, numRecord)
|
||||||
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
.ToList();
|
||||||
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
}
|
||||||
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
|
||||||
var firstRecord = new SqlParameter("@FirstRecord", FirstRecord);
|
|
||||||
var numRecord = new SqlParameter("@NumRecord", NumRecord);
|
|
||||||
|
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetDdbTurni
|
|
||||||
.FromSqlRaw("EXEC stp_UI_DDBTurni_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo,@FirstRecord,@NumRecord", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo, firstRecord, numRecord)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,12 +206,15 @@ namespace MP.Data.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int StatDdbGetCount(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
public int StatDdbGetCount(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||||
{
|
{
|
||||||
var dbResult = dbCtx
|
int numResult = 0;
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
|
{
|
||||||
|
numResult = dbCtx
|
||||||
.DbSetDdbTurni
|
.DbSetDdbTurni
|
||||||
.Where(x => (x.IdxMacchina == IdxMacchina || IdxMacchina == "*") && (x.IdxOdl == IdxODL || IdxODL == -999) && (x.KeyRichiesta == KeyRichiesta || KeyRichiesta == "*") && (x.CodArticolo == CodArticolo || CodArticolo == "*") && (x.InizioPeriodo >= DataStart && x.InizioPeriodo <= DataEnd))
|
.Where(x => (x.IdxMacchina == IdxMacchina || IdxMacchina == "*") && (x.IdxOdl == IdxODL || IdxODL == -999) && (x.KeyRichiesta == KeyRichiesta || KeyRichiesta == "*") && (x.CodArticolo == CodArticolo || CodArticolo == "*") && (x.InizioPeriodo >= DataStart && x.InizioPeriodo <= DataEnd))
|
||||||
.Count();
|
.Count();
|
||||||
|
}
|
||||||
return dbResult;
|
return numResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -223,22 +223,23 @@ namespace MP.Data.Controllers
|
|||||||
/// <param name="numRecord"></param>
|
/// <param name="numRecord"></param>
|
||||||
/// <param name="searchVal"></param>
|
/// <param name="searchVal"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<DatabaseModels.ODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
public List<DatabaseModels.StatsODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||||
{
|
{
|
||||||
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
|
List<DatabaseModels.StatsODL> dbResult = new List<DatabaseModels.StatsODL>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
{
|
||||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||||
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||||
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
||||||
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
||||||
|
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetODL
|
|
||||||
.FromSqlRaw("EXEC stp_UI_Odl_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetODL
|
||||||
|
.FromSqlRaw("EXEC stp_UI_Odl_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,19 +254,20 @@ namespace MP.Data.Controllers
|
|||||||
public List<DatabaseModels.ResScarti> StatScartiGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
public List<DatabaseModels.ResScarti> StatScartiGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||||
{
|
{
|
||||||
List<DatabaseModels.ResScarti> dbResult = new List<DatabaseModels.ResScarti>();
|
List<DatabaseModels.ResScarti> dbResult = new List<DatabaseModels.ResScarti>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
|
{
|
||||||
|
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||||
|
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||||
|
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||||
|
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
||||||
|
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
||||||
|
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
||||||
|
|
||||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
dbResult = dbCtx
|
||||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
.DbSetScarti
|
||||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
.FromSqlRaw("EXEC stp_UI_RS_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
||||||
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
.ToList();
|
||||||
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
}
|
||||||
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
|
||||||
|
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetScarti
|
|
||||||
.FromSqlRaw("EXEC stp_UI_RS_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,19 +282,20 @@ namespace MP.Data.Controllers
|
|||||||
public List<DatabaseModels.TurniOee> StatTurniOeeGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
public List<DatabaseModels.TurniOee> StatTurniOeeGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||||
{
|
{
|
||||||
List<DatabaseModels.TurniOee> dbResult = new List<DatabaseModels.TurniOee>();
|
List<DatabaseModels.TurniOee> dbResult = new List<DatabaseModels.TurniOee>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
|
{
|
||||||
|
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||||
|
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||||
|
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||||
|
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
||||||
|
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
||||||
|
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
||||||
|
|
||||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
dbResult = dbCtx
|
||||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
.DbSetTurniOee
|
||||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
.FromSqlRaw("EXEC stp_UI_TurniOee_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
||||||
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
.ToList();
|
||||||
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
}
|
||||||
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
|
||||||
|
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetTurniOee
|
|
||||||
.FromSqlRaw("EXEC stp_UI_TurniOee_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,26 +308,20 @@ namespace MP.Data.Controllers
|
|||||||
public List<DatabaseModels.UserActionLog> StatUserLogGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
public List<DatabaseModels.UserActionLog> StatUserLogGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||||
{
|
{
|
||||||
List<DatabaseModels.UserActionLog> dbResult = new List<DatabaseModels.UserActionLog>();
|
List<DatabaseModels.UserActionLog> dbResult = new List<DatabaseModels.UserActionLog>();
|
||||||
|
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||||
|
{
|
||||||
|
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||||
|
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||||
|
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||||
|
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
||||||
|
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
||||||
|
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
||||||
|
|
||||||
//dbResult = dbCtx
|
dbResult = dbCtx
|
||||||
// .DbSetUserLog
|
.DbSetUserLog
|
||||||
// .Where(x => x.Valore.Contains(searchVal) || x.Cognome.Contains(searchVal) || x.CodArticolo.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
.FromSqlRaw("EXEC stp_UI_UL_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
||||||
// .OrderByDescending(x => x.DataOraRif)
|
.ToList();
|
||||||
// .Take(numRecord)
|
}
|
||||||
// .ToList();
|
|
||||||
|
|
||||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
|
||||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
|
||||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
|
||||||
var idxODL = new SqlParameter("@IdxODL", IdxODL);
|
|
||||||
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
|
|
||||||
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
|
|
||||||
|
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetUserLog
|
|
||||||
.FromSqlRaw("EXEC stp_UI_UL_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using MP.Data.DatabaseModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MP.Data.DTO
|
||||||
|
{
|
||||||
|
public class DossierFluxLogDTO
|
||||||
|
{
|
||||||
|
public List<FluxLog> ODL { get; set; } = new List<FluxLog>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace MP.Data.DatabaseModels
|
namespace MP.Data.DatabaseModels
|
||||||
{
|
{
|
||||||
|
[Table("AnagArticoli")]
|
||||||
public partial class AnagArticoli
|
public partial class AnagArticoli
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
@@ -13,6 +15,7 @@ namespace MP.Data.DatabaseModels
|
|||||||
public string DescArticolo { get; set; }
|
public string DescArticolo { get; set; }
|
||||||
public string Disegno { get; set; }
|
public string Disegno { get; set; }
|
||||||
public string Tipo { get; set; }
|
public string Tipo { get; set; }
|
||||||
|
public string Azienda { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("AnagraficaGruppi")]
|
||||||
|
public partial class AnagGruppi
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
//[Key, DatabaseGenerated(DatabaseGeneratedOption.None), MaxLength(50)]
|
||||||
|
public string CodGruppo { get; set; }
|
||||||
|
|
||||||
|
//[MaxLength(50)]
|
||||||
|
public string TipoGruppo { get; set; }
|
||||||
|
|
||||||
|
//[MaxLength(250)]
|
||||||
|
public string DescrGruppo { get; set; }
|
||||||
|
|
||||||
|
public bool SelEnabled { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("Config")]
|
||||||
|
public partial class ConfigModel
|
||||||
|
{
|
||||||
|
public string Chiave { get; set; }
|
||||||
|
public string Valore { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Valore di default/riferimento per la variabile
|
||||||
|
/// </summary>
|
||||||
|
public string ValoreStd { get; set; }
|
||||||
|
public string Note { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("Dossiers")]
|
||||||
|
public partial class Dossiers
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string IdxMacchina { get; set; }
|
||||||
|
|
||||||
|
public DateTime DtRif { get; set; }
|
||||||
|
|
||||||
|
public int IdxODL { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string DataType { get; set; }
|
||||||
|
|
||||||
|
public string Valore { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("FluxLog")]
|
||||||
|
public partial class FluxLog
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string IdxMacchina { get; set; }
|
||||||
|
|
||||||
|
public DateTime dtEvento { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodFlux { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(250)]
|
||||||
|
public string Valore { get; set; }
|
||||||
|
|
||||||
|
public int Cnt { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("LinkMenuJQM")]
|
||||||
|
public partial class LinkMenu
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int idxLink { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string TipoLink { get; set; } = "";
|
||||||
|
|
||||||
|
public int ordine { get; set; } = 0;
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string Testo { get; set; } = "";
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string NavigateUrl { get; set; } = "";
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string icona { get; set; } = "";
|
||||||
|
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("ListValues")]
|
||||||
|
public partial class ListValues
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string TableName { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string FieldName { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string value { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string label { get; set; }
|
||||||
|
|
||||||
|
public int ordinal { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
public partial class MappaStatoExpl
|
||||||
|
{
|
||||||
|
public int RowNum { get; set; }
|
||||||
|
public DateTime? LastUpdate { get; set; }
|
||||||
|
public string IdxMacchina { get; set; }
|
||||||
|
public string CodMacchina { get; set; }
|
||||||
|
public string Nome { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
|
public int? IdxOdl { get; set; }
|
||||||
|
public string CodArticolo { get; set; }
|
||||||
|
public string Disegno { get; set; }
|
||||||
|
public int? NumPezzi { get; set; }
|
||||||
|
public decimal? TCAssegnato { get; set; }
|
||||||
|
public DateTime? DataInizioOdl { get; set; }
|
||||||
|
public string Semaforo { get; set; }
|
||||||
|
public int? IdxStato { get; set; }
|
||||||
|
public string DescrizioneStato { get; set; }
|
||||||
|
public double? Durata { get; set; }
|
||||||
|
public int? PezziProd { get; set; }
|
||||||
|
public int? PezziConf { get; set; }
|
||||||
|
public decimal? TempoOn { get; set; }
|
||||||
|
public decimal? TempoAuto { get; set; }
|
||||||
|
public decimal? TempoRun { get; set; }
|
||||||
|
public decimal? TCMedio { get; set; }
|
||||||
|
public decimal? TCLav { get; set; }
|
||||||
|
public decimal? TCEff { get; set; }
|
||||||
|
public decimal? TCMedioRt { get; set; }
|
||||||
|
public decimal? TCLavRT { get; set; }
|
||||||
|
public decimal? TCEffRT { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("ODL")]
|
||||||
|
public partial class ODLModel
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int IdxOdl { get; set; }
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodArticolo { get; set; } = "";
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string IdxMacchina { get; set; }
|
||||||
|
public int NumPezzi { get; set; }
|
||||||
|
public decimal Tcassegnato { get; set; }
|
||||||
|
public DateTime? DataInizio { get; set; }
|
||||||
|
public DateTime? DataFine { get; set; }
|
||||||
|
[MaxLength(2500)]
|
||||||
|
public string Note { get; set; } = "";
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string KeyRichiesta { get; set; }
|
||||||
|
public int PzPallet { get; set; } = 1;
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodCli { get; set; } = "";
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
[Table("PromesseODL")]
|
||||||
|
public partial class PODLModel
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int IdxPromessa { get; set; }
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string KeyRichiesta { get; set; }
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string KeyBCode { get; set; }
|
||||||
|
public bool Attivabile { get; set; } = false;
|
||||||
|
public int IdxOdl { get; set; } = 0;
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodArticolo { get; set; } = "";
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodGruppo { get; set; } = "";
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string IdxMacchina { get; set; }
|
||||||
|
public int NumPezzi { get; set; } = 1;
|
||||||
|
public decimal Tcassegnato { get; set; } = 1;
|
||||||
|
public DateTime? DueDate { get; set; }
|
||||||
|
public int Priorita { get; set; } = 1;
|
||||||
|
public int PzPallet { get; set; } = 1;
|
||||||
|
[MaxLength(2500)]
|
||||||
|
public string Note { get; set; } = "";
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodCli { get; set; } = "";
|
||||||
|
public DateTime InsertDate { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public string CodFase
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "*";
|
||||||
|
var allData = KeyRichiesta.Split('_');
|
||||||
|
if (allData.Length > 0)
|
||||||
|
{
|
||||||
|
answ = allData[0];
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data.DatabaseModels
|
||||||
|
{
|
||||||
|
public partial class StatsAnagArticoli
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string CodArticolo { get; set; }
|
||||||
|
public string DescArticolo { get; set; }
|
||||||
|
public string Disegno { get; set; }
|
||||||
|
public string Tipo { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace MP.Data.DatabaseModels
|
namespace MP.Data.DatabaseModels
|
||||||
{
|
{
|
||||||
public partial class ODL
|
public partial class StatsODL
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyName>MP.Data</AssemblyName>
|
<AssemblyName>MP.Data</AssemblyName>
|
||||||
<RootNamespace>MP.Data</RootNamespace>
|
<RootNamespace>MP.Data</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyName>MP.Data</AssemblyName>
|
<AssemblyName>MP.Data</AssemblyName>
|
||||||
<RootNamespace>MP.Data</RootNamespace>
|
<RootNamespace>MP.Data</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -12,14 +12,14 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.7" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.7" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.7">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.7" />
|
||||||
<PackageReference Include="NLog" Version="4.7.11" />
|
<PackageReference Include="NLog" Version="5.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
using NLog;
|
||||||
|
using StackExchange.Redis;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MP.Data
|
||||||
|
{
|
||||||
|
public class MessagePipe
|
||||||
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private bool enableLog = false;
|
||||||
|
private IConnectionMultiplexer redis;
|
||||||
|
private IDatabase? redisDb;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Protected Fields
|
||||||
|
|
||||||
|
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Protected Fields
|
||||||
|
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false)
|
||||||
|
{
|
||||||
|
_channel = channelName;
|
||||||
|
redis = redisConn;
|
||||||
|
redisDb = redis.GetDatabase();
|
||||||
|
this.enableLog = enableLog;
|
||||||
|
// aggiungo sottoscrittore
|
||||||
|
setupSubscriber();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Events
|
||||||
|
|
||||||
|
public event EventHandler EA_NewMessage = delegate { };
|
||||||
|
|
||||||
|
#endregion Public Events
|
||||||
|
|
||||||
|
#region Private Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Canale associato al gestore pipeline messaggi
|
||||||
|
/// </summary>
|
||||||
|
private string _channel { get; set; } = "";
|
||||||
|
|
||||||
|
#endregion Private Properties
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
private void setupSubscriber()
|
||||||
|
{
|
||||||
|
ISubscriber sub = redis.GetSubscriber();
|
||||||
|
//Subscribe to the channel named messages
|
||||||
|
sub.Subscribe(_channel, (channel, message) =>
|
||||||
|
{
|
||||||
|
Log.Trace($"ch {channel} | {message}");
|
||||||
|
// messaggio
|
||||||
|
PubSubEventArgs mea = new PubSubEventArgs(message);
|
||||||
|
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||||
|
if (EA_NewMessage != null)
|
||||||
|
{
|
||||||
|
EA_NewMessage(this, mea);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Log.Info($"Subscribed {_channel}");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
public bool saveAndSendMessage(string memKey, string message)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// invio notifica tramite il canale richiesto
|
||||||
|
answ = sendMessage(message);
|
||||||
|
if (redisDb != null)
|
||||||
|
{
|
||||||
|
redisDb.StringSetAsync(memKey, message);
|
||||||
|
if (enableLog)
|
||||||
|
{
|
||||||
|
Log.Info($"Redis Cache Key: {memKey}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio messaggio sul canale
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newMess"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool sendMessage(string newMess)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
ISubscriber sub = redis.GetSubscriber();
|
||||||
|
sub.Publish(_channel, newMess);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio messaggio sul canale + salvataggio in cache REDIS
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="memKey">Chiave REDIS x salvare valore</param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PubSubEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public PubSubEventArgs(string messaggio)
|
||||||
|
{
|
||||||
|
this.newMessage = messaggio;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string newMessage { get; set; } = "";
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using MP.Data.DatabaseModels;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MP.Data
|
||||||
|
{
|
||||||
|
public partial class MoonProContext : DbContext
|
||||||
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
private IConfiguration _configuration;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MoonProContext(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoonProContext(DbContextOptions<MoonProContext> options) : base(options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public virtual DbSet<StatsAnagArticoli> DbSetStatArticoli { get; set; }
|
||||||
|
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
|
||||||
|
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
|
||||||
|
public virtual DbSet<MappaStatoExpl> DbSetMSE { get; set; }
|
||||||
|
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
|
||||||
|
public virtual DbSet<AnagGruppi> DbSetAnagGruppi { get; set; }
|
||||||
|
public virtual DbSet<ListValues> DbSetListValues { get; set; }
|
||||||
|
public virtual DbSet<LinkMenu> DbSetLinkMenu { get; set; }
|
||||||
|
public virtual DbSet<ODLModel> DbSetODL { get; set; }
|
||||||
|
public virtual DbSet<PODLModel> DbSetPODL { get; set; }
|
||||||
|
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
|
||||||
|
public virtual DbSet<Dossiers> DbSetDossiers { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
|
|
||||||
|
#region Protected Methods
|
||||||
|
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
{
|
||||||
|
if (!optionsBuilder.IsConfigured)
|
||||||
|
{
|
||||||
|
string connString = _configuration.GetConnectionString("Mp.Data");
|
||||||
|
if (string.IsNullOrEmpty(connString))
|
||||||
|
{
|
||||||
|
connString = _configuration.GetConnectionString("Mp.Mon");
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(connString))
|
||||||
|
{
|
||||||
|
connString = _configuration.GetConnectionString("Mp.STATS");
|
||||||
|
}
|
||||||
|
|
||||||
|
optionsBuilder.UseSqlServer(connString);
|
||||||
|
//optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
||||||
|
|
||||||
|
modelBuilder.Entity<StatsAnagArticoli>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.CodArticolo);
|
||||||
|
|
||||||
|
entity.ToView("v_UI_AnagArticoli");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodArticolo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.DescArticolo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250);
|
||||||
|
|
||||||
|
entity.Property(e => e.Disegno)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.Tipo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
});
|
||||||
|
modelBuilder.Entity<AnagArticoli>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.CodArticolo);
|
||||||
|
|
||||||
|
entity.ToView("AnagArticoli");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodArticolo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.DescArticolo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250);
|
||||||
|
|
||||||
|
entity.Property(e => e.Disegno)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.Tipo)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.Azienda)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Macchine>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdxMacchina);
|
||||||
|
|
||||||
|
entity.ToView("Macchine");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodMacchina).HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.Descrizione).HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.IdxMacchina)
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.Nome).HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<MappaStatoExpl>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.RowNum);
|
||||||
|
|
||||||
|
entity.ToTable("MappaStatoExpl");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodArticolo)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasDefaultValueSql("('-')");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodMacchina).HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.DataInizioOdl)
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("DataInizioODL");
|
||||||
|
|
||||||
|
entity.Property(e => e.DescrizioneStato)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasDefaultValueSql("('n.d.')");
|
||||||
|
|
||||||
|
entity.Property(e => e.Disegno)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasDefaultValueSql("('')");
|
||||||
|
|
||||||
|
entity.Property(e => e.Durata)
|
||||||
|
.HasColumnName("durata")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.IdxOdl).HasColumnName("idxODL");
|
||||||
|
|
||||||
|
entity.Property(e => e.IdxStato)
|
||||||
|
.HasColumnName("idxStato")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.LastUpdate)
|
||||||
|
.HasColumnType("datetime")
|
||||||
|
.HasColumnName("lastUpdate");
|
||||||
|
|
||||||
|
entity.Property(e => e.Nome).HasMaxLength(50);
|
||||||
|
|
||||||
|
entity.Property(e => e.PezziConf).HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.PezziProd).HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.Semaforo)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasDefaultValueSql("('')");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCAssegnato)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCAssegnato")
|
||||||
|
.HasDefaultValueSql("((1))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCEff)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCEff")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCEffRT)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCEffRT")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCLav)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCLav")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCLavRT)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCLavRT")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCMedio)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCMedio")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TCMedioRt)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasColumnName("TCMedioRT")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TempoAuto)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TempoOn)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.TempoRun)
|
||||||
|
.HasColumnType("decimal(18, 8)")
|
||||||
|
.HasDefaultValueSql("((0))");
|
||||||
|
|
||||||
|
entity.Property(e => e.Url)
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnName("url");
|
||||||
|
});
|
||||||
|
modelBuilder.Entity<ConfigModel>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Chiave);
|
||||||
|
|
||||||
|
entity.ToTable("Config");
|
||||||
|
|
||||||
|
entity.Property(e => e.Chiave)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnName("chiave");
|
||||||
|
|
||||||
|
entity.Property(e => e.Note).HasColumnName("note");
|
||||||
|
|
||||||
|
entity.Property(e => e.Valore).HasColumnName("valore");
|
||||||
|
|
||||||
|
entity.Property(e => e.ValoreStd)
|
||||||
|
.HasColumnName("valoreStd")
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
});
|
||||||
|
modelBuilder.Entity<AnagGruppi>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.CodGruppo);
|
||||||
|
|
||||||
|
entity.Property(e => e.CodGruppo)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnName("CodGruppo");
|
||||||
|
|
||||||
|
entity.Property(e => e.TipoGruppo)
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnName("TipoGruppo");
|
||||||
|
|
||||||
|
entity.Property(e => e.DescrGruppo)
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnName("DescrGruppo");
|
||||||
|
|
||||||
|
entity.Property(e => e.SelEnabled)
|
||||||
|
.HasColumnName("SelEnabled");
|
||||||
|
|
||||||
|
});
|
||||||
|
modelBuilder.Entity<ListValues>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => new { e.TableName, e.FieldName, e.value });
|
||||||
|
|
||||||
|
});
|
||||||
|
modelBuilder.Entity<FluxLog>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => new { e.IdxMacchina, e.dtEvento, e.CodFlux });
|
||||||
|
|
||||||
|
});
|
||||||
|
modelBuilder.Entity<Dossiers>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => new { e.IdxMacchina, e.DtRif });
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,18 +34,14 @@ namespace MP.Data
|
|||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
|
public virtual DbSet<StatsAnagArticoli> DbSetArticoli { get; set; }
|
||||||
public virtual DbSet<AzioniUL> DbSetAzioniUL { get; set; }
|
public virtual DbSet<AzioniUL> DbSetAzioniUL { get; set; }
|
||||||
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
|
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
|
||||||
public virtual DbSet<DdbTurni> DbSetDdbTurni { get; set; }
|
public virtual DbSet<DdbTurni> DbSetDdbTurni { get; set; }
|
||||||
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
|
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
|
||||||
public virtual DbSet<ODL> DbSetODL { get; set; }
|
public virtual DbSet<StatsODL> DbSetODL { get; set; }
|
||||||
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
|
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
|
||||||
public virtual DbSet<TurniOee> DbSetTurniOee { get; set; }
|
public virtual DbSet<TurniOee> DbSetTurniOee { get; set; }
|
||||||
#if false
|
|
||||||
public virtual DbSet<TurniPareto> DbSetTurniPareto { get; set; }
|
|
||||||
public virtual DbSet<TurniParetoOdl> DbSetTurniParetoOdl { get; set; }
|
|
||||||
#endif
|
|
||||||
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
|
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
@@ -102,7 +98,7 @@ namespace MP.Data
|
|||||||
.HasMaxLength(5);
|
.HasMaxLength(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<AnagArticoli>(entity =>
|
modelBuilder.Entity<StatsAnagArticoli>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasNoKey();
|
entity.HasNoKey();
|
||||||
|
|
||||||
@@ -142,6 +138,7 @@ namespace MP.Data
|
|||||||
entity.Property(e => e.Nome).HasMaxLength(50);
|
entity.Property(e => e.Nome).HasMaxLength(50);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<DdbTurni>(entity =>
|
modelBuilder.Entity<DdbTurni>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasNoKey();
|
entity.HasNoKey();
|
||||||
@@ -328,7 +325,7 @@ namespace MP.Data
|
|||||||
.HasMaxLength(250);
|
.HasMaxLength(250);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<ODL>(entity =>
|
modelBuilder.Entity<StatsODL>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.IdxOdl)
|
entity.HasKey(e => e.IdxOdl)
|
||||||
.HasName("PK_ODL_1");
|
.HasName("PK_ODL_1");
|
||||||
|
|||||||
@@ -39,6 +39,30 @@ namespace MP.Data
|
|||||||
await Task.Run(() => File.WriteAllLines(path, lines.ToArray()));
|
await Task.Run(() => File.WriteAllLines(path, lines.ToArray()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string redKeyArtUsed
|
||||||
|
{
|
||||||
|
get => RedHash($"CACHE:CheckArtUsed");
|
||||||
|
}
|
||||||
|
public static string redKeyTabCheckArt
|
||||||
|
{
|
||||||
|
get => RedHash($"CACHE:TabCheckArt");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da funzionalita' DbConfig) + keyName richiesto...
|
||||||
|
/// </summary>
|
||||||
|
public static string RedHash(string keyName)
|
||||||
|
{
|
||||||
|
string answ = keyName;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ =$"MP:Data:{keyName}";
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace MP.Data
|
||||||
|
{
|
||||||
|
public class chartJsData
|
||||||
|
{
|
||||||
|
#region Public Classes
|
||||||
|
|
||||||
|
public class chartJsTSerie
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public DateTime x { get; set; }
|
||||||
|
public double y { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class chartJsXY
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public double x { get; set; }
|
||||||
|
public double y { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Classes
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -234,6 +234,18 @@ namespace MP.FileData.Controllers
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool FileExport(FileModel currFile)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
|
||||||
|
{
|
||||||
|
// sovrascrivo il file su disco
|
||||||
|
File.WriteAllBytes(currFile.Path, currFile.FileContent);
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
public FileModel FileGetByKey(int FileId)
|
public FileModel FileGetByKey(int FileId)
|
||||||
{
|
{
|
||||||
FileModel thisFile = null;
|
FileModel thisFile = null;
|
||||||
@@ -450,10 +462,10 @@ namespace MP.FileData.Controllers
|
|||||||
|
|
||||||
// rileggo file...
|
// rileggo file...
|
||||||
var newFileInfo = new FileInfo(currFile.Path);
|
var newFileInfo = new FileInfo(currFile.Path);
|
||||||
|
currFile.LastMod = newFileInfo.LastWriteTime;
|
||||||
|
|
||||||
// aggiorno stato del file a unchanged e data mod ad ora...
|
// aggiorno stato del file a unchanged e data mod ad ora...
|
||||||
currFile.DiskStatus = FileState.Ok;
|
currFile.DiskStatus = FileState.Ok;
|
||||||
currFile.LastMod = newFileInfo.LastWriteTime;
|
|
||||||
localDbCtx.Entry(currFile).State = EntityState.Modified;
|
localDbCtx.Entry(currFile).State = EntityState.Modified;
|
||||||
|
|
||||||
// salvo DB
|
// salvo DB
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace MP.FileData
|
|||||||
{
|
{
|
||||||
if (!optionsBuilder.IsConfigured)
|
if (!optionsBuilder.IsConfigured)
|
||||||
{
|
{
|
||||||
string connString = _configuration.GetConnectionString("MP.Land");
|
string connString = _configuration.GetConnectionString("MP.Prog");
|
||||||
if (!string.IsNullOrEmpty(connString))
|
if (!string.IsNullOrEmpty(connString))
|
||||||
{
|
{
|
||||||
optionsBuilder.UseSqlServer(connString);
|
optionsBuilder.UseSqlServer(connString);
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
Gruppi
|
||||||
|
</div>
|
||||||
|
<div class="col-6 text-right">
|
||||||
|
<select @bind="@groupName" class="form-control form-control-sm">
|
||||||
|
<option value="">--- Tutti ---</option>
|
||||||
|
@if (ListGroups != null)
|
||||||
|
{
|
||||||
|
@foreach (var item in ListGroups)
|
||||||
|
{
|
||||||
|
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Net.Http;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Components.Forms;
|
||||||
|
using Microsoft.AspNetCore.Components.Routing;
|
||||||
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
|
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||||
|
using Microsoft.JSInterop;
|
||||||
|
using MP.Land;
|
||||||
|
using MP.Land.Shared;
|
||||||
|
using MP.AppAuth.Models;
|
||||||
|
using MP.Land.Data;
|
||||||
|
|
||||||
|
namespace MP.Land.Components
|
||||||
|
{
|
||||||
|
public partial class CmpGroupFilt
|
||||||
|
{
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected MessageService AppMService { get; set; }
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected AppAuthService DataService { get; set; }
|
||||||
|
|
||||||
|
private List<AnagraficaGruppi> ListGroups;
|
||||||
|
private string groupName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return AppMService.CodGruppo;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AppMService.CodGruppo = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await ReloadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ReloadData()
|
||||||
|
{
|
||||||
|
// carico i gruppi
|
||||||
|
ListGroups = await DataService.AnagGruppiFilt("REPARTO");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
{
|
{
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<select @bind="@PageSize" class="form-control form-control-sm">
|
<select @bind="@PageSize" class="form-control form-control-sm">
|
||||||
<option value="2">2</option>
|
<option value="3">3</option>
|
||||||
<option value="4">4</option>
|
<option value="6">6</option>
|
||||||
<option value="10">10</option>
|
<option value="9">9</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace MP.Land.Components
|
|||||||
|
|
||||||
protected int _numPage { get; set; } = 1;
|
protected int _numPage { get; set; } = 1;
|
||||||
|
|
||||||
protected int _numRecord { get; set; } = 4;
|
protected int _numRecord { get; set; } = 6;
|
||||||
|
|
||||||
protected int percLoading { get; set; } = 0;
|
protected int percLoading { get; set; } = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -3,77 +3,122 @@
|
|||||||
@using Microsoft.Extensions.Configuration
|
@using Microsoft.Extensions.Configuration
|
||||||
|
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
|
||||||
@inject AppAuthService DataService
|
@inject AppAuthService DataService
|
||||||
|
@inject LicenseService LicServ
|
||||||
|
|
||||||
<div class="card">
|
@if (authOk()) // disegno box cliccabile e programma attivato
|
||||||
<div class="card-header">
|
{
|
||||||
@if (authOk())
|
<div class="card">
|
||||||
{
|
<div class="card-header">
|
||||||
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="text-info" title="Apri">
|
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="btn btn-outline-info btn-block" title="Apri">
|
||||||
<h3 class="mb-0">@CurrItem.AppName <i class="fas fa-link"></i></h3>
|
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
||||||
|
<h3 class="mb-0">@CurrItem.AppName </h3>
|
||||||
</a>
|
</a>
|
||||||
}
|
</div>
|
||||||
else
|
<div class="card-body">
|
||||||
{
|
<div class="row text-dark">
|
||||||
<del>
|
<div class="col-4 text-left">
|
||||||
<h3 class="mb-0 text-secondary">@CurrItem.AppName</h3>
|
|
||||||
</del>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="card-body pb-0">
|
|
||||||
<div class="row">
|
|
||||||
@if (authOk())
|
|
||||||
{
|
|
||||||
<div class="col-3 text-info">
|
|
||||||
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
|
||||||
</div>
|
|
||||||
<div class="col-9" style="overflow-y: auto; height: 8em;">
|
|
||||||
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
||||||
<ul style="mb-0">
|
<div class="border-bottom"></div>
|
||||||
@(traduci($"{CurrItem.AppName}-LIST"))
|
<div class="badge badge-success"> Licenza Attiva</div>
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
<div class="col-8 border-left text-left">
|
||||||
else
|
@(traduci($"{CurrItem.AppName}-LIST"))
|
||||||
{
|
|
||||||
<div class="col-3 text-secondary">
|
|
||||||
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9 text-secondary" style="overflow-y: auto; height: 8em;">
|
</div>
|
||||||
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
|
||||||
<ul style="mb-0">
|
|
||||||
@(traduci($"{CurrItem.AppName}-LIST"))
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer text-danger py-1">
|
}
|
||||||
@if (authOk())
|
else // disegno box non cliccabile e licenza mancante
|
||||||
{
|
{
|
||||||
<span class="text-success">Programma Attivato</span>
|
<div class="card">
|
||||||
}
|
<div class="card-header">
|
||||||
else
|
<button class="btn btn-outline-secondary btn-block" title="Manca Licenza" disabled>
|
||||||
{
|
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
|
||||||
<span class="text-danger">Licenza non attivata!</span>
|
<h3 class="mb-0">@CurrItem.AppName</h3>
|
||||||
}
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row text-muted">
|
||||||
|
<div class="col-4 text-left">
|
||||||
|
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
|
||||||
|
<div class="border-bottom"></div>
|
||||||
|
<div class="badge badge-danger"> Licenza Mancante</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 border-left text-left">
|
||||||
|
@(traduci($"{CurrItem.AppName}-LIST"))
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public UpdMan CurrItem { get; set; }
|
public UpdMan CurrItem { get; set; }
|
||||||
|
|
||||||
|
protected List<AnagKeyValueModel> AKVList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return LicServ.AKVList;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
LicServ.AKVList = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
// check init AKV
|
||||||
|
if (AKVList == null || AKVList.Count == 0)
|
||||||
|
{
|
||||||
|
AKVList = await DataService.AnagKeyValList();
|
||||||
|
LicServ.InitAkv();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected string getAKVString(string nomeVar)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (AKVList != null)
|
||||||
|
{
|
||||||
|
var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
answ = currRec.ValString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected AnagKeyValueModel getAKVRec(string nomeVar)
|
||||||
|
{
|
||||||
|
AnagKeyValueModel answ = new AnagKeyValueModel();
|
||||||
|
if (AKVList != null)
|
||||||
|
{
|
||||||
|
answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
protected bool authOk()
|
protected bool authOk()
|
||||||
{
|
{
|
||||||
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
|
bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey);
|
||||||
return answ;
|
if (allOk)
|
||||||
|
{
|
||||||
|
allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey);
|
||||||
|
}
|
||||||
|
return allOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string fullUrl(string relUrl)
|
protected string fullUrl(string relUrl)
|
||||||
{
|
{
|
||||||
return $"{Configuration["BaseUrl"]}{relUrl}";
|
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MarkupString traduci(string lemma)
|
protected MarkupString traduci(string lemma)
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<div class="row text-center">
|
@using MP.Land.Data
|
||||||
|
@inject LicenseService LicServ
|
||||||
|
|
||||||
|
<div class="row text-center">
|
||||||
@if (authOk())
|
@if (authOk())
|
||||||
{
|
{
|
||||||
<div class="col-12 mt-2">
|
<div class="col-12 mt-2">
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ namespace MP.Land.Components
|
|||||||
protected bool authOk()
|
protected bool authOk()
|
||||||
{
|
{
|
||||||
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
|
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
|
||||||
|
if (answ)
|
||||||
|
{
|
||||||
|
answ = LicServ.checkLicenseActive(CurrItem.LicenseKey);
|
||||||
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,12 +81,12 @@ namespace MP.Land.Components
|
|||||||
|
|
||||||
protected string fullUrl(string relUrl)
|
protected string fullUrl(string relUrl)
|
||||||
{
|
{
|
||||||
return $"{Configuration["BaseUrl"]}{relUrl}";
|
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string localPath(string localRepo)
|
protected string localPath(string localRepo)
|
||||||
{
|
{
|
||||||
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
return @$"{Configuration["ServerConf:downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
|
|||||||
@@ -2,34 +2,25 @@
|
|||||||
|
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
|
|
||||||
<div class="card">
|
<div class="card text-center my-2">
|
||||||
<div class="card-header py-2 font-weight-bold">
|
<div class="card-header list-group-item-info">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 col-md-4">
|
<div class="col-6 text-left">
|
||||||
<div class="badge badge-pill badge-dark px-2 py-1">
|
<b>@Environment</b>
|
||||||
<div class="px-1">
|
|
||||||
<span>EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 text-right">
|
<div class="col-6 text-right">
|
||||||
<h4 class="py-0 mb-0">@Environment</h4>
|
<b>Matr. @CurrItem.MatrOpr</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body px-3">
|
<div class="card-body text-center">
|
||||||
<div class="row">
|
<div class="img-fluid" id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
|
||||||
<div class="col-6 col-md-4">
|
</div>
|
||||||
<div id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
|
<div class="card-footer text-center">
|
||||||
</div>
|
<b>@CurrItem.Cognome @CurrItem.Nome</b>
|
||||||
<div class="col-6 col-md-8">
|
|
||||||
<h2><b>@CurrItem.Cognome</b> @CurrItem.Nome</h2>
|
|
||||||
matr: @CurrItem.MatrOpr
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@*<div class="card-footer text-muted py-1">
|
@*<div class="card-footer text-muted py-1">
|
||||||
Card login MAPO-TAB
|
Card login MAPO-TAB
|
||||||
</div>*@
|
</div>*@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -40,7 +31,7 @@
|
|||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
if (!firstRender)
|
if (firstRender)
|
||||||
{
|
{
|
||||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
|
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
|
||||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
|
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace MP.Land.Data
|
|||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
public static AppAuth.Controllers.AppAuthController dbController;
|
public static AppAuth.Controllers.AppAuthController dbController;
|
||||||
|
public static AppAuth.Controllers.MPController MpDbController;
|
||||||
|
|
||||||
#endregion Public Fields
|
#endregion Public Fields
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ namespace MP.Land.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dbController = new AppAuth.Controllers.AppAuthController(configuration);
|
dbController = new AppAuth.Controllers.AppAuthController(configuration);
|
||||||
|
MpDbController = new AppAuth.Controllers.MPController(configuration);
|
||||||
_logger.LogInformation("DbController OK");
|
_logger.LogInformation("DbController OK");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,6 +129,46 @@ namespace MP.Land.Data
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
public async Task<List<AppAuth.Models.AnagraficaGruppi>> AnagGruppiAll()
|
||||||
|
{
|
||||||
|
List<AppAuth.Models.AnagraficaGruppi> dbResult = new List<AppAuth.Models.AnagraficaGruppi>();
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
dbResult = dbController.AnagGruppiGetAll();
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Trace($"Effettuata lettura da DB per AnagGruppiAll: {ts.TotalMilliseconds} ms");
|
||||||
|
return await Task.FromResult(dbResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<AppAuth.Models.AnagraficaGruppi>> AnagGruppiFilt(string codTipo)
|
||||||
|
{
|
||||||
|
List<AppAuth.Models.AnagraficaGruppi> dbResult = new List<AppAuth.Models.AnagraficaGruppi>();
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
dbResult = dbController.AnagGruppiFilt(codTipo);
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Trace($"Effettuata lettura da DB per AnagGruppiFilt: {ts.TotalMilliseconds} ms");
|
||||||
|
return await Task.FromResult(dbResult);
|
||||||
|
}
|
||||||
|
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperByGroupList(string codGruppo, string searchVal)
|
||||||
|
{
|
||||||
|
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
var rawData = dbController
|
||||||
|
.AnagOpByGruppoGetFilt(codGruppo, searchVal);
|
||||||
|
dbResult = rawData
|
||||||
|
.GroupBy(user => user.MatrOpr)
|
||||||
|
.Select(grp => grp.First())
|
||||||
|
.ToList();
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Trace($"Effettuata lettura da DB per AnagOperByGroupList: {ts.TotalMilliseconds} ms");
|
||||||
|
return await Task.FromResult(dbResult);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList(string searchVal)
|
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList(string searchVal)
|
||||||
{
|
{
|
||||||
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
||||||
@@ -143,6 +185,7 @@ namespace MP.Land.Data
|
|||||||
{
|
{
|
||||||
// Clear database controller
|
// Clear database controller
|
||||||
dbController.Dispose();
|
dbController.Dispose();
|
||||||
|
MpDbController.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Traduci(string lemma, string lingua = "IT")
|
public string Traduci(string lemma, string lingua = "IT")
|
||||||
@@ -170,6 +213,24 @@ namespace MP.Land.Data
|
|||||||
return await Task.FromResult(dbResult);
|
return await Task.FromResult(dbResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<AppAuth.Models.AnagKeyValueModel>> AnagKeyValList()
|
||||||
|
{
|
||||||
|
List<AppAuth.Models.AnagKeyValueModel> dbResult = new List<AppAuth.Models.AnagKeyValueModel>();
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
dbResult = MpDbController.AnagKeyValuesGetAll();
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Trace($"Effettuata lettura da DB per AnagKeyValList: {ts.TotalMilliseconds} ms");
|
||||||
|
return await Task.FromResult(dbResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task ResetCache()
|
||||||
|
{
|
||||||
|
string cacheKey = ":MP:VOCAB";
|
||||||
|
await distributedCache.RemoveAsync(cacheKey);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,498 @@
|
|||||||
|
using Egw.Core;
|
||||||
|
using Microsoft.Extensions.Caching.Distributed;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using MP.AppAuth.Models;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using RestSharp;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace MP.Land.Data
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Servizi e dati condivisi a livello applicazione
|
||||||
|
/// </summary>
|
||||||
|
public class LicenseService
|
||||||
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static IConfiguration? _configuration;
|
||||||
|
private static ILogger<LicenseService>? _logger;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// URL dell'API x chiamate gestione licenze
|
||||||
|
/// </summary>
|
||||||
|
private static string apiUrl = "https://liman.egalware.com/ELM.API/";
|
||||||
|
//private static string apiUrl = "https://localhost:44351/";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiave redis x info della licenza
|
||||||
|
/// </summary>
|
||||||
|
private static string rkeyAppInfo = "LongCache:AppInfo";
|
||||||
|
|
||||||
|
private readonly IDistributedCache distributedCache;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco obj in cache
|
||||||
|
/// </summary>
|
||||||
|
private List<string> cachedDataList = new List<string>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fattorte conversione cache sliding --> 1 h
|
||||||
|
/// </summary>
|
||||||
|
private int cacheFact = 12;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Durata assoluta massima della cache IN SECONDI
|
||||||
|
/// </summary>
|
||||||
|
private int chAbsExp = 60 * 5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Durata della cache IN SECONDI in modalità inattiva (non acceduta) prima di venire rimossa
|
||||||
|
/// NON estende oltre il tempo massimo di validità della cache (chAbsExp)
|
||||||
|
/// </summary>
|
||||||
|
private int chSliExp = 60 * 1;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Protected Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiave redis x attivazioni della licenza
|
||||||
|
/// </summary>
|
||||||
|
protected const string rKeyAttByLic = "LongCache:AttByLic";
|
||||||
|
|
||||||
|
#endregion Protected Fields
|
||||||
|
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Init classe
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="configuration"></param>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
/// <param name="distributedCache"></param>
|
||||||
|
public LicenseService(IConfiguration configuration, ILogger<LicenseService> logger, IDistributedCache distributedCache)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_configuration = configuration;
|
||||||
|
this.distributedCache = distributedCache;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Events
|
||||||
|
|
||||||
|
public event Action EA_InfoUpdated = null!;
|
||||||
|
|
||||||
|
#endregion Public Events
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public List<LiManObj.AttivazioneDTO> ActivList { get; set; } = new List<LiManObj.AttivazioneDTO>();
|
||||||
|
|
||||||
|
public List<AnagKeyValueModel> AKVList { get; set; } = new List<AnagKeyValueModel>();
|
||||||
|
|
||||||
|
public string Applicazione { get; set; } = "";
|
||||||
|
|
||||||
|
public bool HasActivData
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
bool answ = ValidData;
|
||||||
|
// se ok controllo che ci siano attivazioni
|
||||||
|
if (answ)
|
||||||
|
{
|
||||||
|
// provo classe locale...
|
||||||
|
answ = ActivList != null && ActivList.Count > 0;
|
||||||
|
// se non le avessi carico!
|
||||||
|
if (!answ)
|
||||||
|
{
|
||||||
|
var pUpd = Task.Run(async () =>
|
||||||
|
{
|
||||||
|
ActivList = await ActivListCache();
|
||||||
|
});
|
||||||
|
pUpd.Wait();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime infoExpiry { get; set; } = DateTime.Today.AddDays(1);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice cliente/installazione
|
||||||
|
/// </summary>
|
||||||
|
public string Installazione { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Master key licenza principale
|
||||||
|
/// </summary>
|
||||||
|
public string MasterKey { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Numero licenze da DB
|
||||||
|
/// </summary>
|
||||||
|
public int NumLicDb { get; set; } = -1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Numero licenze da auth remota
|
||||||
|
/// </summary>
|
||||||
|
public int NumLicRemote { get; set; } = -1;
|
||||||
|
|
||||||
|
public bool ValidData
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// controllo valori string base
|
||||||
|
bool checkData = !string.IsNullOrEmpty(Installazione) && !string.IsNullOrEmpty(Applicazione) && !string.IsNullOrEmpty(MasterKey) && ActivList != null && ActivList.Count > 0;
|
||||||
|
return checkData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opzioni cache con moltiplicatore durata risp durata base (1/5 minuti)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="multFact"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private DistributedCacheEntryOptions cacheOpt(int multFact)
|
||||||
|
{
|
||||||
|
var numSecAbsExp = chAbsExp * multFact;
|
||||||
|
var numSecSliExp = chSliExp * multFact;
|
||||||
|
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddSeconds(numSecAbsExp)).SetSlidingExpiration(TimeSpan.FromSeconds(numSecSliExp));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco attivazioni attuali
|
||||||
|
/// </summary>
|
||||||
|
private async Task<List<LiManObj.AttivazioneDTO>?> OnlineActivationList()
|
||||||
|
{
|
||||||
|
List<LiManObj.AttivazioneDTO>? answ = new List<LiManObj.AttivazioneDTO>();
|
||||||
|
// cerco online
|
||||||
|
RestClient client = new RestClient(apiUrl);
|
||||||
|
//client.Authenticator = new HttpBasicAuthenticator("username", "password");
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(MasterKey);
|
||||||
|
var request = new RestRequest($"api/attivazioni/?chiave={MKeyEnc}", Method.Get);
|
||||||
|
var response = await client.GetAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
// salvo in redis contenuto serializzato
|
||||||
|
string rawData = $"{response.Content}";
|
||||||
|
answ = JsonConvert.DeserializeObject<List<LiManObj.AttivazioneDTO>?>(rawData);
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupera info licenza da remoto
|
||||||
|
/// </summary>
|
||||||
|
private async Task<List<LiManObj.ApplicativoDTO>> OnlineAppInfo()
|
||||||
|
{
|
||||||
|
List<LiManObj.ApplicativoDTO> answ = new List<LiManObj.ApplicativoDTO>();
|
||||||
|
// cerco online
|
||||||
|
RestClient client = new RestClient(apiUrl);
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(MasterKey);
|
||||||
|
//string mKey = System.Net.WebUtility.UrlEncode(MasterKey);
|
||||||
|
string reqUrl = $"api/licenza/{Installazione}?CodApp={Applicazione}&Chiave={MKeyEnc}";
|
||||||
|
var request = new RestRequest(reqUrl, Method.Get);
|
||||||
|
var response = await client.GetAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
// verifico risposta
|
||||||
|
string rawData = $"{response.Content}";
|
||||||
|
answ = JsonConvert.DeserializeObject<List<LiManObj.ApplicativoDTO>?>(rawData);
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReportUpdated()
|
||||||
|
{
|
||||||
|
if (EA_InfoUpdated != null)
|
||||||
|
{
|
||||||
|
EA_InfoUpdated?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
|
|
||||||
|
#region Protected Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cerca di recuperare valore INT da elenco AKV
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="varReq">Chiave AKV richiesta</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected int getAVKInt(string varReq)
|
||||||
|
{
|
||||||
|
int answ = -9999;
|
||||||
|
if (AKVList != null && AKVList.Count > 0)
|
||||||
|
{
|
||||||
|
var currRec = AKVList.Where(x => x.NomeVar == varReq).FirstOrDefault();
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
answ = currRec.ValInt ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cerca di recuperare valore string da elenco AKV
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="varReq">Chiave AKV richiesta</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected string getAVKStr(string varReq)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (AKVList != null && AKVList.Count > 0)
|
||||||
|
{
|
||||||
|
var currRec = AKVList.Where(x => x.NomeVar == varReq).FirstOrDefault();
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
answ = $"{currRec.ValString}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero chiave da redis
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rKey"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected async Task<string> getRSV(string rKey)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
var redisDataList = await distributedCache.GetAsync(rKey);
|
||||||
|
if (redisDataList != null)
|
||||||
|
{
|
||||||
|
answ = Encoding.UTF8.GetString(redisDataList);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Salvataggio chiave in redis
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rKey"></param>
|
||||||
|
/// <param name="rVal"></param>
|
||||||
|
/// <param name="cacheMult"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected async Task<bool> setRSV(string rKey, string rVal, int cacheMult)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
var redisDataList = Encoding.UTF8.GetBytes(rVal);
|
||||||
|
await distributedCache.SetAsync(rKey, redisDataList, cacheOpt(cacheMult));
|
||||||
|
fatto = true;
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Salvataggio chiave in redis
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rKey"></param>
|
||||||
|
/// <param name="rValInt"></param>
|
||||||
|
/// <param name="cacheMult"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected async Task<bool> setRSV(string rKey, int rValInt, int cacheMult)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
var redisDataList = Encoding.UTF8.GetBytes($"{rValInt}");
|
||||||
|
await distributedCache.SetAsync(rKey, redisDataList, cacheOpt(cacheMult));
|
||||||
|
fatto = true;
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Registra in cache chiave se non fosse già in elenco
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newKey"></param>
|
||||||
|
protected void trackCache(string newKey)
|
||||||
|
{
|
||||||
|
if (!cachedDataList.Contains(newKey))
|
||||||
|
{
|
||||||
|
cachedDataList.Add(newKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Methods
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
public async Task<List<LiManObj.AttivazioneDTO>> ActivListCache()
|
||||||
|
{
|
||||||
|
List<LiManObj.AttivazioneDTO> dbResult = new List<LiManObj.AttivazioneDTO>();
|
||||||
|
string cacheKey = $"{rKeyAttByLic}:{MasterKey}";
|
||||||
|
trackCache(cacheKey);
|
||||||
|
string rawData = await getRSV(cacheKey);
|
||||||
|
if (!string.IsNullOrEmpty(rawData))
|
||||||
|
{
|
||||||
|
var cacheRes = JsonConvert.DeserializeObject<List<LiManObj.AttivazioneDTO>?>(rawData);
|
||||||
|
if (cacheRes != null)
|
||||||
|
{
|
||||||
|
dbResult = cacheRes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return await Task.FromResult(dbResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica attivazione licenza
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="authKey"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool checkLicenseActive(string authKey)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
//cerco anche nelle info AKV
|
||||||
|
if (AKVList != null)
|
||||||
|
{
|
||||||
|
var recLic = AKVList.Where(x => x.ValString == authKey).FirstOrDefault();
|
||||||
|
int numLic = 0;
|
||||||
|
//cerco in record
|
||||||
|
if (recLic != null)
|
||||||
|
{
|
||||||
|
numLic = (int)recLic.ValInt;
|
||||||
|
// verifico scadenza licenza!
|
||||||
|
DateTime scadenza = licenseManGLS.expiryDateByAuthKey(Installazione, recLic.NomeVar, numLic, authKey);
|
||||||
|
answ = scadenza > DateTime.Today;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogInformation($"Record non trovato per {authKey}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato server gestione licenze
|
||||||
|
/// </summary>
|
||||||
|
public async Task<string> checkLimanServer()
|
||||||
|
{
|
||||||
|
string answ = "ND";
|
||||||
|
// cerco online
|
||||||
|
RestClient client = new RestClient(apiUrl);
|
||||||
|
var request = new RestRequest($"api/health", Method.Get);
|
||||||
|
var response = await client.GetAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
// verifico risposta
|
||||||
|
answ = response.Content.Replace("\"", "");
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Init della classe con variabili di base da Redis/DB
|
||||||
|
/// </summary>
|
||||||
|
public bool InitAkv()
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
Applicazione = "MAPO";
|
||||||
|
Installazione = getAVKStr("Installazione");
|
||||||
|
MasterKey = getAVKStr(Applicazione);
|
||||||
|
NumLicDb = getAVKInt(Applicazione);
|
||||||
|
fatto = !string.IsNullOrEmpty($"{Installazione}{MasterKey}");
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<LiManObj.ApplicativoDTO>> LicAppCache()
|
||||||
|
{
|
||||||
|
List<LiManObj.ApplicativoDTO> dbResult = new List<LiManObj.ApplicativoDTO>();
|
||||||
|
string cacheKey = $"{rkeyAppInfo}:{MasterKey}";
|
||||||
|
trackCache(cacheKey);
|
||||||
|
string rawData = await getRSV(cacheKey);
|
||||||
|
if (!string.IsNullOrEmpty(rawData))
|
||||||
|
{
|
||||||
|
var cacheRes = JsonConvert.DeserializeObject<List<LiManObj.ApplicativoDTO>?>(rawData);
|
||||||
|
if (cacheRes != null)
|
||||||
|
{
|
||||||
|
dbResult = cacheRes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return await Task.FromResult(dbResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Init della classe con variabili di base da Redis/DB
|
||||||
|
/// </summary>
|
||||||
|
public async Task<bool> RefreshLicense()
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
// scadenza info a 15 gg...
|
||||||
|
int numDays = 15;
|
||||||
|
|
||||||
|
// dati applicativo
|
||||||
|
var appData = await OnlineAppInfo();
|
||||||
|
if (appData != null)
|
||||||
|
{
|
||||||
|
if (appData.Count > 0)
|
||||||
|
{
|
||||||
|
fatto = await setAppInfo(appData, numDays);
|
||||||
|
// salvo info licenza...
|
||||||
|
NumLicRemote = appData[0].NumLicenze;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// dati attivazioni
|
||||||
|
var onlineAct = await OnlineActivationList();
|
||||||
|
if (onlineAct != null)
|
||||||
|
{
|
||||||
|
if (onlineAct.Count > 0)
|
||||||
|
{
|
||||||
|
infoExpiry = DateTime.Now.AddDays(numDays);
|
||||||
|
ActivList = onlineAct;
|
||||||
|
fatto = await setActivList(onlineAct, numDays);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Task.Delay(1);
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> setActivList(List<LiManObj.AttivazioneDTO> newActList, int numDays)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
string cacheKey = $"{rKeyAttByLic}:{MasterKey}";
|
||||||
|
var rawData = JsonConvert.SerializeObject(newActList);
|
||||||
|
await setRSV(cacheKey, rawData, numDays * cacheFact * 24);
|
||||||
|
fatto = true;
|
||||||
|
if (EA_InfoUpdated != null)
|
||||||
|
{
|
||||||
|
EA_InfoUpdated?.Invoke();
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> setAppInfo(List<LiManObj.ApplicativoDTO> newAppInfo, int numDays)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
string cacheKey = $"{rkeyAppInfo}:{MasterKey}";
|
||||||
|
var rawData = JsonConvert.SerializeObject(newAppInfo);
|
||||||
|
await setRSV(cacheKey, rawData, numDays * cacheFact * 24);
|
||||||
|
fatto = true;
|
||||||
|
if (EA_InfoUpdated != null)
|
||||||
|
{
|
||||||
|
EA_InfoUpdated?.Invoke();
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -106,6 +106,21 @@ namespace MP.Land.Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected string _groupName { get; set; } = "";
|
||||||
|
public string CodGruppo
|
||||||
|
{
|
||||||
|
get => _groupName;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_groupName != value)
|
||||||
|
{
|
||||||
|
_groupName = value;
|
||||||
|
ReportFilter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace MP.Land.Data
|
|||||||
public bool OnlyMod { get; set; } = false;
|
public bool OnlyMod { get; set; } = false;
|
||||||
public bool OnlyNoTag { get; set; } = false;
|
public bool OnlyNoTag { get; set; } = false;
|
||||||
public int PageNum { get; set; } = 1;
|
public int PageNum { get; set; } = 1;
|
||||||
public int PageSize { get; set; } = 4;
|
public int PageSize { get; set; } = 6;
|
||||||
public string SearchVal { get; set; } = "";
|
public string SearchVal { get; set; } = "";
|
||||||
public string Tag { get; set; } = "";
|
public string Tag { get; set; } = "";
|
||||||
|
|
||||||
|
|||||||
+16
-6
@@ -1,9 +1,9 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<RootNamespace>MP.Land</RootNamespace>
|
<RootNamespace>MP.Land</RootNamespace>
|
||||||
<Version>1.1.2109.2118</Version>
|
<Version>6.15.2209.1212</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -25,6 +25,15 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS03.pubxml" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Properties\PublishProfiles\FolderProfile.pubxml.user" />
|
||||||
|
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
|
||||||
|
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
|
||||||
|
<None Include="Properties\PublishProfiles\IISProfile.pubxml.user" />
|
||||||
|
<None Include="Properties\PublishProfiles\IIS03.pubxml.user" />
|
||||||
<None Include="wwwroot\lib\index.svg" />
|
<None Include="wwwroot\lib\index.svg" />
|
||||||
<None Include="wwwroot\lib\jquery.min.js" />
|
<None Include="wwwroot\lib\jquery.min.js" />
|
||||||
<None Include="wwwroot\lib\LICENSE" />
|
<None Include="wwwroot\lib\LICENSE" />
|
||||||
@@ -36,14 +45,15 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
||||||
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
|
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
|
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
|
||||||
|
<PackageReference Include="RestSharp" Version="107.1.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
+59
-15
@@ -2,9 +2,10 @@
|
|||||||
@using MP.Land.Data
|
@using MP.Land.Data
|
||||||
|
|
||||||
@inject MessageService AppMService
|
@inject MessageService AppMService
|
||||||
|
@inject LicenseService LicServ
|
||||||
|
|
||||||
<div class="row mx-2">
|
<div class="row mx-2">
|
||||||
<div class="col-12 col-lg-8 offset-lg-2">
|
<div class="col-12 col-lg-10 offset-lg-1">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header text-center">
|
<div class="card-header text-center">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -28,28 +29,71 @@
|
|||||||
<img src="img/LogoMapoFull.png" class="img-fluid" />
|
<img src="img/LogoMapoFull.png" class="img-fluid" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3"></div>
|
<div class="col-lg-3"></div>
|
||||||
<div class="col-12">
|
<div class="col-6">
|
||||||
<h4 class="card-title">@Messaggio</h4>
|
<h4 class="card-title">@Messaggio</h4>
|
||||||
|
<br />
|
||||||
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
|
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
|
||||||
|
<hr />
|
||||||
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot" target="_blank">visita il link</a> sul nostro sito.</p>
|
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot" target="_blank">visita il link</a> sul nostro sito.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-6 text-right">
|
||||||
|
<div runat="server" id="divCheck" class="@mainCss">
|
||||||
|
<h4>Info installazione</h4>
|
||||||
|
<hr />
|
||||||
|
<div class="d-flex justify-content-between @remSrvCss">
|
||||||
|
<div class="px-2">
|
||||||
|
<i class="fa fa-server" aria-hidden="true"></i> Remote Server:
|
||||||
|
</div>
|
||||||
|
<div class="px-2">
|
||||||
|
<b>@ServerStatus</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<div class="px-2">
|
||||||
|
<i class="fa fa-certificate" aria-hidden="true"></i> Cliente:
|
||||||
|
</div>
|
||||||
|
<div class="px-2">
|
||||||
|
<b>@Installazione</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<div class="px-2">
|
||||||
|
<i class="fa fa-desktop" aria-hidden="true"></i> App:
|
||||||
|
</div>
|
||||||
|
<div class="px-2">
|
||||||
|
<b>@Applicazione</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between @licenseCss">
|
||||||
|
<div class="px-2">
|
||||||
|
<i class="fa fa-users" aria-hidden="true"></i> Licenze:
|
||||||
|
</div>
|
||||||
|
<div class="px-2">
|
||||||
|
<b title="# Licenze locali / # Licenze Remote">@Licenze</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between @expDateCss">
|
||||||
|
<div class="px-2">
|
||||||
|
<i class="far fa-calendar-check" aria-hidden="true"></i> Scadenza:
|
||||||
|
</div>
|
||||||
|
<div class="px-2">
|
||||||
|
<b>@($"{Scadenza:yyyy/MM/dd}")</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between @licenseCss">
|
||||||
|
<div class="px-2">
|
||||||
|
<i class="fa fa-key" aria-hidden="true"></i> Key
|
||||||
|
</div>
|
||||||
|
<div class="px-2">
|
||||||
|
<span Font-Size="0.6em" class="small">@MastKey</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
protected string Titolo = "";
|
|
||||||
protected string Messaggio = "";
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
Titolo = "MES | SCADA | IOT";
|
|
||||||
Messaggio = "Soluzione integrata per la gestione della produzione";
|
|
||||||
AppMService.ShowSearch = false;
|
|
||||||
AppMService.PageName = "About";
|
|
||||||
AppMService.PageIcon = "fas fa-info-circle pr-2";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System.Net.Http;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Components.Forms;
|
||||||
|
using Microsoft.AspNetCore.Components.Routing;
|
||||||
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
|
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||||
|
using Microsoft.JSInterop;
|
||||||
|
using MP.Land;
|
||||||
|
using MP.Land.Shared;
|
||||||
|
using MP.Land.Data;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
|
namespace MP.Land.Pages
|
||||||
|
{
|
||||||
|
public partial class About
|
||||||
|
{
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
private string Titolo = "";
|
||||||
|
private string Messaggio = "";
|
||||||
|
|
||||||
|
private string ServerStatus = "SrvState";
|
||||||
|
private string Installazione = "Inst";
|
||||||
|
private string Applicazione = "App";
|
||||||
|
private string Licenze = "#";
|
||||||
|
private DateTime Scadenza = DateTime.Today;
|
||||||
|
private string MastKey = "########################";
|
||||||
|
|
||||||
|
private string mainCss = "alert alert-info";
|
||||||
|
private string remSrvCss = "bg-warning text-secondary";
|
||||||
|
private string expDateCss = "bg-warning text-secondary";
|
||||||
|
private string licenseCss = "bg-warning text-secondary";
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
updatePageHead();
|
||||||
|
|
||||||
|
await reloadLicenseData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task reloadLicenseData()
|
||||||
|
{
|
||||||
|
int cDelay = 5;
|
||||||
|
// recupero dati
|
||||||
|
await Task.Delay(cDelay);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LicServ.InitAkv();
|
||||||
|
// verifico stati
|
||||||
|
ServerStatus = await LicServ.checkLimanServer();
|
||||||
|
Installazione = LicServ.Installazione;
|
||||||
|
Applicazione = LicServ.Applicazione;
|
||||||
|
MastKey = LicServ.MasterKey;
|
||||||
|
await Task.Delay(cDelay);
|
||||||
|
var fatto = await LicServ.RefreshLicense();
|
||||||
|
await Task.Delay(cDelay);
|
||||||
|
Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}";
|
||||||
|
licenseCss = "";
|
||||||
|
}
|
||||||
|
catch(Exception exc)
|
||||||
|
{
|
||||||
|
licenseCss = "bg-dark text-warning";
|
||||||
|
Log.Error($"Eccezione in reloadLicenseData:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
bool okRemoteSrv = ServerStatus == "OK";
|
||||||
|
bool okScadenza = LicServ.checkLicenseActive(LicServ.MasterKey);
|
||||||
|
bool okNumLic = (LicServ.NumLicDb <= LicServ.NumLicRemote);
|
||||||
|
|
||||||
|
// aggiornamento css secondo status colore da check
|
||||||
|
mainCss = okNumLic ? "alert alert-success shadowBox" : "alert alert-warning shadowBox";
|
||||||
|
expDateCss = okScadenza ? "" : "bg-danger text-warning";
|
||||||
|
remSrvCss = okRemoteSrv ? "" : "bg-danger text-warning";
|
||||||
|
await Task.Delay(cDelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePageHead()
|
||||||
|
{
|
||||||
|
Titolo = "MES | SCADA | IOT";
|
||||||
|
Messaggio = "Soluzione integrata per la gestione della produzione";
|
||||||
|
AppMService.ShowSearch = false;
|
||||||
|
AppMService.PageName = "About";
|
||||||
|
AppMService.PageIcon = "fas fa-info-circle pr-2";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
@foreach (var item in ListRecords)
|
@foreach (var item in ListRecords)
|
||||||
{
|
{
|
||||||
<div class="col-4 mb-2">
|
<div class="col-12 col-sm-6 col-xl-4 my-1">
|
||||||
<HomeLink CurrItem="@item"></HomeLink>
|
<HomeLink CurrItem="@item"></HomeLink>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@page "/RefreshData"
|
||||||
|
|
||||||
|
@using MP.Land.Components
|
||||||
|
@using MP.Land.Data
|
||||||
|
|
||||||
|
@inject AppAuthService DataService
|
||||||
|
@inject LicenseService LicServ
|
||||||
|
@inject NavigationManager NavManager
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<LoadingData></LoadingData>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@code {
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await Task.Delay(100);
|
||||||
|
LicServ.AKVList = new List<AppAuth.Models.AnagKeyValueModel>();
|
||||||
|
await Task.Delay(100);
|
||||||
|
await DataService.ResetCache();
|
||||||
|
await Task.Delay(100);
|
||||||
|
|
||||||
|
// redireziono
|
||||||
|
NavManager.NavigateTo("");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,11 +3,12 @@
|
|||||||
@using MP.Land.Data
|
@using MP.Land.Data
|
||||||
@using Microsoft.Extensions.Configuration
|
@using Microsoft.Extensions.Configuration
|
||||||
|
|
||||||
|
@inject AppAuthService DataService
|
||||||
@inject MessageService AppMService
|
@inject MessageService AppMService
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
|
||||||
<div class="row mx-2">
|
<div class="row mx-2">
|
||||||
<div class="col-12 col-lg-8 offset-lg-2">
|
<div class="col-12 col-lg-10 offset-lg-1">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header text-center">
|
<div class="card-header text-center">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -126,6 +127,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card-footer py-1">
|
||||||
|
<span>Chiave licenza: <b>@masterLic</b></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -135,6 +139,26 @@
|
|||||||
protected string Titolo = "MAPO System Info";
|
protected string Titolo = "MAPO System Info";
|
||||||
protected string Messaggio = "HW & SW details";
|
protected string Messaggio = "HW & SW details";
|
||||||
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
|
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
|
||||||
|
|
||||||
|
protected string masterLic = "";
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await ReloadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async Task ReloadData()
|
||||||
|
{
|
||||||
|
var akvList = await DataService.AnagKeyValList();
|
||||||
|
var licRecord = akvList
|
||||||
|
.Where(x => x.NomeVar == "MAPO")
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (licRecord != null)
|
||||||
|
{
|
||||||
|
masterLic = licRecord.ValString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected string DbNameExample
|
protected string DbNameExample
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -156,6 +180,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//string connStr = memLayer.ML.confReadString("DbConfConnectionString");
|
|
||||||
//currHwSwInfo = currHwSwInfo;
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
@using MP.Land.Data
|
@using MP.Land.Data
|
||||||
@using MP.Land.Components
|
@using MP.Land.Components
|
||||||
|
@inject LicenseService LicServ
|
||||||
|
|
||||||
<div class="alert alert-secondary">
|
<div class="alert alert-secondary">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
@foreach (var item in ListRecords)
|
@foreach (var item in ListRecords)
|
||||||
{
|
{
|
||||||
<div class="col-4 mb-2">
|
<div class="col-12 col-sm-6 col-xl-4 my-1">
|
||||||
<SingleDownload CurrItem="@item"></SingleDownload>
|
<SingleDownload CurrItem="@item"></SingleDownload>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,11 +85,23 @@ namespace MP.Land.Pages
|
|||||||
percLoading = 0;
|
percLoading = 0;
|
||||||
TotalMb = 0;
|
TotalMb = 0;
|
||||||
numDone = 0;
|
numDone = 0;
|
||||||
numTot = ListRecords.Count;
|
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
// ciclo su tutti
|
// ciclo su tutti quelli con licenza valida...
|
||||||
foreach (var item in ListRecords)
|
List<AppAuth.Models.UpdMan> rawList = ListRecords
|
||||||
|
.Where(x => !string.IsNullOrEmpty(x.LicenseKey)).ToList();
|
||||||
|
List<AppAuth.Models.UpdMan> authList = new List<AppAuth.Models.UpdMan>();
|
||||||
|
|
||||||
|
// ciclo SOLO tra quelli davvero autorizzati...
|
||||||
|
foreach (var item in rawList)
|
||||||
|
{
|
||||||
|
if (LicServ.checkLicenseActive(item.LicenseKey))
|
||||||
|
{
|
||||||
|
authList.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
numTot = authList.Count;
|
||||||
|
foreach (var item in authList)
|
||||||
{
|
{
|
||||||
long size = 0;
|
long size = 0;
|
||||||
size = await scaricaSingolo(item);
|
size = await scaricaSingolo(item);
|
||||||
@@ -109,7 +121,7 @@ namespace MP.Land.Pages
|
|||||||
|
|
||||||
protected string localPath(string localRepo)
|
protected string localPath(string localRepo)
|
||||||
{
|
{
|
||||||
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
return @$"{Configuration["ServerConf:downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
<CmpGroupFilt></CmpGroupFilt>
|
||||||
@if (ListRecords == null)
|
@if (ListRecords == null)
|
||||||
{
|
{
|
||||||
<LoadingData></LoadingData>
|
<LoadingData></LoadingData>
|
||||||
@@ -15,10 +16,11 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@foreach (var item in ListRecords)
|
@foreach (var item in ListRecords)
|
||||||
{
|
{
|
||||||
<div class="col-6 my-2 userCard">
|
<div class="col-12 col-sm-6 col-xl-4 my-1 userCard">
|
||||||
<UserCard CurrItem="@item" BaseUrl="@BaseUrlTab" Environment="@Environment"></UserCard>
|
<UserCard CurrItem="@item" BaseUrl="@BaseUrlTab" Environment="@Environment"></UserCard>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
+102
-75
@@ -11,12 +11,14 @@ namespace MP.Land.Pages
|
|||||||
{
|
{
|
||||||
public partial class UserQr : IDisposable
|
public partial class UserQr : IDisposable
|
||||||
{
|
{
|
||||||
#region Private Fields
|
#region Public Methods
|
||||||
|
|
||||||
private List<AnagraficaOperatori> ListRecords;
|
public void Dispose()
|
||||||
private List<AnagraficaOperatori> SearchRecords;
|
{
|
||||||
|
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Fields
|
#region Protected Fields
|
||||||
|
|
||||||
@@ -25,6 +27,74 @@ namespace MP.Land.Pages
|
|||||||
|
|
||||||
#endregion Protected Fields
|
#endregion Protected Fields
|
||||||
|
|
||||||
|
#region Protected Properties
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected MessageService AppMService { get; set; }
|
||||||
|
|
||||||
|
protected string BaseUrlTab
|
||||||
|
{
|
||||||
|
get => $"{Configuration["ServerConf:BaseUrl"]}{Configuration["QrJumpPath"]}";
|
||||||
|
}
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected AppAuthService DataService { get; set; }
|
||||||
|
|
||||||
|
protected string Environment
|
||||||
|
{
|
||||||
|
get => Configuration["Environment"];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Properties
|
||||||
|
|
||||||
|
#region Protected Methods
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
AppMService.ShowSearch = true;
|
||||||
|
AppMService.PageName = "User Card";
|
||||||
|
AppMService.PageIcon = "fas fa-qrcode pr-2";
|
||||||
|
await ReloadData();
|
||||||
|
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||||
|
AppMService.EA_FilterUpdated += OnFilterUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async Task PagerReloadNum(int newNum)
|
||||||
|
{
|
||||||
|
ListRecords = null;
|
||||||
|
numRecord = newNum;
|
||||||
|
await ReloadData();
|
||||||
|
isLoading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async Task PagerReloadPage(int newNum)
|
||||||
|
{
|
||||||
|
ListRecords = null;
|
||||||
|
currPage = newNum;
|
||||||
|
await ReloadData();
|
||||||
|
isLoading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MarkupString traduci(string lemma)
|
||||||
|
{
|
||||||
|
MarkupString answ;
|
||||||
|
//string rawHtml = "<li>primo</li><li>secondo</li>";
|
||||||
|
string rawHtml = DataService.Traduci(lemma, "IT");
|
||||||
|
answ = new MarkupString(rawHtml);
|
||||||
|
// cerco nella cache Redis
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private List<AnagraficaOperatori> ListRecords;
|
||||||
|
|
||||||
|
private List<AnagraficaOperatori> SearchRecords;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
@@ -42,6 +112,14 @@ namespace MP.Land.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string groupName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return AppMService.CodGruppo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
private bool isLoading { get; set; } = false;
|
||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
@@ -58,28 +136,16 @@ namespace MP.Land.Pages
|
|||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|
||||||
#region Protected Properties
|
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService AppMService { get; set; }
|
|
||||||
|
|
||||||
protected string BaseUrlTab
|
|
||||||
{
|
|
||||||
get => $"{Configuration["BaseUrl"]}{Configuration["QrJumpPath"]}";
|
|
||||||
}
|
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected AppAuthService DataService { get; set; }
|
|
||||||
|
|
||||||
protected string Environment
|
|
||||||
{
|
|
||||||
get => Configuration["Environment"];
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
|
private async void OnFilterUpdated()
|
||||||
|
{
|
||||||
|
ListRecords = null;
|
||||||
|
currPage = 1;
|
||||||
|
await Task.Delay(1);
|
||||||
|
await ReloadData();
|
||||||
|
}
|
||||||
|
|
||||||
private async void OnSeachUpdated()
|
private async void OnSeachUpdated()
|
||||||
{
|
{
|
||||||
ListRecords = null;
|
ListRecords = null;
|
||||||
@@ -88,41 +154,21 @@ namespace MP.Land.Pages
|
|||||||
await ReloadData();
|
await ReloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private Methods
|
private async Task ReloadData()
|
||||||
|
|
||||||
#region Protected Methods
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
AppMService.ShowSearch = true;
|
|
||||||
AppMService.PageName = "User Card";
|
|
||||||
AppMService.PageIcon = "fas fa-qrcode pr-2";
|
|
||||||
await ReloadData();
|
|
||||||
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async Task PagerReloadNum(int newNum)
|
|
||||||
{
|
|
||||||
ListRecords = null;
|
|
||||||
numRecord = newNum;
|
|
||||||
await ReloadData();
|
|
||||||
isLoading = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async Task PagerReloadPage(int newNum)
|
|
||||||
{
|
|
||||||
ListRecords = null;
|
|
||||||
currPage = newNum;
|
|
||||||
await ReloadData();
|
|
||||||
isLoading = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async Task ReloadData()
|
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
// importante altrimenti NON mostra update UI
|
// importante altrimenti NON mostra update UI
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
// se ho selezionato qualcosa cerco x gruppo
|
||||||
|
//if (groupName != "")
|
||||||
|
//{
|
||||||
|
SearchRecords = await DataService.AnagOperByGroupList(groupName, AppMService.SearchVal);
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// //altrimenti TUTTI
|
||||||
|
// SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
||||||
|
//}
|
||||||
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
|
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
|
||||||
totalCount = SearchRecords.Count();
|
totalCount = SearchRecords.Count();
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
@@ -130,25 +176,6 @@ namespace MP.Land.Pages
|
|||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MarkupString traduci(string lemma)
|
#endregion Private Methods
|
||||||
{
|
|
||||||
MarkupString answ;
|
|
||||||
//string rawHtml = "<li>primo</li><li>secondo</li>";
|
|
||||||
string rawHtml = DataService.Traduci(lemma, "IT");
|
|
||||||
answ = new MarkupString(rawHtml);
|
|
||||||
// cerco nella cache Redis
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Protected Methods
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Methods
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+28
-27
@@ -35,6 +35,32 @@
|
|||||||
<a href="" class="reload">Reload</a>
|
<a href="" class="reload">Reload</a>
|
||||||
<a class="dismiss">🗙</a>
|
<a class="dismiss">🗙</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
||||||
|
<script>
|
||||||
|
//Blazor.start().then(() => {
|
||||||
|
// Blazor.defaultReconnectionHandler._reconnectionDisplay = {
|
||||||
|
// show: () => { },
|
||||||
|
// update: (d) => { },
|
||||||
|
// rejected: (d) => document.location.reload()
|
||||||
|
// };
|
||||||
|
//});
|
||||||
|
|
||||||
|
Blazor.start().then(() => {
|
||||||
|
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
|
||||||
|
get() {
|
||||||
|
return this.__reconnectionDisplay;
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.__reconnectionDisplay = {
|
||||||
|
show: () => value.show(),
|
||||||
|
update: (d) => value.update(d),
|
||||||
|
rejected: (d) => document.location.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- inside of body section and after the div/app tag -->
|
<!-- inside of body section and after the div/app tag -->
|
||||||
<script src="jquery/jquery.min.js"></script>
|
<script src="jquery/jquery.min.js"></script>
|
||||||
@@ -43,33 +69,8 @@
|
|||||||
|
|
||||||
<script src="font-awesome/js/all.min.js"></script>
|
<script src="font-awesome/js/all.min.js"></script>
|
||||||
<script src="_framework/blazor.server.js"></script>
|
<script src="_framework/blazor.server.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="~/lib/qrcode.js"></script>
|
<script type="text/javascript" src="~/lib/qrcode.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript" src="~/lib/qrHelper.js"></script>
|
||||||
function clearContent(elementID) {
|
|
||||||
console.log(elementID);
|
|
||||||
document.getElementById(elementID).innerHTML = "";
|
|
||||||
}
|
|
||||||
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
|
|
||||||
//var qrcode = new QRCode("qrCodeImg");
|
|
||||||
function displayQr(elementName, rawData) {
|
|
||||||
console.log(elementName);
|
|
||||||
try {
|
|
||||||
if (elementName != "" && rawData != "") {
|
|
||||||
qrcode = new QRCode(document.getElementById(elementName),
|
|
||||||
{
|
|
||||||
text: rawData,
|
|
||||||
width: 200,
|
|
||||||
height: 200
|
|
||||||
});
|
|
||||||
//qrcode = new QRCode(document.getElementById(elementName));
|
|
||||||
//qrcode.clear();
|
|
||||||
//qrcode.makeCode(rawData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -10,7 +10,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
<PublishProvider>FileSystem</PublishProvider>
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
<PublishUrl>bin\publish\net5.0\</PublishUrl>
|
<PublishUrl>bin\publish\net6.0\</PublishUrl>
|
||||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ProjectGuid>d949ab45-9b65-4594-a97e-182bc3831707</ProjectGuid>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -4,25 +4,25 @@ This file is used by the publish/package process of your Web project. You can cu
|
|||||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
<SiteUrlToLaunchAfterPublish>
|
<SiteUrlToLaunchAfterPublish>
|
||||||
</SiteUrlToLaunchAfterPublish>
|
</SiteUrlToLaunchAfterPublish>
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
||||||
<SelfContained>false</SelfContained>
|
<SelfContained>false</SelfContained>
|
||||||
<MSDeployServiceURL>https://IIS01:8172/MsDeploy.axd</MSDeployServiceURL>
|
<MSDeployServiceURL>https://iis01.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||||
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
||||||
<RemoteSitePhysicalPath />
|
<RemoteSitePhysicalPath />
|
||||||
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
|
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
|
||||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||||
<UserName>jenkins</UserName>
|
<UserName>jenkins</UserName>
|
||||||
<_SavePWD>True</_SavePWD>
|
<_SavePWD>True</_SavePWD>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
|
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -4,24 +4,25 @@ This file is used by the publish/package process of your Web project. You can cu
|
|||||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
<SiteUrlToLaunchAfterPublish>
|
<SiteUrlToLaunchAfterPublish>
|
||||||
</SiteUrlToLaunchAfterPublish>
|
</SiteUrlToLaunchAfterPublish>
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
||||||
<SelfContained>false</SelfContained>
|
<SelfContained>false</SelfContained>
|
||||||
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
|
<MSDeployServiceURL>https://iis02.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||||
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
||||||
<RemoteSitePhysicalPath />
|
<RemoteSitePhysicalPath />
|
||||||
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
|
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
|
||||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||||
<UserName>jenkins</UserName>
|
<UserName>jenkins</UserName>
|
||||||
<_SavePWD>True</_SavePWD>
|
<_SavePWD>True</_SavePWD>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
</PropertyGroup>
|
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||||
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<SiteUrlToLaunchAfterPublish>
|
||||||
|
</SiteUrlToLaunchAfterPublish>
|
||||||
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
|
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
<MSDeployServiceURL>https://iis03.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||||
|
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
||||||
|
<RemoteSitePhysicalPath />
|
||||||
|
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
|
||||||
|
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||||
|
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||||
|
<UserName>jenkins</UserName>
|
||||||
|
<_SavePWD>True</_SavePWD>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||||
|
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA+11nhJeDSkeTlSej+COD3AAAAAACAAAAAAADZgAAwAAAABAAAADHiGtCyOetOyeT2xaFL+NDAAAAAASAAACgAAAAEAAAAAuYw1PbVDVdZhloQ7eVuTsYAAAAfA8iFmY49U48HUeRwWwQNsvZg5FRMf9SFAAAACB+0njgnTZ+1teEqoJcNV16idHL</EncryptedPassword>
|
||||||
|
<History>True|2022-02-26T17:27:19.1178345Z;False|2022-02-26T18:23:39.1747983+01:00;True|2021-05-26T19:49:56.4831784+02:00;True|2021-05-25T16:56:57.0194126+02:00;True|2021-05-24T18:44:45.5388713+02:00;True|2021-05-24T18:23:50.6056375+02:00;True|2021-05-24T18:01:51.1166144+02:00;True|2021-05-24T17:07:21.6348703+02:00;True|2021-05-24T17:07:10.8304877+02:00;True|2021-05-24T11:12:19.8440009+02:00;True|2021-05-24T11:12:08.1362921+02:00;True|2021-05-22T12:03:42.2864462+02:00;True|2021-05-21T19:54:05.6348108+02:00;False|2021-05-21T19:53:46.2134560+02:00;True|2021-05-21T08:11:55.5022811+02:00;True|2021-05-20T19:40:34.2462833+02:00;True|2021-05-20T19:40:10.3931366+02:00;True|2021-05-20T17:27:02.9543079+02:00;True|2021-05-20T16:59:12.4323448+02:00;True|2021-05-20T16:58:55.5021812+02:00;False|2021-05-20T16:58:03.5161910+02:00;True|2021-05-19T19:28:03.8104716+02:00;True|2021-05-18T19:48:52.9083044+02:00;True|2021-05-18T18:15:50.2374168+02:00;True|2021-05-18T18:06:20.0997789+02:00;True|2021-05-18T14:56:33.7479984+02:00;True|2021-05-17T17:03:39.9822588+02:00;True|2021-05-17T16:33:53.4419457+02:00;True|2021-05-17T16:33:10.5405414+02:00;False|2021-05-17T16:30:04.8648550+02:00;False|2021-05-17T16:29:49.5085445+02:00;</History>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -4,18 +4,18 @@ This file is used by the publish/package process of your Web project. You can cu
|
|||||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
-->
|
-->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<WebPublishMethod>Package</WebPublishMethod>
|
<WebPublishMethod>Package</WebPublishMethod>
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
<SiteUrlToLaunchAfterPublish />
|
<SiteUrlToLaunchAfterPublish />
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
||||||
<DesktopBuildPackageLocation>bin\publish\MP.Land.zip</DesktopBuildPackageLocation>
|
<DesktopBuildPackageLocation>bin\publish\MP.Land.zip</DesktopBuildPackageLocation>
|
||||||
<PackageAsSingleFile>true</PackageAsSingleFile>
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<SelfContained>false</SelfContained>
|
<SelfContained>false</SelfContained>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
|
||||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
|
||||||
-->
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
|
||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
|
||||||
<SiteUrlToLaunchAfterPublish>
|
|
||||||
</SiteUrlToLaunchAfterPublish>
|
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
|
||||||
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
|
|
||||||
<SelfContained>false</SelfContained>
|
|
||||||
<MSDeployServiceURL>https://w2019-iis-dev:8172/MsDeploy.axd</MSDeployServiceURL>
|
|
||||||
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
|
|
||||||
<RemoteSitePhysicalPath />
|
|
||||||
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
|
|
||||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
|
||||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
|
||||||
<UserName>jenkins</UserName>
|
|
||||||
<_SavePWD>True</_SavePWD>
|
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<i>Modulo gestione Programmi MAPO</i>
|
<i>Modulo gestione Programmi MAPO</i>
|
||||||
<h4>Versione: 1.1.2109.2118</h4>
|
<h4>Versione: 6.15.2209.1212</h4>
|
||||||
<br />
|
<br />
|
||||||
Note di rilascio:
|
Note di rilascio:
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.1.2109.2118
|
6.15.2209.1212
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<item>
|
<item>
|
||||||
<version>1.1.2109.2118</version>
|
<version>6.15.2209.1212</version>
|
||||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||||
<mandatory>false</mandatory>
|
<mandatory>false</mandatory>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
@media (min-width: 992px) {
|
||||||
.page {
|
.page {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,11 @@
|
|||||||
<span class="fas fa-wrench fa-2x pr-2" aria-hidden="true"></span> System Info
|
<span class="fas fa-wrench fa-2x pr-2" aria-hidden="true"></span> System Info
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="RefreshData">
|
||||||
|
<span class="fas fa-sync-alt fa-2x pr-2" aria-hidden="true"></span> Refresh Data
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
@media (min-width: 992px) {
|
||||||
.navbar-toggler {
|
.navbar-toggler {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ namespace MP.Land
|
|||||||
services.AddServerSideBlazor();
|
services.AddServerSideBlazor();
|
||||||
|
|
||||||
services.AddSingleton<IConfiguration>(Configuration);
|
services.AddSingleton<IConfiguration>(Configuration);
|
||||||
|
services.AddSingleton<LicenseService>();
|
||||||
|
|
||||||
services.AddScoped<AppAuthService>();
|
services.AddScoped<AppAuthService>();
|
||||||
services.AddScoped<MessageService>();
|
services.AddScoped<MessageService>();
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
{
|
{
|
||||||
"DetailedErrors": true,
|
"DetailedErrors": true,
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
|
||||||
},
|
|
||||||
"AllowedHosts": "*",
|
|
||||||
"BaseUrl": "IIS02",
|
|
||||||
"Environment": "PROD",
|
|
||||||
"ConnectionStrings": {
|
|
||||||
"DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
|
||||||
"MP.Land": "Server=localhost\\SQLEXPRESS;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;"
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Environment": "Steam PROD",
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"QrJumpPath": "MP/TAB/jumper?",
|
||||||
|
"appVers": "stable",
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||||
|
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||||
|
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
|
||||||
|
},
|
||||||
|
"ServerConf": {
|
||||||
|
"BaseUrl": "https://iis02.egalware.com/",
|
||||||
|
"downloadPath": "C:\\Steamware\\installers\\MP"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"DetailedErrors": true,
|
"DetailedErrors": true,
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"Environment": "Steam DEV",
|
||||||
"BaseUrl": "https://IIS01/",
|
"ServerConf": {
|
||||||
"Environment": "Steam STAG"
|
"BaseUrl": "https://iis01.egalware.com/",
|
||||||
|
"downloadPath": "C:\\Steamware\\installers\\MP"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+24
-24
@@ -1,27 +1,27 @@
|
|||||||
{
|
{
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
}
|
|
||||||
//"LogLevel": {
|
|
||||||
// "Default": "Debug",
|
|
||||||
// "Microsoft": "Information",
|
|
||||||
// "Microsoft.AspNetCore.SignalR": "Debug",
|
|
||||||
// "Microsoft.AspNetCore.Http.Connections": "Debug",
|
|
||||||
// "System": "Information"
|
|
||||||
//}
|
|
||||||
},
|
|
||||||
"AllowedHosts": "*",
|
|
||||||
"BaseUrl": "https://localhost:44309/",
|
|
||||||
"QrJumpPath": "MP/TAB/jumper?",
|
|
||||||
"Environment": "Steam DEV",
|
|
||||||
"downloadPath": "C:\\Steamware\\installers\\MP",
|
|
||||||
"appVers": "stable",
|
|
||||||
"ConnectionStrings": {
|
|
||||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
|
||||||
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
|
||||||
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"QrJumpPath": "MP/TAB/jumper?",
|
||||||
|
"Environment": "Steam DEV",
|
||||||
|
"appVers": "stable",
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||||
|
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||||
|
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
|
||||||
|
},
|
||||||
|
"ServerConf": {
|
||||||
|
"BaseUrl": "https://localhost:44309/",
|
||||||
|
"downloadPath": "C:\\Steamware\\installers\\MP"
|
||||||
|
}
|
||||||
|
//"ConnectionStrings": {
|
||||||
|
// "DefaultConnection": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||||
|
// "MP.Land": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||||
|
// "Redis": "localhost:6379,defaultDatabase=11,keepAlive=180,asyncTimeout=5000"
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
param([string]$ProjectDir, [string]$ProjectPath);
|
param([string]$ProjectDir, [string]$ProjectPath);
|
||||||
|
|
||||||
$FileVers="Resources\VersNum.txt"
|
$FileMajMin = "..\MajMin.vers"
|
||||||
$FileManIn="Resources\manifest-original.xml"
|
$FileVers = "Resources\VersNum.txt"
|
||||||
$FileManOut="Resources\manifest.xml"
|
$FileManIn = "Resources\manifest-original.xml"
|
||||||
$FileCLogIn="Resources\ChangeLog-original.html"
|
$FileManOut = "Resources\manifest.xml"
|
||||||
$FileCLogOut="Resources\ChangeLog.html"
|
$FileCLogIn = "Resources\ChangeLog-original.html"
|
||||||
$MajMin="1.1."
|
$FileCLogOut = "Resources\ChangeLog.html"
|
||||||
|
$MajMin = Get-Content $FileMajMin # "6.14."
|
||||||
$currentDate = get-date -format yyMM;
|
$currentDate = get-date -format yyMM;
|
||||||
$currentTime = get-date -format ddHH;
|
$currentTime = get-date -format ddHH;
|
||||||
$find = "<Version>(.|\n)*?</Version>";
|
$find = "<Version>(.|\n)*?</Version>";
|
||||||
$currRelNum=$MajMin + $currentDate +"." + $currentTime
|
$currRelNum = $MajMin + $currentDate +"." + $currentTime
|
||||||
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
|
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
|
||||||
$csproj = Get-Content $ProjectPath
|
$csproj = Get-Content $ProjectPath
|
||||||
$csprojUpdated = $csproj -replace $find, $replace
|
$csprojUpdated = $csproj -replace $find, $replace
|
||||||
|
|||||||
@@ -63,6 +63,52 @@ a,
|
|||||||
.footer {
|
.footer {
|
||||||
line-height: 1.8em;
|
line-height: 1.8em;
|
||||||
}
|
}
|
||||||
|
.textTrim {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.maxChar {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.max5Char {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 5rem;
|
||||||
|
}
|
||||||
|
.max10Char {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 10rem;
|
||||||
|
}
|
||||||
|
.max20Char {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 20rem;
|
||||||
|
}
|
||||||
|
.max30Char {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 30rem;
|
||||||
|
}
|
||||||
|
.max40Char {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 40rem;
|
||||||
|
}
|
||||||
|
.max50Char {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 50rem;
|
||||||
|
}
|
||||||
/*------------------------------------------------------------------
|
/*------------------------------------------------------------------
|
||||||
[ Shortcuts / .shortcuts ]
|
[ Shortcuts / .shortcuts ]
|
||||||
*/
|
*/
|
||||||
@@ -76,7 +122,7 @@ a,
|
|||||||
min-width: 9rem;
|
min-width: 9rem;
|
||||||
min-height: 5rem;
|
min-height: 5rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.66666667rem 0;
|
padding: 2rem/3 0;
|
||||||
margin: 0 2px 1em;
|
margin: 0 2px 1em;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -89,13 +135,13 @@ a,
|
|||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 0.5rem;
|
border-radius: 1rem/2;
|
||||||
}
|
}
|
||||||
.shortcuts .shortcut-sm {
|
.shortcuts .shortcut-sm {
|
||||||
min-width: 4.5rem;
|
min-width: 4.5rem;
|
||||||
min-height: 3rem;
|
min-height: 3rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.25rem 0;
|
padding: 1rem/4 0;
|
||||||
margin: 0 2px 1em;
|
margin: 0 2px 1em;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -108,7 +154,7 @@ a,
|
|||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 0.5rem;
|
border-radius: 1rem/2;
|
||||||
}
|
}
|
||||||
.shortcuts .shortcut .shortcut-icon {
|
.shortcuts .shortcut .shortcut-icon {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -63,6 +63,50 @@ a, .btn-link {
|
|||||||
line-height: 1.8em;
|
line-height: 1.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.textTrim {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.maxChar {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max5Char {
|
||||||
|
.maxChar;
|
||||||
|
width: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max10Char {
|
||||||
|
.maxChar;
|
||||||
|
width: 10rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max20Char {
|
||||||
|
.maxChar;
|
||||||
|
width: 20rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max30Char {
|
||||||
|
.maxChar;
|
||||||
|
width: 30rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max40Char {
|
||||||
|
.maxChar;
|
||||||
|
width: 40rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max50Char {
|
||||||
|
.maxChar;
|
||||||
|
width: 50rem;
|
||||||
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------
|
/*------------------------------------------------------------------
|
||||||
[ Shortcuts / .shortcuts ]
|
[ Shortcuts / .shortcuts ]
|
||||||
*/
|
*/
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');@import url('fonts.min.css');h1,h2,h3,h4,h5,h6,b,display-1,display-2,display-3,display-4{font-family:'Lato',sans-serif}html,body,.textCondensed{font-family:'Roboto Condensed',sans-serif}a,.btn-link{color:#0366d6}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac}.content{padding-top:1.1rem}.valid.modified:not([type=checkbox]){outline:1px solid #26b050}.invalid{outline:1px solid #f00}.validation-message{color:#f00}.textStriked{text-decoration:line-through}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem}.footer{line-height:1.8em}.shortcuts{text-align:center}.shortcuts .shortcut-icon{font-size:2rem}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:.66666667rem 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:.5rem}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:.25rem 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:.5rem}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut:hover .shortcut-icon{color:#c93}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666}@media(max-width:640px){.shortcuts .shortcut{min-width:8rem;min-height:4rem}body{font-size:.8em}}
|
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');@import url('fonts.min.css');h1,h2,h3,h4,h5,h6,b,display-1,display-2,display-3,display-4{font-family:'Lato',sans-serif}html,body,.textCondensed{font-family:'Roboto Condensed',sans-serif}a,.btn-link{color:#0366d6}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac}.content{padding-top:1.1rem}.valid.modified:not([type=checkbox]){outline:1px solid #26b050}.invalid{outline:1px solid #f00}.validation-message{color:#f00}.textStriked{text-decoration:line-through}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem}.footer{line-height:1.8em}.textTrim{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.maxChar{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.max5Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:5rem}.max10Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:10rem}.max20Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:20rem}.max30Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:30rem}.max40Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:40rem}.max50Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:50rem}.shortcuts{text-align:center}.shortcuts .shortcut-icon{font-size:2rem}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:2rem/3 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:1rem/4 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut:hover .shortcut-icon{color:#c93}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666}@media(max-width:640px){.shortcuts .shortcut{min-width:8rem;min-height:4rem}body{font-size:.8em}}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
function clearContent(elementID) {
|
||||||
|
//console.log("Remove " + elementID);
|
||||||
|
document.getElementById(elementID).innerHTML = "";
|
||||||
|
}
|
||||||
|
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
|
||||||
|
//var qrcode = new QRCode("qrCodeImg");
|
||||||
|
function displayQr(elementName, rawData) {
|
||||||
|
//console.log("Add " + elementName);
|
||||||
|
try {
|
||||||
|
if (elementName != "" && rawData != "") {
|
||||||
|
qrcode = new QRCode(document.getElementById(elementName),
|
||||||
|
{
|
||||||
|
text: rawData,
|
||||||
|
width: 200,
|
||||||
|
height: 200
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
}
|
||||||
@@ -360,8 +360,8 @@ var QRCode;
|
|||||||
})() : (function () { // Drawing in Canvas
|
})() : (function () { // Drawing in Canvas
|
||||||
function _onMakeImage() {
|
function _onMakeImage() {
|
||||||
this._elImage.src = this._elCanvas.toDataURL("image/png");
|
this._elImage.src = this._elCanvas.toDataURL("image/png");
|
||||||
this._elImage.style.display = "block";
|
//this._elImage.style.display = "block";
|
||||||
this._elCanvas.style.display = "none";
|
//this._elCanvas.style.display = "none";
|
||||||
this._elImage.className = "img-fluid";
|
this._elImage.className = "img-fluid";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<Router AppAssembly="@typeof(App).Assembly">
|
||||||
|
<Found Context="routeData">
|
||||||
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||||
|
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||||
|
</Found>
|
||||||
|
<NotFound>
|
||||||
|
<PageTitle>Not found</PageTitle>
|
||||||
|
<LayoutView Layout="@typeof(MainLayout)">
|
||||||
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||||
|
</LayoutView>
|
||||||
|
</NotFound>
|
||||||
|
</Router>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<div class="row text-light">
|
||||||
|
<div class="col-5 pe-0 text-left">
|
||||||
|
<b>Mapo MON @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-7 ps-0 text-end">
|
||||||
|
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user