Compare commits
205 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 317508f37b | |||
| 00e6b19eba | |||
| a566e94c88 | |||
| 64beb99dba | |||
| 6d190dd95c | |||
| 2d3cfabdf1 | |||
| 8bde0ce0cd | |||
| 30dd6cbd51 | |||
| fcdb23d281 | |||
| 493215ee33 | |||
| 912dd3579b | |||
| 6d7214a274 | |||
| 56785369ab | |||
| 301b69026d | |||
| 7a0bc3a9f9 | |||
| 2c1919c290 | |||
| 5274068c09 | |||
| 281e24423b | |||
| 26acf3c185 | |||
| 8d0adc92ee | |||
| 0d919556ad | |||
| 7bb56a9f1c | |||
| 3a391b090c | |||
| 122fd0bf0e | |||
| ae174cb094 | |||
| 93f284790b | |||
| 5b8c294136 | |||
| 32c75cdd05 | |||
| ff8f86c9ca | |||
| 4b6218ff75 | |||
| b409e698b7 | |||
| 927a89d388 | |||
| 5e172e1022 | |||
| fcd1f16071 | |||
| ba91bd9edb | |||
| 9fbd8600ab | |||
| f6a91943b0 | |||
| 3f90dc6016 | |||
| a4b4b47231 | |||
| 21ef7c6e73 | |||
| f5a6ad0033 | |||
| c38445b1cd | |||
| e90c52a744 | |||
| c7fcfa748c | |||
| c3c81755b0 | |||
| 97d9395f4a | |||
| c787b575b4 | |||
| 0a91b1413f | |||
| 2a2b2b3f31 | |||
| aaba44f575 | |||
| 5d6de5e7fc | |||
| e857b8a714 | |||
| 96b9402bf4 | |||
| b5568d6d7e | |||
| 60f961d5dd | |||
| 9842dcd70d | |||
| 1a6b7093c0 | |||
| 7974b9c2a9 | |||
| a58513d719 | |||
| 4a9e129071 | |||
| 57bd776be3 | |||
| 828c2c57f6 | |||
| c881b12524 | |||
| 623d9d3e6d | |||
| b522bd4ec0 | |||
| 0eb8d93241 | |||
| 86ca7fa93c | |||
| 97038f5ff7 | |||
| 660f8fd356 | |||
| 2e9f816685 | |||
| 2b14b256c1 | |||
| f84dd6e9fe | |||
| 39d4d61f12 | |||
| af06c24d7a | |||
| a9dff7d43b | |||
| db8f2da831 | |||
| b2ebe8e674 | |||
| ab550f8468 | |||
| d062c60073 | |||
| 4e75085d1f | |||
| 71ca2d7e69 | |||
| 780eef4459 | |||
| 9163841613 | |||
| 543428608f | |||
| 5c7bfada7e | |||
| c5092e711b | |||
| 0c86362d41 | |||
| c864a7df5f | |||
| f306683687 | |||
| a8743bec74 | |||
| db5638e776 | |||
| 9ddf247346 | |||
| 32397cead9 | |||
| 6ccbffdecf | |||
| a714b5388b | |||
| 2633d7af0a | |||
| ea148e953c | |||
| ea5f4b2284 | |||
| 55cfed26bb | |||
| c4f646a8b0 | |||
| 2e852b0893 | |||
| 94f22f8fa4 | |||
| 0f75ef1633 | |||
| 05b6a42db1 | |||
| 872b5ca316 | |||
| c7f4c97700 | |||
| d7d1698a10 | |||
| 34d23a6b80 | |||
| 09f4c3c5f9 | |||
| 5ace18880b | |||
| 78fb307cbb | |||
| cb185b8786 | |||
| 3462046e42 | |||
| 4821f441b6 | |||
| 816a7278aa | |||
| b502420309 | |||
| ab1556058a | |||
| 00ec07453b | |||
| c924e5b4e7 | |||
| 6ba7564862 | |||
| ecaabd56ec | |||
| bf8f455c0c | |||
| f5884e371d | |||
| 4b6c6c7360 | |||
| b5866beb43 | |||
| 72063ec338 | |||
| 704169ea7a | |||
| 8fd4d39bb5 | |||
| 4dbe99f2f1 | |||
| c7320338d7 | |||
| ff05e237a6 | |||
| c3ec21979c | |||
| a7d27169f1 | |||
| a1f3703c1b | |||
| 46937deb89 | |||
| 065d6bd7e9 | |||
| 2df65a3f81 | |||
| 42a9bb0939 | |||
| 02d47189c7 | |||
| 82f29a64c9 | |||
| 2c0ef38c8f | |||
| 0946620767 | |||
| 4e0c53a875 | |||
| 2409d677b3 | |||
| 57f7a58298 | |||
| a5d70ede6a | |||
| 42fc9a9db1 | |||
| 7a2c227296 | |||
| daa6a793d8 | |||
| 0e9d9aade2 | |||
| d59f2489d0 | |||
| e2bd1bc4ca | |||
| 26c3321461 | |||
| acd0b7fed1 | |||
| d8ca11601d | |||
| baf3c89c10 | |||
| 3ac94e4a14 | |||
| 0bdc4ef879 | |||
| 53f6712d86 | |||
| 431690be9d | |||
| f23d19cf64 | |||
| 3584075fcf | |||
| bc59b06b6e | |||
| c70e6151d9 | |||
| b8ec296dc6 | |||
| 8bfa06ec0a | |||
| 39388f44c7 | |||
| 9fd6736f27 | |||
| ad9e9fc957 | |||
| 46dd6e0cc3 | |||
| bd8617750f | |||
| f4fa99c0c2 | |||
| 3c271dd802 | |||
| d285162d63 | |||
| 9604e12b21 | |||
| 4298d1d8be | |||
| 61340fe6dc | |||
| 5f0a82ab67 | |||
| ce071c8cfd | |||
| b5d72a18bb | |||
| 1c7aef0bad | |||
| 0b6851eefb | |||
| 74db3e9c0c | |||
| a0503bb07e | |||
| 78da4b0922 | |||
| 74b640efe3 | |||
| c2da7c5590 | |||
| 951cc064c7 | |||
| c2f469cd29 | |||
| c0638513cb | |||
| 094750f247 | |||
| 28f2dbf2e3 | |||
| 7841e5ebbc | |||
| da56ffcca8 | |||
| a5ec8f2105 | |||
| 5a8b618a68 | |||
| fcdb96834e | |||
| 6b868ee1a0 | |||
| c35afc82c6 | |||
| 45c5de32a8 | |||
| 5d49772dba | |||
| 017f3ea2b1 | |||
| 5eb53c677d | |||
| 20fc4f1793 | |||
| 1239951b72 |
@@ -0,0 +1,4 @@
|
||||
[*.cs]
|
||||
|
||||
# CS1591: Missing XML comment for publicly visible type or member
|
||||
dotnet_diagnostic.CS1591.severity = none
|
||||
+172
-64
@@ -1,17 +1,28 @@
|
||||
variables:
|
||||
VERS_MAIN: '1.0'
|
||||
NEXUS_PATH: 'LiMan'
|
||||
APP_NAME: 'LiMan.UI'
|
||||
NUGET_PATH: 'C:\Tools\nuget.exe'
|
||||
|
||||
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
|
||||
.nuget-fix: &nuget-fix
|
||||
- |
|
||||
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
|
||||
if ($hasSource -eq 0) {
|
||||
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
||||
} else {
|
||||
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
||||
echo "esecuzione Nuget FIX steps"
|
||||
dotnet nuget list source
|
||||
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
|
||||
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||
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-group-3/index.json -n "Steamware Nexus" -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
|
||||
echo "Steamware Nexus Source added"
|
||||
|
||||
# helper creazione files zip
|
||||
.zipper: &zipper
|
||||
@@ -28,19 +39,6 @@ variables:
|
||||
|
||||
#cd "$env:APP_NAME\bin\publish\net6.0"
|
||||
|
||||
# # helper creazione hash files x EXE
|
||||
# .hashBuildExe: &hashBuildExe
|
||||
# - |
|
||||
# $Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
# $MD5 = Get-FileHash $Target -Algorithm MD5
|
||||
# $SHA1 = Get-FileHash $Target -Algorithm SHA1
|
||||
# New-Item $Target".md5"
|
||||
# New-Item $Target".sha1"
|
||||
# $MD5.Hash | Set-Content -Path $Target".md5"
|
||||
# $SHA1.Hash | Set-Content -Path $Target".sha1"
|
||||
|
||||
# echo "Created HASH files for $Target"
|
||||
|
||||
# helper creazione hash files x IIS
|
||||
.hashBuild: &hashBuild
|
||||
- |
|
||||
@@ -78,17 +76,62 @@ variables:
|
||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
|
||||
echo "mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName"
|
||||
}
|
||||
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 $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
|
||||
|
||||
# image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
|
||||
# helper x fix version number
|
||||
.version-fix: &version-fix
|
||||
- |
|
||||
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format ddHH)
|
||||
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
|
||||
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
|
||||
$env:NEW_COPYRIGHT = "EgalWare @ 2021-" + (get-date -format yyyy)
|
||||
#$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
|
||||
#$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
|
||||
#$newContenuto = $newContenuto -replace 'EgalWare © 2021', $env:NEW_COPYRIGHT
|
||||
#$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
|
||||
# display versioni generate
|
||||
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
|
||||
Write-Output $resoconto;
|
||||
echo "Replace completati"
|
||||
|
||||
# helper x fix nuspec file
|
||||
.nuspec-fix: &nuspec-fix
|
||||
- |
|
||||
echo "Modifica dati file nuspec Release"
|
||||
$currRelease = $env:NUM_REL
|
||||
$currDebug = $env:NUM_DEB
|
||||
$find = "<version>(.|\n)*?</version>";
|
||||
$fileNameRel = "$env:APP_NAME.Release.nuspec";
|
||||
$replRel = "<version>" + $currRelease + "</version>";
|
||||
$nuspDataRel = Get-Content $fileNameRel;
|
||||
$nuspDataRelUpd = $nuspDataRel -replace $find, $replRel;
|
||||
$nuspDataRelUpd = $nuspDataRelUpd -replace "#copyright#", $replCopy;
|
||||
$nuspDataRelUpd = $nuspDataRelUpd -replace "#releaseNotes#", "Build $adesso";
|
||||
Set-Content -Path $fileNameRel -Value $nuspDataRelUpd;
|
||||
echo "Modifica dati file nuspec Debug"
|
||||
$fileNameDeb = "$env:APP_NAME.Debug.nuspec";
|
||||
$replDeb = "<version>" + $currDebug + "</version>";
|
||||
$nuspDataDeb = Get-Content $fileNameDeb;
|
||||
$nuspDataDebUpd = $nuspDataDeb -replace $find, $replDeb;
|
||||
$nuspDataDebUpd = $nuspDataDebUpd -replace "#copyright#", $replCopy;
|
||||
$nuspDataDebUpd = $nuspDataDebUpd -replace "#releaseNotes#", "Build $adesso";
|
||||
Set-Content -Path $fileNameDeb -Value $nuspDataDebUpd;
|
||||
echo "replace completati"
|
||||
|
||||
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
- release
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# BUILD
|
||||
# --------------------------------
|
||||
UI:build:
|
||||
stage: build
|
||||
tags:
|
||||
@@ -118,76 +161,87 @@ Transfer:build:
|
||||
- dotnet restore LiMan.sln
|
||||
script:
|
||||
- dotnet build LiMan.Transfer/LiMan.Transfer.csproj
|
||||
|
||||
UI:test:
|
||||
stage: test
|
||||
|
||||
EgwProxy.LiMan:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- develop
|
||||
needs: ["UI:build"]
|
||||
variables:
|
||||
APP_NAME: EgwProxy.LiMan
|
||||
SOL_NAME: EgwProxy.LiMan
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
script:
|
||||
- dotnet test LiMan.UI/LiMan.UI.csproj
|
||||
|
||||
API:test:
|
||||
stage: test
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- develop
|
||||
needs: ["API:build"]
|
||||
script:
|
||||
- dotnet test LiMan.Api/LiMan.Api.csproj
|
||||
|
||||
Transfer:test:
|
||||
stage: test
|
||||
tags:
|
||||
- win
|
||||
needs: ["Transfer:build"]
|
||||
script:
|
||||
- dotnet test LiMan.Transfer/LiMan.Transfer.csproj
|
||||
|
||||
- echo $CI_COMMIT_BRANCH
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# DEPLOY
|
||||
# --------------------------------
|
||||
UI:IIS01:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- develop
|
||||
needs: ["UI:test"]
|
||||
needs: ["UI:build"]
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
|
||||
- *zipper
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
API:IIS01:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: 'LiMan.Api'
|
||||
only:
|
||||
- develop
|
||||
needs: ["API:test"]
|
||||
needs: ["API:build"]
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
|
||||
- *zipper
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
UI:IIS02:deploy:
|
||||
UI:IIS04:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- main
|
||||
needs: ["UI:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
|
||||
|
||||
API:IIS02:deploy:
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS04.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
|
||||
- *zipper
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
API:IIS04:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: 'LiMan.Api'
|
||||
only:
|
||||
- main
|
||||
needs: ["API:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS04.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
|
||||
- *zipper
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
Transfer:deploy:
|
||||
stage: deploy
|
||||
@@ -195,14 +249,68 @@ Transfer:deploy:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: LiMan.Transfer
|
||||
needs: ["Transfer:test"]
|
||||
needs: ["Transfer:build"]
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
script:
|
||||
- dotnet build LiMan.Transfer/LiMan.Transfer.csproj
|
||||
- dotnet publish -p:PublishProfile=SingleFileX86.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release LiMan.Transfer/LiMan.Transfer.csproj
|
||||
- *zipper
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
|
||||
EgwProxy.LiMan:deploy:
|
||||
stage: deploy
|
||||
needs: ["EgwProxy.LiMan:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Debug
|
||||
APP_NAME: EgwProxy.LiMan
|
||||
SOL_NAME: EgwProxy.LiMan
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
# - '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- dotnet build "$env:APP_NAME\$env:APP_NAME.csproj"
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Debug.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
# --------------------------------
|
||||
# RELEASE
|
||||
# --------------------------------
|
||||
EgwProxy.LiMan:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.LiMan:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Release
|
||||
APP_NAME: EgwProxy.LiMan
|
||||
SOL_NAME: EgwProxy.LiMan
|
||||
only:
|
||||
refs:
|
||||
- SDK
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:SOL_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- dotnet build "$env:APP_NAME\$env:APP_NAME.csproj"
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Release.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
# UI:installer:
|
||||
# stage: installer
|
||||
# tags:
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/LiMan.UI/bin/Debug/net5.0/LiMan.UI.dll",
|
||||
"program": "${workspaceFolder}/LiMan.UI/bin/Debug/net6.0/LiMan.UI.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/LiMan.UI",
|
||||
"stopAtEntry": false,
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
public class Const
|
||||
{
|
||||
|
||||
// classi utilità x cache REDIS dati DB
|
||||
public const string redisBaseAddr = "MagManUi";
|
||||
public const string rKeyConfig = $"{redisBaseAddr}:Cache";
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using static Core.Enum;
|
||||
|
||||
namespace Core.DTO
|
||||
{
|
||||
@@ -6,6 +7,9 @@ namespace Core.DTO
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodApp { get; set; } = "";
|
||||
public string CodInst { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Codice univoco della sub licenza (opzionale)
|
||||
/// </summary>
|
||||
@@ -33,6 +37,11 @@ namespace Core.DTO
|
||||
/// </summary>
|
||||
public int IdxLic { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di ticket
|
||||
/// </summary>
|
||||
public TipologiaTicket TType { get; set; } = TipologiaTicket.Licenze;
|
||||
|
||||
/// <summary>
|
||||
/// IDX licenza child (opzionale)
|
||||
/// </summary>
|
||||
|
||||
+43
-40
@@ -1,53 +1,56 @@
|
||||
namespace Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Stato richieste x workflow interno
|
||||
/// </summary>
|
||||
public enum StatoRichiesta
|
||||
public class Enum
|
||||
{
|
||||
ND = 0,
|
||||
/// <summary>
|
||||
/// Stato richieste x workflow interno
|
||||
/// </summary>
|
||||
public enum StatoRichiesta
|
||||
{
|
||||
ND = 0,
|
||||
|
||||
Richiesta,
|
||||
Richiesta,
|
||||
|
||||
Valutazione,
|
||||
Valutazione,
|
||||
|
||||
Approvata,
|
||||
Approvata,
|
||||
|
||||
Rifiutata
|
||||
}
|
||||
Rifiutata
|
||||
}
|
||||
|
||||
public enum TipoLicenza
|
||||
{
|
||||
ND = 0,
|
||||
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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Licenza LEgacy Steamware
|
||||
/// Tipologia di ticket
|
||||
/// </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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di ticket
|
||||
/// </summary>
|
||||
public enum TipologiaTicket
|
||||
{
|
||||
ND = 0,
|
||||
Licenze,
|
||||
FileUpload
|
||||
public enum TipologiaTicket
|
||||
{
|
||||
ND = 0,
|
||||
Licenze,
|
||||
FileUpload
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Init classe validatore
|
||||
/// </summary>
|
||||
public class MachineDataValidator
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init classe validatore
|
||||
/// </summary>
|
||||
/// <param name="currMachineData"></param>
|
||||
public MachineDataValidator(string rawData)
|
||||
{
|
||||
// inizializzo info di base
|
||||
Dictionary<string, string> currMachineData = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
{
|
||||
currMachineData = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
|
||||
}
|
||||
catch(Exception exc)
|
||||
{ }
|
||||
}
|
||||
machTestData = currMachineData;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce HASH del codice impiego = payload utente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string machineKeyHash
|
||||
{
|
||||
get => calcMachineHash();
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Dati rispetto cui fare i calcoli di validazione
|
||||
/// </summary>
|
||||
private Dictionary<string, string> machTestData = new Dictionary<string, string>();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Calcola HASH del codice impiego = payload utente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string calcMachineHash()
|
||||
{
|
||||
string hash = "";
|
||||
string buffData = currBaseBuffer();
|
||||
if (!string.IsNullOrEmpty(buffData))
|
||||
{
|
||||
// hashing!
|
||||
|
||||
using (var hAlgo = SHA512.Create())
|
||||
//using (var hAlgo = MD5.Create())
|
||||
{
|
||||
byte[] InputBytes = Encoding.UTF8.GetBytes(buffData);
|
||||
var byteHash = hAlgo.ComputeHash(InputBytes);
|
||||
hash = BitConverter.ToString(byteHash).Replace("-", "").Replace("/", "").Replace("\\", "").ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
public bool hasValidData
|
||||
{
|
||||
get => machTestData != null && machTestData.Count > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola hash key da info PC
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string currBaseBuffer()
|
||||
{
|
||||
string answ = "????????????????????????????????????????????";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try
|
||||
{
|
||||
// calcolo hashKey da alcuni valori solamente
|
||||
sb.Append($"{machTestData["SystemName"]}|");
|
||||
sb.Append($"{machTestData["ProcessorId"]}|");
|
||||
sb.Append($"{machTestData["PartNumber"]}|");
|
||||
sb.Append($"{machTestData["MACAddress"]}|");
|
||||
sb.Append($"{machTestData["SerialNumber"]}|");
|
||||
sb.Append($"{machTestData["OSArchitecture"]}|");
|
||||
sb.Append($"{machTestData["SoftwareElementID"]}|");
|
||||
sb.Append($"{machTestData["SystemBiosMajorVersion"]}|");
|
||||
sb.Append($"{machTestData["SystemBiosMinorVersion"]}|");
|
||||
sb.Append($"{machTestData["CpuVersion"]}|");
|
||||
sb.Append($"{machTestData["BiosVersion"]}|");
|
||||
if (sb.Length > 0)
|
||||
{
|
||||
answ = sb.ToString();
|
||||
// lo uso 2 volte dritto e reverse...
|
||||
answ += ReverseString(sb.ToString());
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera info da dictionary
|
||||
/// </summary>
|
||||
/// <param name="keyName"></param>
|
||||
/// <returns></returns>
|
||||
private string getDictVal(string keyName)
|
||||
{
|
||||
string answ = $"{keyName}{keyName}";
|
||||
if (machTestData.ContainsKey(keyName))
|
||||
{
|
||||
answ = machTestData[keyName];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue reverse delal stringa
|
||||
/// </summary>
|
||||
/// <param name="myStr"></param>
|
||||
/// <returns></returns>
|
||||
private string ReverseString(string myStr)
|
||||
{
|
||||
char[] myArr = myStr.ToCharArray();
|
||||
Array.Reverse(myArr);
|
||||
return new string(myArr);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Core.Enum;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
@@ -37,7 +38,7 @@ namespace Core
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Istanzia un nuovo ogetto richeista supporto
|
||||
/// Istanzia un nuovo ogetto richiesta supporto
|
||||
/// </summary>
|
||||
/// <param name="codApp">Codice Applicazione (es EBW-UP)</param>
|
||||
/// <param name="codImp">Codice Impegno (es codice chiave HW)</param>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
public class UploadResult
|
||||
{
|
||||
public bool Uploaded { get; set; }
|
||||
public string? FileName { get; set; }
|
||||
public string? StoredFileName { get; set; }
|
||||
public string FileName { get; set; } = "";
|
||||
public string StoredFileName { get; set; } = "";
|
||||
public int ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,8 @@ namespace Core
|
||||
plainAuthKey = SteamCrypto.DecryptString(authKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
|
||||
answ = Convert.ToDateTime(plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), ""));
|
||||
}
|
||||
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);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.3" newVersion="8.0.0.3" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{5DADD362-4B14-45AD-AB0A-B30361D7449B}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>EgwProxy.LiMan.ConsoleTest</RootNamespace>
|
||||
<AssemblyName>EgwProxy.LiMan.ConsoleTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.LiMan\EgwProxy.LiMan.csproj">
|
||||
<Project>{1b8191a0-dd4e-4320-878b-246a9b61c368}</Project>
|
||||
<Name>EgwProxy.LiMan</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.LiMan.ConsoleTest
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string separator = "-----------------";
|
||||
string codApp = "EgtBeamWall";
|
||||
string answ = "";
|
||||
#if DEBUG
|
||||
string srvUrl = "localhost:5003";
|
||||
//string srvUrl = "liman.egalware.com/ELM.API";
|
||||
#else
|
||||
string srvUrl = "liman.egalware.com/ELM.API";
|
||||
#endif
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("EgwProxy.LiMan | Console test app");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("premere un tasto per continuare...");
|
||||
Console.ReadLine();
|
||||
// per prima cosa instanzio (cablato) la classe di comnicazione
|
||||
var commLib = new DataSyncro(srvUrl);
|
||||
|
||||
// test ping
|
||||
Console.WriteLine("Premere ENT per check ping");
|
||||
answ = Console.ReadLine();
|
||||
bool servOk = commLib.CheckRemote();
|
||||
string esito = servOk ? "OK" : "KO";
|
||||
Console.WriteLine($"Esito controllo server: {esito}");
|
||||
|
||||
// chiamo e mostro elenco
|
||||
var listAll = commLib.ReleaseGetAll(codApp);
|
||||
|
||||
// mostro elenco
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Elenco versioni completo:");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("");
|
||||
foreach (var item in listAll)
|
||||
{
|
||||
Console.WriteLine($"{item.CodApp} | {item.VersNum} | {item.VersText} | {item.ReleaseDate:yyyy-MM-dd}");
|
||||
}
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("premere un tasto per continuare...");
|
||||
Console.WriteLine("");
|
||||
Console.ReadLine();
|
||||
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Elenco versioni filtrato:");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("Inserire versione minima richiesta (default: 0.0.0.0)");
|
||||
answ = Console.ReadLine();
|
||||
answ = string.IsNullOrEmpty(answ) ? "0.0.0.0" : answ;
|
||||
|
||||
while (!string.IsNullOrEmpty(answ))
|
||||
{
|
||||
var listFilt = commLib.ReleaseGetFilt(codApp, answ);
|
||||
foreach (var item in listFilt)
|
||||
{
|
||||
Console.WriteLine($"{item.CodApp} | {item.VersNum} | {item.VersText} | {item.ReleaseDate:yyyy-MM-dd}");
|
||||
}
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("");
|
||||
|
||||
Console.WriteLine("Inserire versione minima richiesta (se vuoto esce)");
|
||||
answ = Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.LiMan.ConsoleTest")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.LiMan.ConsoleTest")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("5dadd362-4b14-45ad-ab0a-b30361d7449b")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwProxy.LiMan</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.LiMan</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione REST con server LiMan - beta/unstable</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.LiMan LiMan Rest</tags>
|
||||
<dependencies>
|
||||
<dependency id="RestSharp" version="111.2.0.0" />
|
||||
<dependency id="Newtonsoft.Json" version="13.0.0.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.LiMan\bin\Debug\EgwProxy.LiMan*.dll" target="lib" />
|
||||
<file src="EgwProxy.LiMan\bin\Debug\EgwProxy.LiMan*.config" target="lib" />
|
||||
<file src="EgwProxy.LiMan\bin\Debug\EgwProxy.LiMan*.pdb" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwProxy.LiMan</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.LiMan</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione REST con server LiMan</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.LiMan LiMan Rest</tags>
|
||||
<dependencies>
|
||||
<dependency id="RestSharp" version="111.2.0.0" />
|
||||
<dependency id="Newtonsoft.Json" version="13.0.0.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.LiMan\bin\Debug\EgwProxy.LiMan*.dll" target="lib" />
|
||||
<file src="EgwProxy.LiMan\bin\Debug\EgwProxy.LiMan*.config" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34902.65
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.LiMan", "EgwProxy.LiMan\EgwProxy.LiMan.csproj", "{1B8191A0-DD4E-4320-878B-246A9B61C368}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.LiMan.ConsoleTest", "EgwProxy.LiMan.ConsoleTest\EgwProxy.LiMan.ConsoleTest.csproj", "{5DADD362-4B14-45AD-AB0A-B30361D7449B}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestWinFormVB", "TestWinFormVB\TestWinFormVB.vbproj", "{CC0A7D8F-0888-45F5-B791-FCD90349CD21}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1B8191A0-DD4E-4320-878B-246A9B61C368}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1B8191A0-DD4E-4320-878B-246A9B61C368}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1B8191A0-DD4E-4320-878B-246A9B61C368}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1B8191A0-DD4E-4320-878B-246A9B61C368}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5DADD362-4B14-45AD-AB0A-B30361D7449B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5DADD362-4B14-45AD-AB0A-B30361D7449B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5DADD362-4B14-45AD-AB0A-B30361D7449B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5DADD362-4B14-45AD-AB0A-B30361D7449B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CC0A7D8F-0888-45F5-B791-FCD90349CD21}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4898F98F-F4DF-4114-A026-D03C28F288A3}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace EgwProxy.LiMan.DTO
|
||||
{
|
||||
public class ReleaseDTO
|
||||
{
|
||||
/// <summary>
|
||||
/// Codice/Nome applicativo
|
||||
/// </summary>
|
||||
public string CodApp { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Versione applicativo formato semver numerico 4 blocchi
|
||||
/// </summary>
|
||||
public string VersNum { get; set; } = "0.0.0.0";
|
||||
|
||||
/// <summary>
|
||||
/// Versione applicativo, formato testuale libero, può essere uguale a VersNum
|
||||
/// </summary>
|
||||
public string VersText { get; set; } = "a.b";
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto versione calcolato da VersNum
|
||||
/// </summary>
|
||||
public Version VersVal { get; set; } = new Version();
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia permessa la versione quando viene valutata la versione massima consentita
|
||||
/// </summary>
|
||||
public bool IsPermitted { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Data di release
|
||||
/// </summary>
|
||||
public DateTime ReleaseDate { get; set; } = DateTime.Today.AddYears(100);
|
||||
|
||||
/// <summary>
|
||||
/// Url pagina web di changelog (traduzione gestita sul sito target) - calcolato da CodApp + vers
|
||||
/// </summary>
|
||||
public string UrlChangelog { get; set; } = "http://releases.egalware.com";
|
||||
|
||||
/// <summary>
|
||||
/// Url pagina web di changelog estesa (traduzione gestita sul sito target) - calcolato da CodApp + vers
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public string UrlChangelogExt { get; set; } = "http://releases.egalware.com";
|
||||
|
||||
/// <summary>
|
||||
/// Indica se il record sia da considerare attivo/pubblico
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public bool IsActive { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
using EgwProxy.LiMan.DTO;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using NLog.Fluent;
|
||||
using RestSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace EgwProxy.LiMan
|
||||
{
|
||||
public class DataSyncro
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza la libreria di comunicazione con il token assegnato
|
||||
/// </summary>
|
||||
/// <param name="serverUrl">URL del server</param>
|
||||
public DataSyncro(string serverUrl)
|
||||
{
|
||||
servAddr = serverUrl;
|
||||
apiUrl = $"https://{servAddr}/api/";
|
||||
rcOptions = new RestClientOptions { BaseUrl = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(callTimeout) };
|
||||
Log.Info($"DataSyncro initialized | api: {apiUrl} | timeout: {callTimeout}");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Test ping x indirizzo indicato
|
||||
/// </summary>
|
||||
/// <param name="tgtAddr">Indirizzo da pingare</param>
|
||||
/// <returns></returns>
|
||||
public static IPStatus pingAddress(string tgtAddr)
|
||||
{
|
||||
IPStatus answ = IPStatus.Unknown;
|
||||
IPAddress address;
|
||||
PingReply reply;
|
||||
using (Ping pingSender = new Ping())
|
||||
{
|
||||
address = IPAddress.Loopback;
|
||||
int pingMsTimeout = 500;
|
||||
IPAddress.TryParse(tgtAddr, out address);
|
||||
try
|
||||
{
|
||||
// se != null --> uso tgtAddr...
|
||||
if (address != null)
|
||||
{
|
||||
reply = pingSender.Send(address, pingMsTimeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
reply = pingSender.Send(tgtAddr, pingMsTimeout);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
reply = pingSender.Send(IPAddress.Loopback, pingMsTimeout);
|
||||
}
|
||||
answ = reply.Status;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test ping x indirizzo indicato
|
||||
/// </summary>
|
||||
/// <param name="tgtAddr">Indirizzo da pingare</param>
|
||||
/// <param name="timeout">Timeout chiamata in ms</param>
|
||||
/// <returns></returns>
|
||||
public static IPStatus pingAddress(string tgtAddr, int timeout)
|
||||
{
|
||||
IPStatus answ = IPStatus.Unknown;
|
||||
IPAddress address;
|
||||
PingReply reply;
|
||||
using (Ping pingSender = new Ping())
|
||||
{
|
||||
address = IPAddress.Loopback;
|
||||
int pingMsTimeout = timeout;
|
||||
IPAddress.TryParse(tgtAddr, out address);
|
||||
try
|
||||
{
|
||||
// se != null --> uso tgtAddr...
|
||||
if (address != null && address != IPAddress.Loopback)
|
||||
{
|
||||
reply = pingSender.Send(address, pingMsTimeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
reply = pingSender.Send(tgtAddr, pingMsTimeout);
|
||||
}
|
||||
answ = reply.Status;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
answ = IPStatus.Unknown;
|
||||
Log.Error($"Errore in ping:{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua chiamata test sul server (ping), se fallisse riprova fino a maxTry volte
|
||||
/// </summary>
|
||||
/// <param name="maxTry">num tentativi in caso di KO</param>
|
||||
/// <param name="waitTime">tempo di attesa medio tra tentativi in ms</param>
|
||||
/// <returns></returns>
|
||||
public bool CheckRemote(int maxTry = 5, int waitTime = 200)
|
||||
{
|
||||
bool res = false;
|
||||
int numTry = 0;
|
||||
IPAddress address = IPAddress.Loopback;
|
||||
string srvName = servAddr;
|
||||
// tolgo eventuale nome con ":"
|
||||
if (servAddr.Contains(":"))
|
||||
{
|
||||
srvName = servAddr.Substring(0, servAddr.IndexOf(":"));
|
||||
}
|
||||
// tolgo eventuale nome con "/"
|
||||
if (servAddr.Contains("/"))
|
||||
{
|
||||
srvName = servAddr.Substring(0, servAddr.IndexOf("/"));
|
||||
}
|
||||
while (!res && numTry < maxTry)
|
||||
{
|
||||
res = pingAddress(srvName, callTimeout) == IPStatus.Success;
|
||||
numTry++;
|
||||
if (!res)
|
||||
{
|
||||
Thread.Sleep(waitTime);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Release applicazione
|
||||
/// </summary>
|
||||
/// <param name="CodApp">CodApp richiesta</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseDTO> ReleaseGetAll(string CodApp)
|
||||
{
|
||||
List<ReleaseDTO> answ = new List<ReleaseDTO>();
|
||||
using (RestClient client = new RestClient(rcOptions))
|
||||
{
|
||||
string CodAppEnc = HttpUtility.UrlEncode(CodApp);
|
||||
var request = new RestRequest($"Release/{CodAppEnc}", Method.Get);
|
||||
var response = client.Get(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
// contenuto serializzato
|
||||
string rawData = $"{response.Content}";
|
||||
answ = JsonConvert.DeserializeObject<List<ReleaseDTO>>(rawData);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Versione Async Elenco Release applicazione
|
||||
/// </summary>
|
||||
/// <param name="CodApp">CodApp richiesta</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ReleaseDTO>> ReleaseGetAllAsync(string CodApp)
|
||||
{
|
||||
List<ReleaseDTO> answ = new List<ReleaseDTO>();
|
||||
|
||||
using (RestClient client = new RestClient(rcOptions))
|
||||
{
|
||||
string CodAppEnc = HttpUtility.UrlEncode(CodApp);
|
||||
var request = new RestRequest($"Release/{CodAppEnc}", Method.Get);
|
||||
var response = await client.GetAsync(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
// contenuto serializzato
|
||||
string rawData = $"{response.Content}";
|
||||
answ = JsonConvert.DeserializeObject<List<ReleaseDTO>>(rawData);
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Release applicazione
|
||||
/// </summary>
|
||||
/// <param name="CodApp">CodApp richiesta</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseDTO> ReleaseGetFilt(string CodApp, string VersMin)
|
||||
{
|
||||
List<ReleaseDTO> answ = new List<ReleaseDTO>();
|
||||
using (RestClient client = new RestClient(rcOptions))
|
||||
{
|
||||
string CodAppEnc = HttpUtility.UrlEncode(CodApp);
|
||||
var request = new RestRequest($"Release/filt/{CodAppEnc}?VersMin={VersMin}", Method.Get);
|
||||
var response = client.Get(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
// contenuto serializzato
|
||||
string rawData = $"{response.Content}";
|
||||
answ = JsonConvert.DeserializeObject<List<ReleaseDTO>>(rawData);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Versione Async Elenco Release applicazione
|
||||
/// </summary>
|
||||
/// <param name="CodApp">CodApp richiesta</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ReleaseDTO>> ReleaseGetFiltAsync(string CodApp, string VersMin)
|
||||
{
|
||||
List<ReleaseDTO> answ = new List<ReleaseDTO>();
|
||||
|
||||
using (RestClient client = new RestClient(rcOptions))
|
||||
{
|
||||
string CodAppEnc = HttpUtility.UrlEncode(CodApp);
|
||||
var request = new RestRequest($"Release/filt/{CodAppEnc}?VersMin={VersMin}", Method.Get);
|
||||
var response = await client.GetAsync(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
// contenuto serializzato
|
||||
string rawData = $"{response.Content}";
|
||||
answ = JsonConvert.DeserializeObject<List<ReleaseDTO>>(rawData);
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Release applicazione
|
||||
/// </summary>
|
||||
/// <param name="CodApp">CodApp richiesta</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <param name="VersMax">Versione massima consentita</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseDTO> ReleaseGetFiltLimit(string CodApp, string VersMin, string VersMax)
|
||||
{
|
||||
List<ReleaseDTO> answ = new List<ReleaseDTO>();
|
||||
using (RestClient client = new RestClient(rcOptions))
|
||||
{
|
||||
string CodAppEnc = HttpUtility.UrlEncode(CodApp);
|
||||
var request = new RestRequest($"Release/filtLimit/{CodAppEnc}?VersMin={VersMin}&VersMax={VersMax}", Method.Get);
|
||||
var response = client.Get(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
// contenuto serializzato
|
||||
string rawData = $"{response.Content}";
|
||||
answ = JsonConvert.DeserializeObject<List<ReleaseDTO>>(rawData);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Versione Async Elenco Release applicazione
|
||||
/// </summary>
|
||||
/// <param name="CodApp">CodApp richiesta</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <param name="VersMax">Versione massima consentita</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ReleaseDTO>> ReleaseGetFiltLimitAsync(string CodApp, string VersMin, string VersMax)
|
||||
{
|
||||
List<ReleaseDTO> answ = new List<ReleaseDTO>();
|
||||
|
||||
using (RestClient client = new RestClient(rcOptions))
|
||||
{
|
||||
string CodAppEnc = HttpUtility.UrlEncode(CodApp);
|
||||
var request = new RestRequest($"Release/filtLimit/{CodAppEnc}?VersMin={VersMin}&VersMax={VersMax}", Method.Get);
|
||||
var response = await client.GetAsync(request);
|
||||
// controllo risposta
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
// contenuto serializzato
|
||||
string rawData = $"{response.Content}";
|
||||
answ = JsonConvert.DeserializeObject<List<ReleaseDTO>>(rawData);
|
||||
}
|
||||
}
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// URL dell'API x chiamate gestione licenze
|
||||
/// </summary>
|
||||
private string apiUrl = $"";
|
||||
|
||||
private int callTimeout = 10000;
|
||||
|
||||
/// <summary>
|
||||
/// Opzioni standard di chiamata
|
||||
/// </summary>
|
||||
private RestClientOptions rcOptions = new RestClientOptions();
|
||||
|
||||
/// <summary>
|
||||
/// Indirizzo server (URL con eventuale porta)
|
||||
/// </summary>
|
||||
private string servAddr = $"";
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1B8191A0-DD4E-4320-878B-246A9B61C368}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgwProxy.LiMan</RootNamespace>
|
||||
<AssemblyName>EgwProxy.LiMan</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp, Version=111.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RestSharp.111.2.0\lib\net471\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DataSyncro.cs" />
|
||||
<Compile Include="RestPayload.cs" />
|
||||
<Compile Include="DTO\ReleaseDTO.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.LiMan")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.LiMan")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1b8191a0-dd4e-4320-878b-246a9b61c368")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,24 @@
|
||||
using EgwProxy.LiMan.DTO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.LiMan
|
||||
{
|
||||
public class RestPayload
|
||||
{
|
||||
public class ReleaseData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record ReleaseDTO x verifica versioni disponibili
|
||||
/// </summary>
|
||||
public List<ReleaseDTO> ReleaseList { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.3" newVersion="8.0.0.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||
<package id="NLog" version="5.0.1" targetFramework="net462" />
|
||||
<package id="RestSharp" version="111.2.0" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net472" />
|
||||
<package id="System.Text.Json" version="8.0.3" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" requireReinstallation="true" />
|
||||
</packages>
|
||||
File diff suppressed because one or more lines are too long
@@ -21,7 +21,7 @@ namespace LiMan.APi.Controllers
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace LiMan.APi.Controllers
|
||||
/// </summary>
|
||||
// POST api/attivazioni/removeKey
|
||||
[HttpPost("removeKey")]
|
||||
public async Task<bool> Delete([FromBody] UserLicenseRequest CurrRequest)
|
||||
public async Task<bool> removeKey([FromBody] UserLicenseRequest CurrRequest)
|
||||
{
|
||||
bool done = await dataService.AttivazioniDelete(CurrRequest.MasterKey, CurrRequest.ParamDict);
|
||||
// se ho qualcosa da loggare...
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
using LiMan.APi.Data;
|
||||
using LiMan.DbSync.DbModels;
|
||||
using LiMan.DbSync.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.APi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller per sync tabelle standard
|
||||
/// </summary>
|
||||
[Route("api/dbsync")]
|
||||
[ApiController]
|
||||
public class DbSyncController : ControllerBase
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init generico
|
||||
/// </summary>
|
||||
/// <param name="DataService"></param>
|
||||
public DbSyncController(ApiDataService DataService, DbSyncService SyncService)
|
||||
{
|
||||
mainDataService = DataService;
|
||||
syncDataService = SyncService;
|
||||
Log.Info("Avviata classe DbSyncController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco dati Config x setup locale GET api/dbsync/conf/[id]?[CodApp]
|
||||
/// </summary>
|
||||
/// <param name="id">Codice cliente/Installazione</param>
|
||||
/// <param name="CodApp">Codice Applicazione</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("conf/{id}")]
|
||||
public async Task<List<ConfigModel>> Get(string id, string CodApp)
|
||||
{
|
||||
// ora recupero le info richieste dall'applicativo
|
||||
List<ConfigModel> result = await syncDataService.ConfigGetAll(CodApp);
|
||||
await mainDataService.recordCall(id, CodApp, $"GET:api/dbsync/conf/");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco dati AnagKeyVal x setup locale GET api/dbsync/anagkeyval/[id]?[CodApp]
|
||||
/// </summary>
|
||||
/// <param name="id">Codice cliente/Installazione</param>
|
||||
/// <param name="CodApp">Codice Applicazione</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("anagkeyval/{id}")]
|
||||
public async Task<List<AnagKeyValueModel>> GetAnagKeyVal(string id, string CodApp)
|
||||
{
|
||||
// ora recupero le info richieste dall'applicativo
|
||||
List<AnagKeyValueModel> result = await syncDataService.AnagKeyValGetAll(CodApp);
|
||||
await mainDataService.recordCall(id, CodApp, $"GET:api/dbsync/anagkeyval/");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco dati Vocabolario x setup locale GET api/dbsync/anagkeyval/[id]?[CodApp]
|
||||
/// </summary>
|
||||
/// <param name="id">Codice cliente/Installazione</param>
|
||||
/// <param name="CodApp">Codice Applicazione</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("vocabolario/{id}")]
|
||||
public async Task<List<VocabolarioModel>> GetVocabolario(string id, string CodApp)
|
||||
{
|
||||
// ora recupero le info richieste dall'applicativo
|
||||
List<VocabolarioModel> result = await syncDataService.VocabolarioGetAll(CodApp);
|
||||
await mainDataService.recordCall(id, CodApp, $"GET:api/dbsync/vocabolario/");
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected ApiDataService mainDataService { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected DbSyncService syncDataService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ namespace LiMan.APi.Controllers
|
||||
/// Caricamento file effettivo via POST
|
||||
/// </summary>
|
||||
/// <param name="ticketId">TicketId x riferimento</param>
|
||||
/// <param name="files">Elenco files da caricare</param>
|
||||
/// <param name="file">Elenco files da caricare</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("single")]
|
||||
public async Task<ActionResult<UploadResult>> PostSingleFile([FromForm] int ticketId, [FromForm] IFormFile file)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
using LiMan.APi.Data;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.APi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller livello Health
|
||||
/// </summary>
|
||||
[Route("api/health")]
|
||||
[ApiController]
|
||||
public class HealthController : ControllerBase
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init generico
|
||||
/// </summary>
|
||||
/// <param name="DataService"></param>
|
||||
public HealthController(ApiDataService DataService)
|
||||
{
|
||||
dataService = DataService;
|
||||
Log.Info("Avviata classe HealthController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected ApiDataService dataService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// GET api/health
|
||||
/// <summary>
|
||||
/// Recupera elenco applicativi dati cliente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<string> Get()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
return "OK";
|
||||
}
|
||||
|
||||
/// GET api/health/id
|
||||
/// <summary>
|
||||
/// Restituisce info riguardo allo stato di salute di un servizio
|
||||
/// </summary>
|
||||
/// <param name="id">Tipo di servizio: db/redis/...</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}")]
|
||||
public async Task<string> Get(string id)
|
||||
{
|
||||
string result = "NA";
|
||||
await Task.Delay(1);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
using Core;
|
||||
using LiMan.APi.Data;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.APi.Controllers
|
||||
@@ -17,48 +19,35 @@ namespace LiMan.APi.Controllers
|
||||
[ApiController]
|
||||
public class LicenzaController : ControllerBase
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init generico
|
||||
/// Init Controller Licenze
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="emailSender"></param>
|
||||
/// <param name="DataService"></param>
|
||||
public LicenzaController(ApiDataService DataService)
|
||||
public LicenzaController(IConfiguration configuration, IEmailSender emailSender, ApiDataService DataService)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_emailSender = emailSender;
|
||||
dataService = DataService;
|
||||
Log.Info("Avviata classe LicenzaController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected ApiDataService dataService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// GET api/licenza/id
|
||||
/// <summary>
|
||||
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id">Codice cliente/Installazione</param>
|
||||
/// <param name="CodApp">Codice Applicazione</param>
|
||||
/// <param name="CodApp">Codice Applicazione</param>
|
||||
/// <param name="Chiave">Chiave licenza da validare</param>
|
||||
/// <returns></returns>
|
||||
// GET api/licenza/id?CodApp=xxx&Chiave=yyyy
|
||||
[HttpGet("{id}")]
|
||||
public async Task<List<DB.DTO.ApplicativoDTO>> Get(string id, string CodApp, string Chiave)
|
||||
{
|
||||
@@ -67,9 +56,60 @@ namespace LiMan.APi.Controllers
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua verifica scadenze licenze secondo 3 livelli dati da diversi orizzonti temporali
|
||||
/// - urgente: entro 1 settimana
|
||||
/// - importante: entro 1 mese
|
||||
/// - info: entro 2 mesi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("CheckScadenze")]
|
||||
public async Task<string> Get()
|
||||
{
|
||||
// oggetti base
|
||||
string answ = "ND";
|
||||
string msgBody = "";
|
||||
StringBuilder sbMain = new StringBuilder();
|
||||
StringBuilder sbActions = new StringBuilder();
|
||||
StringBuilder sbAllProj = new StringBuilder();
|
||||
|
||||
// orizzonti da valutare
|
||||
DateTime oggi = DateTime.Today;
|
||||
|
||||
doLog("Esito della verifica Licenze (scadute/in scadenza)", logType.info, ref sbMain);
|
||||
|
||||
// verifico quelle GIA' SCADUTE (< oggi)
|
||||
List<DB.DTO.ApplicativoDTO> elencoScadute = await dataService.LicenzeExpiring(DateTime.MinValue, oggi);
|
||||
List<DB.DTO.ApplicativoDTO> elencoWeek = await dataService.LicenzeExpiring(oggi, oggi.AddDays(8));
|
||||
List<DB.DTO.ApplicativoDTO> elencoMonth = await dataService.LicenzeExpiring(oggi.AddDays(8), oggi.AddDays(1).AddMonths(1));
|
||||
List<DB.DTO.ApplicativoDTO> elencoTrim = await dataService.LicenzeExpiring(oggi.AddDays(1).AddMonths(1), oggi.AddDays(1).AddMonths(3));
|
||||
|
||||
int numScadute = elencoScadute.Count;
|
||||
int numWeek = elencoWeek.Count;
|
||||
int numMonth = elencoMonth.Count;
|
||||
int numTrim = elencoTrim.Count;
|
||||
|
||||
// display scadute scadute...
|
||||
msgBody += formatCheckPeriodo(elencoScadute, "Licenze <b>SCADUTE</b>", "font-size: 1.3em; color: #D62424;");
|
||||
msgBody += formatCheckPeriodo(elencoWeek, "Licenze in scadenza nella <b>SETTIMANA</b>", "font-size: 1.2em; color: #DF701C;");
|
||||
msgBody += formatCheckPeriodo(elencoMonth, "Licenze in scadenza nel <b>MESE</b>", "font-size: 1.15em; color: #A99C45;");
|
||||
msgBody += formatCheckPeriodo(elencoTrim, "Licenze in scadenza nel <b>TRIMESTRE</b>", "font-size: 1.1em; color: #9Dc935;");
|
||||
|
||||
// predispongo email
|
||||
string msgTopic = "LiMan: verifica Licenze in scadenza";
|
||||
|
||||
// invio email
|
||||
await sendEmail(msgTopic, msgBody.Replace($"{Environment.NewLine}", "<br/>"));
|
||||
|
||||
// ritorno solo LOG azioni
|
||||
answ = $"Scadute {numScadute} | Settimana: {numWeek} | Mese: {numMonth} | Trimestre: {numTrim}";
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// POST api/licenza
|
||||
/// <summary>
|
||||
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
|
||||
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma +
|
||||
/// licenza ATTUALE
|
||||
/// </summary>
|
||||
/// <param name="AppInfo">Info licenza in formato LicenseCoord</param>
|
||||
/// <returns></returns>
|
||||
@@ -95,5 +135,125 @@ namespace LiMan.APi.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Enums
|
||||
|
||||
protected enum logType
|
||||
{
|
||||
none,
|
||||
local,
|
||||
trace,
|
||||
info,
|
||||
warn
|
||||
}
|
||||
|
||||
#endregion Protected Enums
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected ApiDataService dataService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua log del tipo richiesto aggiungendo riga anche allo stringbuilder indicato
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="tipoLog"></param>
|
||||
/// <param name="currSB"></param>
|
||||
protected void doLog(string message, logType tipoLog, ref StringBuilder currSB)
|
||||
{
|
||||
bool doLine = true;
|
||||
switch (tipoLog)
|
||||
{
|
||||
case logType.info:
|
||||
Log.Info(message);
|
||||
break;
|
||||
|
||||
case logType.trace:
|
||||
Log.Trace(message);
|
||||
break;
|
||||
|
||||
case logType.warn:
|
||||
Log.Warn(message);
|
||||
break;
|
||||
|
||||
case logType.local:
|
||||
break;
|
||||
|
||||
default:
|
||||
case logType.none:
|
||||
doLine = false;
|
||||
break;
|
||||
}
|
||||
if (doLine)
|
||||
{
|
||||
currSB.AppendLine(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
currSB.Append(message);
|
||||
}
|
||||
}
|
||||
|
||||
protected string formatCheckPeriodo(List<DB.DTO.ApplicativoDTO> elencoLicenze, string tipoVerifica, string titleStyle)
|
||||
{
|
||||
StringBuilder sbMain = new StringBuilder();
|
||||
doLog($"<div style=\"{titleStyle}\">", logType.none, ref sbMain);
|
||||
int numScadute = elencoLicenze.Count;
|
||||
doLog($"{tipoVerifica}: <b>{numScadute}</b>", logType.info, ref sbMain);
|
||||
doLog("<div style=\"font-size: 1em; color: black;\">", logType.none, ref sbMain);
|
||||
if (elencoLicenze.Count == 0)
|
||||
{
|
||||
doLog($" - nessuna", logType.info, ref sbMain);
|
||||
|
||||
}
|
||||
else {
|
||||
foreach (var item in elencoLicenze)
|
||||
{
|
||||
doLog($" - {item.Scadenza:yyyy.MM.dd} | <b>{item.CodInst}</b> | {item.Descrizione}", logType.info, ref sbMain);
|
||||
}
|
||||
}
|
||||
doLog("</div>", logType.none, ref sbMain);
|
||||
doLog("</div>", logType.none, ref sbMain);
|
||||
return sbMain.ToString();
|
||||
}
|
||||
|
||||
protected async Task sendEmail(string subject, string message)
|
||||
{
|
||||
string emailRaw = _configuration["MailDest:ExpiryNotify"];
|
||||
List<string> emailDestList = emailRaw.Split(",").ToList();
|
||||
foreach (var dest in emailDestList)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _emailSender.SendEmailAsync(dest, subject, message);
|
||||
}
|
||||
catch(Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante invio email:{Environment.NewLine}dest: {dest} | subject {subject}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private readonly IEmailSender _emailSender;
|
||||
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using LiMan.APi.Data;
|
||||
using LiMan.DB.DTO;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.APi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller gestione RELEASE applicativi
|
||||
/// </summary>
|
||||
[Route("api/release")]
|
||||
[ApiController]
|
||||
public class ReleaseController : ControllerBase
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init generico
|
||||
/// </summary>
|
||||
/// <param name="DataService"></param>
|
||||
public ReleaseController(ApiDataService DataService)
|
||||
{
|
||||
dataService = DataService;
|
||||
Log.Info("Avviata classe ReleaseController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco dati licenza Applicativi (completo)
|
||||
/// GET api/Release/EgtBW
|
||||
/// </summary>
|
||||
/// <param name="id">Codice Applicazione</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}")]
|
||||
public async Task<List<ReleaseDTO>> Get(string id)
|
||||
{
|
||||
var result = await dataService.ReleaseGetByApp(id);
|
||||
await dataService.recordCall(id, id, $"GET:api/Release/{id}");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco dati licenza Applicativi data versione minima
|
||||
/// GET api/Release/EgtBW
|
||||
/// </summary>
|
||||
/// <param name="id">Codice Applicazione</param>
|
||||
/// <param name="VersMin">Versione minima richiesta (attuale)</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("filt/{id}")]
|
||||
public async Task<List<ReleaseDTO>> GetFilt(string id, string VersMin)
|
||||
{
|
||||
var result = await dataService.ReleaseGetByAppVers(id, VersMin);
|
||||
await dataService.recordCall(id, id, $"GET:api/Release/filt/{id}");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco dati licenza Applicativi data versione minima + vers limite
|
||||
/// GET api/Release/EgtBW
|
||||
/// </summary>
|
||||
/// <param name="id">Codice Applicazione</param>
|
||||
/// <param name="VersMin">Versione minima richiesta (attuale)</param>
|
||||
/// <param name="VersMax">Versione massima consentita</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("filtLimit/{id}")]
|
||||
public async Task<List<ReleaseDTO>> GetFiltLimit(string id, string VersMin, string VersMax)
|
||||
{
|
||||
var result = await dataService.ReleaseGetByAppVersLimit(id, VersMin, VersMax);
|
||||
await dataService.recordCall(id, id, $"GET:api/Release/filt/{id}");
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dataservice x accesso DB
|
||||
/// </summary>
|
||||
protected ApiDataService dataService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
+703
-576
File diff suppressed because it is too large
Load Diff
@@ -6,31 +6,42 @@
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>C:\Users\samuele\source\repos\LiManApp\LiMan.Api\LiMan.APi.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS03.pubxml" />
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS04.pubxml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS04.pubxml.user" />
|
||||
<None Include="Properties\PublishProfiles\IIS03.pubxml.user" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.28" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.11" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="7.1.1" />
|
||||
<PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft" Version="7.1.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.2" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
||||
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LiMan.DbSync\LiMan.DbSync.csproj" />
|
||||
<ProjectReference Include="..\LiMan.DB\LiMan.DB.csproj" />
|
||||
<ProjectReference Include="..\LiMan.GLS\LiMan.GLS.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
Caricamento file effettivo via POST
|
||||
</summary>
|
||||
<param name="ticketId">TicketId x riferimento</param>
|
||||
<param name="files">Elenco files da caricare</param>
|
||||
<param name="file">Elenco files da caricare</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:LiMan.APi.Controllers.InstallazioniController">
|
||||
@@ -560,7 +560,7 @@
|
||||
</member>
|
||||
<member name="M:LiMan.APi.Data.ApiDataService.TicketAdd(Core.SupportRequest)">
|
||||
<summary>
|
||||
Esegue aggiunta Ticket richeisto + restitusice aperti x cliente
|
||||
Esegue aggiunta Ticket richiesto + restitusice aperti x cliente
|
||||
</summary>
|
||||
<param name="currRequest"></param>
|
||||
<returns></returns>
|
||||
@@ -576,7 +576,7 @@
|
||||
<param name="numRec"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:LiMan.APi.Data.ApiDataService.TicketUpdateState(System.Int32,Core.StatoRichiesta)">
|
||||
<member name="M:LiMan.APi.Data.ApiDataService.TicketUpdateState(System.Int32,Core.Enum.StatoRichiesta)">
|
||||
<summary>
|
||||
Aggiornamentos tato ticket
|
||||
</summary>
|
||||
|
||||
@@ -7,6 +7,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAADyvXRKpxfDWrEi+5cXyVPMAAAAAASAAACgAAAAEAAAAMRndt7QRE05+xDzpFe1wWwYAAAAfM5H5MJhxE4ciNpDlKikQFw6IBALwdj0FAAAAI8ZWcD16VBpqPQZ+tg+phFYzX1T</EncryptedPassword>
|
||||
<History>True|2022-02-04T09:39:26.3565661Z;False|2022-02-04T10:38:16.4000573+01:00;False|2022-02-04T10:31:02.8361162+01:00;False|2022-02-04T10:29:23.4973985+01:00;False|2022-02-04T10:28:21.1773984+01:00;False|2022-02-04T10:25:50.0542905+01:00;False|2022-02-04T10:23:45.1840125+01:00;False|2022-02-04T10:23:24.8448115+01:00;False|2022-02-04T10:22:15.7243050+01:00;False|2022-02-04T10:21:53.7185925+01:00;False|2022-02-04T10:15:28.7942817+01:00;False|2022-02-04T10:12:36.7104601+01:00;True|2022-02-02T11:24:58.6066960+01:00;False|2021-11-16T14:49:02.9625741+01:00;True|2021-11-09T12:19:38.4459836+01:00;True|2021-11-09T12:19:33.2695831+01:00;True|2021-11-09T12:09:32.8676673+01:00;True|2021-11-09T12:09:26.5263401+01:00;True|2021-11-09T12:09:20.3614911+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
|
||||
<History>True|2023-02-03T18:35:00.4015320Z;True|2022-02-04T10:39:26.3565661+01:00;False|2022-02-04T10:38:16.4000573+01:00;False|2022-02-04T10:31:02.8361162+01:00;False|2022-02-04T10:29:23.4973985+01:00;False|2022-02-04T10:28:21.1773984+01:00;False|2022-02-04T10:25:50.0542905+01:00;False|2022-02-04T10:23:45.1840125+01:00;False|2022-02-04T10:23:24.8448115+01:00;False|2022-02-04T10:22:15.7243050+01:00;False|2022-02-04T10:21:53.7185925+01:00;False|2022-02-04T10:15:28.7942817+01:00;False|2022-02-04T10:12:36.7104601+01:00;True|2022-02-02T11:24:58.6066960+01:00;False|2021-11-16T14:49:02.9625741+01:00;True|2021-11-09T12:19:38.4459836+01:00;True|2021-11-09T12:19:33.2695831+01:00;True|2021-11-09T12:09:32.8676673+01:00;True|2021-11-09T12:09:26.5263401+01:00;True|2021-11-09T12:09:20.3614911+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</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>
|
||||
<AllowUntrustedCertificate>true</AllowUntrustedCertificate>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish>liman.egalware.com/ELM.API</SiteUrlToLaunchAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<ProjectGuid>34200ca2-489c-435a-a60b-34de7b7ba04d</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<MSDeployServiceURL>https://office.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||
<DeployIisAppPath>liman.egalware.com/ELM.API</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>true</EnableMSDeployBackup>
|
||||
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
|
||||
<UserName>jenkins</UserName>
|
||||
<_SavePWD>true</_SavePWD>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAADyvXRKpxfDWrEi+5cXyVPMAAAAAASAAACgAAAAEAAAAMRndt7QRE05+xDzpFe1wWwYAAAAfM5H5MJhxE4ciNpDlKikQFw6IBALwdj0FAAAAI8ZWcD16VBpqPQZ+tg+phFYzX1T</EncryptedPassword>
|
||||
<History>True|2023-03-14T13:23:13.2505933Z;True|2023-03-14T14:22:47.9125658+01:00;True|2023-02-03T19:35:00.4015320+01:00;True|2022-02-04T10:39:26.3565661+01:00;False|2022-02-04T10:38:16.4000573+01:00;False|2022-02-04T10:31:02.8361162+01:00;False|2022-02-04T10:29:23.4973985+01:00;False|2022-02-04T10:28:21.1773984+01:00;False|2022-02-04T10:25:50.0542905+01:00;False|2022-02-04T10:23:45.1840125+01:00;False|2022-02-04T10:23:24.8448115+01:00;False|2022-02-04T10:22:15.7243050+01:00;False|2022-02-04T10:21:53.7185925+01:00;False|2022-02-04T10:15:28.7942817+01:00;False|2022-02-04T10:12:36.7104601+01:00;True|2022-02-02T11:24:58.6066960+01:00;False|2021-11-16T14:49:02.9625741+01:00;True|2021-11-09T12:19:38.4459836+01:00;True|2021-11-09T12:19:33.2695831+01:00;True|2021-11-09T12:09:32.8676673+01:00;True|2021-11-09T12:09:26.5263401+01:00;True|2021-11-09T12:09:20.3614911+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -22,7 +22,7 @@
|
||||
"dotnetRunMessages": "true",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"applicationUrl": "https://localhost:5003;http://localhost:5002",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
||||
+60
-19
@@ -1,5 +1,6 @@
|
||||
using LiMan.APi.Data;
|
||||
using LiMan.DB;
|
||||
using LiMan.DbSync.Services;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -9,6 +10,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using StackExchange.Redis;
|
||||
using StackExchange.Redis.Extensions.Core.Configuration;
|
||||
using StackExchange.Redis.Extensions.Newtonsoft;
|
||||
using System;
|
||||
@@ -40,19 +42,20 @@ namespace LiMan.Serv
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
if (env.IsDevelopment() || env.IsStaging())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseSwagger(c =>
|
||||
{
|
||||
c.RouteTemplate = "/swagger/{documentName}/swagger.json";
|
||||
});
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("v1/swagger.json", "LiMan.Api");
|
||||
});
|
||||
// valido solo in sviluppo
|
||||
app.UseSwagger(c =>
|
||||
{
|
||||
c.RouteTemplate = "/swagger/{documentName}/swagger.json";
|
||||
});
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("v1/swagger.json", "LiMan.Api");
|
||||
});
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
@@ -60,14 +63,27 @@ namespace LiMan.Serv
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseFileServer(new FileServerOptions
|
||||
// verifico da conf se sia linux o windows x file da accedere...
|
||||
if (Configuration["HostOs"] == "Win")
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"),
|
||||
RequestPath = new PathString("/unsafe_uploads"),
|
||||
EnableDirectoryBrowsing = true
|
||||
//EnableDirectoryBrowsing = false
|
||||
});
|
||||
|
||||
app.UseFileServer(new FileServerOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"),
|
||||
RequestPath = new PathString("/unsafe_uploads"),
|
||||
EnableDirectoryBrowsing = true
|
||||
//EnableDirectoryBrowsing = false
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseFileServer(new FileServerOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "unsafe_uploads")),
|
||||
RequestPath = new PathString("/unsafe_uploads"),
|
||||
EnableDirectoryBrowsing = true
|
||||
//EnableDirectoryBrowsing = false
|
||||
});
|
||||
}
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
@@ -89,14 +105,22 @@ namespace LiMan.Serv
|
||||
|
||||
// abilitazione x email management con MailKit
|
||||
services.AddTransient<IEmailSender, MailKitEmailSender>();
|
||||
// recupero email reversed
|
||||
string revPwd = Configuration["ExternalProviders:MailKit:SMTP:Password"] ?? "";
|
||||
string pwd = "";
|
||||
foreach (char c in revPwd)
|
||||
{
|
||||
pwd = c + pwd;
|
||||
}
|
||||
services.Configure<MailKitEmailSenderOptions>(options =>
|
||||
{
|
||||
options.Host_Address = Configuration["ExternalProviders:MailKit:SMTP:Address"];
|
||||
options.Host_Port = Convert.ToInt32(Configuration["ExternalProviders:MailKit:SMTP:Port"]);
|
||||
options.Host_Username = Configuration["ExternalProviders:MailKit:SMTP:Account"];
|
||||
options.Host_Password = Configuration["ExternalProviders:MailKit:SMTP:Password"];
|
||||
options.Host_Password = pwd;
|
||||
options.Sender_EMail = Configuration["ExternalProviders:MailKit:SMTP:SenderEmail"];
|
||||
options.Sender_Name = Configuration["ExternalProviders:MailKit:SMTP:SenderName"];
|
||||
options.Host_SecureSocketOptions = MailKit.Security.SecureSocketOptions.Auto;
|
||||
});
|
||||
|
||||
//services.AddStackExchangeRedisCache(options =>
|
||||
@@ -107,12 +131,29 @@ namespace LiMan.Serv
|
||||
services.AddControllers()
|
||||
.AddJsonOptions(c => c.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve);
|
||||
|
||||
services.AddSingleton<ApiDataService>();
|
||||
|
||||
services.AddStackExchangeRedisExtensions<NewtonsoftSerializer>((options) =>
|
||||
{
|
||||
return Configuration.GetSection("Redis").Get<RedisConfiguration>();
|
||||
});
|
||||
|
||||
services.AddSingleton<ApiDataService>();
|
||||
|
||||
// REDIS setup
|
||||
var redisConnString = Configuration.GetConnectionString("Redis");
|
||||
string connStringRedis = redisConnString ?? "localhost:6379, DefaultDatabase=1, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false";
|
||||
string redisSrvAddr = "127.0.0.1";
|
||||
if (connStringRedis.IndexOf(":") >= 0)
|
||||
{
|
||||
redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
||||
}
|
||||
// avvio oggetto shared x redis...
|
||||
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
// Add services x accesso dati
|
||||
services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
|
||||
|
||||
// aggiungo servizio sync DB
|
||||
services.AddSingleton<DbSyncService>();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Environment": "PROD"
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Environment": "PROD",
|
||||
"HostOs": "Win"
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Environment": "STAG"
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Environment": "STAG",
|
||||
"HostOs": "Win"
|
||||
}
|
||||
@@ -8,25 +8,26 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"LiMan.GLS": "Server=SQLSTEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
|
||||
"LiMan.DB": "Server=SQLSTEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
|
||||
"LiMan.GLS": "Server=W2019-SQL-STEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
|
||||
"LiMan.DB": "Server=W2019-SQL-STEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
|
||||
"Redis": "localhost:6379,DefaultDatabase=13"
|
||||
},
|
||||
"ExternalProviders": {
|
||||
"MailKit": {
|
||||
"SMTP": {
|
||||
"Address": "smtp.gmail.com",
|
||||
"Port": "465",
|
||||
"Account": "steamwarebot@gmail.com",
|
||||
"Password": "drmfsls16",
|
||||
"SenderEmail": "steamwarebot@gmail.com",
|
||||
"Address": "smtp-mail.outlook.com",
|
||||
"Port": "587",
|
||||
"Account": "steamwarebot@outlook.it",
|
||||
"Password": "!39elanoizaNaiVnIomais",
|
||||
"SenderEmail": "steamwarebot@outlook.it",
|
||||
"SenderName": "Steamware Email BOT"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MailDest": {
|
||||
"Admin": "samuele@steamware.net",
|
||||
"ProcOp": "ceo@steamware.net"
|
||||
"ExpiryNotify": "samuele.locatelli@egalware.com,mara.baroni@egalware.com",
|
||||
"TicketNotify": "samuele.locatelli@egalware.com, info@egalware.com"
|
||||
},
|
||||
"Redis": {
|
||||
"Password": "",
|
||||
@@ -43,5 +44,6 @@
|
||||
"Database": 14
|
||||
},
|
||||
"FileShare": "\\\\stor01\\TEAM DRIVES\\40_FileUpload\\unsafe_uploads",
|
||||
"ApiUrl": "https://liman.egalware.com/"
|
||||
"ApiUrl": "https://liman.egalware.com/",
|
||||
"HostOs": "Win"
|
||||
}
|
||||
@@ -2,28 +2,25 @@
|
||||
using Core.DTO;
|
||||
using LiMan.DB.DBModels;
|
||||
using LiMan.DB.DTO;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using NLog;
|
||||
using Org.BouncyCastle.Asn1.Crmf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Core.Enum;
|
||||
|
||||
namespace LiMan.DB.Controllers
|
||||
{
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public DbController(IConfiguration configuration)
|
||||
@@ -77,6 +74,28 @@ namespace LiMan.DB.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public bool AttivazioniDelete(int idxSubLic)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
// recupero record
|
||||
var currData = localDbCtx
|
||||
.DbSetSubLicenze
|
||||
.Where(x => x.IdxSubLic == idxSubLic)
|
||||
.FirstOrDefault();
|
||||
// se ho qualcosa procedo...
|
||||
if (currData != null)
|
||||
{
|
||||
localDbCtx.DbSetSubLicenze.Remove(currData);
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
fatto = true;
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista attivfazioni x licenza
|
||||
/// </summary>
|
||||
@@ -247,33 +266,251 @@ namespace LiMan.DB.Controllers
|
||||
localDbCtx.Entry(currData).State = EntityState.Modified;
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
// true
|
||||
// true
|
||||
fatto = true;
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public bool AttivazioniDelete(int idxSubLic)
|
||||
public List<AuthClaimModel> AuthClaimByUserID(int userID)
|
||||
{
|
||||
bool fatto = false;
|
||||
List<AuthClaimModel> dbResult = new List<AuthClaimModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
// recupero record
|
||||
var currData = localDbCtx
|
||||
.DbSetSubLicenze
|
||||
.Where(x => x.IdxSubLic == idxSubLic)
|
||||
.FirstOrDefault();
|
||||
// se ho qualcosa procedo...
|
||||
if (currData != null)
|
||||
DateTime oggi = DateTime.Today;
|
||||
dbResult = localDbCtx
|
||||
.DbSetClaims
|
||||
.Where(x => x.UserID == userID)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<AuthClaimModel> AuthClaimByUserName(string userName)
|
||||
{
|
||||
List<AuthClaimModel> dbResult = new List<AuthClaimModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
DateTime oggi = DateTime.Today;
|
||||
dbResult = localDbCtx
|
||||
.DbSetClaims
|
||||
.Where(x => x.UserNav.Username == userName)
|
||||
.Include(r => r.RoleNav)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool AuthClaimRemove(AuthClaimModel rec2del)
|
||||
{
|
||||
bool answ = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
localDbCtx.DbSetSubLicenze.Remove(currData);
|
||||
// salvo
|
||||
var currData = localDbCtx
|
||||
.DbSetClaims
|
||||
.Where(x => x.ClaimID == rec2del.ClaimID)
|
||||
.FirstOrDefault();
|
||||
if (currData != null)
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetClaims
|
||||
.Remove(currData);
|
||||
}
|
||||
localDbCtx.SaveChanges();
|
||||
fatto = true;
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in AuthClaimRemove | RoleID: {rec2del.RoleID} | UserId: {rec2del.UserID}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
return answ;
|
||||
}
|
||||
|
||||
public bool AuthClaimUpsert(AuthClaimModel newRec)
|
||||
{
|
||||
bool answ = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currData = localDbCtx
|
||||
.DbSetClaims
|
||||
.Where(x => x.ClaimID == newRec.ClaimID)
|
||||
.FirstOrDefault();
|
||||
if (currData != null)
|
||||
{
|
||||
currData.UserID = newRec.UserID;
|
||||
currData.RoleID = newRec.RoleID;
|
||||
currData.DtMod = DateTime.Now;
|
||||
// segno aggiornato
|
||||
localDbCtx.Entry(currData).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetClaims
|
||||
.Add(newRec);
|
||||
}
|
||||
localDbCtx.SaveChanges();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in AuthClaimUpsert | ClaimID: {newRec.ClaimID} | UserID: {newRec.UserID} | RoleID: {newRec.RoleID}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rimozione di ogni Role Claim x utente (che diventa inattivo)
|
||||
/// </summary>
|
||||
/// <param name="UserId"></param>
|
||||
/// <returns></returns>
|
||||
public bool AuthRoleResetUser(int UserId)
|
||||
{
|
||||
bool answ = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currData = localDbCtx
|
||||
.DbSetClaims
|
||||
.Where(x => x.UserID == UserId)
|
||||
.ToList();
|
||||
if (currData != null)
|
||||
{
|
||||
// rimuovo intero range...
|
||||
localDbCtx
|
||||
.DbSetClaims
|
||||
.RemoveRange(currData);
|
||||
}
|
||||
localDbCtx.SaveChanges();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in AuthUserRemoveRoles | UserId: {UserId}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public List<AuthRoleModel> AuthRolesGetAll()
|
||||
{
|
||||
List<AuthRoleModel> dbResult = new List<AuthRoleModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
DateTime oggi = DateTime.Today;
|
||||
dbResult = localDbCtx
|
||||
.DbSetRoles
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool AuthRoleUpsert(AuthRoleModel newRec)
|
||||
{
|
||||
bool answ = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currData = localDbCtx
|
||||
.DbSetRoles
|
||||
.Where(x => x.RoleID == newRec.RoleID)
|
||||
.FirstOrDefault();
|
||||
if (currData != null)
|
||||
{
|
||||
currData.Descrizione = newRec.Descrizione;
|
||||
currData.Ruolo = newRec.Ruolo;
|
||||
// segno aggiornato
|
||||
localDbCtx.Entry(currData).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetRoles
|
||||
.Add(newRec);
|
||||
}
|
||||
localDbCtx.SaveChanges();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in AuthRoleUpsert | RoleID: {newRec.RoleID} | Ruolo: {newRec.Ruolo}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public List<AuthUserModel> AuthUserAll()
|
||||
{
|
||||
List<AuthUserModel> dbResult = new List<AuthUserModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetUsers
|
||||
.Include(c => c.Claims)
|
||||
.ThenInclude(r => r.RoleNav)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<AuthUserModel> AuthUserGetFilt(string userName)
|
||||
{
|
||||
List<AuthUserModel> dbResult = new List<AuthUserModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetUsers
|
||||
.Where(x => x.Username == userName)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool AuthUserUpsert(AuthUserModel newRec)
|
||||
{
|
||||
bool answ = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currData = localDbCtx
|
||||
.DbSetUsers
|
||||
.Where(x => x.UserID == newRec.UserID)
|
||||
.FirstOrDefault();
|
||||
if (currData != null)
|
||||
{
|
||||
currData.Username = newRec.Username;
|
||||
currData.AD_Domain = newRec.AD_Domain;
|
||||
currData.AD_User = newRec.AD_User;
|
||||
currData.Cognome = newRec.Cognome;
|
||||
currData.Nome = newRec.Nome;
|
||||
// segno aggiornato
|
||||
localDbCtx.Entry(currData).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetUsers
|
||||
.Add(newRec);
|
||||
}
|
||||
localDbCtx.SaveChanges();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in AuthUserUpsert | UserID: {newRec.UserID} | userName: {newRec.Username}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public bool DbForceMigrate()
|
||||
@@ -288,7 +525,7 @@ namespace LiMan.DB.Controllers
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in DbForceMigrate");
|
||||
Log.Error($"Eccezione in DbForceMigrate{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
@@ -368,6 +605,100 @@ namespace LiMan.DB.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco applicativi in scadenza nel periodo considerato (min-max)
|
||||
/// </summary>
|
||||
/// <param name="minDate">Data iniziale da considerare</param>
|
||||
/// <param name="maxDate">Data finale da considerare</param>
|
||||
/// <returns></returns>
|
||||
public List<ApplicativoDTO> GetApplicativiExpiring(DateTime minDate, DateTime maxDate)
|
||||
{
|
||||
// cerco solo applicativi attivi
|
||||
bool hideData = true;
|
||||
List<ApplicativoDTO> dbResult = new List<ApplicativoDTO>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
DateTime oggi = DateTime.Today;
|
||||
|
||||
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
StringBuilder sbRandChiave = new StringBuilder();
|
||||
StringBuilder sbRandEnigma = new StringBuilder();
|
||||
StringBuilder sbRandPayload = new StringBuilder();
|
||||
string stdChiave = "";
|
||||
string stdEnigma = "";
|
||||
string stdPayLoad = "";
|
||||
int stdIdxLic = 0;
|
||||
DateTime stdDataEnigma = DateTime.Today;
|
||||
if (hideData)
|
||||
{
|
||||
int numChar = 80;
|
||||
Random random = new Random();
|
||||
|
||||
// idxLic
|
||||
stdIdxLic = random.Next(50000, 100000);
|
||||
|
||||
// chiave random
|
||||
for (int i = 0; i < numChar; i++)
|
||||
{
|
||||
// Generate floating point numbers
|
||||
double myFloat = random.NextDouble();
|
||||
// Generate the char using below logic
|
||||
var myChar = Convert.ToChar(Convert.ToInt32(Math.Floor(25 * myFloat) + 65));
|
||||
sbRandChiave.Append(myChar);
|
||||
}
|
||||
stdChiave = $"{sbRandChiave}";
|
||||
|
||||
// random data enigma
|
||||
stdDataEnigma = DateTime.Today.AddDays(random.Next(0, 15));
|
||||
|
||||
// random enigma
|
||||
for (int i = 0; i < numChar; i++)
|
||||
{
|
||||
// Generate floating point numbers
|
||||
double myFloat = random.NextDouble();
|
||||
// Generate the char using below logic
|
||||
var myChar = Convert.ToChar(Convert.ToInt32(Math.Floor(25 * myFloat) + 65));
|
||||
sbRandEnigma.Append(myChar);
|
||||
}
|
||||
stdEnigma = $"{sbRandEnigma}";
|
||||
|
||||
// random payload
|
||||
for (int i = 0; i < numChar; i++)
|
||||
{
|
||||
// Generate floating point numbers
|
||||
double myFloat = random.NextDouble();
|
||||
// Generate the char using below logic
|
||||
var myChar = Convert.ToChar(Convert.ToInt32(Math.Floor(25 * myFloat) + 65));
|
||||
sbRandPayload.Append(myChar);
|
||||
}
|
||||
stdPayLoad = $"{sbRandPayload}";
|
||||
}
|
||||
|
||||
// calcolo DTO applicativi
|
||||
dbResult = localDbCtx
|
||||
.DbSetLicenze
|
||||
.Where(x => (x.Scadenza >= minDate && x.Scadenza < maxDate))
|
||||
.OrderBy(o => o.Scadenza)
|
||||
.Select(x => new ApplicativoDTO()
|
||||
{
|
||||
IdxLic = hideData ? stdIdxLic : x.IdxLic,
|
||||
Chiave = hideData ? stdChiave : x.Chiave,
|
||||
CodApp = x.CodApp,
|
||||
CodInst = x.CodInst,
|
||||
Descrizione = x.Descrizione,
|
||||
Tipo = x.Tipo,
|
||||
Scadenza = x.Scadenza,
|
||||
NumLicenze = x.NumLicenze,
|
||||
NumLicenzeAttive = -1,
|
||||
DataEnigma = hideData ? stdDataEnigma : x.DataEnigma,
|
||||
Enigma = hideData ? stdEnigma : x.Enigma,
|
||||
Payload = hideData ? stdPayLoad : x.Payload
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<ApplicativoDTO> GetApplicativiFilt(bool OnlyActive, string CodApp, string CodInst, bool hideData)
|
||||
{
|
||||
List<ApplicativoDTO> dbResult = new List<ApplicativoDTO>();
|
||||
@@ -375,8 +706,7 @@ namespace LiMan.DB.Controllers
|
||||
{
|
||||
DateTime oggi = DateTime.Today;
|
||||
|
||||
// generazione stringhe casuali....
|
||||
// https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
StringBuilder sbRandChiave = new StringBuilder();
|
||||
StringBuilder sbRandEnigma = new StringBuilder();
|
||||
StringBuilder sbRandPayload = new StringBuilder();
|
||||
@@ -471,8 +801,25 @@ namespace LiMan.DB.Controllers
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetApp
|
||||
.ToList();
|
||||
.DbSetApp
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public ApplicativoModel GetApplicazioniFilt(string codApp)
|
||||
{
|
||||
ApplicativoModel dbResult = new ApplicativoModel();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
var rawData = localDbCtx
|
||||
.DbSetApp
|
||||
.Where(x => x.CodApp == codApp)
|
||||
.FirstOrDefault();
|
||||
if (rawData != null)
|
||||
{
|
||||
dbResult = rawData;
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -486,8 +833,7 @@ namespace LiMan.DB.Controllers
|
||||
DateTime oggi = DateTime.Today;
|
||||
int stdIdxLic = 0;
|
||||
|
||||
// generazione stringhe casuali....
|
||||
// https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
StringBuilder sbRandChiave = new StringBuilder();
|
||||
string stdChiave = "";
|
||||
|
||||
@@ -555,8 +901,7 @@ namespace LiMan.DB.Controllers
|
||||
DateTime oggi = DateTime.Today;
|
||||
int stdIdxLic = 0;
|
||||
|
||||
// generazione stringhe casuali....
|
||||
// https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
|
||||
StringBuilder sbRandChiave = new StringBuilder();
|
||||
string stdChiave = "";
|
||||
|
||||
@@ -818,6 +1163,183 @@ namespace LiMan.DB.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public bool ReleaseDelete(ReleaseModel rec2del)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
// cerco record esistente...
|
||||
var currRec = localDbCtx
|
||||
.DbSetReleases
|
||||
.Where(x => x.IdxRel == rec2del.IdxRel && rec2del.IdxRel > 0)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetReleases
|
||||
.Remove(currRec);
|
||||
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
fatto = true;
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco release (completo) dato un applicativo applicativi
|
||||
/// </summary>
|
||||
/// <param name="CodApp">Codice applicativo</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseDTO> ReleaseDtoGetByApp(string CodApp)
|
||||
{
|
||||
List<ReleaseDTO> dbResult = new List<ReleaseDTO>();
|
||||
var rawData = ReleaseGetByApp(CodApp);
|
||||
dbResult = rawData
|
||||
.Select(x => new ReleaseDTO()
|
||||
{
|
||||
CodApp = x.CodApp,
|
||||
ReleaseDate = x.ReleaseDate,
|
||||
VersNum = x.VersNum,
|
||||
VersText = x.VersText
|
||||
}).
|
||||
ToList();
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco release (completo) dato un applicativo applicativi
|
||||
/// </summary>
|
||||
/// <param name="CodApp">Codice applicativo</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseDTO> ReleaseDtoGetByAppVers(string CodApp, string MinVers)
|
||||
{
|
||||
List<ReleaseDTO> dbResult = new List<ReleaseDTO>();
|
||||
var rawData = ReleaseGetByAppVers(CodApp, MinVers);
|
||||
dbResult = rawData
|
||||
.Select(x => new ReleaseDTO()
|
||||
{
|
||||
CodApp = x.CodApp,
|
||||
ReleaseDate = x.ReleaseDate,
|
||||
VersNum = x.VersNum,
|
||||
VersText = x.VersText,
|
||||
VersVal = x.VersVal
|
||||
}).
|
||||
ToList();
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco release (completo) dato un applicativo applicativi
|
||||
/// </summary>
|
||||
/// <param name="CodApp">Codice applicativo</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <param name="VersMax">Versione massima consentita</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseDTO> ReleaseDtoGetByAppVersLimit(string CodApp, string VersMin, string VersMax)
|
||||
{
|
||||
List<ReleaseDTO> dbResult = new List<ReleaseDTO>();
|
||||
Version versLimit = new Version(VersMax);
|
||||
var rawData = ReleaseGetByAppVers(CodApp, VersMin);
|
||||
dbResult = rawData
|
||||
.Select(x => new ReleaseDTO()
|
||||
{
|
||||
CodApp = x.CodApp,
|
||||
ReleaseDate = x.ReleaseDate,
|
||||
VersNum = x.VersNum,
|
||||
VersText = x.VersText,
|
||||
VersVal = x.VersVal,
|
||||
IsPermitted = x.VersVal <= versLimit
|
||||
}).
|
||||
ToList();
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco release (completo) dato un applicativo applicativi
|
||||
/// </summary>
|
||||
/// <param name="CodApp">Codice applicativo</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseModel> ReleaseGetByApp(string CodApp)
|
||||
{
|
||||
List<ReleaseModel> dbResult = new List<ReleaseModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
// calcolo DTO applicativi
|
||||
dbResult = localDbCtx
|
||||
.DbSetReleases
|
||||
.Where(x => (x.CodApp.ToLower() == CodApp.ToLower()))
|
||||
.OrderBy(o => o.ReleaseDate)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco release (completo) dato un applicativo applicativi
|
||||
/// </summary>
|
||||
/// <param name="CodApp">Codice applicativo</param>
|
||||
/// <param name="VersMin">Versione minima richiesta</param>
|
||||
/// <returns></returns>
|
||||
public List<ReleaseModel> ReleaseGetByAppVers(string CodApp, string MinVers)
|
||||
{
|
||||
List<ReleaseModel> dbResult = new List<ReleaseModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
Version mVers = new Version(MinVers);
|
||||
// calcolo DTO applicativi
|
||||
dbResult = localDbCtx
|
||||
.DbSetReleases
|
||||
.ToList();
|
||||
|
||||
// verifico per il criterio versione...
|
||||
dbResult = dbResult
|
||||
.Where(x => x.VersVal >= mVers)
|
||||
.OrderBy(o => o.ReleaseDate)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upsert Record Release
|
||||
/// </summary>
|
||||
/// <param name="currItem"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ReleaseUpsert(ReleaseModel currItem)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
// cerco record esistente...
|
||||
var currRec = localDbCtx
|
||||
.DbSetReleases
|
||||
.Where(x => x.IdxRel == currItem.IdxRel && currItem.IdxRel > 0)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
// se trovo aggiorno
|
||||
currRec.VersNum = currItem.VersNum;
|
||||
currRec.VersText = currItem.VersText;
|
||||
currRec.ReleaseDate = currItem.ReleaseDate;
|
||||
localDbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
//altrimenti aggiungo
|
||||
localDbCtx
|
||||
.DbSetReleases
|
||||
.Add(currItem);
|
||||
}
|
||||
|
||||
// salvo
|
||||
await localDbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Annulla modifiche su una specifica entity (cancel update)
|
||||
/// </summary>
|
||||
@@ -843,6 +1365,30 @@ namespace LiMan.DB.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statistiche del LOGchiamate all'API dato filtro
|
||||
/// </summary>
|
||||
/// <param name="DateFrom">Data minima</param>
|
||||
/// <param name="DateTo">DataMax</param>
|
||||
/// <param name="SearchVal">Valore cercato, se "" è tutti</param>
|
||||
/// <returns></returns>
|
||||
public List<StatsCallModel> StatsLogCallGetFilt(DateTime DateFrom, DateTime DateTo, string SearchVal = "")
|
||||
{
|
||||
List<StatsCallModel> dbResult = new List<StatsCallModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
var dtFrom = new SqlParameter("@DateFrom", DateFrom);
|
||||
var dtTo = new SqlParameter("@DateTo", DateTo);
|
||||
var srcVal = new SqlParameter("@SearchVal", SearchVal);
|
||||
dbResult = localDbCtx
|
||||
.DbSetStatCall
|
||||
.FromSqlRaw("exec dbo.stp_StatsCall_filt @DateFrom, @DateTo, @SearchVal", dtFrom, dtTo, srcVal)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool TicketAddNew(SupportRequest currRequest)
|
||||
{
|
||||
bool fatto = false;
|
||||
@@ -882,6 +1428,41 @@ namespace LiMan.DB.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public List<TicketDTO> TicketGetAll(bool onlyOpen, int maxNum)
|
||||
{
|
||||
List<TicketDTO> dbResult = new List<TicketDTO>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetTicket
|
||||
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen))
|
||||
.OrderByDescending(x => x.IdxTicket)
|
||||
.Include(l => l.LicenzaNav)
|
||||
.Take(maxNum)
|
||||
.Select(x => new TicketDTO
|
||||
{
|
||||
CodApp = x.LicenzaNav.CodApp,
|
||||
CodInst = x.LicenzaNav.CodInst,
|
||||
IdxTicket = x.IdxTicket,
|
||||
IdxLic = x.IdxLic,
|
||||
IdxSubLic = x.IdxSubLic,
|
||||
CodImpiego = x.CodImpiego,
|
||||
ContactName = x.ContactName,
|
||||
ContactEmail = x.ContactEmail,
|
||||
ContactPhone = x.ContactPhone,
|
||||
DtReq = x.DtReq,
|
||||
ReqBody = x.ReqBody,
|
||||
Status = x.Status,
|
||||
SupplAnsw = x.SupplAnsw,
|
||||
SupplEmail = x.SupplEmail,
|
||||
SupplUserCode = x.SupplUserCode,
|
||||
Tipo = x.Tipo
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<TicketDTO> TicketGetFilt(bool onlyOpen, TipologiaTicket Tipo, string CodApp, string CodInst, string MasterKey, int maxNum)
|
||||
{
|
||||
List<TicketDTO> dbResult = new List<TicketDTO>();
|
||||
@@ -923,6 +1504,41 @@ namespace LiMan.DB.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<TicketDTO> TicketGetFilt(bool onlyOpen, string CodApp, string CodInst)
|
||||
{
|
||||
List<TicketDTO> dbResult = new List<TicketDTO>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetTicket
|
||||
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen) && (x.LicenzaNav.CodApp == CodApp || string.IsNullOrEmpty(CodApp)) && (x.LicenzaNav.CodInst == CodInst || string.IsNullOrEmpty(CodInst)))
|
||||
.OrderByDescending(x => x.IdxTicket)
|
||||
.Include(l => l.LicenzaNav)
|
||||
.Select(x => new TicketDTO
|
||||
{
|
||||
CodApp = x.LicenzaNav.CodApp,
|
||||
CodInst = x.LicenzaNav.CodInst,
|
||||
IdxTicket = x.IdxTicket,
|
||||
IdxLic = x.IdxLic,
|
||||
IdxSubLic = x.IdxSubLic,
|
||||
CodImpiego = x.CodImpiego,
|
||||
ContactName = x.ContactName,
|
||||
ContactEmail = x.ContactEmail,
|
||||
ContactPhone = x.ContactPhone,
|
||||
DtReq = x.DtReq,
|
||||
ReqBody = x.ReqBody,
|
||||
Status = x.Status,
|
||||
SupplAnsw = x.SupplAnsw,
|
||||
SupplEmail = x.SupplEmail,
|
||||
SupplUserCode = x.SupplUserCode,
|
||||
Tipo = x.Tipo,
|
||||
TType = x.TType
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<TicketDTO> TicketGetFiltAllLic(bool onlyOpen, TipologiaTicket Tipo, string CodApp, string CodInst, int maxNum)
|
||||
{
|
||||
List<TicketDTO> dbResult = new List<TicketDTO>();
|
||||
@@ -964,41 +1580,6 @@ namespace LiMan.DB.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
public List<TicketDTO> TicketGetAll(bool onlyOpen, int maxNum)
|
||||
{
|
||||
List<TicketDTO> dbResult = new List<TicketDTO>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
|
||||
dbResult = localDbCtx
|
||||
.DbSetTicket
|
||||
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen))
|
||||
.OrderByDescending(x => x.IdxTicket)
|
||||
.Take(maxNum)
|
||||
.Select(x => new TicketDTO
|
||||
{
|
||||
IdxTicket = x.IdxTicket,
|
||||
IdxLic = x.IdxLic,
|
||||
IdxSubLic = x.IdxSubLic,
|
||||
CodImpiego = x.CodImpiego,
|
||||
ContactName = x.ContactName,
|
||||
ContactEmail = x.ContactEmail,
|
||||
ContactPhone = x.ContactPhone,
|
||||
DtReq = x.DtReq,
|
||||
ReqBody = x.ReqBody,
|
||||
Status = x.Status,
|
||||
SupplAnsw = x.SupplAnsw,
|
||||
SupplEmail = x.SupplEmail,
|
||||
SupplUserCode = x.SupplUserCode,
|
||||
Tipo = x.Tipo
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
public bool TicketUpdateState(int IdxTicket, StatoRichiesta NewStatus)
|
||||
{
|
||||
bool fatto = false;
|
||||
@@ -1019,23 +1600,6 @@ namespace LiMan.DB.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#if false
|
||||
public List<TicketModel> TicketGetByLic(int IdxLic, int maxNum)
|
||||
{
|
||||
List<TicketModel> dbResult = new List<TicketModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetTicket
|
||||
.Where(x => x.IdxLic == IdxLic)
|
||||
.OrderByDescending(x => x.DtReq)
|
||||
.Take(maxNum)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
#endif
|
||||
|
||||
public bool UpsertApplicazione(ApplicativoModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
@@ -1190,5 +1754,29 @@ namespace LiMan.DB.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#if false
|
||||
public List<TicketModel> TicketGetByLic(int IdxLic, int maxNum)
|
||||
{
|
||||
List<TicketModel> dbResult = new List<TicketModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetTicket
|
||||
.Where(x => x.IdxLic == IdxLic)
|
||||
.OrderByDescending(x => x.DtReq)
|
||||
.Take(maxNum)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -11,25 +11,17 @@ namespace LiMan.DB.DBModels
|
||||
[Table("Applicativi")]
|
||||
public partial class ApplicativoModel
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
//public Applicativo()
|
||||
//{
|
||||
// LicenzeAttives = new HashSet<Licenza>();
|
||||
//}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[Key]
|
||||
[MaxLength(50)]
|
||||
public string CodApp { get; set; }
|
||||
public string CodApp { get; set; } = "";
|
||||
|
||||
[MaxLength(250)]
|
||||
public string Descrizione { get; set; }
|
||||
public string Descrizione { get; set; } = "";
|
||||
|
||||
//public virtual ICollection<Licenza> LicenzeAttives { get; set; }
|
||||
[MaxLength(2500)]
|
||||
public string TplConnString { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.DBModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("AuthClaims")]
|
||||
public partial class AuthClaimModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ClaimID { get; set; }
|
||||
public int RoleID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public DateTime DtIns { get; set; } = DateTime.MinValue;
|
||||
public DateTime DtMod { get; set; } = DateTime.Now;
|
||||
|
||||
[ForeignKey("RoleID")]
|
||||
public virtual AuthRoleModel RoleNav { get; set; }
|
||||
|
||||
[ForeignKey("UserID")]
|
||||
public virtual AuthUserModel UserNav { get; set; }
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.DBModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("AuthRoles")]
|
||||
public partial class AuthRoleModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public AuthRoleModel()
|
||||
{
|
||||
Claims = new HashSet<AuthClaimModel>();
|
||||
}
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int RoleID { get; set; }
|
||||
public string Ruolo { get; set; }
|
||||
public string Descrizione { get; set; }
|
||||
|
||||
public virtual ICollection<AuthClaimModel> Claims { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.DBModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("AuthUsers")]
|
||||
public partial class AuthUserModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public AuthUserModel()
|
||||
{
|
||||
Claims = new HashSet<AuthClaimModel>();
|
||||
}
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int UserID { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string AD_Domain { get; set; } = "";
|
||||
public string AD_User { get; set; } = "";
|
||||
|
||||
public string Cognome { get; set; } = "Cognome";
|
||||
public string Nome { get; set; } = "Nome";
|
||||
|
||||
public virtual ICollection<AuthClaimModel> Claims { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool IsActive
|
||||
{
|
||||
get => Claims != null && Claims.Count > 0;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.DB.DBModels
|
||||
{
|
||||
[Table("Releases")]
|
||||
public partial class ReleaseModel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxRel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Codice/Nome applicativo
|
||||
/// </summary>
|
||||
public string CodApp { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Versione applicativo formato semver numerico 4 blocchi
|
||||
/// </summary>
|
||||
public string VersNum { get; set; } = "0.0.0.0";
|
||||
|
||||
/// <summary>
|
||||
/// Versione applicativo, formato testuale libero, può essere uguale a VersNum
|
||||
/// </summary>
|
||||
public string VersText { get; set; } = "0.1a2";
|
||||
|
||||
/// <summary>
|
||||
/// Versione (calcolata) a partire dal valore Num
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public Version VersVal
|
||||
{
|
||||
get =>!string.IsNullOrEmpty(VersNum) ? new Version(VersNum): new Version();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data di release
|
||||
/// </summary>
|
||||
public DateTime ReleaseDate { get; set; } = DateTime.Today.AddYears(100);
|
||||
|
||||
[ForeignKey("CodApp")]
|
||||
public virtual ApplicativoModel ApplicativoNav { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.DB.DBModels
|
||||
{
|
||||
public partial class StatsCallModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public int YearRef { get; set; } = 0;
|
||||
public string CodInst { get; set; } = "";
|
||||
public string CodApp { get; set; } = "";
|
||||
public int TotCall { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static Core.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Core.Enum;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Core.Enum;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Core.Enum;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace LiMan.DB.DTO
|
||||
{
|
||||
public class ReleaseDTO
|
||||
{
|
||||
/// <summary>
|
||||
/// Codice/Nome applicativo
|
||||
/// </summary>
|
||||
public string CodApp { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Versione applicativo formato semver numerico 4 blocchi
|
||||
/// </summary>
|
||||
public string VersNum { get; set; } = "0.0.0.0";
|
||||
|
||||
/// <summary>
|
||||
/// Versione applicativo, formato testuale libero, può essere uguale a VersNum
|
||||
/// </summary>
|
||||
public string VersText { get; set; } = "a.b";
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto versione calcolato da VersNum
|
||||
/// </summary>
|
||||
public Version VersVal { get; set; } = new Version();
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia permessa la versione quando viene valutata la versione massima consentita
|
||||
/// </summary>
|
||||
public bool IsPermitted { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Data di release
|
||||
/// </summary>
|
||||
public DateTime ReleaseDate { get; set; } = DateTime.Today.AddYears(100);
|
||||
|
||||
/// <summary>
|
||||
/// Url pagina web di changelog (traduzione gestita sul sito target) - calcolato da CodApp + vers
|
||||
/// </summary>
|
||||
//public string UrlChangelog { get; set; } = "http://releases.egalware.com";
|
||||
[NotMapped]
|
||||
public string UrlChangelog
|
||||
{
|
||||
get => $"https://releases.egalware.com/{CodApp}/{VersText}".ToLower();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Url pagina web di changelog estesa (traduzione gestita sul sito target) - calcolato da CodApp + vers
|
||||
/// </summary>
|
||||
//public string UrlChangelogExt { get; set; } = "http://releases.egalware.com";
|
||||
[NotMapped]
|
||||
public string UrlChangelogExt
|
||||
{
|
||||
get => $"https://releases.egalware.com/ext_{CodApp}/{VersText}".ToLower();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attivo/Pubblico (qui calcolato, attivo se la data di release è passata, poi potrebbe essere gestito a parte da DB)
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public bool IsActive
|
||||
{
|
||||
get => (DateTime.Today.Subtract(ReleaseDate).TotalDays >= 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
-1
@@ -56,6 +56,11 @@ namespace LiMan.DB
|
||||
public virtual DbSet<LogLicenzaModel> DbSetLogLicenze { get; set; }
|
||||
public virtual DbSet<SubLicenzaModel> DbSetSubLicenze { get; set; }
|
||||
public virtual DbSet<TicketModel> DbSetTicket { get; set; }
|
||||
public virtual DbSet<StatsCallModel> DbSetStatCall { get; set; }
|
||||
public virtual DbSet<AuthUserModel> DbSetUsers { get; set; }
|
||||
public virtual DbSet<AuthRoleModel> DbSetRoles { get; set; }
|
||||
public virtual DbSet<AuthClaimModel> DbSetClaims { get; set; }
|
||||
public virtual DbSet<ReleaseModel> DbSetReleases { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -75,7 +80,9 @@ namespace LiMan.DB
|
||||
}
|
||||
else
|
||||
{
|
||||
optionsBuilder.UseSqlServer("Server=SQLSTEAM;Database=LiMan.DB;Trusted_Connection=True;");
|
||||
//optionsBuilder.UseSqlServer("Server=SQLSTEAM;Database=LiMan.DB;Trusted_Connection=True;");
|
||||
optionsBuilder.UseSqlServer("Server=W2019-SQL-STEAM;Database=LiMan.DB;Trusted_Connection=True;");
|
||||
//optionsBuilder.UseSqlServer("Server=W2019-SQL-STEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,6 +96,14 @@ namespace LiMan.DB
|
||||
entity.HasKey(e => new { e.DataRif, e.CodInst, e.CodApp, e.TargetUrl });
|
||||
});
|
||||
|
||||
|
||||
modelBuilder.Entity<StatsCallModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.YearRef, e.CodInst, e.CodApp });
|
||||
|
||||
entity.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="2.15.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.28">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.28" />
|
||||
<PackageReference Include="NLog" Version="5.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="SqlScripts\Stored\stp_StatsCall_filt.sql">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="SqlScripts\Views\v_StatsCall.sql">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -13,7 +13,7 @@ namespace LiMan.DB.Migrations
|
||||
{
|
||||
IdxTicket = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DtReq = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DtReq = table.Column<DateTime>(type: "datetime", nullable: false, defaultValue: DateTime.Now, defaultValueSql: "GETDATE()"),
|
||||
Tipo = table.Column<int>(type: "int", nullable: false),
|
||||
IdxLic = table.Column<int>(type: "int", nullable: false),
|
||||
IdxSubLic = table.Column<int>(type: "int", nullable: false),
|
||||
|
||||
@@ -0,0 +1,401 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LiMan.DB;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
[DbContext(typeof(LMDbContext))]
|
||||
[Migration("20240531171929_AddViewAndStored01")]
|
||||
partial class AddViewAndStored01
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
|
||||
{
|
||||
b.Property<string>("CodApp")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodApp");
|
||||
|
||||
b.ToTable("Applicativi");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxFileAttach")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullStoragePath")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxTicket")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OriginalName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("StorageName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxFileAttach");
|
||||
|
||||
b.HasIndex("IdxTicket");
|
||||
|
||||
b.ToTable("FileAttach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.InstallazioneModel", b =>
|
||||
{
|
||||
b.Property<string>("CodInst")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Cliente")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Contatto")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodInst");
|
||||
|
||||
b.ToTable("Installazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("DataEnigma")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Enigma")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Locked")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.ToTable("Licenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogCallModel", b =>
|
||||
{
|
||||
b.Property<DateTime>("DataRif")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TargetUrl")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("NumCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("DataRif", "CodInst", "CodApp", "TargetUrl");
|
||||
|
||||
b.ToTable("LogCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLogLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLogLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("LogLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
|
||||
{
|
||||
b.Property<int>("YearRef")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("TotCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("YearRef", "CodInst", "CodApp");
|
||||
|
||||
b.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxSubLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VetoUnlock")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("IdxSubLic");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("SubLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxTicket")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactPhone")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DtReq")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IdxSubLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ReqBody")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplAnsw")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplUserCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxTicket");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("TicketLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxTicket")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TicketNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Attivazioni")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Tickets")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Navigation("Attivazioni");
|
||||
|
||||
b.Navigation("Tickets");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
public partial class AddViewAndStored01 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// aggiunta views
|
||||
addView(migrationBuilder, "v_StatsCall");
|
||||
// aggiunta stored
|
||||
addStored(migrationBuilder, "stp_StatsCall_filt");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// rimozione stored
|
||||
remStored(migrationBuilder, "stp_StatsCall_filt");
|
||||
// rimozione views
|
||||
remView(migrationBuilder, "v_StatsCall");
|
||||
}
|
||||
|
||||
private void addView(MigrationBuilder migrationBuilder, string viewName)
|
||||
{
|
||||
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SqlScripts", "Views", $"{viewName}.sql");
|
||||
string viewBody = File.ReadAllText(path);
|
||||
migrationBuilder.Sql(viewBody);
|
||||
}
|
||||
private void addStored(MigrationBuilder migrationBuilder, string objName)
|
||||
{
|
||||
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SqlScripts", "Stored", $"{objName}.sql");
|
||||
string viewBody = File.ReadAllText(path);
|
||||
migrationBuilder.Sql(viewBody);
|
||||
}
|
||||
|
||||
private void remView(MigrationBuilder migrationBuilder, string viewName)
|
||||
{
|
||||
migrationBuilder.Sql($"EXEC('DROP VIEW IF EXISTS dbo.{viewName}');");
|
||||
}
|
||||
|
||||
private void remStored(MigrationBuilder migrationBuilder, string objName)
|
||||
{
|
||||
migrationBuilder.Sql($"EXEC('DROP PROCEDURE IF EXISTS dbo.{objName}');");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,500 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LiMan.DB;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
[DbContext(typeof(LMDbContext))]
|
||||
[Migration("20240713132356_AddUserRoleClaim01")]
|
||||
partial class AddUserRoleClaim01
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.28")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
|
||||
{
|
||||
b.Property<string>("CodApp")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodApp");
|
||||
|
||||
b.ToTable("Applicativi");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.Property<int>("ClaimID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ClaimID"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DtMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("RoleID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ClaimID");
|
||||
|
||||
b.HasIndex("RoleID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("AuthClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Property<int>("RoleID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RoleID"), 1L, 1);
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ruolo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("RoleID");
|
||||
|
||||
b.ToTable("AuthRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserID"), 1L, 1);
|
||||
|
||||
b.Property<string>("AD_Domain")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("AD_User")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserID");
|
||||
|
||||
b.ToTable("AuthUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxFileAttach")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullStoragePath")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxTicket")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OriginalName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("StorageName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxFileAttach");
|
||||
|
||||
b.HasIndex("IdxTicket");
|
||||
|
||||
b.ToTable("FileAttach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.InstallazioneModel", b =>
|
||||
{
|
||||
b.Property<string>("CodInst")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Cliente")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Contatto")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodInst");
|
||||
|
||||
b.ToTable("Installazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("DataEnigma")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Enigma")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Locked")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.ToTable("Licenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogCallModel", b =>
|
||||
{
|
||||
b.Property<DateTime>("DataRif")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TargetUrl")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("NumCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("DataRif", "CodInst", "CodApp", "TargetUrl");
|
||||
|
||||
b.ToTable("LogCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLogLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLogLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("LogLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
|
||||
{
|
||||
b.Property<int>("YearRef")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("TotCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("YearRef", "CodInst", "CodApp");
|
||||
|
||||
b.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxSubLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VetoUnlock")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("IdxSubLic");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("SubLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxTicket")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactPhone")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DtReq")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IdxSubLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ReqBody")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplAnsw")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplUserCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxTicket");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("TicketLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.AuthRoleModel", "RoleNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("RoleID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.AuthUserModel", "UserNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("RoleNav");
|
||||
|
||||
b.Navigation("UserNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxTicket")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TicketNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Attivazioni")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Tickets")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Navigation("Attivazioni");
|
||||
|
||||
b.Navigation("Tickets");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
public partial class AddUserRoleClaim01 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthRoles",
|
||||
columns: table => new
|
||||
{
|
||||
RoleID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Ruolo = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Descrizione = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AuthRoles", x => x.RoleID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthUsers",
|
||||
columns: table => new
|
||||
{
|
||||
UserID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Username = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
AD_Domain = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
AD_User = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AuthUsers", x => x.UserID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthClaims",
|
||||
columns: table => new
|
||||
{
|
||||
ClaimID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
RoleID = table.Column<int>(type: "int", nullable: false),
|
||||
UserID = table.Column<int>(type: "int", nullable: false),
|
||||
DtIns = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DtMod = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AuthClaims", x => x.ClaimID);
|
||||
table.ForeignKey(
|
||||
name: "FK_AuthClaims_AuthRoles_RoleID",
|
||||
column: x => x.RoleID,
|
||||
principalTable: "AuthRoles",
|
||||
principalColumn: "RoleID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_AuthClaims_AuthUsers_UserID",
|
||||
column: x => x.UserID,
|
||||
principalTable: "AuthUsers",
|
||||
principalColumn: "UserID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AuthClaims_RoleID",
|
||||
table: "AuthClaims",
|
||||
column: "RoleID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AuthClaims_UserID",
|
||||
table: "AuthClaims",
|
||||
column: "UserID");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthUsers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,506 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LiMan.DB;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
[DbContext(typeof(LMDbContext))]
|
||||
[Migration("20240715060405_AddUserRoleClaim02")]
|
||||
partial class AddUserRoleClaim02
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.28")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
|
||||
{
|
||||
b.Property<string>("CodApp")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodApp");
|
||||
|
||||
b.ToTable("Applicativi");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.Property<int>("ClaimID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ClaimID"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DtMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("RoleID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ClaimID");
|
||||
|
||||
b.HasIndex("RoleID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("AuthClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Property<int>("RoleID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RoleID"), 1L, 1);
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ruolo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("RoleID");
|
||||
|
||||
b.ToTable("AuthRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserID"), 1L, 1);
|
||||
|
||||
b.Property<string>("AD_Domain")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("AD_User")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserID");
|
||||
|
||||
b.ToTable("AuthUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxFileAttach")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullStoragePath")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxTicket")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OriginalName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("StorageName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxFileAttach");
|
||||
|
||||
b.HasIndex("IdxTicket");
|
||||
|
||||
b.ToTable("FileAttach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.InstallazioneModel", b =>
|
||||
{
|
||||
b.Property<string>("CodInst")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Cliente")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Contatto")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodInst");
|
||||
|
||||
b.ToTable("Installazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("DataEnigma")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Enigma")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Locked")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.ToTable("Licenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogCallModel", b =>
|
||||
{
|
||||
b.Property<DateTime>("DataRif")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TargetUrl")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("NumCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("DataRif", "CodInst", "CodApp", "TargetUrl");
|
||||
|
||||
b.ToTable("LogCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLogLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLogLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("LogLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
|
||||
{
|
||||
b.Property<int>("YearRef")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("TotCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("YearRef", "CodInst", "CodApp");
|
||||
|
||||
b.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxSubLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VetoUnlock")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("IdxSubLic");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("SubLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxTicket")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactPhone")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DtReq")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IdxSubLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ReqBody")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplAnsw")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplUserCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxTicket");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("TicketLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.AuthRoleModel", "RoleNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("RoleID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.AuthUserModel", "UserNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("RoleNav");
|
||||
|
||||
b.Navigation("UserNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxTicket")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TicketNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Attivazioni")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Tickets")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Navigation("Attivazioni");
|
||||
|
||||
b.Navigation("Tickets");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
public partial class AddUserRoleClaim02 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Cognome",
|
||||
table: "AuthUsers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Nome",
|
||||
table: "AuthUsers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Cognome",
|
||||
table: "AuthUsers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Nome",
|
||||
table: "AuthUsers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,510 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LiMan.DB;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
[DbContext(typeof(LMDbContext))]
|
||||
[Migration("20240718060756_AddTplConnString01")]
|
||||
partial class AddTplConnString01
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.28")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
|
||||
{
|
||||
b.Property<string>("CodApp")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("TplConnString")
|
||||
.HasMaxLength(2500)
|
||||
.HasColumnType("nvarchar(2500)");
|
||||
|
||||
b.HasKey("CodApp");
|
||||
|
||||
b.ToTable("Applicativi");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.Property<int>("ClaimID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ClaimID"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DtMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("RoleID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ClaimID");
|
||||
|
||||
b.HasIndex("RoleID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("AuthClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Property<int>("RoleID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RoleID"), 1L, 1);
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ruolo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("RoleID");
|
||||
|
||||
b.ToTable("AuthRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserID"), 1L, 1);
|
||||
|
||||
b.Property<string>("AD_Domain")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("AD_User")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserID");
|
||||
|
||||
b.ToTable("AuthUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxFileAttach")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullStoragePath")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxTicket")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OriginalName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("StorageName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxFileAttach");
|
||||
|
||||
b.HasIndex("IdxTicket");
|
||||
|
||||
b.ToTable("FileAttach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.InstallazioneModel", b =>
|
||||
{
|
||||
b.Property<string>("CodInst")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Cliente")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Contatto")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodInst");
|
||||
|
||||
b.ToTable("Installazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("DataEnigma")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Enigma")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Locked")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.ToTable("Licenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogCallModel", b =>
|
||||
{
|
||||
b.Property<DateTime>("DataRif")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TargetUrl")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("NumCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("DataRif", "CodInst", "CodApp", "TargetUrl");
|
||||
|
||||
b.ToTable("LogCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLogLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLogLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("LogLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
|
||||
{
|
||||
b.Property<int>("YearRef")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("TotCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("YearRef", "CodInst", "CodApp");
|
||||
|
||||
b.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxSubLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VetoUnlock")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("IdxSubLic");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("SubLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxTicket")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactPhone")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DtReq")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IdxSubLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ReqBody")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplAnsw")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplUserCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxTicket");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("TicketLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.AuthRoleModel", "RoleNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("RoleID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.AuthUserModel", "UserNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("RoleNav");
|
||||
|
||||
b.Navigation("UserNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxTicket")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TicketNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Attivazioni")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Tickets")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Navigation("Attivazioni");
|
||||
|
||||
b.Navigation("Tickets");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
public partial class AddTplConnString01 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TplConnString",
|
||||
table: "Applicativi",
|
||||
type: "nvarchar(2500)",
|
||||
maxLength: 2500,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TplConnString",
|
||||
table: "Applicativi");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,546 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LiMan.DB;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
[DbContext(typeof(LMDbContext))]
|
||||
[Migration("20240806142953_AddRelModel01")]
|
||||
partial class AddRelModel01
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.28")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
|
||||
{
|
||||
b.Property<string>("CodApp")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("TplConnString")
|
||||
.HasMaxLength(2500)
|
||||
.HasColumnType("nvarchar(2500)");
|
||||
|
||||
b.HasKey("CodApp");
|
||||
|
||||
b.ToTable("Applicativi");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.Property<int>("ClaimID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ClaimID"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DtMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("RoleID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ClaimID");
|
||||
|
||||
b.HasIndex("RoleID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("AuthClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Property<int>("RoleID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RoleID"), 1L, 1);
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ruolo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("RoleID");
|
||||
|
||||
b.ToTable("AuthRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserID"), 1L, 1);
|
||||
|
||||
b.Property<string>("AD_Domain")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("AD_User")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserID");
|
||||
|
||||
b.ToTable("AuthUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxFileAttach")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullStoragePath")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxTicket")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OriginalName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("StorageName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxFileAttach");
|
||||
|
||||
b.HasIndex("IdxTicket");
|
||||
|
||||
b.ToTable("FileAttach");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.InstallazioneModel", b =>
|
||||
{
|
||||
b.Property<string>("CodInst")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Cliente")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Contatto")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.HasKey("CodInst");
|
||||
|
||||
b.ToTable("Installazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("DataEnigma")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Enigma")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Locked")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Payload")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.ToTable("Licenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogCallModel", b =>
|
||||
{
|
||||
b.Property<DateTime>("DataRif")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("TargetUrl")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("NumCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("DataRif", "CodInst", "CodApp", "TargetUrl");
|
||||
|
||||
b.ToTable("LogCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxLogLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("NumLicenze")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Scadenza")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxLogLic");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.HasIndex("CodInst");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("LogLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ReleaseModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxRel")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxRel"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("ReleaseDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("VersNum")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("VersText")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxRel");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.ToTable("Releases");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
|
||||
{
|
||||
b.Property<int>("YearRef")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("TotCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("YearRef", "CodInst", "CodApp");
|
||||
|
||||
b.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxSubLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VetoUnlock")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("IdxSubLic");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("SubLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxTicket")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ContactPhone")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DtReq")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("IdxLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IdxSubLic")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ReqBody")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SupplAnsw")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SupplUserCode")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Tipo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("IdxTicket");
|
||||
|
||||
b.HasIndex("IdxLic");
|
||||
|
||||
b.ToTable("TicketLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.AuthRoleModel", "RoleNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("RoleID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.AuthUserModel", "UserNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("RoleNav");
|
||||
|
||||
b.Navigation("UserNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxTicket")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TicketNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodInst");
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
|
||||
b.Navigation("InstallazioneNav");
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ReleaseModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Attivazioni")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
.WithMany("Tickets")
|
||||
.HasForeignKey("IdxLic")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Navigation("Attivazioni");
|
||||
|
||||
b.Navigation("Tickets");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
public partial class AddRelModel01 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Releases",
|
||||
columns: table => new
|
||||
{
|
||||
IdxRel = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CodApp = table.Column<string>(type: "nvarchar(50)", nullable: true),
|
||||
VersNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
VersText = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ReleaseDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValue: DateTime.Now, defaultValueSql: "GETDATE()")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Releases", x => x.IdxRel);
|
||||
table.ForeignKey(
|
||||
name: "FK_Releases_Applicativi_CodApp",
|
||||
column: x => x.CodApp,
|
||||
principalTable: "Applicativi",
|
||||
principalColumn: "CodApp");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Releases_CodApp",
|
||||
table: "Releases",
|
||||
column: "CodApp");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Releases");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DB.Migrations
|
||||
{
|
||||
[DbContext(typeof(LMDbContext))]
|
||||
@@ -15,10 +17,11 @@ namespace LiMan.DB.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("ProductVersion", "5.0.10")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
|
||||
.HasAnnotation("ProductVersion", "6.0.28")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
|
||||
{
|
||||
@@ -30,17 +33,98 @@ namespace LiMan.DB.Migrations
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("TplConnString")
|
||||
.HasMaxLength(2500)
|
||||
.HasColumnType("nvarchar(2500)");
|
||||
|
||||
b.HasKey("CodApp");
|
||||
|
||||
b.ToTable("Applicativi");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.Property<int>("ClaimID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ClaimID"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtIns")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DtMod")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("RoleID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ClaimID");
|
||||
|
||||
b.HasIndex("RoleID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("AuthClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Property<int>("RoleID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RoleID"), 1L, 1);
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ruolo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("RoleID");
|
||||
|
||||
b.ToTable("AuthRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Property<int>("UserID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserID"), 1L, 1);
|
||||
|
||||
b.Property<string>("AD_Domain")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("AD_User")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserID");
|
||||
|
||||
b.ToTable("AuthUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxFileAttach")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
|
||||
|
||||
b.Property<DateTime>("DtEvent")
|
||||
.HasColumnType("datetime2");
|
||||
@@ -95,8 +179,9 @@ namespace LiMan.DB.Migrations
|
||||
{
|
||||
b.Property<int>("IdxLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
@@ -166,8 +251,9 @@ namespace LiMan.DB.Migrations
|
||||
{
|
||||
b.Property<int>("IdxLogLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
@@ -204,12 +290,59 @@ namespace LiMan.DB.Migrations
|
||||
b.ToTable("LogLicenze");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ReleaseModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxRel")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxRel"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("ReleaseDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("VersNum")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("VersText")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("IdxRel");
|
||||
|
||||
b.HasIndex("CodApp");
|
||||
|
||||
b.ToTable("Releases");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
|
||||
{
|
||||
b.Property<int>("YearRef")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("CodInst")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("CodApp")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("TotCall")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("YearRef", "CodInst", "CodApp");
|
||||
|
||||
b.ToView("v_StatsCall");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.Property<int>("IdxSubLic")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
|
||||
|
||||
b.Property<string>("Chiave")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
@@ -237,8 +370,9 @@ namespace LiMan.DB.Migrations
|
||||
{
|
||||
b.Property<int>("IdxTicket")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
|
||||
|
||||
b.Property<string>("CodImpiego")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
@@ -289,6 +423,25 @@ namespace LiMan.DB.Migrations
|
||||
b.ToTable("TicketLog");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.AuthRoleModel", "RoleNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("RoleID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LiMan.DB.DBModels.AuthUserModel", "UserNav")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("RoleNav");
|
||||
|
||||
b.Navigation("UserNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
|
||||
@@ -338,6 +491,15 @@ namespace LiMan.DB.Migrations
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.ReleaseModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
|
||||
.WithMany()
|
||||
.HasForeignKey("CodApp");
|
||||
|
||||
b.Navigation("ApplicativoNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
|
||||
{
|
||||
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
|
||||
@@ -360,6 +522,16 @@ namespace LiMan.DB.Migrations
|
||||
b.Navigation("LicenzaNav");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
|
||||
{
|
||||
b.Navigation("Claims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
|
||||
{
|
||||
b.Navigation("Attivazioni");
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
|
||||
DROP PROCEDURE IF EXISTS dbo.stp_StatsCall_filt;
|
||||
GO
|
||||
|
||||
/*-- =============================================
|
||||
-- Author: S.E.L.
|
||||
-- Description: Estrazione dati statistiche call filtrati
|
||||
|
||||
EXEC dbo.stp_StatsCall_filt '2024-01-01', GETDATE(), ''
|
||||
|
||||
-- Mod. date: 2024.05.31
|
||||
-- =============================================*/
|
||||
CREATE PROCEDURE [dbo].[stp_StatsCall_filt]
|
||||
(
|
||||
@DtFrom DATETIME
|
||||
,@DtTo DATETIME
|
||||
,@SearchVal NVARCHAR(250)
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
SET NOCOUNT ON;
|
||||
SET XACT_ABORT ON;
|
||||
|
||||
WITH cteDati AS
|
||||
(
|
||||
SELECT YEAR(DataRif) AS YearRef, CodInst, CodApp, SUM(NumCall) AS TotCall
|
||||
FROM LogCall
|
||||
WHERE DataRif BETWEEN @DtFrom and @DtTo
|
||||
AND (@SearchVal = '' OR TargetUrl LIKE '%'+@SearchVal+'%')
|
||||
GROUP BY YEAR(DataRif), CodInst, CodApp
|
||||
)
|
||||
|
||||
SELECT *
|
||||
FROM cteDati
|
||||
ORDER BY YearRef DESC, TotCall DESC
|
||||
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,23 @@
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
DROP VIEW IF EXISTS dbo.v_StatsCall;
|
||||
GO
|
||||
|
||||
CREATE VIEW [dbo].[v_StatsCall]
|
||||
AS
|
||||
|
||||
WITH cteDati AS
|
||||
(
|
||||
SELECT YEAR(DataRif) AS YearRef, CodInst, CodApp, SUM(NumCall) AS TotCall
|
||||
FROM LogCall
|
||||
GROUP BY YEAR(DataRif), CodInst, CodApp
|
||||
)
|
||||
|
||||
SELECT *
|
||||
FROM cteDati
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,91 @@
|
||||
using LiMan.DbSync.DbModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.DbSync.Controllers
|
||||
{
|
||||
public class DbSyncController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public DbSyncController()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
Log.Info("Dispose di DbSyncController");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record AnagKeyVal
|
||||
/// </summary>
|
||||
/// <param name="cString">stringa connessione al DB da sincronizzare</param>
|
||||
/// <returns></returns>
|
||||
public List<AnagKeyValueModel> AnagKeyValGetAll(string cString)
|
||||
{
|
||||
List<AnagKeyValueModel> dbResult = new List<AnagKeyValueModel>();
|
||||
using (LMDbSyncContext dbCtx = new LMDbSyncContext(cString))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagKeyVal
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record Config
|
||||
/// </summary>
|
||||
/// <param name="cString">stringa connessione al DB da sincronizzare</param>
|
||||
/// <returns></returns>
|
||||
public List<ConfigModel> ConfigGetAll(string cString)
|
||||
{
|
||||
List<ConfigModel> dbResult = new List<ConfigModel>();
|
||||
using (LMDbSyncContext dbCtx = new LMDbSyncContext(cString))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record Vocabolario
|
||||
/// </summary>
|
||||
/// <param name="cString">stringa connessione al DB da sincronizzare</param>
|
||||
/// <returns></returns>
|
||||
public List<VocabolarioModel> VocabolarioGetAll(string cString)
|
||||
{
|
||||
List<VocabolarioModel> dbResult = new List<VocabolarioModel>();
|
||||
using (LMDbSyncContext dbCtx = new LMDbSyncContext(cString))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetVocabolario
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace LiMan.DbSync.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("AnagKeyValue")]
|
||||
public partial class AnagKeyValueModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, Column("nomeVar")]
|
||||
public string NomeVar { get; set; } = "";
|
||||
|
||||
[Column("valInt")]
|
||||
public int? ValInt { get; set; }
|
||||
|
||||
[Column("valFloat")]
|
||||
public double? ValFloat { get; set; }
|
||||
|
||||
[Column("valString")]
|
||||
public string ValString { get; set; } = "";
|
||||
|
||||
[Column("descrizione")]
|
||||
public string Descrizione { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace LiMan.DbSync.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("Config")]
|
||||
public partial class ConfigModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, Column("chiave")]
|
||||
public string Chiave { get; set; } = "";
|
||||
|
||||
[Column("valore")]
|
||||
public string Valore { get; set; } = "";
|
||||
|
||||
[Column("valoreStd")]
|
||||
public string ValoreStd { get; set; } = "";
|
||||
|
||||
[Column("note")]
|
||||
public string Note { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.DbSync.DbModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("Vocabolario")]
|
||||
public partial class VocabolarioModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string Lemma { get; set; } = "";
|
||||
public string Lingua { get; set; } = "";
|
||||
public string Traduzione { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using LiMan.DbSync.DbModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiMan.DbSync
|
||||
{
|
||||
public partial class LMDbSyncContext : Microsoft.EntityFrameworkCore.DbContext
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#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 LMDbSyncContext()
|
||||
{
|
||||
}
|
||||
|
||||
public LMDbSyncContext(string cString)
|
||||
{
|
||||
connString = cString;
|
||||
}
|
||||
|
||||
public LMDbSyncContext(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public LMDbSyncContext(DbContextOptions<LMDbSyncContext> 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
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<AnagKeyValueModel> DbSetAnagKeyVal { get; set; }
|
||||
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
|
||||
public virtual DbSet<VocabolarioModel> DbSetVocabolario { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
|
||||
private string connString = "";
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
// se vuota rileggo da json
|
||||
if (string.IsNullOrEmpty(connString))
|
||||
{
|
||||
connString = _configuration.GetConnectionString("LiMan.DB");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(connString))
|
||||
{
|
||||
optionsBuilder.UseSqlServer(connString);
|
||||
}
|
||||
else
|
||||
{
|
||||
//optionsBuilder.UseSqlServer("Server=SQLSTEAM;Database=LiMan.DB;Trusted_Connection=True;");
|
||||
optionsBuilder.UseSqlServer("Server=W2019-SQL-STEAM;Database=LiMan.DB;Trusted_Connection=True;");
|
||||
//optionsBuilder.UseSqlServer("Server=W2019-SQL-STEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
||||
|
||||
modelBuilder.Entity<VocabolarioModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.Lingua, e.Lemma });
|
||||
|
||||
entity.ToTable("Vocabolario");
|
||||
|
||||
entity.Property(e => e.Lingua).HasMaxLength(3);
|
||||
|
||||
entity.Property(e => e.Lemma).HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.Traduzione)
|
||||
.IsRequired()
|
||||
.HasMaxLength(500);
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void DbForceMigrate()
|
||||
{
|
||||
try
|
||||
{
|
||||
// se non ci fosse... crea o migra!
|
||||
Database.Migrate();
|
||||
Log.Info("DbForceMigrate: done!");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error(exc, "DbForceMigrate: Exception during context initialization 01");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.28">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.28" />
|
||||
<PackageReference Include="NLog" Version="5.3.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.2.88" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
<ProjectReference Include="..\LiMan.DB\LiMan.DB.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,136 @@
|
||||
using Core;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.DbSync.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe di partenza x costruzione servizi di accesso dati + cache
|
||||
/// </summary>
|
||||
public class BaseServ
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
protected IConfiguration _configuration = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga IN SECONDI
|
||||
/// </summary>
|
||||
protected int cacheTtlLong = 60 * 5;
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache breve IN SECONDI
|
||||
/// </summary>
|
||||
protected int cacheTtlShort = 60 * 1;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
protected IConnectionMultiplexer redisConn = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
||||
/// </summary>
|
||||
protected IDatabase redisDb = null!;
|
||||
|
||||
protected Random rnd = new Random();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache breve (1 min circa + perturbazione percentuale +/-10%)
|
||||
/// </summary>
|
||||
protected TimeSpan FastCache
|
||||
{
|
||||
get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
|
||||
/// </summary>
|
||||
protected TimeSpan LongCache
|
||||
{
|
||||
get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache MOLTO breve (10 sec circa + perturbazione percentuale +/-10%)
|
||||
/// </summary>
|
||||
protected TimeSpan UltraFastCache
|
||||
{
|
||||
get => TimeSpan.FromSeconds(cacheTtlShort / 6 * rnd.Next(900, 1100) / 1000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache MOLTO lunga (+ perturbazione percentuale +/-10%)
|
||||
/// </summary>
|
||||
protected TimeSpan UltraLongCache
|
||||
{
|
||||
get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000);
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Refresh globale cache redis
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> FlushRedisCache()
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
await Task.Delay(1);
|
||||
RedisValue pattern = new RedisValue($"{Const.rKeyConfig}:*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
stopWatch.Stop();
|
||||
Log.Debug($"FlushRedisCache in {stopWatch.Elapsed.TotalMilliseconds} ms");
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Esegue flush memoria redis dato pattern
|
||||
/// </summary>
|
||||
/// <param name="pattern"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
||||
{
|
||||
bool answ = false;
|
||||
var listEndpoints = redisConn.GetEndPoints();
|
||||
foreach (var endPoint in listEndpoints)
|
||||
{
|
||||
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
||||
var server = redisConn.GetServer(endPoint);
|
||||
if (server != null)
|
||||
{
|
||||
var keyList = server.Keys(redisDb.Database, pattern);
|
||||
foreach (var item in keyList)
|
||||
{
|
||||
await redisDb.KeyDeleteAsync(item);
|
||||
}
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
using Core;
|
||||
using LiMan.DbSync.Controllers;
|
||||
using LiMan.DbSync.DbModels;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.DbSync.Services
|
||||
{
|
||||
public class DbSyncService : BaseServ
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public DbSyncService(IConfiguration configuration, IConnectionMultiplexer redisConnMult)
|
||||
{
|
||||
Log.Info("DbSyncService starting...");
|
||||
_configuration = configuration;
|
||||
// Conf cache
|
||||
redisConn = redisConnMult;
|
||||
redisDb = this.redisConn.GetDatabase();
|
||||
|
||||
// json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/
|
||||
JSSettings = new JsonSerializerSettings()
|
||||
{
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
|
||||
};
|
||||
|
||||
// cod app
|
||||
CodApp = _configuration["CodApp"];
|
||||
dbController = new DbSyncController();
|
||||
TplController = new DB.Controllers.DbController(configuration);
|
||||
|
||||
// chiudo log
|
||||
Log.Info("DbSyncService started!");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record AnagKeyVal
|
||||
/// </summary>
|
||||
/// <param name="appName">nome APP del DB da sincronizzare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagKeyValueModel>> AnagKeyValGetAll(string appName)
|
||||
{
|
||||
string source = "DB";
|
||||
string cString = ConnString(appName);
|
||||
List<AnagKeyValueModel>? dbResult = new List<AnagKeyValueModel>();
|
||||
try
|
||||
{
|
||||
string currKey = $"{Const.rKeyConfig}:DbSync:AnagKeyVal";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
source = "REDIS";
|
||||
var tempResult = JsonConvert.DeserializeObject<List<AnagKeyValueModel>>(rawData);
|
||||
if (tempResult == null)
|
||||
{
|
||||
dbResult = new List<AnagKeyValueModel>();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.AnagKeyValGetAll(cString);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
// per evitare loopback uso deserialize...
|
||||
var tempResult = JsonConvert.DeserializeObject<List<AnagKeyValueModel>>(rawData);
|
||||
if (tempResult != null)
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
if (dbResult == null)
|
||||
{
|
||||
dbResult = new List<AnagKeyValueModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"AnagKeyValGetAll | {source} in: {ts.TotalMilliseconds} ms");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Error during AnagKeyValGetAll:{Environment.NewLine}{exc}");
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record Config
|
||||
/// </summary>
|
||||
/// <param name="appName">nome APP del DB da sincronizzare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ConfigModel>> ConfigGetAll(string appName)
|
||||
{
|
||||
string source = "DB";
|
||||
string cString = ConnString(appName);
|
||||
List<ConfigModel>? dbResult = new List<ConfigModel>();
|
||||
if (!string.IsNullOrEmpty(cString))
|
||||
{
|
||||
try
|
||||
{
|
||||
string currKey = $"{Const.rKeyConfig}:DbSync:Config";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
source = "REDIS";
|
||||
var tempResult = JsonConvert.DeserializeObject<List<ConfigModel>>(rawData);
|
||||
if (tempResult == null)
|
||||
{
|
||||
dbResult = new List<ConfigModel>();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.ConfigGetAll(cString);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
// per evitare loopback uso deserialize...
|
||||
var tempResult = JsonConvert.DeserializeObject<List<ConfigModel>>(rawData);
|
||||
if (tempResult != null)
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
if (dbResult == null)
|
||||
{
|
||||
dbResult = new List<ConfigModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ConfigGetAll | {source} in: {ts.TotalMilliseconds} ms");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Error during ConfigGetAll:{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record Vocabolario
|
||||
/// </summary>
|
||||
/// <param name="appName">nome APP del DB da sincronizzare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VocabolarioModel>> VocabolarioGetAll(string appName)
|
||||
{
|
||||
string source = "DB";
|
||||
string cString = ConnString(appName);
|
||||
List<VocabolarioModel>? dbResult = new List<VocabolarioModel>();
|
||||
try
|
||||
{
|
||||
string currKey = $"{Const.rKeyConfig}:DbSync:Vocabolario";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
source = "REDIS";
|
||||
var tempResult = JsonConvert.DeserializeObject<List<VocabolarioModel>>(rawData);
|
||||
if (tempResult == null)
|
||||
{
|
||||
dbResult = new List<VocabolarioModel>();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.VocabolarioGetAll(cString);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
// per evitare loopback uso deserialize...
|
||||
var tempResult = JsonConvert.DeserializeObject<List<VocabolarioModel>>(rawData);
|
||||
if (tempResult != null)
|
||||
{
|
||||
dbResult = tempResult;
|
||||
}
|
||||
}
|
||||
if (dbResult == null)
|
||||
{
|
||||
dbResult = new List<VocabolarioModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"VocabolarioGetAll | {source} in: {ts.TotalMilliseconds} ms");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Error during VocabolarioGetAll:{Environment.NewLine}{exc}");
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static JsonSerializerSettings? JSSettings;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected DbSyncController dbController { get; set; } = null!;
|
||||
protected LiMan.DB.Controllers.DbController TplController { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string CodApp { get; set; } = "";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce la stringa di connessione al DB data app riferimento
|
||||
/// </summary>
|
||||
/// <param name="appName"></param>
|
||||
/// <returns></returns>
|
||||
private string ConnString(string appName)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
var currRec = TplController.GetApplicazioniFilt(appName);
|
||||
if (currRec != null)
|
||||
{
|
||||
answ = currRec.TplConnString;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace LiMan.GLS.Controllers
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in DbForceMigrate");
|
||||
Log.Error($"Eccezione in DbForceMigrate{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -9,15 +9,15 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.28" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.28">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.28" />
|
||||
<PackageReference Include="NLog" Version="5.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.13" />
|
||||
<None Include="..\.editorconfig" Link=".editorconfig" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.3.2" />
|
||||
<PackageReference Include="RestSharp" Version="106.15.0" />
|
||||
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="106.15.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -6,6 +6,7 @@ using RestSharp;
|
||||
using RestSharp.Serializers.NewtonsoftJson;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using static Core.Enum;
|
||||
|
||||
namespace MyApp // Note: actual namespace depends on the project name.
|
||||
{
|
||||
@@ -113,7 +114,7 @@ namespace MyApp // Note: actual namespace depends on the project name.
|
||||
var client = new RestClient(apiUrl);
|
||||
client.UseNewtonsoftJson();
|
||||
|
||||
SupportRequest newSuppReq = new SupportRequest();
|
||||
SupportRequest? newSuppReq = new SupportRequest();
|
||||
string rawData = "";
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\publish\net6.0\win-x86\</PublishDir>
|
||||
<PublishDir>bin\publish\net6.0\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<PublishSingleFile>True</PublishSingleFile>
|
||||
<PublishReadyToRun>True</PublishReadyToRun>
|
||||
<PublishTrimmed>False</PublishTrimmed>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -11,7 +11,7 @@ Sintassi
|
||||
|
||||
|
||||
L'applicativo si occupa delal fase di
|
||||
* generazione ticket richeista invio
|
||||
* generazione ticket richiesta invio
|
||||
* invio singoli files ZIP su piattaforma
|
||||
|
||||
E' necessario chiamarlo indicando 2 parametri:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>License Manager</i>
|
||||
<h4>Versione: 1.1.2202.0907</h4>
|
||||
<h4>Versione: 1.1.2408.0817</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2202.0907
|
||||
1.1.2408.0817
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2202.0907</version>
|
||||
<version>1.1.2408.0817</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Core
|
||||
using static Core.Enum;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
public class TicketDTO
|
||||
{
|
||||
|
||||
+12
-10
@@ -1,10 +1,12 @@
|
||||
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p>Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
<CascadingAuthenticationState>
|
||||
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p>Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
</CascadingAuthenticationState>
|
||||
|
||||
@@ -1,79 +1,110 @@
|
||||
<div class="card">
|
||||
<div class="card-header bg-info py-1 text-light">
|
||||
<h3>Attivazioni</h3>
|
||||
</div>
|
||||
<div class="card-body bg-light p-1">
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
|
||||
</th>
|
||||
<th>#</th>
|
||||
<th>Impiego</th>
|
||||
<th>
|
||||
Chiave
|
||||
@if (showKey)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
|
||||
}
|
||||
</th>
|
||||
<th>Scadenza Veto</th>
|
||||
<th class="text-right"><i class="fas fa-user-lock"></i></th>
|
||||
<th class="text-right"><i class="fas fa-exclamation-triangle"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(record.IdxLic)">
|
||||
<td class="text-nowrap">
|
||||
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
|
||||
<i class="oi oi-lock-unlocked"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<b>@record.IdxSubLic</b>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodImpiego
|
||||
</td>
|
||||
<td>
|
||||
<div class="card-header bg-info py-1 text-light">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<h3>Attivazioni</h3>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#machKeyGen">
|
||||
Show Machine KeyGen <i class="fas fa-key"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body bg-light p-1">
|
||||
<div class="modal" id="machKeyGen">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Machine Key Generator</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<MachineKeyGen></MachineKeyGen>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button type="button" class="btn btn-sm btn-warning w-100" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
|
||||
</th>
|
||||
<th>#</th>
|
||||
<th>Impiego</th>
|
||||
<th>
|
||||
Chiave
|
||||
@if (showKey)
|
||||
{
|
||||
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
|
||||
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
@record.Chiave
|
||||
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (record.Locked)
|
||||
{
|
||||
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (!record.Locked)
|
||||
{
|
||||
<button title="Elimina Licenza" class="btn btn-sm btn-danger" @onclick="() => Remove(record)"><i class="fas fa-trash"></i></button>
|
||||
}
|
||||
</td>
|
||||
</th>
|
||||
<th>Scadenza Veto</th>
|
||||
<th class="text-right"><i class="fas fa-user-lock"></i></th>
|
||||
<th class="text-right"><i class="fas fa-exclamation-triangle"></i></th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(record.IdxLic)">
|
||||
<td class="text-nowrap">
|
||||
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
|
||||
<i class="oi oi-lock-unlocked"></i>
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<b>@record.IdxSubLic</b>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodImpiego
|
||||
</td>
|
||||
<td>
|
||||
@if (showKey)
|
||||
{
|
||||
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@record.Chiave
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (record.Locked)
|
||||
{
|
||||
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
|
||||
}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (!record.Locked)
|
||||
{
|
||||
<button title="Elimina Licenza" class="btn btn-sm btn-danger" @onclick="() => Remove(record)"><i class="fas fa-trash"></i></button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,7 +95,7 @@ namespace LiMan.UI.Components
|
||||
ListRecords = null;
|
||||
await Task.Delay(1);
|
||||
ListRecords = MasterLicence.Attivazioni.ToList();
|
||||
//ListRecords = await DataService.AttivazioniGetByLic(MasterLicence.IdxLic);
|
||||
//AllRecords = await DataService.AttivazioniGetByLic(MasterLicence.IdxLic);
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<div class="card shadow shadow-lg">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<h3>Chiavi</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-2">
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
|
||||
@if (AllRecords == null || AllRecords.Count == 0)
|
||||
{
|
||||
<div class="alert alert-warning">No record to search</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
<div class="alert alert-info text-center mb-0">
|
||||
<b>@AllRecords.Count</b> Records found
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Numero</th>
|
||||
<th>Seriale</th>
|
||||
<th>Data</th>
|
||||
<th>Note</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.Number</td>
|
||||
<td>@item.Seriale</td>
|
||||
<td>@($"{item.Date:yyyy.MM.dd}")</td>
|
||||
<td>@item.Note</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="setNumRec" numPageChanged="setNumPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,107 @@
|
||||
using Liman.CadCam.DbModel;
|
||||
using Liman.CadCam.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.UI.Components
|
||||
{
|
||||
public partial class CadCamSearchKey
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public string searchVal { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected CadCamService CCService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<KeyModel> AllRecords { get; set; } = new List<KeyModel>();
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private List<KeyModel> ListRecords { get; set; } = new List<KeyModel>();
|
||||
private int numRecord { get; set; } = 5;
|
||||
private List<KeyModel> SearchRecords { get; set; } = new List<KeyModel>();
|
||||
private int totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
ReloadAllData();
|
||||
// aggiorno
|
||||
}
|
||||
|
||||
protected void setNumPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
ReloadAllData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected void setNumRec(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
ReloadAllData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void ReloadAllData()
|
||||
{
|
||||
// rileggo i dati
|
||||
isLoading = true;
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
SearchRecords = AllRecords
|
||||
.Where(x => (!string.IsNullOrEmpty(x.Note) && x.Note.Contains(searchVal, StringComparison.CurrentCultureIgnoreCase))
|
||||
|| x.Number.ToString().Contains(searchVal, StringComparison.CurrentCultureIgnoreCase)
|
||||
|| (!string.IsNullOrEmpty(x.Seriale) && x.Seriale.Contains(searchVal, StringComparison.CurrentCultureIgnoreCase)))
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchRecords = new List<KeyModel>();
|
||||
}
|
||||
totalCount = SearchRecords.Count;
|
||||
// paginazione!
|
||||
ListRecords = SearchRecords
|
||||
.Skip((currPage - 1) * numRecord)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
AllRecords = await CCService.KeysGetAll();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<div class="card shadow shadow-lg">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<h3>Licenze</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-2">
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
|
||||
@if (AllRecords == null || AllRecords.Count == 0)
|
||||
{
|
||||
<div class="alert alert-warning">No record to search</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(searchVal) && string.IsNullOrEmpty(LockId))
|
||||
{
|
||||
<div class="alert alert-info text-center mb-0">
|
||||
<b>@AllRecords.Count</b> Records found
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Prodotto</th>
|
||||
<th>Licenza</th>
|
||||
<th>Assistenza</th>
|
||||
<th>Note</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="small">
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
string cssDef = item.IsDefinitiva ? "text-success" : "text-danger";
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex justify-content-between small text-nowrap">
|
||||
<div class="px-1">
|
||||
<b>@item.ProdNav.ProductName</b>
|
||||
</div>
|
||||
<div class="px-1">
|
||||
Vers: @item.ProductVersion
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between small text-nowrap @item.CssDefinitiva">
|
||||
<div class="px-1">
|
||||
Level: @item.ProductLevel
|
||||
</div>
|
||||
<div class="px-1">
|
||||
D: @($"{item.ProductDeadline:yyyy.MM.dd}")
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-nowrap">
|
||||
<button class="btn btn-sm btn-outline-primary" @onclick="() => ReportLockId(item.LockID)">
|
||||
<div class="small">
|
||||
@item.LockID
|
||||
</div>
|
||||
<small>
|
||||
<i class="fas fa-angle-double-right"></i> @($"{item.Date:yyyy.MM.dd}") <i class="fas fa-angle-double-left"></i>
|
||||
</small>
|
||||
</button>
|
||||
</td>
|
||||
<td class="@item.CssScad">
|
||||
<b>@($"{item.DtScadenza:yyyy.MM}")</b>
|
||||
</td>
|
||||
<td>@item.Note</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="setNumRec" numPageChanged="setNumPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,127 @@
|
||||
using Liman.CadCam.DbModel;
|
||||
using Liman.CadCam.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.UI.Components
|
||||
{
|
||||
public partial class CadCamSearchLic
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public string searchVal { get; set; } = "";
|
||||
|
||||
|
||||
[Parameter]
|
||||
public int ProdId { get; set; } = 0;
|
||||
[Parameter]
|
||||
public string LockId { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected CadCamService CCService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<LicenceModel> AllRecords { get; set; } = new List<LicenceModel>();
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private List<LicenceModel> ListRecords { get; set; } = new List<LicenceModel>();
|
||||
private int numRecord { get; set; } = 10;
|
||||
private List<LicenceModel> SearchRecords { get; set; } = new List<LicenceModel>();
|
||||
private int totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
ReloadAllData();
|
||||
// aggiorno
|
||||
}
|
||||
|
||||
protected void setNumPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
ReloadAllData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected void setNumRec(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
ReloadAllData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
protected async Task ReportLockId(string lockId)
|
||||
{
|
||||
await EC_LockIdSel.InvokeAsync(lockId);
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_LockIdSel { get; set; }
|
||||
|
||||
private void ReloadAllData()
|
||||
{
|
||||
// rileggo i dati
|
||||
isLoading = true;
|
||||
if (!string.IsNullOrEmpty(searchVal) || !string.IsNullOrEmpty(LockId))
|
||||
{
|
||||
SearchRecords = AllRecords
|
||||
.Where(x => (ProdId == 0 || x.ProductID == ProdId) && (string.IsNullOrEmpty(LockId) || x.LockID.Contains(LockId, StringComparison.CurrentCultureIgnoreCase))
|
||||
&& (string.IsNullOrEmpty(searchVal) || (
|
||||
(!string.IsNullOrEmpty(x.Note) && x.Note.Contains(searchVal, StringComparison.CurrentCultureIgnoreCase))
|
||||
|| x.ProductVersion.ToString().Contains(searchVal, StringComparison.CurrentCultureIgnoreCase)
|
||||
|| (!string.IsNullOrEmpty(x.Note) && x.Note.Contains(searchVal, StringComparison.CurrentCultureIgnoreCase))
|
||||
))
|
||||
)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchRecords = new List<LicenceModel>();
|
||||
}
|
||||
// ordinamento data desc
|
||||
SearchRecords = SearchRecords.OrderByDescending(x => x.DtScadenza).ToList();
|
||||
totalCount = SearchRecords.Count;
|
||||
// paginazione!
|
||||
ListRecords = SearchRecords
|
||||
.Skip((currPage - 1) * numRecord)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
AllRecords = await CCService.LicencesGetAll();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<div class="card shadow shadow-lg">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<h3>Prodotti</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-2">
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
|
||||
@if (AllRecords == null || AllRecords.Count == 0)
|
||||
{
|
||||
<div class="alert alert-warning">No record to search</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
<div class="alert alert-info text-center mb-0">
|
||||
<b>@AllRecords.Count</b> Records found
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>Numero</th>
|
||||
<th>Opzione 1</th>
|
||||
<th>Opzione 2</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.ProductName</td>
|
||||
<td>@item.ProductNumber</td>
|
||||
<td>@item.ProductOption1</td>
|
||||
<td>@item.ProductOption2</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="setNumRec" numPageChanged="setNumPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</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