118 Commits

Author SHA1 Message Date
marco.salvi 457035e66c Aggiunta prima versione ci/cd 2022-04-12 10:01:17 +02:00
Samuele Locatelli 49930062c9 refresh calcolo versioni 2022-02-03 10:43:46 +01:00
Samuele Locatelli b47c8f9e49 Merge tag 'FixDataLayerSingleton' into develop
Fix gestione da singleton ad oggetti pagina/controllo
2022-01-28 19:22:26 +01:00
Samuele Locatelli e92d288cc3 Merge branch 'release/FixDataLayerSingleton' 2022-01-28 19:22:17 +01:00
Samuele Locatelli e8ef38fc56 Refresh: comportamento con DataLayer istsanziato x singola pagina/UserControl 2022-01-28 19:21:20 +01:00
Samuele E. Locatelli a22667f505 Merge branch 'develop' 2020-12-31 12:26:26 +01:00
Samuele E. Locatelli bfb2c4fc9c Del MAG (spostato in MAPO) 2020-12-31 09:23:34 +01:00
Samuele E. Locatelli e9c7bbbcdb fix progetto 2020-12-31 09:22:51 +01:00
Samuele E. Locatelli f0e51ba3a0 inizio spostamento progetto MP-MAG in soluzione MAPO 2020-12-31 09:10:13 +01:00
Samuele E. Locatelli f8dbf27447 inizio mod jenkins x MAG 2020-12-31 09:08:42 +01:00
Samuele E. Locatelli 06ed89bd75 fix conf e comportamento x redirect (da testare) verso TAB 2020-12-31 09:08:33 +01:00
Samuele E. Locatelli 823132cf07 redirect da pagina MAIN... 2020-12-30 19:19:02 +01:00
Samuele E. Locatelli 092e39a89e Aggiunta pubblicazione MANUALE x IIS01/IIS02 2020-12-30 19:14:47 +01:00
Samuele E. Locatelli ff79b12420 OK refresh qty prelevata post AL2UDC merge 2020-12-30 18:57:20 +01:00
Samuele E. Locatelli 3bbc14f11e OK qta prelevata x ordine 2020-12-30 18:44:44 +01:00
Samuele E. Locatelli e11068cab3 Merge branch 'develop' into beta 2020-12-30 17:55:46 +01:00
Samuele E. Locatelli cc3b6b4a1b prima rel con giro carico UDC validato 2020-12-30 17:55:35 +01:00
Samuele E. Locatelli 75fda50c94 cambio colorazione x stato enabled/disabled... 2020-12-30 17:35:12 +01:00
Samuele E. Locatelli 0ed92b84d4 start UDC-pedane (2 check x correttezza...) 2020-12-30 16:20:04 +01:00
Samuele E. Locatelli 69c32c30e0 fix grafico + test pack/pedane 2020-12-30 14:18:11 +01:00
Samuele E. Locatelli 4f7f03cd1f Updatre display + comportamento pack --> pedana 2020-12-30 13:21:01 +01:00
Samuele E. Locatelli fba002dfdd Continuato modifiche x gestione SMART delle pedane 2020-12-30 13:13:48 +01:00
Samuele E. Locatelli 8f9645e4e7 OK check status PL 2020-12-30 11:00:39 +01:00
Samuele E. Locatelli b7337e7ae1 pagina smart starter 2020-12-30 10:40:51 +01:00
Samuele E. Locatelli de7bc44204 fix grafico dettaglio UDC 2020-12-29 19:06:35 +01:00
Samuele E. Locatelli befacf6da0 Merge branch 'develop' into beta 2020-12-29 18:54:23 +01:00
Samuele E. Locatelli 226540c7d2 update detail UDC x pedana 2020-12-29 18:54:15 +01:00
Samuele E. Locatelli 756277e466 fix visualizzaizone packList det 2020-12-29 18:39:56 +01:00
Samuele E. Locatelli e11f6d6a70 reord user mod 2020-12-29 18:30:30 +01:00
Samuele E. Locatelli 7cbc7d025e inizio cmp gestione lettura scanner 2020-12-29 17:01:55 +01:00
Samuele E. Locatelli b690b86aec update gestione PL Scanner 2020-12-29 17:01:17 +01:00
Samuele E. Locatelli 492aa5496e inizio pagina smart device 2020-12-29 15:17:12 +01:00
Samuele E. Locatelli 4f9d701821 update barcode preliminare 2020-12-29 15:17:05 +01:00
Samuele E. Locatelli 25b36f8941 update gest pedane 2020-12-29 15:16:55 +01:00
Samuele E. Locatelli 2f52a12591 fix footer 2020-12-29 15:16:29 +01:00
Samuele E. Locatelli 49a2a44c94 Add loghi 2020-12-29 15:16:21 +01:00
Samuele E. Locatelli d9d7bbcc41 Merge branch 'develop' 2020-12-24 15:39:02 +01:00
Samuele E. Locatelli 228b022a01 new rel 2020-12-24 15:38:48 +01:00
Samuele E. Locatelli 51efaf5dd1 fix display pedane a cascata 2020-12-24 15:38:37 +01:00
Samuele E. Locatelli 13249b2b74 fix formattazioen dati peso/qta pedane 2020-12-24 15:34:48 +01:00
Samuele E. Locatelli fb6c874ba4 update float --> decimal su DB 2020-12-24 10:15:37 +01:00
Samuele E. Locatelli 9b1e597416 fix peso/tara su AL da bilancia 2020-12-24 09:52:29 +01:00
Samuele E. Locatelli 0d631bfd5d Merge branch 'master' into develop 2020-12-23 16:00:06 +01:00
Samuele E. Locatelli 9d8b8f2a08 Merge branch 'beta' 2020-12-23 16:00:01 +01:00
Samuele E. Locatelli ab477afcb1 Aggiunta list UDC in composizione pedane 2020-12-23 15:58:13 +01:00
Samuele E. Locatelli 0f04b63a29 UPdate gestPEdane x mostrare richiesta 2020-12-23 15:00:02 +01:00
Samuele E. Locatelli 161bd4522d new rel 2020-12-23 12:03:01 +01:00
Samuele E. Locatelli c574dcc396 Ok gestione pedane (edit, aggiunta...) 2020-12-23 12:02:49 +01:00
Samuele E. Locatelli 4a231c9b77 Update (pèarziale) gestione PackList 2020-12-22 15:38:26 +01:00
Samuele E. Locatelli 9fd39a8f85 ancora update gitspread 2020-12-22 14:42:07 +01:00
Samuele E. Locatelli b15c2876b3 update gitspread! 2020-12-22 14:40:37 +01:00
Samuele E. Locatelli d6e2d586fe Merge branch 'develop' into beta 2020-12-22 14:34:02 +01:00
Samuele E. Locatelli 4ceb8aa01b Completata gestione packlist (CRUD) 2020-12-22 14:33:53 +01:00
Samuele E. Locatelli 30ed0f8fab Update visualizzazione 2020-12-22 13:01:33 +01:00
Samuele E. Locatelli e9a5bd6839 riorganizzato componenti packList... 2020-12-22 12:59:21 +01:00
Samuele E. Locatelli c4b83b1575 COmpletato creazione liste ordini da EXT 2020-12-22 12:42:32 +01:00
Samuele E. Locatelli ed60f662b6 Bozza editing ordini 2020-12-21 19:50:06 +01:00
Samuele E. Locatelli 7ad36062c4 estrazione modulo x OrdersList 2020-12-21 19:29:50 +01:00
Samuele E. Locatelli 40560b99f6 Continuo master/detail PackList 2020-12-21 19:17:32 +01:00
Samuele E. Locatelli 39da8e016c ok creazione oggetto testata PackingList 2020-12-21 18:54:25 +01:00
Samuele E. Locatelli b5731d46e9 start new rel 2020-12-21 17:06:58 +01:00
Samuele E. Locatelli 5da9298045 inizio aggiunta gestione PackList 2020-12-21 17:06:40 +01:00
Samuele E. Locatelli 0d9ad0c940 refresh gitSpread... 2020-10-26 18:41:23 +01:00
Samuele E. Locatelli 3914bc869a eliminato reference a mongocrypt 2020-10-26 18:23:47 +01:00
Samuele E. Locatelli 4b498595e6 fix echo 2020-10-26 18:21:21 +01:00
Samuele E. Locatelli 1879d441c3 typo label goto 2020-10-26 18:21:06 +01:00
Samuele E. Locatelli 9accacf2ed refresh 2020-10-26 18:20:27 +01:00
Samuele E. Locatelli 60ae233ada fix git spread call 2020-10-26 18:19:18 +01:00
Samuele E. Locatelli 3af82343d1 update script 2020-10-26 18:10:35 +01:00
Samuele E. Locatelli 0371394885 Script pubblicazione + newRel 2020-10-26 18:09:35 +01:00
Samuele E. Locatelli 4d2a1bcb10 Merge branch 'develop' 2020-10-26 16:47:36 +01:00
Samuele E. Locatelli 062cb9986c Fix rinominate colonne 2020-10-26 16:46:54 +01:00
Samuele E. Locatelli 010b5635b9 Rel 1.5! 2020-10-25 17:15:50 +01:00
Samuele E. Locatelli 581aa79763 Aggiunta metodi e pagina x export aggregato o meno 2020-10-25 17:15:45 +01:00
Samuele E. Locatelli 9e0326ffc2 New rel 2020-10-25 15:47:52 +01:00
Samuele E. Locatelli 5ef9137522 Modifica x caricamento manuale commesse + visualizzazione 2020-10-25 15:46:41 +01:00
Samuele E. Locatelli 12ca01f984 Aggiunta metodi x nuovo campo tempo prev in tabella 2020-10-25 15:46:29 +01:00
Samuele E. Locatelli b947071896 refresh testo readme 2020-10-25 15:46:16 +01:00
Samuele E. Locatelli a217971636 Merge branch 'develop' 2020-05-26 18:54:31 +02:00
Samuele E. Locatelli dbd8ea4f7e refresh 2020-05-26 18:53:35 +02:00
Samuele E. Locatelli 0a0b5d2b35 Fix init MAG 2020-05-22 14:03:06 +02:00
Samuele E. Locatelli 69a2c01fff Fix gestione reset operatore in post multi 2020-05-22 12:58:40 +02:00
Samuele E. Locatelli 41c0bf31a6 Merge branch 'develop' 2020-03-24 13:50:49 +01:00
Samuele E. Locatelli 70604473a0 Fix insert/edit pedana... 2020-03-24 12:03:09 +01:00
Samuele E. Locatelli 382916df7d Fix procedura check menù x forzare login... 2020-03-24 08:53:34 +01:00
Samuele E. Locatelli d5af76fb91 Merge branch 'develop' 2020-03-23 19:53:51 +01:00
Samuele E. Locatelli 115c1870c6 Update gestione filtro x LDP 2020-03-23 19:53:40 +01:00
Samuele E. Locatelli 1bb728ff86 inizio dett pedane 2020-03-19 19:59:03 +01:00
Samuele E. Locatelli 639585c0d0 Fix componenti progetto 2020-03-19 19:00:30 +01:00
Samuele E. Locatelli 1861019ba5 Merge branch 'develop' 2020-03-19 18:57:39 +01:00
Samuele E. Locatelli c0174161e9 Completata prima vers packList 2020-03-19 18:57:32 +01:00
Samuele E. Locatelli 0cc3acda52 Fix selezione pedane con add... 2020-03-19 18:51:34 +01:00
Samuele E. Locatelli 4c4f72496c Meetodi x gest pedane 2020-03-19 18:45:43 +01:00
Samuele E. Locatelli d84e581b2c inizio gest pedane 2020-03-19 18:45:37 +01:00
Samuele E. Locatelli 79ff9ca4ef Spostsamento da progetto steamware a nuget pkg 2020-03-19 16:26:38 +01:00
Samuele E. Locatelli ff3578b911 Aggiunte pagine x menuTop e gestione permessi/funzione 2020-03-19 15:56:32 +01:00
Samuele E. Locatelli 896350733c Completata revisione menuTop 2020-03-19 15:56:18 +01:00
Samuele E. Locatelli a7d4d1d5e4 Refresh nome pagina pedane 2020-03-19 14:07:03 +01:00
Samuele E. Locatelli 9a498dbabd Rename prt --> gestPedane 2020-03-19 14:06:37 +01:00
Samuele E. Locatelli c697093ad3 rename selector --> menu 2020-03-19 14:05:56 +01:00
Samuele E. Locatelli 2fccbb28a7 Merge branch 'develop' 2020-03-19 11:56:36 +01:00
Samuele E. Locatelli 9346810ec1 Ok print SL e FIN!!! 2020-03-19 11:56:09 +01:00
Samuele E. Locatelli 43a1680844 Merge branch 'develop' 2020-03-18 20:33:42 +01:00
Samuele E. Locatelli a520000fb2 Completato fix x creazione UDC + stampa x semilav e finiti 2020-03-18 20:33:36 +01:00
Samuele E. Locatelli 4ce03983c9 Altri update ma ancora errori da fixare... 2020-03-18 19:40:18 +01:00
Samuele E. Locatelli 1fba7f5c4a Update parziale con NUOVI metodi x creaz lotti + UDC 2020-03-18 19:36:56 +01:00
Samuele E. Locatelli 4c7e8e8aca Rename componente artOUT 2020-03-18 16:28:00 +01:00
Samuele E. Locatelli 559fbc5393 Rename comp lotto OUT, OK filtraggio da CodStato 2020-03-18 16:26:44 +01:00
Samuele E. Locatelli d34d484204 Fix sstato creazione lotti SL (era MP x errore) 2020-03-18 16:21:44 +01:00
Samuele E. Locatelli 863c7b41f8 Merge branch 'develop' 2020-03-18 16:16:09 +01:00
Samuele E. Locatelli 9d53de119b Fatta modifica x lotti IN x semilavorati e finiti 2020-03-18 16:16:00 +01:00
Samuele E. Locatelli 9e10b66d7a rinominato componente x semilavorati 2020-03-18 16:15:38 +01:00
Samuele E. Locatelli e2bfe69c35 Update e inizioa comporre pagina finiti 2020-03-18 15:43:16 +01:00
Samuele E. Locatelli 16559ae5d8 Rename componente 2020-03-18 15:43:07 +01:00
Samuele E. Locatelli 6620a5be2d Merge branch 'develop' 2020-03-18 13:00:41 +01:00
Samuele E. Locatelli 21bd4d33f0 Fix semilavorati con info su coda da tab 2020-03-18 13:00:15 +01:00
Samuele E. Locatelli 38e3d3cb44 Spostata gestione printQueue come derivata da tab 2020-03-18 12:59:49 +01:00
Samuele E. Locatelli 43cc6693d2 iniziato cart finiti 2020-03-18 12:59:12 +01:00
406 changed files with 4428 additions and 131441 deletions
+4
View File
@@ -0,0 +1,4 @@
[*.cs]
# CA1303: Non passare valori letterali come parametri localizzati
dotnet_diagnostic.CA1303.severity = none
+155
View File
@@ -0,0 +1,155 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
# EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\b2bcondomini\Release'
# DEPLOY_FOLDER: 'c:\Projects\Deploy\b2bcondomini\Builds'
NEXUS_PATH: 'CTRACK/C-TRACK'
APP_NAME: 'C-TRACK'
SOL_NAME: 'C-TRACK'
VERS_MAIN: '1.5'
NEW_REL: ''
OUTPUT_DIR: ''
# 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 "`"$NEXUS_PASSWD`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
}
echo $hasSource
# helper x fix version number
.version-fix: &version-fix
- |
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+$CI_PIPELINE_IID
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
echo "Set vers: $env:NEW_REL"
# helper pulizia files zip
.cleanup-zip: &cleanup-zip
- |
$env:OUTPUT_DIR = "Releases\" + $CI_COMMIT_BRANCH + "\*"
if ((Test-Path $env:OUTPUT_DIR))
{
Remove-Item $env:OUTPUT_DIR -Force -Recurse -ErrorAction Ignore
}
echo "Clening ZIP dir: $env:OUTPUT_DIR"
# helper creazione files zip
.zipper: &zipper
- |
$7zipPath = $env:ProgramFiles+"\7-Zip\7z.exe"
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$Source = "$env:APP_NAME\bin\*"
7zip a -tzip $Target $Source
echo "called ZIP $Source --> $Target"
# helper creazione hash files
.hashBuild: &hashBuild
- |
$Target = "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 x send su NEXUS
.nexusUpload: &nexusUpload
- |
Set-Alias mCurl C:\Windows\system32\curl.exe
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$VersNumb = $env:NEW_REL
echo "Curr Version: $VersNumb"
$FileManIn="VersGen\manifest.xml"
$FileManOut=$env:APP_NAME +"\Resources\manifest.xml"
$FileCLogIn="VersGen\ChangeLog.html"
$FileCLogOut=$env:APP_NAME +"\Resources\ChangeLog.html"
echo "Manifest path: $FileManOut"
echo "ChangeLog path: $FileCLogOut"
if($CI_COMMIT_BRANCH -eq "master")
{
$version = "stable"
}
else
{
$version = "unstable"
}
$manData = Get-Content $FileManIn
$manData = $manData -replace "1.0.0.0", $VersNumb
$manData = $manData -replace "{{DIRNAME}}", $env:NEXUS_PATH
$manData = $manData -replace "{{BRANCHNAME}}", "$version/LAST"
$manData = $manData -replace "{{PACKNAME}}", $env:APP_NAME
Set-Content -Path $FileManOut -Value $manData
$clogData = Get-Content $FileCLogIn
$clogData = $clogData -replace "{{CURRENT-REL}}", $VersNumb
Set-Content -Path $FileCLogOut -Value $clogData
$File2Send = Get-ChildItem("Releases\$CI_COMMIT_BRANCH\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
}
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileManOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileManOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileCLogOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileCLogOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
# $File2Send = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$CI_COMMIT_BRANCH/LAST/$env:APP_NAME-$version.zip
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$CI_COMMIT_BRANCH/ARCHIVE/$VersNumb/$env:APP_NAME-$version.zip
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send".md5" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".md5
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send".sha1" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".sha1"
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
stages:
- build
- deploy
PUB:Build:
stage: build
tags:
- win
#variables:
# - APP_NAME: 'PUB'
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore $env:SOL_NAME.sln' # path alla solution corrente
- *version-fix
script:
- '& "$env:MSBUILD_PATH" $env:APP_NAME\$env:APP_NAME.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
PUB:Deploy:
stage: deploy
tags:
- win
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore $env:SOL_NAME.sln' # path alla solution corrente
- *version-fix
- *cleanup-zip
script:
- '& "$env:MSBUILD_PATH" $env:APP_NAME\$env:APP_NAME.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
- *zipper
- *hashBuild
- *nexusUpload
needs: ["PUB:Build"]
+3 -2
View File
@@ -87,7 +87,9 @@
<Reference Include="SteamWare, Version=3.5.2002.721, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SteamWare.3.5.2002.721\lib\net462\SteamWare.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll</HintPath>
</Reference>
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
@@ -191,7 +193,6 @@
<Content Include="App_Readme\README_SteamWare.txt" />
<Content Include="App_Readme\SteamWare_demo\example-config-table.txt" />
<Content Include="App_Readme\SteamWare_demo\example-favicon.ico" />
<Content Include="mongocrypt.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets" Condition="Exists('..\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets')" />
+1024 -3
View File
File diff suppressed because it is too large Load Diff
+80 -13
View File
@@ -23,6 +23,7 @@
<Mapping SourceColumn="CodGruppo" DataSetColumn="CodGruppo" />
<Mapping SourceColumn="CodArt" DataSetColumn="CodArt" />
<Mapping SourceColumn="QtaRic" DataSetColumn="QtaRic" />
<Mapping SourceColumn="TimeEst" DataSetColumn="TimeEst" />
<Mapping SourceColumn="QtaEv" DataSetColumn="QtaEv" />
<Mapping SourceColumn="Prior" DataSetColumn="Prior" />
<Mapping SourceColumn="Concluso" DataSetColumn="Concluso" />
@@ -100,6 +101,7 @@
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@NumTask" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodArt" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@QtaRic" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="float" DbType="Double" Direction="Input" ParameterName="@TimeEst" Precision="53" ProviderType="Float" Scale="0" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
@@ -286,6 +288,7 @@ FROM v_TaskRec</CommandText>
<Mapping SourceColumn="CodTag" DataSetColumn="CodTag" />
<Mapping SourceColumn="CodArt" DataSetColumn="CodArt" />
<Mapping SourceColumn="QtaRic" DataSetColumn="QtaRic" />
<Mapping SourceColumn="TempoPrev" DataSetColumn="TempoPrev" />
<Mapping SourceColumn="CodOpr" DataSetColumn="CodOpr" />
<Mapping SourceColumn="NomeOpr" DataSetColumn="NomeOpr" />
<Mapping SourceColumn="CodPost" DataSetColumn="CodPost" />
@@ -1126,6 +1129,36 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</DbSource>
</Sources>
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="TaskRecAggTableAdapter" GeneratorDataComponentClassName="TaskRecAggTableAdapter" Name="TaskRecAgg" UserDataComponentName="TaskRecAggTableAdapter">
<MainSource>
<DbSource ConnectionRef="C_TRACKConnectionString (Settings)" DbObjectName="C_TRACK.dbo.stp_TRA_GetByFilt" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="getByFilt" GetMethodModifier="Public" GetMethodName="getByFilt" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="getByFilt" UserSourceName="getByFilt">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_TRA_GetByFilt</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodArt" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DtFrom" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DtTo" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="NumTask" DataSetColumn="NumTask" />
<Mapping SourceColumn="CodArt" DataSetColumn="CodArt" />
<Mapping SourceColumn="QtaRic" DataSetColumn="QtaRic" />
<Mapping SourceColumn="TempoPrev" DataSetColumn="TempoPrev" />
<Mapping SourceColumn="IdxRec" DataSetColumn="IdxRec" />
<Mapping SourceColumn="DtStart" DataSetColumn="DtStart" />
<Mapping SourceColumn="DtEnd" DataSetColumn="DtEnd" />
<Mapping SourceColumn="QtaEv" DataSetColumn="QtaEv" />
<Mapping SourceColumn="DurataMin" DataSetColumn="DurataMin" />
<Mapping SourceColumn="TCiclo" DataSetColumn="TCiclo" />
</Mappings>
<Sources />
</TableAdapter>
</Tables>
<Sources />
</DataSource>
@@ -1134,7 +1167,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
<xs:element name="DS_App" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DS_App" msprop:Generator_UserDSName="DS_App">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="TaskList" msprop:Generator_TableClassName="TaskListDataTable" msprop:Generator_TableVarName="tableTaskList" msprop:Generator_TablePropName="TaskList" msprop:Generator_RowDeletingName="TaskListRowDeleting" msprop:Generator_RowChangingName="TaskListRowChanging" msprop:Generator_RowEvHandlerName="TaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskListRowDeleted" msprop:Generator_UserTableName="TaskList" msprop:Generator_RowChangedName="TaskListRowChanged" msprop:Generator_RowEvArgName="TaskListRowChangeEvent" msprop:Generator_RowClassName="TaskListRow">
<xs:element name="TaskList" msprop:Generator_TableClassName="TaskListDataTable" msprop:Generator_TableVarName="tableTaskList" msprop:Generator_RowChangedName="TaskListRowChanged" msprop:Generator_TablePropName="TaskList" msprop:Generator_RowDeletingName="TaskListRowDeleting" msprop:Generator_RowChangingName="TaskListRowChanging" msprop:Generator_RowEvHandlerName="TaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskListRowDeleted" msprop:Generator_RowClassName="TaskListRow" msprop:Generator_UserTableName="TaskList" msprop:Generator_RowEvArgName="TaskListRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="NumTask" msprop:Generator_ColumnVarNameInTable="columnNumTask" msprop:Generator_ColumnPropNameInRow="NumTask" msprop:Generator_ColumnPropNameInTable="NumTaskColumn" msprop:Generator_UserColumnName="NumTask">
@@ -1159,6 +1192,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:simpleType>
</xs:element>
<xs:element name="QtaRic" msprop:Generator_ColumnVarNameInTable="columnQtaRic" msprop:Generator_ColumnPropNameInRow="QtaRic" msprop:Generator_ColumnPropNameInTable="QtaRicColumn" msprop:Generator_UserColumnName="QtaRic" type="xs:int" />
<xs:element name="TimeEst" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTimeEst" msprop:Generator_ColumnPropNameInRow="TimeEst" msprop:Generator_ColumnPropNameInTable="TimeEstColumn" msprop:Generator_UserColumnName="TimeEst" type="xs:decimal" minOccurs="0" />
<xs:element name="QtaEv" msprop:Generator_ColumnVarNameInTable="columnQtaEv" msprop:Generator_ColumnPropNameInRow="QtaEv" msprop:Generator_ColumnPropNameInTable="QtaEvColumn" msprop:Generator_UserColumnName="QtaEv" type="xs:int" minOccurs="0" />
<xs:element name="Prior" msprop:Generator_ColumnVarNameInTable="columnPrior" msprop:Generator_ColumnPropNameInRow="Prior" msprop:Generator_ColumnPropNameInTable="PriorColumn" msprop:Generator_UserColumnName="Prior" type="xs:int" />
<xs:element name="Concluso" msprop:Generator_ColumnVarNameInTable="columnConcluso" msprop:Generator_ColumnPropNameInRow="Concluso" msprop:Generator_ColumnPropNameInTable="ConclusoColumn" msprop:Generator_UserColumnName="Concluso" type="xs:boolean" />
@@ -1171,7 +1205,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagFasi" msprop:Generator_TableClassName="AnagFasiDataTable" msprop:Generator_TableVarName="tableAnagFasi" msprop:Generator_TablePropName="AnagFasi" msprop:Generator_RowDeletingName="AnagFasiRowDeleting" msprop:Generator_RowChangingName="AnagFasiRowChanging" msprop:Generator_RowEvHandlerName="AnagFasiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagFasiRowDeleted" msprop:Generator_UserTableName="AnagFasi" msprop:Generator_RowChangedName="AnagFasiRowChanged" msprop:Generator_RowEvArgName="AnagFasiRowChangeEvent" msprop:Generator_RowClassName="AnagFasiRow">
<xs:element name="AnagFasi" msprop:Generator_TableClassName="AnagFasiDataTable" msprop:Generator_TableVarName="tableAnagFasi" msprop:Generator_RowChangedName="AnagFasiRowChanged" msprop:Generator_TablePropName="AnagFasi" msprop:Generator_RowDeletingName="AnagFasiRowDeleting" msprop:Generator_RowChangingName="AnagFasiRowChanging" msprop:Generator_RowEvHandlerName="AnagFasiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagFasiRowDeleted" msprop:Generator_RowClassName="AnagFasiRow" msprop:Generator_UserTableName="AnagFasi" msprop:Generator_RowEvArgName="AnagFasiRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodFase" msprop:Generator_ColumnVarNameInTable="columnCodFase" msprop:Generator_ColumnPropNameInRow="CodFase" msprop:Generator_ColumnPropNameInTable="CodFaseColumn" msprop:Generator_UserColumnName="CodFase">
@@ -1193,7 +1227,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagOpr" msprop:Generator_TableClassName="AnagOprDataTable" msprop:Generator_TableVarName="tableAnagOpr" msprop:Generator_TablePropName="AnagOpr" msprop:Generator_RowDeletingName="AnagOprRowDeleting" msprop:Generator_RowChangingName="AnagOprRowChanging" msprop:Generator_RowEvHandlerName="AnagOprRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagOprRowDeleted" msprop:Generator_UserTableName="AnagOpr" msprop:Generator_RowChangedName="AnagOprRowChanged" msprop:Generator_RowEvArgName="AnagOprRowChangeEvent" msprop:Generator_RowClassName="AnagOprRow">
<xs:element name="AnagOpr" msprop:Generator_TableClassName="AnagOprDataTable" msprop:Generator_TableVarName="tableAnagOpr" msprop:Generator_RowChangedName="AnagOprRowChanged" msprop:Generator_TablePropName="AnagOpr" msprop:Generator_RowDeletingName="AnagOprRowDeleting" msprop:Generator_RowChangingName="AnagOprRowChanging" msprop:Generator_RowEvHandlerName="AnagOprRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagOprRowDeleted" msprop:Generator_RowClassName="AnagOprRow" msprop:Generator_UserTableName="AnagOpr" msprop:Generator_RowEvArgName="AnagOprRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodOpr" msprop:Generator_ColumnVarNameInTable="columnCodOpr" msprop:Generator_ColumnPropNameInRow="CodOpr" msprop:Generator_ColumnPropNameInTable="CodOprColumn" msprop:Generator_UserColumnName="CodOpr">
@@ -1220,7 +1254,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TaskRec" msprop:Generator_TableClassName="TaskRecDataTable" msprop:Generator_TableVarName="tableTaskRec" msprop:Generator_TablePropName="TaskRec" msprop:Generator_RowDeletingName="TaskRecRowDeleting" msprop:Generator_RowChangingName="TaskRecRowChanging" msprop:Generator_RowEvHandlerName="TaskRecRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskRecRowDeleted" msprop:Generator_UserTableName="TaskRec" msprop:Generator_RowChangedName="TaskRecRowChanged" msprop:Generator_RowEvArgName="TaskRecRowChangeEvent" msprop:Generator_RowClassName="TaskRecRow">
<xs:element name="TaskRec" msprop:Generator_TableClassName="TaskRecDataTable" msprop:Generator_TableVarName="tableTaskRec" msprop:Generator_RowChangedName="TaskRecRowChanged" msprop:Generator_TablePropName="TaskRec" msprop:Generator_RowDeletingName="TaskRecRowDeleting" msprop:Generator_RowChangingName="TaskRecRowChanging" msprop:Generator_RowEvHandlerName="TaskRecRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskRecRowDeleted" msprop:Generator_RowClassName="TaskRecRow" msprop:Generator_UserTableName="TaskRec" msprop:Generator_RowEvArgName="TaskRecRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="IdxRec" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnIdxRec" msprop:Generator_ColumnPropNameInRow="IdxRec" msprop:Generator_ColumnPropNameInTable="IdxRecColumn" msprop:Generator_UserColumnName="IdxRec" type="xs:int" />
@@ -1246,6 +1280,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:simpleType>
</xs:element>
<xs:element name="QtaRic" msprop:Generator_ColumnVarNameInTable="columnQtaRic" msprop:Generator_ColumnPropNameInRow="QtaRic" msprop:Generator_ColumnPropNameInTable="QtaRicColumn" msprop:Generator_UserColumnName="QtaRic" type="xs:int" />
<xs:element name="TempoPrev" msprop:Generator_ColumnVarNameInTable="columnTempoPrev" msprop:Generator_ColumnPropNameInRow="TempoPrev" msprop:Generator_ColumnPropNameInTable="TempoPrevColumn" msprop:Generator_UserColumnName="TempoPrev" type="xs:decimal" />
<xs:element name="CodOpr" msprop:Generator_ColumnVarNameInTable="columnCodOpr" msprop:Generator_ColumnPropNameInRow="CodOpr" msprop:Generator_ColumnPropNameInTable="CodOprColumn" msprop:Generator_UserColumnName="CodOpr">
<xs:simpleType>
<xs:restriction base="xs:string">
@@ -1296,7 +1331,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagPost" msprop:Generator_TableClassName="AnagPostDataTable" msprop:Generator_TableVarName="tableAnagPost" msprop:Generator_TablePropName="AnagPost" msprop:Generator_RowDeletingName="AnagPostRowDeleting" msprop:Generator_RowChangingName="AnagPostRowChanging" msprop:Generator_RowEvHandlerName="AnagPostRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagPostRowDeleted" msprop:Generator_UserTableName="AnagPost" msprop:Generator_RowChangedName="AnagPostRowChanged" msprop:Generator_RowEvArgName="AnagPostRowChangeEvent" msprop:Generator_RowClassName="AnagPostRow">
<xs:element name="AnagPost" msprop:Generator_TableClassName="AnagPostDataTable" msprop:Generator_TableVarName="tableAnagPost" msprop:Generator_RowChangedName="AnagPostRowChanged" msprop:Generator_TablePropName="AnagPost" msprop:Generator_RowDeletingName="AnagPostRowDeleting" msprop:Generator_RowChangingName="AnagPostRowChanging" msprop:Generator_RowEvHandlerName="AnagPostRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagPostRowDeleted" msprop:Generator_RowClassName="AnagPostRow" msprop:Generator_UserTableName="AnagPost" msprop:Generator_RowEvArgName="AnagPostRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodPost" msprop:Generator_ColumnVarNameInTable="columnCodPost" msprop:Generator_ColumnPropNameInRow="CodPost" msprop:Generator_ColumnPropNameInTable="CodPostColumn" msprop:Generator_UserColumnName="CodPost">
@@ -1338,7 +1373,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TraEv2Stati" msprop:Generator_TableClassName="TraEv2StatiDataTable" msprop:Generator_TableVarName="tableTraEv2Stati" msprop:Generator_TablePropName="TraEv2Stati" msprop:Generator_RowDeletingName="TraEv2StatiRowDeleting" msprop:Generator_RowChangingName="TraEv2StatiRowChanging" msprop:Generator_RowEvHandlerName="TraEv2StatiRowChangeEventHandler" msprop:Generator_RowDeletedName="TraEv2StatiRowDeleted" msprop:Generator_UserTableName="TraEv2Stati" msprop:Generator_RowChangedName="TraEv2StatiRowChanged" msprop:Generator_RowEvArgName="TraEv2StatiRowChangeEvent" msprop:Generator_RowClassName="TraEv2StatiRow">
<xs:element name="TraEv2Stati" msprop:Generator_TableClassName="TraEv2StatiDataTable" msprop:Generator_TableVarName="tableTraEv2Stati" msprop:Generator_RowChangedName="TraEv2StatiRowChanged" msprop:Generator_TablePropName="TraEv2Stati" msprop:Generator_RowDeletingName="TraEv2StatiRowDeleting" msprop:Generator_RowChangingName="TraEv2StatiRowChanging" msprop:Generator_RowEvHandlerName="TraEv2StatiRowChangeEventHandler" msprop:Generator_RowDeletedName="TraEv2StatiRowDeleted" msprop:Generator_RowClassName="TraEv2StatiRow" msprop:Generator_UserTableName="TraEv2Stati" msprop:Generator_RowEvArgName="TraEv2StatiRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodMappa" msprop:Generator_ColumnVarNameInTable="columnCodMappa" msprop:Generator_ColumnPropNameInRow="CodMappa" msprop:Generator_ColumnPropNameInTable="CodMappaColumn" msprop:Generator_UserColumnName="CodMappa">
@@ -1400,7 +1435,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagEventi" msprop:Generator_TableClassName="AnagEventiDataTable" msprop:Generator_TableVarName="tableAnagEventi" msprop:Generator_TablePropName="AnagEventi" msprop:Generator_RowDeletingName="AnagEventiRowDeleting" msprop:Generator_RowChangingName="AnagEventiRowChanging" msprop:Generator_RowEvHandlerName="AnagEventiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagEventiRowDeleted" msprop:Generator_UserTableName="AnagEventi" msprop:Generator_RowChangedName="AnagEventiRowChanged" msprop:Generator_RowEvArgName="AnagEventiRowChangeEvent" msprop:Generator_RowClassName="AnagEventiRow">
<xs:element name="AnagEventi" msprop:Generator_TableClassName="AnagEventiDataTable" msprop:Generator_TableVarName="tableAnagEventi" msprop:Generator_RowChangedName="AnagEventiRowChanged" msprop:Generator_TablePropName="AnagEventi" msprop:Generator_RowDeletingName="AnagEventiRowDeleting" msprop:Generator_RowChangingName="AnagEventiRowChanging" msprop:Generator_RowEvHandlerName="AnagEventiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagEventiRowDeleted" msprop:Generator_RowClassName="AnagEventiRow" msprop:Generator_UserTableName="AnagEventi" msprop:Generator_RowEvArgName="AnagEventiRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodEvento" msprop:Generator_ColumnVarNameInTable="columnCodEvento" msprop:Generator_ColumnPropNameInRow="CodEvento" msprop:Generator_ColumnPropNameInTable="CodEventoColumn" msprop:Generator_UserColumnName="CodEvento">
@@ -1434,7 +1469,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PODL" msprop:Generator_TableClassName="PODLDataTable" msprop:Generator_TableVarName="tablePODL" msprop:Generator_RowChangedName="PODLRowChanged" msprop:Generator_TablePropName="PODL" msprop:Generator_RowDeletingName="PODLRowDeleting" msprop:Generator_RowChangingName="PODLRowChanging" msprop:Generator_RowEvHandlerName="PODLRowChangeEventHandler" msprop:Generator_RowDeletedName="PODLRowDeleted" msprop:Generator_RowClassName="PODLRow" msprop:Generator_UserTableName="PODL" msprop:Generator_RowEvArgName="PODLRowChangeEvent">
<xs:element name="PODL" msprop:Generator_TableClassName="PODLDataTable" msprop:Generator_TableVarName="tablePODL" msprop:Generator_TablePropName="PODL" msprop:Generator_RowDeletingName="PODLRowDeleting" msprop:Generator_RowChangingName="PODLRowChanging" msprop:Generator_RowEvHandlerName="PODLRowChangeEventHandler" msprop:Generator_RowDeletedName="PODLRowDeleted" msprop:Generator_UserTableName="PODL" msprop:Generator_RowChangedName="PODLRowChanged" msprop:Generator_RowEvArgName="PODLRowChangeEvent" msprop:Generator_RowClassName="PODLRow">
<xs:complexType>
<xs:sequence>
<xs:element name="idxPromessa" msprop:Generator_ColumnVarNameInTable="columnidxPromessa" msprop:Generator_ColumnPropNameInRow="idxPromessa" msprop:Generator_ColumnPropNameInTable="idxPromessaColumn" msprop:Generator_UserColumnName="idxPromessa" type="xs:int" />
@@ -1526,7 +1561,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagArticoli" msprop:Generator_TableClassName="AnagArticoliDataTable" msprop:Generator_TableVarName="tableAnagArticoli" msprop:Generator_RowChangedName="AnagArticoliRowChanged" msprop:Generator_TablePropName="AnagArticoli" msprop:Generator_RowDeletingName="AnagArticoliRowDeleting" msprop:Generator_RowChangingName="AnagArticoliRowChanging" msprop:Generator_RowEvHandlerName="AnagArticoliRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagArticoliRowDeleted" msprop:Generator_RowClassName="AnagArticoliRow" msprop:Generator_UserTableName="AnagArticoli" msprop:Generator_RowEvArgName="AnagArticoliRowChangeEvent">
<xs:element name="AnagArticoli" msprop:Generator_TableClassName="AnagArticoliDataTable" msprop:Generator_TableVarName="tableAnagArticoli" msprop:Generator_TablePropName="AnagArticoli" msprop:Generator_RowDeletingName="AnagArticoliRowDeleting" msprop:Generator_RowChangingName="AnagArticoliRowChanging" msprop:Generator_RowEvHandlerName="AnagArticoliRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagArticoliRowDeleted" msprop:Generator_UserTableName="AnagArticoli" msprop:Generator_RowChangedName="AnagArticoliRowChanged" msprop:Generator_RowEvArgName="AnagArticoliRowChangeEvent" msprop:Generator_RowClassName="AnagArticoliRow">
<xs:complexType>
<xs:sequence>
<xs:element name="CodArt" msprop:Generator_ColumnVarNameInTable="columnCodArt" msprop:Generator_ColumnPropNameInRow="CodArt" msprop:Generator_ColumnPropNameInTable="CodArtColumn" msprop:Generator_UserColumnName="CodArt">
@@ -1575,7 +1610,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TaskList2Post" msprop:Generator_TableClassName="TaskList2PostDataTable" msprop:Generator_TableVarName="tableTaskList2Post" msprop:Generator_TablePropName="TaskList2Post" msprop:Generator_RowDeletingName="TaskList2PostRowDeleting" msprop:Generator_RowChangingName="TaskList2PostRowChanging" msprop:Generator_RowEvHandlerName="TaskList2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskList2PostRowDeleted" msprop:Generator_UserTableName="TaskList2Post" msprop:Generator_RowChangedName="TaskList2PostRowChanged" msprop:Generator_RowEvArgName="TaskList2PostRowChangeEvent" msprop:Generator_RowClassName="TaskList2PostRow">
<xs:element name="TaskList2Post" msprop:Generator_TableClassName="TaskList2PostDataTable" msprop:Generator_TableVarName="tableTaskList2Post" msprop:Generator_RowChangedName="TaskList2PostRowChanged" msprop:Generator_TablePropName="TaskList2Post" msprop:Generator_RowDeletingName="TaskList2PostRowDeleting" msprop:Generator_RowChangingName="TaskList2PostRowChanging" msprop:Generator_RowEvHandlerName="TaskList2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskList2PostRowDeleted" msprop:Generator_RowClassName="TaskList2PostRow" msprop:Generator_UserTableName="TaskList2Post" msprop:Generator_RowEvArgName="TaskList2PostRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="NumTask" msprop:Generator_ColumnVarNameInTable="columnNumTask" msprop:Generator_ColumnPropNameInRow="NumTask" msprop:Generator_ColumnPropNameInTable="NumTaskColumn" msprop:Generator_UserColumnName="NumTask">
@@ -1635,7 +1670,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagStati" msprop:Generator_TableClassName="AnagStatiDataTable" msprop:Generator_TableVarName="tableAnagStati" msprop:Generator_TablePropName="AnagStati" msprop:Generator_RowDeletingName="AnagStatiRowDeleting" msprop:Generator_RowChangingName="AnagStatiRowChanging" msprop:Generator_RowEvHandlerName="AnagStatiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagStatiRowDeleted" msprop:Generator_UserTableName="AnagStati" msprop:Generator_RowChangedName="AnagStatiRowChanged" msprop:Generator_RowEvArgName="AnagStatiRowChangeEvent" msprop:Generator_RowClassName="AnagStatiRow">
<xs:element name="AnagStati" msprop:Generator_TableClassName="AnagStatiDataTable" msprop:Generator_TableVarName="tableAnagStati" msprop:Generator_RowChangedName="AnagStatiRowChanged" msprop:Generator_TablePropName="AnagStati" msprop:Generator_RowDeletingName="AnagStatiRowDeleting" msprop:Generator_RowChangingName="AnagStatiRowChanging" msprop:Generator_RowEvHandlerName="AnagStatiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagStatiRowDeleted" msprop:Generator_RowClassName="AnagStatiRow" msprop:Generator_UserTableName="AnagStati" msprop:Generator_RowEvArgName="AnagStatiRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodStato" msprop:Generator_ColumnVarNameInTable="columnCodStato" msprop:Generator_ColumnPropNameInRow="CodStato" msprop:Generator_ColumnPropNameInTable="CodStatoColumn" msprop:Generator_UserColumnName="CodStato">
@@ -1663,7 +1698,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Opr2Post" msprop:Generator_TableClassName="Opr2PostDataTable" msprop:Generator_TableVarName="tableOpr2Post" msprop:Generator_TablePropName="Opr2Post" msprop:Generator_RowDeletingName="Opr2PostRowDeleting" msprop:Generator_RowChangingName="Opr2PostRowChanging" msprop:Generator_RowEvHandlerName="Opr2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="Opr2PostRowDeleted" msprop:Generator_UserTableName="Opr2Post" msprop:Generator_RowChangedName="Opr2PostRowChanged" msprop:Generator_RowEvArgName="Opr2PostRowChangeEvent" msprop:Generator_RowClassName="Opr2PostRow">
<xs:element name="Opr2Post" msprop:Generator_TableClassName="Opr2PostDataTable" msprop:Generator_TableVarName="tableOpr2Post" msprop:Generator_RowChangedName="Opr2PostRowChanged" msprop:Generator_TablePropName="Opr2Post" msprop:Generator_RowDeletingName="Opr2PostRowDeleting" msprop:Generator_RowChangingName="Opr2PostRowChanging" msprop:Generator_RowEvHandlerName="Opr2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="Opr2PostRowDeleted" msprop:Generator_RowClassName="Opr2PostRow" msprop:Generator_UserTableName="Opr2Post" msprop:Generator_RowEvArgName="Opr2PostRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodOpr" msprop:Generator_ColumnVarNameInTable="columnCodOpr" msprop:Generator_ColumnPropNameInRow="CodOpr" msprop:Generator_ColumnPropNameInTable="CodOprColumn" msprop:Generator_UserColumnName="CodOpr">
@@ -1698,7 +1733,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AnagTag" msprop:Generator_TableClassName="AnagTagDataTable" msprop:Generator_TableVarName="tableAnagTag" msprop:Generator_TablePropName="AnagTag" msprop:Generator_RowDeletingName="AnagTagRowDeleting" msprop:Generator_RowChangingName="AnagTagRowChanging" msprop:Generator_RowEvHandlerName="AnagTagRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagTagRowDeleted" msprop:Generator_UserTableName="AnagTag" msprop:Generator_RowChangedName="AnagTagRowChanged" msprop:Generator_RowEvArgName="AnagTagRowChangeEvent" msprop:Generator_RowClassName="AnagTagRow">
<xs:element name="AnagTag" msprop:Generator_TableClassName="AnagTagDataTable" msprop:Generator_TableVarName="tableAnagTag" msprop:Generator_RowChangedName="AnagTagRowChanged" msprop:Generator_TablePropName="AnagTag" msprop:Generator_RowDeletingName="AnagTagRowDeleting" msprop:Generator_RowChangingName="AnagTagRowChanging" msprop:Generator_RowEvHandlerName="AnagTagRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagTagRowDeleted" msprop:Generator_RowClassName="AnagTagRow" msprop:Generator_UserTableName="AnagTag" msprop:Generator_RowEvArgName="AnagTagRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CodTag" msprop:Generator_ColumnVarNameInTable="columnCodTag" msprop:Generator_ColumnPropNameInRow="CodTag" msprop:Generator_ColumnPropNameInTable="CodTagColumn" msprop:Generator_UserColumnName="CodTag">
@@ -1725,6 +1760,34 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TaskRecAgg" msprop:Generator_TableClassName="TaskRecAggDataTable" msprop:Generator_TableVarName="tableTaskRecAgg" msprop:Generator_TablePropName="TaskRecAgg" msprop:Generator_RowDeletingName="TaskRecAggRowDeleting" msprop:Generator_RowChangingName="TaskRecAggRowChanging" msprop:Generator_RowEvHandlerName="TaskRecAggRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskRecAggRowDeleted" msprop:Generator_UserTableName="TaskRecAgg" msprop:Generator_RowChangedName="TaskRecAggRowChanged" msprop:Generator_RowEvArgName="TaskRecAggRowChangeEvent" msprop:Generator_RowClassName="TaskRecAggRow">
<xs:complexType>
<xs:sequence>
<xs:element name="NumTask" msprop:Generator_ColumnVarNameInTable="columnNumTask" msprop:Generator_ColumnPropNameInRow="NumTask" msprop:Generator_ColumnPropNameInTable="NumTaskColumn" msprop:Generator_UserColumnName="NumTask">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CodArt" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCodArt" msprop:Generator_ColumnPropNameInRow="CodArt" msprop:Generator_ColumnPropNameInTable="CodArtColumn" msprop:Generator_UserColumnName="CodArt" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="QtaRic" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnQtaRic" msprop:Generator_ColumnPropNameInRow="QtaRic" msprop:Generator_ColumnPropNameInTable="QtaRicColumn" msprop:Generator_UserColumnName="QtaRic" type="xs:int" minOccurs="0" />
<xs:element name="TempoPrev" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTempoPrev" msprop:Generator_ColumnPropNameInRow="TempoPrev" msprop:Generator_ColumnPropNameInTable="TempoPrevColumn" msprop:Generator_UserColumnName="TempoPrev" type="xs:decimal" minOccurs="0" />
<xs:element name="IdxRec" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnIdxRec" msprop:Generator_ColumnPropNameInRow="IdxRec" msprop:Generator_ColumnPropNameInTable="IdxRecColumn" msprop:Generator_UserColumnName="IdxRec" type="xs:int" minOccurs="0" />
<xs:element name="DtStart" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDtStart" msprop:Generator_ColumnPropNameInRow="DtStart" msprop:Generator_ColumnPropNameInTable="DtStartColumn" msprop:Generator_UserColumnName="DtStart" type="xs:dateTime" minOccurs="0" />
<xs:element name="DtEnd" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDtEnd" msprop:Generator_ColumnPropNameInRow="DtEnd" msprop:Generator_ColumnPropNameInTable="DtEndColumn" msprop:Generator_UserColumnName="DtEnd" type="xs:dateTime" minOccurs="0" />
<xs:element name="QtaEv" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnQtaEv" msprop:Generator_ColumnPropNameInRow="QtaEv" msprop:Generator_ColumnPropNameInTable="QtaEvColumn" msprop:Generator_UserColumnName="QtaEv" type="xs:int" minOccurs="0" />
<xs:element name="DurataMin" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDurataMin" msprop:Generator_ColumnPropNameInRow="DurataMin" msprop:Generator_ColumnPropNameInTable="DurataMinColumn" msprop:Generator_UserColumnName="DurataMin" type="xs:decimal" minOccurs="0" />
<xs:element name="TCiclo" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTCiclo" msprop:Generator_ColumnPropNameInRow="TCiclo" msprop:Generator_ColumnPropNameInTable="TCicloColumn" msprop:Generator_UserColumnName="TCiclo" type="xs:decimal" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
@@ -1774,5 +1837,9 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
<xs:selector xpath=".//mstns:AnagTag" />
<xs:field xpath="mstns:CodTag" />
</xs:unique>
<xs:unique name="TaskRecAgg_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:TaskRecAgg" />
<xs:field xpath="mstns:NumTask" />
</xs:unique>
</xs:element>
</xs:schema>
+15 -14
View File
@@ -4,21 +4,22 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="-10" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="304" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:TaskList" ZOrder="7" X="91" Y="386" Height="381" Width="289" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagFasi" ZOrder="10" X="887" Y="474" Height="191" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:AnagOpr" ZOrder="13" X="910" Y="728" Height="153" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
<Shape ID="DesignTable:TaskRec" ZOrder="3" X="519" Y="541" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:AnagPost" ZOrder="9" X="519" Y="209" Height="267" Width="200" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
<Shape ID="DesignTable:TraEv2Stati" ZOrder="12" X="195" Y="1020" Height="248" Width="210" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
<Shape ID="DesignTable:AnagEventi" ZOrder="11" X="903" Y="966" Height="172" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:PODL" ZOrder="8" X="560" Y="1047" Height="343" Width="199" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagArticoli" ZOrder="6" X="258" Y="1475" Height="229" Width="217" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:TaskList2Post" ZOrder="1" X="809" Y="16" Height="400" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagStati" ZOrder="5" X="220" Y="54" Height="191" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:Opr2Post" ZOrder="4" X="175" Y="774" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:AnagTag" ZOrder="2" X="563" Y="18" Height="153" Width="196" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
<Shape ID="DesignTable:TaskList" ZOrder="2" X="85" Y="299" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagFasi" ZOrder="11" X="887" Y="474" Height="191" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:AnagOpr" ZOrder="14" X="910" Y="728" Height="153" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
<Shape ID="DesignTable:TaskRec" ZOrder="5" X="519" Y="541" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagPost" ZOrder="10" X="519" Y="209" Height="267" Width="200" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
<Shape ID="DesignTable:TraEv2Stati" ZOrder="13" X="195" Y="1020" Height="248" Width="210" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
<Shape ID="DesignTable:AnagEventi" ZOrder="12" X="903" Y="966" Height="172" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:PODL" ZOrder="9" X="560" Y="1047" Height="343" Width="199" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagArticoli" ZOrder="8" X="152" Y="1317" Height="229" Width="217" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:TaskList2Post" ZOrder="3" X="809" Y="16" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:AnagStati" ZOrder="7" X="220" Y="54" Height="191" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:Opr2Post" ZOrder="6" X="175" Y="774" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:AnagTag" ZOrder="4" X="563" Y="18" Height="153" Width="196" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
<Shape ID="DesignTable:TaskRecAgg" ZOrder="1" X="833" Y="1202" Height="267" Width="232" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
</Shapes>
<Connectors />
</DiagramLayout>
+141 -110
View File
@@ -2,115 +2,146 @@
namespace AppData
{
public class dataLayer
{
/// <summary>
/// avvio classe
/// </summary>
protected dataLayer()
public class dataLayer
{
avvioTA();
setupConnectionStringBase();
#region Public Fields
/// <summary>
/// singleton classe
/// </summary>
public static dataLayer man = new dataLayer();
/// <summary>
/// Elenco POSTAZIONI
/// </summary>
public DS_AppTableAdapters.AnagFasiTableAdapter taAF;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_UtilityTableAdapters.AnagKeyValueTableAdapter taAKV;
/// <summary>
/// Elenco ARTICOLI
/// </summary>
public DS_AppTableAdapters.AnagArticoliTableAdapter taAnArt;
/// <summary>
/// Elenco OPERATORI
/// </summary>
public DS_AppTableAdapters.AnagOprTableAdapter taAO;
/// <summary>
/// Elenco POSTAZIONI
/// </summary>
public DS_AppTableAdapters.AnagPostTableAdapter taAP;
/// <summary>
/// Elenco TAG
/// </summary>
public DS_AppTableAdapters.AnagTagTableAdapter taAT;
/// <summary>
/// Elenco PROMESSE ODL
/// </summary>
public DS_AppTableAdapters.Opr2PostTableAdapter taO2P;
/// <summary>
/// Elenco PROMESSE ODL
/// </summary>
public DS_AppTableAdapters.PODLTableAdapter taPODL;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TraEv2StatiTableAdapter taTE2S;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TaskListTableAdapter taTL;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TaskList2PostTableAdapter taTL2Post;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TaskRecTableAdapter taTR;
/// <summary>
/// Elenco TASK Aggregati
/// </summary>
public DS_AppTableAdapters.TaskRecAggTableAdapter taTRA;
#endregion Public Fields
#region Protected Constructors
/// <summary>
/// avvio classe
/// </summary>
public dataLayer()
{
avvioTA();
setupConnectionStringBase();
}
#endregion Protected Constructors
#region Private Methods
/// <summary>
/// avvia table adapters
/// </summary>
private void avvioTA()
{
// avvio i table adapters...
taAnArt = new DS_AppTableAdapters.AnagArticoliTableAdapter();
taAF = new DS_AppTableAdapters.AnagFasiTableAdapter();
taAO = new DS_AppTableAdapters.AnagOprTableAdapter();
taAP = new DS_AppTableAdapters.AnagPostTableAdapter();
taAT = new DS_AppTableAdapters.AnagTagTableAdapter();
taO2P = new DS_AppTableAdapters.Opr2PostTableAdapter();
taPODL = new DS_AppTableAdapters.PODLTableAdapter();
taTL = new DS_AppTableAdapters.TaskListTableAdapter();
taTL2Post = new DS_AppTableAdapters.TaskList2PostTableAdapter();
taTR = new DS_AppTableAdapters.TaskRecTableAdapter();
taTRA = new DS_AppTableAdapters.TaskRecAggTableAdapter();
taTE2S = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
taAKV = new DS_UtilityTableAdapters.AnagKeyValueTableAdapter();
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// effettua setup dei connection strings da web.config delal singola applicazione
/// </summary>
protected virtual void setupConnectionStringBase()
{
string connString = memLayer.ML.confReadString("CTrackConnectionString");
// connections strings del db
taAnArt.Connection.ConnectionString = connString;
taAF.Connection.ConnectionString = connString;
taAO.Connection.ConnectionString = connString;
taAP.Connection.ConnectionString = connString;
taAT.Connection.ConnectionString = connString;
taO2P.Connection.ConnectionString = connString;
taPODL.Connection.ConnectionString = connString;
taTL.Connection.ConnectionString = connString;
taTL2Post.Connection.ConnectionString = connString;
taTR.Connection.ConnectionString = connString;
taTRA.Connection.ConnectionString = connString;
taTE2S.Connection.ConnectionString = connString;
taAKV.Connection.ConnectionString = connString;
}
#endregion Protected Methods
}
/// <summary>
/// avvia table adapters
/// </summary>
private void avvioTA()
{
// avvio i table adapters...
taAnArt = new DS_AppTableAdapters.AnagArticoliTableAdapter();
taAF = new DS_AppTableAdapters.AnagFasiTableAdapter();
taAO = new DS_AppTableAdapters.AnagOprTableAdapter();
taAP = new DS_AppTableAdapters.AnagPostTableAdapter();
taAT = new DS_AppTableAdapters.AnagTagTableAdapter();
taO2P = new DS_AppTableAdapters.Opr2PostTableAdapter();
taPODL = new DS_AppTableAdapters.PODLTableAdapter();
taTL = new DS_AppTableAdapters.TaskListTableAdapter();
taTL2Post = new DS_AppTableAdapters.TaskList2PostTableAdapter();
taTR = new DS_AppTableAdapters.TaskRecTableAdapter();
taTE2S = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
taAKV = new DS_UtilityTableAdapters.AnagKeyValueTableAdapter();
}
/// <summary>
/// effettua setup dei connection strings da web.config delal singola applicazione
/// </summary>
protected virtual void setupConnectionStringBase()
{
string connString = memLayer.ML.confReadString("CTrackConnectionString");
// connections strings del db
taAnArt.Connection.ConnectionString = connString;
taAF.Connection.ConnectionString = connString;
taAO.Connection.ConnectionString = connString;
taAP.Connection.ConnectionString = connString;
taAT.Connection.ConnectionString = connString;
taO2P.Connection.ConnectionString = connString;
taPODL.Connection.ConnectionString = connString;
taTL.Connection.ConnectionString = connString;
taTL2Post.Connection.ConnectionString = connString;
taTR.Connection.ConnectionString = connString;
taTE2S.Connection.ConnectionString = connString;
taAKV.Connection.ConnectionString = connString;
}
/// <summary>
/// Elenco ARTICOLI
/// </summary>
public DS_AppTableAdapters.AnagArticoliTableAdapter taAnArt;
/// <summary>
/// Elenco POSTAZIONI
/// </summary>
public DS_AppTableAdapters.AnagFasiTableAdapter taAF;
/// <summary>
/// Elenco OPERATORI
/// </summary>
public DS_AppTableAdapters.AnagOprTableAdapter taAO;
/// <summary>
/// Elenco POSTAZIONI
/// </summary>
public DS_AppTableAdapters.AnagPostTableAdapter taAP;
/// <summary>
/// Elenco TAG
/// </summary>
public DS_AppTableAdapters.AnagTagTableAdapter taAT;
/// <summary>
/// Elenco PROMESSE ODL
/// </summary>
public DS_AppTableAdapters.Opr2PostTableAdapter taO2P;
/// <summary>
/// Elenco PROMESSE ODL
/// </summary>
public DS_AppTableAdapters.PODLTableAdapter taPODL;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TaskListTableAdapter taTL;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TaskList2PostTableAdapter taTL2Post;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TaskRecTableAdapter taTR;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_AppTableAdapters.TraEv2StatiTableAdapter taTE2S;
/// <summary>
/// Elenco TASK
/// </summary>
public DS_UtilityTableAdapters.AnagKeyValueTableAdapter taAKV;
/// <summary>
/// singleton classe
/// </summary>
public static dataLayer man = new dataLayer();
}
}
}
+212 -178
View File
@@ -2,188 +2,222 @@
namespace AppData
{
public class mUtils
{
#region definizione Regexp
/// <summary>
/// RegExp x Cod ARTICOLO
/// </summary>
public static string reCodArt = memLayer.ML.cdv("regExp_CodArt");
/// <summary>
/// RegExp x Cod OPERATORE
/// </summary>
public static string reCodOper = memLayer.ML.cdv("regExp_CodOper");
/// <summary>
/// RegExp x Cod POSTAZIONE
/// </summary>
public static string reCodPost = memLayer.ML.cdv("regExp_CodPost");
/// <summary>
/// RegExp x Cod COMMESSA (NumTask)
/// </summary>
public static string reNumTask = memLayer.ML.cdv("regExp_NumTask");
/// <summary>
/// RegExp x QTA
/// </summary>
public static string reQta = memLayer.ML.cdv("regExp_QtaRic");
/// <summary>
/// RegExp x RESET / CANCEL
/// </summary>
public static string reReset = memLayer.ML.cdv("regExp_KO");
/// <summary>
/// RegExp x CONFERMA ADD
/// </summary>
public static string reAddNew = memLayer.ML.cdv("regExp_AddNew");
/// <summary>
/// RegExp x CONFERMA DELETE
/// </summary>
public static string reDelete = memLayer.ML.cdv("regExp_DEL");
/// <summary>
/// Comando x RESET OPERATORE
/// </summary>
public static string reCmdResetOper = memLayer.ML.cdv("regExp_CmdResetOper");
/// <summary>
/// Comando x RESET COMMESSA (NumTask)
/// </summary>
public static string reCmdResetNumTask = memLayer.ML.cdv("regExp_CmdResetNumTask");
/// <summary>
/// Comando x PAUSA (es COMMESSA/NumTask)
/// </summary>
public static string reCmdPause = memLayer.ML.cdv("regExp_CmdPause");
/// <summary>
/// Comando x CHIUSURA COMMESSA (NumTask)
/// </summary>
public static string reCmdClose = memLayer.ML.cdv("regExp_CmdClose");
/// <summary>
/// OPZIONE: indica che è abilitato BCode
/// </summary>
public static bool OptUseBCode = memLayer.ML.CRB("OptUseBCode");
/// <summary>
/// OPZIONE: indica che è abilitata selezione TASK/COMMESSA
/// </summary>
public static bool OptUseSelTask = memLayer.ML.CRB("OptUseSelTask");
/// <summary>
/// OPZIONE: indica che è abilitata selezione TAG
/// </summary>
public static bool OptUseSelTag = memLayer.ML.CRB("OptUseSelTag");
/// <summary>
/// OPZIONE: indica che è da eseguire il preprocessing
/// </summary>
public static bool OptBCodePrepDo = memLayer.ML.CRB("OptBCodePrepDo");
/// <summary>
/// RegExp x Cod dati raw x preprocessare
/// </summary>
public static string rePreproc = memLayer.ML.cdv("regExp_Preproc");
/// <summary>
/// RegExp x Cod dati da TENERE post preprocessing
/// </summary>
public static string rePreprocKeep = memLayer.ML.cdv("regExp_PreprocKeep");
#endregion
/// <summary>
/// Codice Operatore
/// </summary>
public static string CodOpr
public class mUtils
{
get
{
string answ = "";
answ = memLayer.ML.StringSessionObj("CodOpr");
// se vuoto cerco anche nei cookies...
if (answ == "")
{
answ = memLayer.ML.getCookieVal("CTrack_CodOpr");
// se non vuoto salvo...
memLayer.ML.setSessionVal("CodOpr", answ);
}
return answ;
}
set
{
memLayer.ML.setSessionVal("CodOpr", value);
memLayer.ML.setCookieVal("CTrack_CodOpr", value);
memLayer.ML.emptySessionVal("NomeOpr");
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public static string CodPost
{
get
{
string answ = "";
answ = memLayer.ML.StringSessionObj("CodPost");
if (string.IsNullOrEmpty(answ))
{
answ = memLayer.ML.getCookieVal("CTrack_CodPost");
// se non vuoto salvo...
memLayer.ML.setSessionVal("CodPost", answ);
}
return answ;
}
set
{
memLayer.ML.setSessionVal("CodPost", value);
memLayer.ML.setCookieVal("CTrack_CodPost", value);
memLayer.ML.emptySessionVal("DescPost");
}
}
/// <summary>
/// Restituisce boolean se post corrente sia multi operatore
/// </summary>
public static bool postIsMulti
{
get
{
bool answ = false;
if (memLayer.ML.isInSessionObject("postIsMulti"))
{
answ = memLayer.ML.BoolSessionObj("postIsMulti");
}
else
{
string rawAnsw = memLayer.ML.getCookieVal("CTrack_postIsMulti");
bool.TryParse(rawAnsw, out answ);
// se non vuoto salvo...
memLayer.ML.setSessionVal("postIsMulti", answ);
}
return answ;
}
set
{
memLayer.ML.setSessionVal("postIsMulti", value);
memLayer.ML.setCookieVal("CTrack_postIsMulti", value.ToString());
}
}
#region Public Fields
/// <summary>
/// oggetto valore opzionale letto 8e scorporato da barcode), es TAG in commessa + tag
/// </summary>
public static string optValueBC
{
get
{
string answ;
if (memLayer.ML.isInSessionObject("optValueBC"))
/// <summary>
/// Array di regole di sostituzione per valori Time
/// </summary>
public static string[] lRepCleanTime = memLayer.ML.CRS("confAddTaskCleanTime").Split('#');
/// <summary>
/// OPZIONE: indica che è da eseguire il preprocessing
/// </summary>
public static bool OptBCodePrepDo = memLayer.ML.CRB("OptBCodePrepDo");
/// <summary>
/// OPZIONE: indica che è abilitato BCode
/// </summary>
public static bool OptUseBCode = memLayer.ML.CRB("OptUseBCode");
/// <summary>
/// OPZIONE: indica che è abilitata selezione TAG
/// </summary>
public static bool OptUseSelTag = memLayer.ML.CRB("OptUseSelTag");
/// <summary>
/// OPZIONE: indica che è abilitata selezione TASK/COMMESSA
/// </summary>
public static bool OptUseSelTask = memLayer.ML.CRB("OptUseSelTask");
/// <summary>
/// RegExp x CONFERMA ADD
/// </summary>
public static string reAddNew = memLayer.ML.cdv("regExp_AddNew");
/// <summary>
/// Comando x CHIUSURA COMMESSA (NumTask)
/// </summary>
public static string reCmdClose = memLayer.ML.cdv("regExp_CmdClose");
/// <summary>
/// Comando x PAUSA (es COMMESSA/NumTask)
/// </summary>
public static string reCmdPause = memLayer.ML.cdv("regExp_CmdPause");
/// <summary>
/// Comando x RESET COMMESSA (NumTask)
/// </summary>
public static string reCmdResetNumTask = memLayer.ML.cdv("regExp_CmdResetNumTask");
/// <summary>
/// Comando x RESET OPERATORE
/// </summary>
public static string reCmdResetOper = memLayer.ML.cdv("regExp_CmdResetOper");
/// <summary>
/// RegExp x Cod ARTICOLO
/// </summary>
public static string reCodArt = memLayer.ML.cdv("regExp_CodArt");
/// <summary>
/// RegExp x Cod OPERATORE
/// </summary>
public static string reCodOper = memLayer.ML.cdv("regExp_CodOper");
/// <summary>
/// RegExp x Cod POSTAZIONE
/// </summary>
public static string reCodPost = memLayer.ML.cdv("regExp_CodPost");
/// <summary>
/// RegExp x CONFERMA DELETE
/// </summary>
public static string reDelete = memLayer.ML.cdv("regExp_DEL");
/// <summary>
/// RegExp x Cod COMMESSA (NumTask)
/// </summary>
public static string reNumTask = memLayer.ML.cdv("regExp_NumTask");
/// <summary>
/// RegExp x Cod dati raw x preprocessare
/// </summary>
public static string rePreproc = memLayer.ML.cdv("regExp_Preproc");
/// <summary>
/// RegExp x Cod dati da TENERE post preprocessing
/// </summary>
public static string rePreprocKeep = memLayer.ML.cdv("regExp_PreprocKeep");
/// <summary>
/// RegExp x QTA
/// </summary>
public static string reQta = memLayer.ML.cdv("regExp_QtaRic");
/// <summary>
/// RegExp x RESET / CANCEL
/// </summary>
public static string reReset = memLayer.ML.cdv("regExp_KO");
/// <summary>
/// RegExp x TempoPrevisto
/// </summary>
public static string reTempoPrev = memLayer.ML.cdv("regExp_TimePrev");
/// <summary>
/// Fattore conversione tempo stimato letto da BCode (def 1 = NO conversione, 10=da dividere per 10)
/// </summary>
public static int TimeEstFactor = memLayer.ML.cdvi("confAddTaskTimeFactor");
#endregion Public Fields
#region Public Properties
/// <summary>
/// Codice Operatore
/// </summary>
public static string CodOpr
{
answ = memLayer.ML.StringSessionObj("optValueBC");
get
{
string answ = "";
answ = memLayer.ML.StringSessionObj("CodOpr");
// se vuoto cerco anche nei cookies...
if (answ == "")
{
answ = memLayer.ML.getCookieVal("CTrack_CodOpr");
// se non vuoto salvo...
memLayer.ML.setSessionVal("CodOpr", answ);
}
return answ;
}
set
{
memLayer.ML.setSessionVal("CodOpr", value);
memLayer.ML.setCookieVal("CTrack_CodOpr", value);
memLayer.ML.emptySessionVal("NomeOpr");
}
}
else
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public static string CodPost
{
answ = "";
get
{
string answ = "";
answ = memLayer.ML.StringSessionObj("CodPost");
if (string.IsNullOrEmpty(answ))
{
answ = memLayer.ML.getCookieVal("CTrack_CodPost");
// se non vuoto salvo...
memLayer.ML.setSessionVal("CodPost", answ);
}
return answ;
}
set
{
memLayer.ML.setSessionVal("CodPost", value);
memLayer.ML.setCookieVal("CTrack_CodPost", value);
memLayer.ML.emptySessionVal("DescPost");
}
}
return answ;
}
set
{
memLayer.ML.setSessionVal("optValueBC", value, false);
}
/// <summary>
/// oggetto valore opzionale letto 8e scorporato da barcode), es TAG in commessa + tag
/// </summary>
public static string optValueBC
{
get
{
string answ;
if (memLayer.ML.isInSessionObject("optValueBC"))
{
answ = memLayer.ML.StringSessionObj("optValueBC");
}
else
{
answ = "";
}
return answ;
}
set
{
memLayer.ML.setSessionVal("optValueBC", value, false);
}
}
/// <summary>
/// Restituisce boolean se post corrente sia multi operatore
/// </summary>
public static bool postIsMulti
{
get
{
bool answ = false;
if (memLayer.ML.isInSessionObject("postIsMulti"))
{
answ = memLayer.ML.BoolSessionObj("postIsMulti");
}
else
{
string rawAnsw = memLayer.ML.getCookieVal("CTrack_postIsMulti");
bool.TryParse(rawAnsw, out answ);
// se non vuoto salvo...
memLayer.ML.setSessionVal("postIsMulti", answ);
}
return answ;
}
set
{
memLayer.ML.setSessionVal("postIsMulti", value);
memLayer.ML.setCookieVal("CTrack_postIsMulti", value.ToString());
}
}
#endregion Public Properties
}
}
}
}
+96 -96
View File
@@ -3,107 +3,107 @@ using System.Text.RegularExpressions;
namespace AppData
{
/// <summary>
/// macchina di gestione degli stati
/// </summary>
public class stateMachine
{
/// <summary>
/// macchina di gestione degli stati
/// </summary>
public class stateMachine
{
protected DS_AppTableAdapters.AnagEventiTableAdapter taEv;
protected DS_AppTableAdapters.TraEv2StatiTableAdapter taEv2St;
//protected DS_applicazioneTableAdapters.IstObjTableAdapter taIstObj;
protected stateMachine()
{
avvioTA();
setupConnectionStringBase();
}
/// <summary>
/// avvia table adapters
/// </summary>
private void avvioTA()
{
taEv = new DS_AppTableAdapters.AnagEventiTableAdapter();
taEv2St = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
//taIstObj = new DS_applicazioneTableAdapters.IstObjTableAdapter();
}
/// <summary>
/// effettua setup dei connection strings da web.config della singola applicazione
/// </summary>
protected virtual void setupConnectionStringBase()
{
string connString = memLayer.ML.confReadString("CTrackConnectionString");
// connections strings del db
taEv.Connection.ConnectionString = connString;
taEv2St.Connection.ConnectionString = connString;
//taIstObj.Connection.ConnectionString = connString;
}
public static stateMachine st = new stateMachine();
/// <summary>
/// restituisce il tipo di comando associato...
/// </summary>
/// <param name="comando"></param>
/// <returns></returns>
public tipoAzione azioneComando(inputComando comando)
{
Match testNumTask = Regex.Match(comando.valore, mUtils.reNumTask);
Match testOper = Regex.Match(comando.valore, mUtils.reCodOper);
Match testPost = Regex.Match(comando.valore, mUtils.reCodPost);
tipoAzione _azione = tipoAzione.noAct;
// se è un SET OPR o POST è un azione IMPLICITA...
if (testOper.Success || testPost.Success)
{
_azione = tipoAzione.esegui;
}
else if (testNumTask.Success)
{
_azione = tipoAzione.esegui;
}
else if (dataLayer.man.taAF.getByKey(comando.currCmdIn).Rows.Count > 0)
{
_azione = tipoAzione.esegui;
}
else
{
// altrimenti controllo azione
string toDo = "";
try
protected DS_AppTableAdapters.AnagEventiTableAdapter taEv;
protected DS_AppTableAdapters.TraEv2StatiTableAdapter taEv2St;
//protected DS_applicazioneTableAdapters.IstObjTableAdapter taIstObj;
protected stateMachine()
{
toDo = taEv.getByKey(comando.currCmdIn)[0].Action;
avvioTA();
setupConnectionStringBase();
}
catch
{ }
switch (toDo)
/// <summary>
/// avvia table adapters
/// </summary>
private void avvioTA()
{
case "ok":
_azione = tipoAzione.conferma;
break;
case "ko":
_azione = tipoAzione.annulla;
break;
case "act":
_azione = tipoAzione.esegui;
break;
default:
_azione = tipoAzione.noAct;
break;
taEv = new DS_AppTableAdapters.AnagEventiTableAdapter();
taEv2St = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
//taIstObj = new DS_applicazioneTableAdapters.IstObjTableAdapter();
}
/// <summary>
/// effettua setup dei connection strings da web.config della singola applicazione
/// </summary>
protected virtual void setupConnectionStringBase()
{
string connString = memLayer.ML.confReadString("CTrackConnectionString");
// connections strings del db
taEv.Connection.ConnectionString = connString;
taEv2St.Connection.ConnectionString = connString;
//taIstObj.Connection.ConnectionString = connString;
}
public static stateMachine st = new stateMachine();
/// <summary>
/// restituisce il tipo di comando associato...
/// </summary>
/// <param name="comando"></param>
/// <returns></returns>
public tipoAzione azioneComando(inputComando comando)
{
Match testNumTask = Regex.Match(comando.valore, mUtils.reNumTask);
Match testOper = Regex.Match(comando.valore, mUtils.reCodOper);
Match testPost = Regex.Match(comando.valore, mUtils.reCodPost);
tipoAzione _azione = tipoAzione.noAct;
// se è un SET OPR o POST è un azione IMPLICITA...
if (testOper.Success || testPost.Success)
{
_azione = tipoAzione.esegui;
}
else if (testNumTask.Success)
{
_azione = tipoAzione.esegui;
}
else if (dataLayer.man.taAF.getByKey(comando.currCmdIn).Rows.Count > 0)
{
_azione = tipoAzione.esegui;
}
else
{
// altrimenti controllo azione
string toDo = "";
try
{
toDo = taEv.getByKey(comando.currCmdIn)[0].Action;
}
catch
{ }
switch (toDo)
{
case "ok":
_azione = tipoAzione.conferma;
break;
case "ko":
_azione = tipoAzione.annulla;
break;
case "act":
_azione = tipoAzione.esegui;
break;
default:
_azione = tipoAzione.noAct;
break;
}
}
return _azione;
}
}
return _azione;
}
}
public enum tipoAzione
{
annulla,
conferma,
esegui,
noAct,
setup
}
public enum tipoEsito
{
error,
ok,
undef
}
public enum tipoAzione
{
annulla,
conferma,
esegui,
noAct,
setup
}
public enum tipoEsito
{
error,
ok,
undef
}
}
+4 -23
View File
@@ -9,9 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppData", "AppData\AppData.csproj", "{85BD343D-4246-48DF-BE81-F34321896F88}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP-MAG", "MP-MAG\MP-MAG.csproj", "{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagData", "MagData\MagData.csproj", "{973245E4-02C0-4ED1-A81B-1727C5F4CA59}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9EAA61B-E4E0-4051-8836-6F9A89E27930}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -52,26 +53,6 @@ Global
{85BD343D-4246-48DF-BE81-F34321896F88}.OVH-EletScal|Any CPU.Build.0 = Release|Any CPU
{85BD343D-4246-48DF-BE81-F34321896F88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85BD343D-4246-48DF-BE81-F34321896F88}.Release|Any CPU.Build.0 = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS01|Any CPU.Build.0 = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS02|Any CPU.ActiveCfg = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS02|Any CPU.Build.0 = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.OVH-EletScal|Any CPU.ActiveCfg = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.OVH-EletScal|Any CPU.Build.0 = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Release|Any CPU.Build.0 = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS01|Any CPU.Build.0 = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS02|Any CPU.ActiveCfg = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS02|Any CPU.Build.0 = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.OVH-EletScal|Any CPU.ActiveCfg = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.OVH-EletScal|Any CPU.Build.0 = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+13
View File
@@ -0,0 +1,13 @@
using AppData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace C_TRACK
{
public class BasePage : System.Web.UI.Page
{
protected dataLayer DLMan = new dataLayer();
}
}
+93
View File
@@ -0,0 +1,93 @@
using AppData;
using Newtonsoft.Json;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace C_TRACK
{
public class BaseUserControl : System.Web.UI.UserControl
{
#region Public Events
protected dataLayer DLMan = new dataLayer();
/// <summary>
/// Generico evento di richiesta refresh a aprent
/// </summary>
public event EventHandler eh_doRefresh;
/// <summary>
/// Generico evento di richiesta refresh a aprent
/// </summary>
public event EventHandler eh_doReset;
#endregion Public Events
#region Protected Properties
/// <summary>
/// Codice operatore salvato in cookie
/// </summary>
protected string cookieCodOpr
{
get
{
return memLayer.ML.getCookieVal("CTrack_CodOpr");
}
}
/// <summary>
/// Codice post salvato in cookie
/// </summary>
protected string cookieCodPost
{
get
{
return memLayer.ML.getCookieVal("CTrack_CodPost");
}
}
#endregion Protected Properties
#region Public Methods
/// <summary>
/// Chiamata evento
/// </summary>
public void raiseEvent()
{
// se qualcuno ascolta sollevo evento nuovo valore...
if (eh_doRefresh != null)
{
eh_doRefresh(this, new EventArgs());
}
}
/// <summary>
/// Chiamata evento
/// </summary>
public void raiseReset()
{
// se qualcuno ascolta sollevo evento nuovo valore...
if (eh_doReset != null)
{
eh_doReset(this, new EventArgs());
}
}
/// <summary>
/// Wrapper traduzione termini
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return SteamWare.user_std.UtSn.Traduci(lemma);
}
#endregion Public Methods
}
}
+6 -1
View File
@@ -300,7 +300,6 @@
<Content Include="images\logo_sw.png" />
<Content Include="jumper.aspx" />
<Content Include="login.aspx" />
<Content Include="mongocrypt.dll" />
<Content Include="postazioni.aspx" />
<Content Include="Properties\PublishProfiles\IIS01.pubxml.user" />
<Content Include="Properties\PublishProfiles\IIS02.pubxml.user" />
@@ -551,6 +550,12 @@
<Compile Include="barcode.aspx.designer.cs">
<DependentUpon>barcode.aspx</DependentUpon>
</Compile>
<Compile Include="BasePage.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BaseUserControl.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="closeAllRec.aspx.cs">
<DependentUpon>closeAllRec.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
+364 -363
View File
@@ -4,376 +4,377 @@
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.6.2" />
<httpRuntime targetFramework="4.6.2" />
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /></controls>
</pages>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<sessionState timeout="600" mode="Custom" customProvider="MySessionStateStore">
<providers>
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="localhost" accessKey="localhost" ssl="false" applicationName="C.TRACK" databaseId="2" />
</providers>
</sessionState>
<customErrors mode="RemoteOnly" defaultRedirect="error.html" />
</system.web>
<!--<system.web.extensions>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.6.2" />
<httpRuntime targetFramework="4.6.2" />
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<sessionState timeout="600" mode="Custom" customProvider="MySessionStateStore">
<providers>
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="localhost" accessKey="localhost" ssl="false" applicationName="C.TRACK" databaseId="2" />
</providers>
</sessionState>
<customErrors mode="RemoteOnly" defaultRedirect="error.html" />
</system.web>
<!--<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="true" enableCaching="true" />
</scripting>
</system.web.extensions>-->
<appSettings>
<add key="CodModulo" value="C.TRACK" />
<add key="cacheOnRedis" value="true" />
<add key="maxAgeAppConf_min" value="15" />
<add key="_logDir" value="~/logs/" />
<add key="logMitigSec" value="1" />
<!--Conf generale-->
<add key="appVers" value="stable" />
<add key="downloadPath" value="c:\Steamware\installers\CTRACK\" />
<!--Redis conn-->
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
<add key="redisDb" value="2" />
<add key="_safePages" value="chLang#jumper#unauthorized#forceUser#login#test#UserAdmin#UpdMan#about#contact" />
<!--area DB-->
<add key="CTrackConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="DevicesAuthConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
</appSettings>
<connectionStrings>
<add name="AppData.Properties.Settings.C_TRACKConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.XmlSerializer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Timer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Overlapped" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.RegularExpressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.SecureString" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Json" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Numerics" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Resources.ResourceManager" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Requests" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.NetworkInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq.Queryable" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq.Expressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Globalization.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Globalization" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Dynamic.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Tools" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Debug" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Contracts" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data.Common" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.EventBasedAsync" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.24.0.0" newVersion="0.24.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<remove name="Session" />
<add name="Session" type="Microsoft.AspNet.SessionState.SessionStateModuleAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode" />
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers></system.webServer>
<elmah>
<!--
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
more information on remote access and securing ELMAH.
-->
<security allowRemoteAccess="false" />
</elmah>
<location path="elmah.axd" inheritInChildApplications="false">
<system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<!--
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
<appSettings>
<add key="CodModulo" value="C.TRACK" />
<add key="cacheOnRedis" value="true" />
<add key="maxAgeAppConf_min" value="15" />
<add key="_logDir" value="~/logs/" />
<add key="logMitigSec" value="1" />
<!--Conf generale-->
<add key="appVers" value="stable" />
<add key="downloadPath" value="c:\Steamware\installers\CTRACK\" />
<!--Redis conn-->
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
<add key="redisDb" value="2" />
<add key="_safePages" value="chLang#jumper#unauthorized#forceUser#login#test#UserAdmin#UpdMan#about#contact" />
<!--area DB-->
<add key="CTrackConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="DevicesAuthConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
</appSettings>
<connectionStrings>
<add name="AppData.Properties.Settings.C_TRACKConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="ErrorLog" connectionString="Data Source=SQL2016DEV;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.XmlSerializer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Timer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Overlapped" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.RegularExpressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.SecureString" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Serialization.Json" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Numerics" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Resources.ResourceManager" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Requests" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.NetworkInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq.Queryable" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq.Expressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Linq" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Globalization.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Globalization" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Dynamic.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Tools" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Debug" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.Contracts" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data.Common" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.EventBasedAsync" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.24.0.0" newVersion="0.24.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<remove name="Session" />
<add name="Session" type="Microsoft.AspNet.SessionState.SessionStateModuleAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode" />
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLog" />
<security allowRemoteAccess="false" />
</elmah>
<location path="elmah.axd" inheritInChildApplications="false">
<system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<!--
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
more information on using ASP.NET authorization securing ELMAH.
<authorization>
<allow roles="admin" />
<deny users="*" />
<deny users="*" />
</authorization>
-->
</system.web>
<system.webServer>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
</location>
</configuration>
</system.web>
<system.webServer>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
</location>
</configuration>
+27 -18
View File
@@ -1,20 +1,29 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_addTask.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_addTask" %>
<div runat="server" id="divAddNew">
<div class="row font-weight-bold py-2">
<div class="col-3 text-center" runat="server" id="divArticolo">
<asp:Label runat="server" ID="lblCodArt" CssClass="text-secondary">Cod.ARTICOLO</asp:Label>
<div><%: CodArticolo %></div>
<%@ Register Src="~/WebUserControls/mod_periodo.ascx" TagPrefix="uc1" TagName="mod_periodo" %>
<div runat="server" id="divAddNew">
<div class="row font-weight-bold py-2">
<div class="col text-center" runat="server" id="divExport">
<asp:HyperLink runat="server" ID="hlExport" CssClass="btn btn-warning btn-block" NavigateUrl="~/export.aspx" Target="_blank"><i class="fas fa-download"></i> Data Export</asp:HyperLink>
</div>
<div class="col text-center" runat="server" id="divArticolo">
<asp:Label runat="server" ID="lblCodArt" CssClass="text-secondary">Cod.ARTICOLO</asp:Label>
<div><%: CodArticolo %></div>
</div>
<div class="col text-center" runat="server" id="divCommessa">
<asp:Label runat="server" ID="lblNumTask" CssClass="text-secondary">COMMESSA</asp:Label>
<div><%: NumTask %></div>
</div>
<div class="col text-center" runat="server" id="divQta">
<asp:Label runat="server" ID="lblQta" CssClass="text-secondary">QUANTITA</asp:Label>
<div><%: Quantita %></div>
</div>
<div class="col text-center" runat="server" id="divTime">
<asp:Label runat="server" ID="Label1" CssClass="text-secondary">TEMPO <sub>prev</sub></asp:Label>
<div><%: TimeEst %></div>
</div>
<div class="col text-center" runat="server" id="divReset">
<asp:LinkButton runat="server" ID="lbtReset" CssClass="btn btn-info btn-block" OnClick="lbtReset_Click"><i class="fas fa-sync-alt"></i> RESET</asp:LinkButton>
</div>
</div>
<div class="col-3 text-center" runat="server" id="divCommessa">
<asp:Label runat="server" ID="lblNumTask" CssClass="text-secondary">COMMESSA</asp:Label>
<div><%: NumTask %></div>
</div>
<div class="col-3 text-center" runat="server" id="divQta">
<asp:Label runat="server" ID="lblQta" CssClass="text-secondary">QUANTITA</asp:Label>
<div><%: Quantita %></div>
</div>
<div class="col-3 text-center" runat="server" id="divReset">
<asp:LinkButton runat="server" ID="lbtReset" CssClass="btn btn-info btn-block" OnClick="lbtReset_Click"><i class="fas fa-sync-alt"></i> RESET</asp:LinkButton>
</div>
</div>
</div>
</div>
+230 -157
View File
@@ -1,182 +1,255 @@
using AppData;
using SteamWare;
using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace C_TRACK.WebUserControls
{
public partial class mod_addTask : System.Web.UI.UserControl
{
/// <summary>
/// evento aggiunta record
/// </summary>
public event EventHandler eh_created;
protected void Page_Load(object sender, EventArgs e)
public partial class mod_addTask : BaseUserControl
{
if (!Page.IsPostBack)
{
CodArticolo = "";
NumTask = "";
Quantita = 0;
}
checkValori();
}
#region Public Events
private void checkValori()
{
// verifica quali valori siano disponibili e di conseguenza visualizza COLORE...
divArticolo.Attributes.Remove("class");
divCommessa.Attributes.Remove("class");
divQta.Attributes.Remove("class");
divArticolo.Attributes.Add("class", CodArticolo != "" ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
divCommessa.Attributes.Add("class", NumTask != "" ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
divQta.Attributes.Add("class", Quantita > 0 ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
}
/// <summary>
/// Input da processare...
/// </summary>
public string newInput
{
set
{
processInput(value);
}
}
/// <summary>
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
/// </summary>
/// <param name="value"></param>
private void processInput(string value)
{
// verifico se sia un articolo...
Match testReset = Regex.Match(value, mUtils.reReset);
Match testDelete = Regex.Match(value, mUtils.reDelete);
Match testAddNew = Regex.Match(value, mUtils.reAddNew);
Match testCodArt = Regex.Match(value, mUtils.reCodArt);
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
Match testQta = Regex.Match(value, mUtils.reQta);
/// <summary>
/// evento aggiunta record
/// </summary>
public event EventHandler eh_created;
#endregion Public Events
if (testReset.Success)
{
CodArticolo = "";
NumTask = "";
Quantita = 0;
}
else if (testDelete.Success)
{
// creo...
dataLayer.man.taTL.deleteQuery(NumTask);
// resetto!
CodArticolo = "";
NumTask = "";
Quantita = 0;
// invoco update...
if (eh_created != null)
#region Public Properties
/// <summary>
/// Cod ARTICOLO corrente
/// </summary>
public string CodArticolo
{
eh_created(this, new EventArgs());
get
{
return memLayer.ML.StringSessionObj("currCodArt");
}
set
{
memLayer.ML.setSessionVal("currCodArt", value);
}
}
}
else if (testAddNew.Success)
{
// se qta > 0 ed ho articolo e commessa...
if (Quantita > 0 && CodArticolo != "" && NumTask != "")
/// <summary>
/// Input da processare...
/// </summary>
public string newInput
{
// creo...
dataLayer.man.taTL.insertQuery(NumTask, CodArticolo, Quantita);
// resetto!
CodArticolo = "";
NumTask = "";
Quantita = 0;
// invoco update...
if (eh_created != null)
{
eh_created(this, new EventArgs());
}
set
{
processInput(value);
}
}
}
else if (testCodArt.Success)
{
CodArticolo = value;
}
else if (testNumTask.Success)
{
NumTask = value;
}
else if (testQta.Success)
{
int qta = 0;
int.TryParse(value, out qta);
Quantita = qta;
}
// non match con RegExp --> ricerca ESPLICITA, se abilitato ricerca estesa
if (memLayer.ML.CRB("OptEnableMapoIn") && !(testCodArt.Success || testNumTask.Success))
{
var tabArt = dataLayer.man.taAnArt.getByKey(value);
if (tabArt.Rows.Count > 0)
/// <summary>
/// Cod COMMESSA corrente
/// </summary>
public string NumTask
{
CodArticolo = value;
get
{
return memLayer.ML.StringSessionObj("currNumTask");
}
set
{
memLayer.ML.setSessionVal("currNumTask", value);
}
}
else
/// <summary>
/// QTA da produrre
/// </summary>
public int Quantita
{
var tabTask = dataLayer.man.taTL.getByKey(value);
if (tabTask.Rows.Count > 0)
{
NumTask = value;
}
get
{
return memLayer.ML.IntSessionObj("currQta");
}
set
{
memLayer.ML.setSessionVal("currQta", value);
}
}
}
checkValori();
}
/// <summary>
/// Tempo stimato x produzione
/// </summary>
public float TimeEst
{
get
{
float answ = -1;
string rawVal = memLayer.ML.StringSessionObj("currTimeEst");
float.TryParse(rawVal, out answ);
return answ;
}
set
{
memLayer.ML.setSessionVal("currTimeEst", value);
}
}
/// <summary>
/// Cod ARTICOLO corrente
/// </summary>
public string CodArticolo
{
get
{
return memLayer.ML.StringSessionObj("currCodArt");
}
set
{
memLayer.ML.setSessionVal("currCodArt", value);
}
}
/// <summary>
/// Cod COMMESSA corrente
/// </summary>
public string NumTask
{
get
{
return memLayer.ML.StringSessionObj("currNumTask");
}
set
{
memLayer.ML.setSessionVal("currNumTask", value);
}
}
/// <summary>
/// QTA da produrre
/// </summary>
public int Quantita
{
get
{
return memLayer.ML.IntSessionObj("currQta");
}
set
{
memLayer.ML.setSessionVal("currQta", value);
}
}
#endregion Public Properties
protected void lbtReset_Click(object sender, EventArgs e)
{
processInput(memLayer.ML.CRS("regExp_KO"));
#region Private Methods
private void checkValori()
{
// verifica quali valori siano disponibili e di conseguenza visualizza COLORE...
divArticolo.Attributes.Remove("class");
divCommessa.Attributes.Remove("class");
divQta.Attributes.Remove("class");
divTime.Attributes.Remove("class");
divArticolo.Attributes.Add("class", CodArticolo != "" ? "col text-center table-success text-success" : "col text-center text-secondary");
divCommessa.Attributes.Add("class", NumTask != "" ? "col text-center table-success text-success" : "col text-center text-secondary");
divQta.Attributes.Add("class", Quantita > 0 ? "col text-center table-success text-success" : "col text-center text-secondary");
divTime.Attributes.Add("class", TimeEst > 0 ? "col text-center table-success text-success" : "col text-center text-secondary");
}
/// <summary>
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
/// </summary>
/// <param name="value"></param>
private void processInput(string value)
{
// verifico se sia un articolo...
Match testReset = Regex.Match(value, mUtils.reReset);
Match testDelete = Regex.Match(value, mUtils.reDelete);
Match testAddNew = Regex.Match(value, mUtils.reAddNew);
Match testCodArt = Regex.Match(value, mUtils.reCodArt);
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
Match testQta = Regex.Match(value, mUtils.reQta);
Match testTempo = Regex.Match(value, mUtils.reTempoPrev);
if (testReset.Success)
{
CodArticolo = "";
NumTask = "";
Quantita = 0;
TimeEst = 0;
}
else if (testDelete.Success)
{
// creo...
DLMan.taTL.deleteQuery(NumTask);
// resetto!
CodArticolo = "";
NumTask = "";
Quantita = 0;
// invoco update...
if (eh_created != null)
{
eh_created(this, new EventArgs());
}
}
else if (testAddNew.Success)
{
// controllo condizione richiesta tempo x setup Task
bool confAddTaskReqTime = memLayer.ML.CRB("confAddTaskReqTime");
// se NON richiesto --> Time=0
if (!confAddTaskReqTime)
{
TimeEst = 0;
}
// se qta > 0 ed ho articolo e commessa...
if (Quantita > 0 && !string.IsNullOrEmpty(CodArticolo) && !string.IsNullOrEmpty(NumTask) && (!confAddTaskReqTime || TimeEst > 0))
{
// creo...
DLMan.taTL.insertQuery(NumTask, CodArticolo, Quantita, TimeEst);
// resetto!
CodArticolo = "";
NumTask = "";
Quantita = 0;
// invoco update...
if (eh_created != null)
{
eh_created(this, new EventArgs());
}
}
}
else if (testTempo.Success)
{
string newVal = value;
// effettuo pulizia variabile da conf...
foreach (var item in mUtils.lRepCleanTime)
{
string[] repVal = item.Split('|');
if (repVal.Length > 1)
{
newVal = newVal.Replace(repVal[0], repVal[1]);
}
}
float tPrev = 0;
float.TryParse(newVal, out tPrev);
// se configurata conversione procedo
if (mUtils.TimeEstFactor != 1)
{
tPrev = tPrev / mUtils.TimeEstFactor;
}
// assegno!
TimeEst = tPrev;
}
else if (testCodArt.Success)
{
CodArticolo = value;
}
else if (testNumTask.Success)
{
NumTask = value;
}
else if (testQta.Success)
{
int qta = 0;
int.TryParse(value, out qta);
Quantita = qta;
}
// non match con RegExp --> ricerca ESPLICITA, se abilitato ricerca estesa
if (memLayer.ML.CRB("OptEnableMapoIn") && !(testCodArt.Success || testNumTask.Success))
{
var tabArt = DLMan.taAnArt.getByKey(value);
if (tabArt.Rows.Count > 0)
{
CodArticolo = value;
}
else
{
var tabTask = DLMan.taTL.getByKey(value);
if (tabTask.Rows.Count > 0)
{
NumTask = value;
}
}
}
checkValori();
}
#endregion Private Methods
#region Protected Methods
protected void lbtReset_Click(object sender, EventArgs e)
{
processInput(memLayer.ML.CRS("regExp_KO"));
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
CodArticolo = "";
NumTask = "";
Quantita = 0;
}
checkValori();
}
#endregion Protected Methods
}
}
}
+51 -13
View File
@@ -7,11 +7,13 @@
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace C_TRACK.WebUserControls {
public partial class mod_addTask {
namespace C_TRACK.WebUserControls
{
public partial class mod_addTask
{
/// <summary>
/// Controllo divAddNew.
/// </summary>
@@ -20,7 +22,25 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divAddNew;
/// <summary>
/// Controllo divExport.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divExport;
/// <summary>
/// Controllo hlExport.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hlExport;
/// <summary>
/// Controllo divArticolo.
/// </summary>
@@ -29,7 +49,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divArticolo;
/// <summary>
/// Controllo lblCodArt.
/// </summary>
@@ -38,7 +58,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblCodArt;
/// <summary>
/// Controllo divCommessa.
/// </summary>
@@ -47,7 +67,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divCommessa;
/// <summary>
/// Controllo lblNumTask.
/// </summary>
@@ -56,7 +76,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblNumTask;
/// <summary>
/// Controllo divQta.
/// </summary>
@@ -65,7 +85,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divQta;
/// <summary>
/// Controllo lblQta.
/// </summary>
@@ -74,7 +94,25 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblQta;
/// <summary>
/// Controllo divTime.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTime;
/// <summary>
/// Controllo Label1.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// Controllo divReset.
/// </summary>
@@ -83,7 +121,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divReset;
/// <summary>
/// Controllo lbtReset.
/// </summary>
+128 -128
View File
@@ -5,143 +5,143 @@ using System.Web.UI.WebControls;
namespace C_TRACK.WebUserControls
{
public partial class mod_btnComandi : System.Web.UI.UserControl
{
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
public partial class mod_btnComandi : BaseUserControl
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
set
{
memLayer.ML.setSessionVal("CurrNumTask", value);
}
}
/// <summary>
/// evento comando clicked
/// </summary>
public event EventHandler eh_clickComando;
protected void Page_Load(object sender, EventArgs e)
{
updateBtn();
}
/// <summary>
/// segnala click su button comando
/// </summary>
public void segnalaClick()
{
eh_clickComando?.Invoke(this, new EventArgs());
}
protected void lbtCmd_Click(object sender, EventArgs e)
{
// PROCEDO SOLO SE non ho veto...
if (!hasVeto)
{
LinkButton lb = (LinkButton)sender;
memLayer.ML.setSessionVal("btnCmdPress", lb.CommandArgument, false);
segnalaClick();
}
else
{
updateBtn();
}
}
public void updateBtn()
{
// verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA)
if (mUtils.CodOpr != "")
{
var tabTR = dataLayer.man.taTR.getAttiveByOpr(mUtils.CodOpr);
if (tabTR.Rows.Count > 0)
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
// se NON HO una commessa attiva, SELEZIONO la PRIMA commessa aperta...
if (CurrNumTask == "")
{
CurrNumTask = tabTR[0].NumTask;
}
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
set
{
memLayer.ML.setSessionVal("CurrNumTask", value);
}
}
}
/// <summary>
/// evento comando clicked
/// </summary>
public event EventHandler eh_clickComando;
// controllo se HO una fase corrente...
repComandi.Visible = !hasVeto;
if (!hasVeto)
{
// altrimenti imposto fasi da postazione...
repComandi.DataBind();
}
}
/// <summary>
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
/// - ho una commessa
/// - la commessa NON E' chiusa...
/// </summary>
public string datiCommessa
{
get
{
string answ = "";
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
if (CurrNumTask == "")
protected void Page_Load(object sender, EventArgs e)
{
// se NON E' multi
if (mUtils.postIsMulti)
{
answ = "<-- Gestione commesse";
}
else
{
answ = "Manca Commessa";
}
updateBtn();
}
else
/// <summary>
/// segnala click su button comando
/// </summary>
public void segnalaClick()
{
answ = hasVeto ? "Commessa Chiusa: " + CurrNumTask.ToString() : "";
eh_clickComando?.Invoke(this, new EventArgs());
}
return answ;
}
}
/// <summary>
/// Verifica se la commessa sia assente/chiusa
/// </summary>
public bool hasVeto
{
get
{
bool answ = false;
bool noTask = CurrNumTask == "";
bool isChiuso = false;
try
protected void lbtCmd_Click(object sender, EventArgs e)
{
isChiuso = dataLayer.man.taTL.getByKey(CurrNumTask)[0].Concluso;
// PROCEDO SOLO SE non ho veto...
if (!hasVeto)
{
LinkButton lb = (LinkButton)sender;
memLayer.ML.setSessionVal("btnCmdPress", lb.CommandArgument, false);
segnalaClick();
}
else
{
updateBtn();
}
}
public void updateBtn()
{
// verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA)
if (mUtils.CodOpr != "")
{
var tabTR = DLMan.taTR.getAttiveByOpr(mUtils.CodOpr);
if (tabTR.Rows.Count > 0)
{
// se NON HO una commessa attiva, SELEZIONO la PRIMA commessa aperta...
if (CurrNumTask == "")
{
CurrNumTask = tabTR[0].NumTask;
}
}
}
// controllo se HO una fase corrente...
repComandi.Visible = !hasVeto;
if (!hasVeto)
{
// altrimenti imposto fasi da postazione...
repComandi.DataBind();
}
}
/// <summary>
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
/// - ho una commessa
/// - la commessa NON E' chiusa...
/// </summary>
public string datiCommessa
{
get
{
string answ = "";
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
if (CurrNumTask == "")
{
// se NON E' multi
if (mUtils.postIsMulti)
{
answ = "<-- Gestione commesse";
}
else
{
answ = "Manca Commessa";
}
}
else
{
answ = hasVeto ? "Commessa Chiusa: " + CurrNumTask.ToString() : "";
}
return answ;
}
}
/// <summary>
/// Verifica se la commessa sia assente/chiusa
/// </summary>
public bool hasVeto
{
get
{
bool answ = false;
bool noTask = CurrNumTask == "";
bool isChiuso = false;
try
{
isChiuso = DLMan.taTL.getByKey(CurrNumTask)[0].Concluso;
}
catch
{ }
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
answ = noTask || isChiuso;
return answ;
}
}
/// <summary>
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
/// - ho una commessa
/// - la commessa NON E' chiusa...
/// </summary>
public string cssEnabled
{
get
{
string answ = "";
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
answ = hasVeto ? "disabled" : "";
return answ;
}
}
catch
{ }
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
answ = noTask || isChiuso;
return answ;
}
}
/// <summary>
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
/// - ho una commessa
/// - la commessa NON E' chiusa...
/// </summary>
public string cssEnabled
{
get
{
string answ = "";
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
answ = hasVeto ? "disabled" : "";
return answ;
}
}
}
}
+27 -27
View File
@@ -4,35 +4,35 @@ using System;
namespace C_TRACK.WebUserControls
{
public partial class mod_checkPost : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_checkPost : BaseUserControl
{
// se ho operatore in sessione ma NON HO postazione... cerco di recuperare postazione
if (mUtils.CodOpr != "" && mUtils.CodPost == "")
{
// cerco da tab se ha una postazione (prendo la prima...)
var righeOpr = dataLayer.man.taAP.getByOpr(mUtils.CodOpr);
if (righeOpr.Rows.Count > 0)
protected void Page_Load(object sender, EventArgs e)
{
mUtils.CodPost = righeOpr[0].CodPost;
// se ho operatore in sessione ma NON HO postazione... cerco di recuperare postazione
if (mUtils.CodOpr != "" && mUtils.CodPost == "")
{
// cerco da tab se ha una postazione (prendo la prima...)
var righeOpr = DLMan.taAP.getByOpr(mUtils.CodOpr);
if (righeOpr.Rows.Count > 0)
{
mUtils.CodPost = righeOpr[0].CodPost;
}
}
// verifico di avere CodOpr in sessione...
if (mUtils.CodPost == "")
{
// mostro warning..
divWarning.Visible = true;
// se NON sono in pagina bcode --> rimando a richiesta dichiarazione POSTAZIONE (con BARCODE)
if (devicesAuthProxy.pagCorrente != "barcode")
{
Response.Redirect("~/barcode");
}
}
else
{
divWarning.Visible = false;
}
}
}
// verifico di avere CodOpr in sessione...
if (mUtils.CodPost == "")
{
// mostro warning..
divWarning.Visible = true;
// se NON sono in pagina bcode --> rimando a richiesta dichiarazione POSTAZIONE (con BARCODE)
if (devicesAuthProxy.pagCorrente != "barcode")
{
Response.Redirect("~/barcode");
}
}
else
{
divWarning.Visible = false;
}
}
}
}
+154 -153
View File
@@ -4,172 +4,173 @@ using System;
namespace C_TRACK.WebUserControls
{
public partial class mod_faseCurr : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_faseCurr : BaseUserControl
{
if (!Page.IsPostBack)
{
mod_numKeyb.Visible = false;
setupValori();
}
mod_numKeyb.eh_comandoRegistrato += Mod_numKeyb_eh_comandoRegistrato;
mod_numKeyb.eh_reset += Mod_numKeyb_eh_reset;
}
private void Mod_numKeyb_eh_reset(object sender, EventArgs e)
{
// nascondo keyb...
mod_numKeyb.Visible = false;
}
private void Mod_numKeyb_eh_comandoRegistrato(object sender, EventArgs e)
{
// recupero valore
if (mod_numKeyb.numSelected >= 0)
{
txtQta.Text = mod_numKeyb.numSelected.ToString();
refreshQtaSel();
// nascondo keyb...
mod_numKeyb.Visible = false;
}
}
private void setupValori()
{
// recupero riga TR e popolo valori visualizzati
var tabTR = dataLayer.man.taTR.getByPost(mUtils.CodPost, false);
bool showDiv = false;
if (tabTR.Rows.Count > 0)
{
DescFaseCurr = tabTR[0].DescrFase;
QtaFaseCurr = tabTR[0].QtaEv;
txtQta.Text = QtaFaseCurr.ToString();
idxRecCurr = tabTR[0].IdxRec;
showDiv = true;
}
divFaseCurr.Visible = showDiv;
}
/// <summary>
/// Descrizione fase attiva
/// </summary>
public string DescFaseCurr
{
get
{
return memLayer.ML.StringSessionObj("DescFaseCurr");
}
set
{
memLayer.ML.setSessionVal("DescFaseCurr", value);
}
}
/// <summary>
/// Qta della fase attiva
/// </summary>
public int QtaFaseCurr
{
get
{
return memLayer.ML.IntSessionObj("QtaFaseCurr");
}
set
{
memLayer.ML.setSessionVal("QtaFaseCurr", value);
}
}
/// <summary>
/// idxRec della fase attiva
/// </summary>
public int idxRecCurr
{
get
{
return memLayer.ML.IntSessionObj("idxRecCurr");
}
set
{
memLayer.ML.setSessionVal("idxRecCurr", value);
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("DescPost"))
protected void Page_Load(object sender, EventArgs e)
{
answ = memLayer.ML.StringSessionObj("DescPost");
if (!Page.IsPostBack)
{
mod_numKeyb.Visible = false;
setupValori();
}
mod_numKeyb.eh_comandoRegistrato += Mod_numKeyb_eh_comandoRegistrato;
mod_numKeyb.eh_reset += Mod_numKeyb_eh_reset;
}
if (answ == "")
private void Mod_numKeyb_eh_reset(object sender, EventArgs e)
{
var tabPost = dataLayer.man.taAP.getByKey(mUtils.CodPost);
if (tabPost.Rows.Count > 0)
{
answ = tabPost[0].Descrizione;
}
memLayer.ML.setSessionVal("DescPost", answ);
// nascondo keyb...
mod_numKeyb.Visible = false;
}
return answ;
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("NomeOpr"))
private void Mod_numKeyb_eh_comandoRegistrato(object sender, EventArgs e)
{
answ = memLayer.ML.StringSessionObj("NomeOpr");
// recupero valore
if (mod_numKeyb.numSelected >= 0)
{
txtQta.Text = mod_numKeyb.numSelected.ToString();
refreshQtaSel();
// nascondo keyb...
mod_numKeyb.Visible = false;
}
}
if (answ == "")
private void setupValori()
{
var tabOpr = dataLayer.man.taAO.getByKey(mUtils.CodOpr);
if (tabOpr.Rows.Count > 0)
{
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
}
memLayer.ML.setSessionVal("NomeOpr", answ);
// recupero riga TR e popolo valori visualizzati
var tabTR = DLMan.taTR.getByPost(mUtils.CodPost, false);
bool showDiv = false;
if (tabTR.Rows.Count > 0)
{
DescFaseCurr = tabTR[0].DescrFase;
QtaFaseCurr = tabTR[0].QtaEv;
txtQta.Text = QtaFaseCurr.ToString();
idxRecCurr = tabTR[0].IdxRec;
showDiv = true;
}
divFaseCurr.Visible = showDiv;
}
return answ;
}
}
protected void txtQta_TextChanged(object sender, EventArgs e)
{
refreshQtaSel();
}
/// <summary>
/// Descrizione fase attiva
/// </summary>
public string DescFaseCurr
{
get
{
return memLayer.ML.StringSessionObj("DescFaseCurr");
}
set
{
memLayer.ML.setSessionVal("DescFaseCurr", value);
}
}
/// <summary>
/// Qta della fase attiva
/// </summary>
public int QtaFaseCurr
{
get
{
return memLayer.ML.IntSessionObj("QtaFaseCurr");
}
set
{
memLayer.ML.setSessionVal("QtaFaseCurr", value);
}
}
/// <summary>
/// idxRec della fase attiva
/// </summary>
public int idxRecCurr
{
get
{
return memLayer.ML.IntSessionObj("idxRecCurr");
}
set
{
memLayer.ML.setSessionVal("idxRecCurr", value);
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("DescPost"))
{
answ = memLayer.ML.StringSessionObj("DescPost");
}
if (answ == "")
{
var tabPost = DLMan.taAP.getByKey(mUtils.CodPost);
if (tabPost.Rows.Count > 0)
{
answ = tabPost[0].Descrizione;
}
memLayer.ML.setSessionVal("DescPost", answ);
}
return answ;
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("NomeOpr"))
{
answ = memLayer.ML.StringSessionObj("NomeOpr");
}
if (answ == "")
{
var tabOpr = DLMan.taAO.getByKey(mUtils.CodOpr);
if (tabOpr.Rows.Count > 0)
{
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
}
memLayer.ML.setSessionVal("NomeOpr", answ);
}
return answ;
}
}
private void refreshQtaSel()
{
int newQta = QtaFaseCurr;
int.TryParse(txtQta.Text, out newQta);
// salvo nuova qta...
QtaFaseCurr = newQta;
}
protected void txtQta_TextChanged(object sender, EventArgs e)
{
refreshQtaSel();
}
protected void lbtKeyb_Click(object sender, EventArgs e)
{
toggleNumKeyb();
}
/// <summary>
/// Toggle visibilità numKeyb
/// </summary>
private void toggleNumKeyb()
{
mod_numKeyb.Visible = !mod_numKeyb.Visible;
}
private void refreshQtaSel()
{
int newQta = QtaFaseCurr;
int.TryParse(txtQta.Text, out newQta);
// salvo nuova qta...
QtaFaseCurr = newQta;
}
protected void lbtReset_Click(object sender, EventArgs e)
{
Response.Redirect("~/barcode");
protected void lbtKeyb_Click(object sender, EventArgs e)
{
toggleNumKeyb();
}
/// <summary>
/// Toggle visibilità numKeyb
/// </summary>
private void toggleNumKeyb()
{
mod_numKeyb.Visible = !mod_numKeyb.Visible;
}
protected void lbtReset_Click(object sender, EventArgs e)
{
Response.Redirect("~/barcode");
}
}
}
}
+10 -10
View File
@@ -3,18 +3,18 @@ using System;
namespace C_TRACK.WebUserControls
{
public partial class mod_fasiAttive : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_fasiAttive : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
protected void lbtCloseAll_Click(object sender, EventArgs e)
{
// chiama la procedura che chiude tutte la fasi rimaste attive...
dataLayer.man.taTR.closePending();
Response.Redirect("~/task");
protected void lbtCloseAll_Click(object sender, EventArgs e)
{
// chiama la procedura che chiude tutte la fasi rimaste attive...
DLMan.taTR.closePending();
Response.Redirect("~/task");
}
}
}
}
+114 -114
View File
@@ -6,132 +6,132 @@ using System.Web.UI;
namespace C_TRACK.WebUserControls
{
public partial class mod_menuTopCompact : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_menuTopCompact : BaseUserControl
{
string lastPage = Request.Url.LocalPath.Split('/').Last();
if (!Page.IsPostBack)
{
// fix visibilità TASK
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
hlReset.Visible = false;
// se l'utente NON c'è torno a login...
if (!devicesAuthProxy.stObj.isAuth)
protected void Page_Load(object sender, EventArgs e)
{
if (lastPage != "" && lastPage != "login")
{
Session["nextPage"] = lastPage;
}
// SE non sono in "safe page"
if (memLayer.ML.CRS("_loginPages").ToLower().IndexOf(lastPage.ToLower()) < 0)
{
Response.Redirect("~/login");
}
string lastPage = Request.Url.LocalPath.Split('/').Last();
if (!Page.IsPostBack)
{
// fix visibilità TASK
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
hlReset.Visible = false;
// se l'utente NON c'è torno a login...
if (!devicesAuthProxy.stObj.isAuth)
{
if (lastPage != "" && lastPage != "login")
{
Session["nextPage"] = lastPage;
}
// SE non sono in "safe page"
if (memLayer.ML.CRS("_loginPages").ToLower().IndexOf(lastPage.ToLower()) < 0)
{
Response.Redirect("~/login");
}
}
else
{
PagCorrente();
// leggo da conf SE mostrare logout...
hlReset.Visible = memLayer.ML.CRB("enableLogOut");
}
}
// controllo pagina...
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
// controllo pag auth...
if (!pageAuth && memLayer.ML.confReadString("_safePages").ToLower().IndexOf(lastPage.ToLower()) < 0)
{
Response.Redirect("~/login");
}
lblTitolo.Text = memLayer.ML.CRS("appName");
}
else
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
PagCorrente();
// leggo da conf SE mostrare logout...
hlReset.Visible = memLayer.ML.CRB("enableLogOut");
string[] uri = Request.Url.LocalPath.Split('/');
// salvo pagina corrente
devicesAuthProxy.pagCorrente = uri.Last();
if (devicesAuthProxy.pagPrecedente == "")
{
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
}
}
}
// controllo pagina...
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
// controllo pag auth...
if (!pageAuth && memLayer.ML.confReadString("_safePages").ToLower().IndexOf(lastPage.ToLower()) < 0)
{
Response.Redirect("~/login");
}
lblTitolo.Text = memLayer.ML.CRS("appName");
}
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
string[] uri = Request.Url.LocalPath.Split('/');
// salvo pagina corrente
devicesAuthProxy.pagCorrente = uri.Last();
if (devicesAuthProxy.pagPrecedente == "")
{
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
}
}
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
/// <summary>
/// Codice ART corrente
/// </summary>
public string CurrCodArt
{
get
{
return memLayer.ML.StringSessionObj("CurrCodArt");
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("DescPost"))
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
answ = memLayer.ML.StringSessionObj("DescPost");
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
if (answ == "")
/// <summary>
/// Codice ART corrente
/// </summary>
public string CurrCodArt
{
var tabPost = dataLayer.man.taAP.getByKey(mUtils.CodPost);
if (tabPost.Rows.Count > 0)
{
answ = tabPost[0].Descrizione;
}
memLayer.ML.setSessionVal("DescPost", answ);
get
{
return memLayer.ML.StringSessionObj("CurrCodArt");
}
}
return answ;
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("NomeOpr"))
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
answ = memLayer.ML.StringSessionObj("NomeOpr");
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("DescPost"))
{
answ = memLayer.ML.StringSessionObj("DescPost");
}
if (answ == "")
{
var tabPost = DLMan.taAP.getByKey(mUtils.CodPost);
if (tabPost.Rows.Count > 0)
{
answ = tabPost[0].Descrizione;
}
memLayer.ML.setSessionVal("DescPost", answ);
}
return answ;
}
}
if (answ == "")
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
var tabOpr = dataLayer.man.taAO.getByKey(mUtils.CodOpr);
if (tabOpr.Rows.Count > 0)
{
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
}
memLayer.ML.setSessionVal("NomeOpr", answ);
get
{
string answ = "";
if (memLayer.ML.isInSessionObject("NomeOpr"))
{
answ = memLayer.ML.StringSessionObj("NomeOpr");
}
if (answ == "")
{
var tabOpr = DLMan.taAO.getByKey(mUtils.CodOpr);
if (tabOpr.Rows.Count > 0)
{
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
}
memLayer.ML.setSessionVal("NomeOpr", answ);
}
return answ;
}
}
/// <summary>
/// Forzo refresh pannello superiore
/// </summary>
public void doUpdate()
{
divCurr.DataBind();
}
return answ;
}
}
/// <summary>
/// Forzo refresh pannello superiore
/// </summary>
public void doUpdate()
{
divCurr.DataBind();
}
}
}
+89 -89
View File
@@ -10,106 +10,106 @@ using System.Web.UI.WebControls;
namespace C_TRACK.WebUserControls
{
public partial class mod_opr2post : System.Web.UI.UserControl
{
/// <summary>
/// evento aggiunta record
/// </summary>
public event EventHandler eh_reqUpdate;
protected void Page_Load(object sender, EventArgs e)
public partial class mod_opr2post : BaseUserControl
{
if (!Page.IsPostBack)
{
if (mUtils.postIsMulti)
/// <summary>
/// evento aggiunta record
/// </summary>
public event EventHandler eh_reqUpdate;
protected void Page_Load(object sender, EventArgs e)
{
lbtClosePeriod.DataBind();
doUpdate();
if (!Page.IsPostBack)
{
if (mUtils.postIsMulti)
{
lbtClosePeriod.DataBind();
doUpdate();
}
}
}
}
}
public void doUpdate()
{
grView.DataBind();
}
public void doUpdate()
{
grView.DataBind();
}
/// <summary>
/// CodPost selezionato in sessione
/// </summary>
protected string codPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
/// <summary>
/// CodPost selezionato in sessione
/// </summary>
protected string codPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
protected void lbtClosePeriod_Click(object sender, EventArgs e)
{
// chiude il turno andando a ripartire tutte le ore operatore sulle commesse attive e senza riportare attivi gli operatori
dataLayer.man.taTR.checkAlloc(codPost, false);
grView.DataBind();
reportUpdate();
}
protected void lbtClosePeriod_Click(object sender, EventArgs e)
{
// chiude il turno andando a ripartire tutte le ore operatore sulle commesse attive e senza riportare attivi gli operatori
DLMan.taTR.checkAlloc(codPost, false);
grView.DataBind();
reportUpdate();
}
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
reportUpdate();
}
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
reportUpdate();
}
private void reportUpdate()
{
// invoco update...
if (eh_reqUpdate != null)
{
eh_reqUpdate(this, new EventArgs());
}
}
private void reportUpdate()
{
// invoco update...
if (eh_reqUpdate != null)
{
eh_reqUpdate(this, new EventArgs());
}
}
/// <summary>
/// Input da processare (tipo codOperatore...)...
/// </summary>
public string newInput
{
set
{
processInput(value);
}
}
/// <summary>
/// Input da processare (tipo codOperatore...)...
/// </summary>
public string newInput
{
set
{
processInput(value);
}
}
/// <summary>
/// Cod OPERATORE corrente
/// </summary>
public string codOper
{
get
{
return memLayer.ML.StringSessionObj("currCodOperMulti");
}
set
{
memLayer.ML.setSessionVal("currCodOperMulti", value);
}
}
/// <summary>
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
/// </summary>
/// <param name="value"></param>
private void processInput(string value)
{
// verifico se sia un operatore...
Match testOper = Regex.Match(value, mUtils.reCodOper);
/// <summary>
/// Cod OPERATORE corrente
/// </summary>
public string codOper
{
get
{
return memLayer.ML.StringSessionObj("currCodOperMulti");
}
set
{
memLayer.ML.setSessionVal("currCodOperMulti", value);
}
}
/// <summary>
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
/// </summary>
/// <param name="value"></param>
private void processInput(string value)
{
// verifico se sia un operatore...
Match testOper = Regex.Match(value, mUtils.reCodOper);
if (testOper.Success)
{
// salvo nuovo operatore SE non ci fosse...
codOper = value;
dataLayer.man.taO2P.InsertQuery(codPost, codOper, DateTime.Now);
reportUpdate();
}
doUpdate();
if (testOper.Success)
{
// salvo nuovo operatore SE non ci fosse...
codOper = value;
DLMan.taO2P.InsertQuery(codPost, codOper, DateTime.Now);
reportUpdate();
}
doUpdate();
}
}
}
}
+7 -15
View File
@@ -1,18 +1,10 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_periodo.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_periodo" %>
<div class="row">
<div class="col">
<asp:TextBox runat="server" ID="txtFrom" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtFrom_TextChanged"></asp:TextBox>
</div>
<div class="col"></div>
<div class="col">
<asp:TextBox runat="server" ID="txtTo" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtTo_TextChanged"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col"></div>
<div class="col">
<asp:HyperLink runat="server" ID="hlExport" Target="_blank" CssClass="btn btn-success btn-block">EXPORT</asp:HyperLink>
</div>
<div class="col"></div>
</div>
<div class="col">
<asp:TextBox runat="server" ID="txtFrom" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtFrom_TextChanged"></asp:TextBox>
</div>
<div class="col">
<asp:TextBox runat="server" ID="txtTo" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtTo_TextChanged"></asp:TextBox>
</div>
</div>
+50 -48
View File
@@ -3,59 +3,61 @@ using System.Web.UI;
namespace C_TRACK.WebUserControls
{
public partial class mod_periodo : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_periodo : BaseUserControl
{
if (!Page.IsPostBack)
{
dataFrom = DateTime.Today.AddMonths(-1);
dataTo = DateTime.Today.AddDays(1);
updateUrl();
}
}
#region Public Properties
protected DateTime dataFrom
{
get
{
DateTime answ = DateTime.Today;
DateTime.TryParse(txtFrom.Text.Trim(), out answ);
return answ;
}
set
{
txtFrom.Text = value.ToString("yyyy-MM-dd");
}
}
public DateTime dataFrom
{
get
{
DateTime answ = DateTime.Today;
DateTime.TryParse(txtFrom.Text.Trim(), out answ);
return answ;
}
set
{
txtFrom.Text = value.ToString("yyyy-MM-dd");
}
}
protected DateTime dataTo
{
get
{
DateTime answ = DateTime.Today;
DateTime.TryParse(txtTo.Text.Trim(), out answ);
return answ;
}
set
{
txtTo.Text = value.ToString("yyyy-MM-dd");
}
}
public DateTime dataTo
{
get
{
DateTime answ = DateTime.Today;
DateTime.TryParse(txtTo.Text.Trim(), out answ);
return answ;
}
set
{
txtTo.Text = value.ToString("yyyy-MM-dd");
}
}
protected void txtFrom_TextChanged(object sender, EventArgs e)
{
updateUrl();
}
#endregion Public Properties
protected void txtTo_TextChanged(object sender, EventArgs e)
{
updateUrl();
}
#region Protected Methods
private void updateUrl()
{
hlExport.NavigateUrl = string.Format("~/doExport?from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", dataFrom, dataTo);
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
dataFrom = DateTime.Today.AddMonths(-1);
dataTo = DateTime.Today.AddDays(1);
}
}
protected void txtFrom_TextChanged(object sender, EventArgs e)
{
raiseEvent();
}
protected void txtTo_TextChanged(object sender, EventArgs e)
{
raiseEvent();
}
#endregion Protected Methods
}
}
}
+8 -15
View File
@@ -7,11 +7,13 @@
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace C_TRACK.WebUserControls {
public partial class mod_periodo {
namespace C_TRACK.WebUserControls
{
public partial class mod_periodo
{
/// <summary>
/// Controllo txtFrom.
/// </summary>
@@ -20,7 +22,7 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFrom;
/// <summary>
/// Controllo txtTo.
/// </summary>
@@ -29,14 +31,5 @@ namespace C_TRACK.WebUserControls {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTo;
/// <summary>
/// Controllo hlExport.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hlExport;
}
}
+104 -104
View File
@@ -5,113 +5,113 @@ using System.Web.UI;
namespace C_TRACK.WebUserControls
{
public partial class mod_postazioni : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_postazioni : BaseUserControl
{
if (!Page.IsPostBack)
{
memLayer.ML.emptySessionVal("DescPost");
}
}
/// <summary>
/// selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo la postazione selezionata
string newCodPost = grView.SelectedValue.ToString();
mUtils.CodPost = newCodPost;
// vedo di recuperare dati postazione...
try
{
DS_App.AnagPostRow datiPost = dataLayer.man.taAP.getByKey(newCodPost)[0];
// salvo!
mUtils.postIsMulti = datiPost.IsMultiOpr;
}
catch
{ }
string nextPage = "";
if (memLayer.ML.StringSessionObj("nextObjCommand") == "setOpr")
{
// salvo su DB...
dataLayer.man.taAP.setOpr(mUtils.CodPost, mUtils.CodOpr);
// set rimando a BCode con settato Postazione
nextPage = "~/barcode";
}
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "freePost")
{
// salvo su DB...
dataLayer.man.taAP.setOpr(mUtils.CodPost, "");
mUtils.CodPost = "";
// set rimando a postazioni
nextPage = "~/postazioni";
}
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "selPost")
{
// set rimando a BCode con settato Postazione
nextPage = "~/barcode";
}
memLayer.ML.setSessionVal("nextObjCommand", "");
// reload pagina!
Response.Redirect(nextPage);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
memLayer.ML.emptySessionVal("DescPost");
}
}
/// <summary>
/// selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo la postazione selezionata
string newCodPost = grView.SelectedValue.ToString();
mUtils.CodPost = newCodPost;
// vedo di recuperare dati postazione...
try
{
DS_App.AnagPostRow datiPost = DLMan.taAP.getByKey(newCodPost)[0];
// salvo!
mUtils.postIsMulti = datiPost.IsMultiOpr;
}
catch
{ }
string nextPage = "";
if (memLayer.ML.StringSessionObj("nextObjCommand") == "setOpr")
{
// salvo su DB...
DLMan.taAP.setOpr(mUtils.CodPost, mUtils.CodOpr);
// set rimando a BCode con settato Postazione
nextPage = "~/barcode";
}
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "freePost")
{
// salvo su DB...
DLMan.taAP.setOpr(mUtils.CodPost, "");
mUtils.CodPost = "";
// set rimando a postazioni
nextPage = "~/postazioni";
}
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "selPost")
{
// set rimando a BCode con settato Postazione
nextPage = "~/barcode";
}
memLayer.ML.setSessionVal("nextObjCommand", "");
// reload pagina!
Response.Redirect(nextPage);
}
/// <summary>
/// salvo in session che il prox comando è liberare postazione...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtFreePost_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", "freePost");
}
/// <summary>
/// salvo in session che il prox comando è impostare operatore...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSetOpr_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", "setOpr");
}
/// <summary>
/// salvo in session che il prox comando è impostare postazione...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelPost_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", "selPost");
}
/// <summary>
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
/// - è un user "power"
/// - è LUI STESSO l'utente da levare
/// </summary>
public bool canUnlock(string thisCodOpr)
{
bool hasLock = thisCodOpr != "";
bool isAdmin = devicesAuthProxy.stObj.userHasRight("CT_admin");
bool isStart = devicesAuthProxy.stObj.userHasRight("CT_userStart");
bool isPower = devicesAuthProxy.stObj.userHasRight("CT_powerUser");
bool isHimself = (mUtils.CodOpr == thisCodOpr);
return hasLock && (isPower || isAdmin || isStart || isHimself);
}
/// <summary>
/// salvo in session che il prox comando è liberare postazione...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtFreePost_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", "freePost");
}
/// <summary>
/// salvo in session che il prox comando è impostare operatore...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSetOpr_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", "setOpr");
}
/// <summary>
/// salvo in session che il prox comando è impostare postazione...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtSelPost_Click(object sender, EventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", "selPost");
}
/// <summary>
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
/// - è un user "power"
/// - è LUI STESSO l'utente da levare
/// </summary>
public bool canUnlock(string thisCodOpr)
{
bool hasLock = thisCodOpr != "";
bool isAdmin = devicesAuthProxy.stObj.userHasRight("CT_admin");
bool isStart = devicesAuthProxy.stObj.userHasRight("CT_userStart");
bool isPower = devicesAuthProxy.stObj.userHasRight("CT_powerUser");
bool isHimself = (mUtils.CodOpr == thisCodOpr);
return hasLock && (isPower || isAdmin || isStart || isHimself);
}
/// <summary>
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
/// - è un user "power"
/// - è LUI STESSO l'utente da levare
/// </summary>
public bool canSelPost(string thisCodOpr)
{
bool hasLock = thisCodOpr != "";
bool isHimself = (mUtils.CodOpr == thisCodOpr);
return hasLock && isHimself;
/// <summary>
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
/// - è un user "power"
/// - è LUI STESSO l'utente da levare
/// </summary>
public bool canSelPost(string thisCodOpr)
{
bool hasLock = thisCodOpr != "";
bool isHimself = (mUtils.CodOpr == thisCodOpr);
return hasLock && isHimself;
}
}
}
}
+92 -77
View File
@@ -1,91 +1,106 @@
using AppData;
using SteamWare;
using SteamWare;
using System;
namespace C_TRACK.WebUserControls
{
public partial class mod_selTask : System.Web.UI.UserControl
{
/// <summary>
/// evento selezione dati
/// </summary>
public event EventHandler eh_dataSel;
protected void Page_Load(object sender, EventArgs e)
public partial class mod_selTask : BaseUserControl
{
#region Public Events
}
/// <summary>
/// evento selezione dati
/// </summary>
public event EventHandler eh_dataSel;
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// selezionata una richiesta
int idxProm = 0;
int.TryParse(grView.SelectedValue.ToString(), out idxProm);
if (idxProm > 0)
{
// --> ho IdxPromessa --> recupero KeyRichiesta = CurrNumTask
var tab = dataLayer.man.taPODL.getByKey(idxProm);
string _numTask = "";
if (tab.Rows.Count > 0)
#endregion Public Events
#region Public Properties
/// <summary>
/// Codice ART corrente
/// </summary>
public string CurrCodArt
{
// recupero NumTask
_numTask = tab[0].KeyRichiesta;
if (_numTask != "")
{
// verifica preliminare se vada creato Task...
checkTask(idxProm);
// salvo commessa
CurrNumTask = _numTask;
// salvo articolo...
CurrCodArt = tab[0].CodArticolo;
// segnalo update
if (eh_dataSel != null)
get
{
eh_dataSel(this, new EventArgs());
return memLayer.ML.StringSessionObj("CurrCodArt");
}
set
{
memLayer.ML.setSessionVal("CurrCodArt", value);
}
}
}
}
}
/// <summary>
/// Verifica se il task vada importato
/// </summary>
/// <param name="idxPromessa"></param>
private void checkTask(int idxPromessa)
{
dataLayer.man.taTL.ImportNew(idxPromessa);
}
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
set
{
memLayer.ML.setSessionVal("CurrNumTask", value);
// salvo anche come btn pressed...
memLayer.ML.setSessionVal("btnCmdPress", value);
}
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
set
{
memLayer.ML.setSessionVal("CurrNumTask", value);
// salvo anche come btn pressed...
memLayer.ML.setSessionVal("btnCmdPress", value);
}
}
#endregion Public Properties
#region Private Methods
/// <summary>
/// Verifica se il task vada importato
/// </summary>
/// <param name="idxPromessa"></param>
private void checkTask(int idxPromessa)
{
DLMan.taTL.ImportNew(idxPromessa);
}
#endregion Private Methods
#region Protected Methods
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// selezionata una richiesta
int idxProm = 0;
int.TryParse(grView.SelectedValue.ToString(), out idxProm);
if (idxProm > 0)
{
// --> ho IdxPromessa --> recupero KeyRichiesta = CurrNumTask
var tab = DLMan.taPODL.getByKey(idxProm);
string _numTask = "";
if (tab.Rows.Count > 0)
{
// recupero NumTask
_numTask = tab[0].KeyRichiesta;
if (_numTask != "")
{
// verifica preliminare se vada creato Task...
checkTask(idxProm);
// salvo commessa
CurrNumTask = _numTask;
// salvo articolo...
CurrCodArt = tab[0].CodArticolo;
// segnalo update
if (eh_dataSel != null)
{
eh_dataSel(this, new EventArgs());
}
}
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
#endregion Protected Methods
}
/// <summary>
/// Codice ART corrente
/// </summary>
public string CurrCodArt
{
get
{
return memLayer.ML.StringSessionObj("CurrCodArt");
}
set
{
memLayer.ML.setSessionVal("CurrCodArt", value);
}
}
}
}
+132 -126
View File
@@ -7,142 +7,148 @@ using System.Web.UI.WebControls;
namespace C_TRACK.WebUserControls
{
public partial class mod_task2post : System.Web.UI.UserControl
{
/// <summary>
/// evento aggiunta record
/// </summary>
public event EventHandler eh_reqUpdate;
protected void Page_Load(object sender, EventArgs e)
public partial class mod_task2post : BaseUserControl
{
if (!Page.IsPostBack)
{
if (mUtils.postIsMulti)
/// <summary>
/// evento aggiunta record
/// </summary>
public event EventHandler eh_reqUpdate;
protected void Page_Load(object sender, EventArgs e)
{
doUpdate();
if (!Page.IsPostBack)
{
if (mUtils.postIsMulti)
{
doUpdate();
}
}
}
public void doUpdate()
{
try
{
grView.DataBind();
}
catch
{
logger.lg.scriviLog($"Eccezione in render gridView: CodPost = {memLayer.ML.StringSessionObj("CodPost")}");
}
}
/// <summary>
/// Stato TASK da mostrare
/// </summary>
public bool taskIsActive
{
get
{
bool answ = false;
bool.TryParse(hfIsActive.Value, out answ);
return answ;
}
set
{
hfIsActive.Value = value.ToString();
}
}
/// <summary>
/// Verifica se lo stato sia ATTIVO
/// </summary>
/// <param name="_IsActive"></param>
/// <returns></returns>
public bool checkActive(object _IsActive)
{
bool answ = false;
bool.TryParse(_IsActive.ToString(), out answ);
return answ;
}
/// <summary>
/// CodPost selezionato in sessione
/// </summary>
protected string codPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
}
}
public void doUpdate()
{
grView.DataBind();
}
/// <summary>
/// Stato TASK da mostrare
/// </summary>
public bool taskIsActive
{
get
{
bool answ = false;
bool.TryParse(hfIsActive.Value, out answ);
return answ;
}
set
{
hfIsActive.Value = value.ToString();
}
}
/// <summary>
/// Verifica se lo stato sia ATTIVO
/// </summary>
/// <param name="_IsActive"></param>
/// <returns></returns>
public bool checkActive(object _IsActive)
{
bool answ = false;
bool.TryParse(_IsActive.ToString(), out answ);
return answ;
}
/// <summary>
/// CodPost selezionato in sessione
/// </summary>
protected string codPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
string numTask = grView.SelectedValue.ToString();
// chiamo toggle status, segnalo update!
DLMan.taTL2Post.ToggleActive(codPost, numTask);
reportUpdate();
}
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
string numTask = grView.SelectedValue.ToString();
// chiamo toggle status, segnalo update!
dataLayer.man.taTL2Post.ToggleActive(codPost, numTask);
reportUpdate();
}
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
reportUpdate();
}
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
reportUpdate();
}
private void reportUpdate()
{
// invoco update...
if (eh_reqUpdate != null)
{
eh_reqUpdate(this, new EventArgs());
}
}
private void reportUpdate()
{
// invoco update...
if (eh_reqUpdate != null)
{
eh_reqUpdate(this, new EventArgs());
}
}
/// <summary>
/// Input da processare (tipo codOperatore...)...
/// </summary>
public string newInput
{
set
{
processInput(value);
}
}
/// <summary>
/// Input da processare (tipo codOperatore...)...
/// </summary>
public string newInput
{
set
{
processInput(value);
}
}
/// <summary>
/// Cod OPERATORE corrente
/// </summary>
public string NumTask
{
get
{
return memLayer.ML.StringSessionObj("currNumTaskMulti");
}
set
{
memLayer.ML.setSessionVal("currNumTaskMulti", value);
}
}
/// <summary>
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
/// </summary>
/// <param name="value"></param>
private void processInput(string value)
{
// verifico se sia un operatore...
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
/// <summary>
/// Cod OPERATORE corrente
/// </summary>
public string NumTask
{
get
{
return memLayer.ML.StringSessionObj("currNumTaskMulti");
}
set
{
memLayer.ML.setSessionVal("currNumTaskMulti", value);
}
}
/// <summary>
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
/// </summary>
/// <param name="value"></param>
private void processInput(string value)
{
// verifico se sia un operatore...
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
if (testNumTask.Success)
{
NumTask = value;
string codTag = mUtils.optValueBC != "" ? mUtils.optValueBC : "";
DLMan.taTL2Post.InsertQuery(codPost, NumTask, codTag);
reportUpdate();
}
doUpdate();
}
if (testNumTask.Success)
{
NumTask = value;
string codTag = mUtils.optValueBC != "" ? mUtils.optValueBC : "";
dataLayer.man.taTL2Post.InsertQuery(codPost, NumTask, codTag);
reportUpdate();
}
doUpdate();
}
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
reportUpdate();
}
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
reportUpdate();
public bool showTag
{
get
{
return memLayer.ML.CRB("OptUseSelTag");
}
}
}
public bool showTag
{
get
{
return memLayer.ML.CRB("OptUseSelTag");
}
}
}
}
+83 -82
View File
@@ -3,90 +3,91 @@
<%@ Register Src="~/WebUserControls/mod_fasiAttive.ascx" TagPrefix="uc1" TagName="mod_fasiAttive" %>
<div class="row text-uppercase mb-2">
<div class="col">
<asp:LinkButton runat="server" ID="lbCaricati" CssClass="btn btn-sm btn-success btn-block" OnClick="lbCaricati_Click" AccessKey="1">[1] Caricate</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbInCorso" CssClass="btn btn-sm btn-warning btn-block" OnClick="lbInCorso_Click" AccessKey="2">[2] In Corso</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbConclusi" CssClass="btn btn-sm btn-secondary btn-block" OnClick="lbConclusi_Click" AccessKey="3">[3] Concluse</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbTutti" CssClass="btn btn-sm btn-dark btn-block" OnClick="lbTutti_Click" AccessKey="0">[0] Tutte Comm</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbFasiAttive" CssClass="btn btn-sm btn-outline-primary btn-block" AccessKey="4" OnClick="lbFasiAttive_Click">[4] Fasi Attive</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbCaricati" CssClass="btn btn-sm btn-success btn-block" OnClick="lbCaricati_Click" AccessKey="1">[1] Caricate</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbInCorso" CssClass="btn btn-sm btn-warning btn-block" OnClick="lbInCorso_Click" AccessKey="2">[2] In Corso</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbConclusi" CssClass="btn btn-sm btn-secondary btn-block" OnClick="lbConclusi_Click" AccessKey="3">[3] Concluse</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbTutti" CssClass="btn btn-sm btn-dark btn-block" OnClick="lbTutti_Click" AccessKey="0">[0] Tutte Comm</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbFasiAttive" CssClass="btn btn-sm btn-outline-primary btn-block" AccessKey="4" OnClick="lbFasiAttive_Click">[4] Fasi Attive</asp:LinkButton>
</div>
</div>
<div class="row">
<div class="col-12">
<uc1:mod_fasiAttive runat="server" ID="mod_fasiAttive" Visible="false" />
<uc1:mod_taskRec runat="server" ID="mod_taskRec" tipoSelezione="byTask" />
<i>NB: tempi espressi in minuti.centesimi</i>
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="NumTask" DataSourceID="ods" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-info" />
<EmptyDataTemplate>
Nessun Risultato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ItemStyle-Width="2em">
<HeaderTemplate>
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true"><i class="fas fa-sync-alt"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info"><i class="fas fa-search"></i></asp:LinkButton>
</ItemTemplate>
<div class="col-12">
<uc1:mod_fasiAttive runat="server" ID="mod_fasiAttive" Visible="false" />
<uc1:mod_taskRec runat="server" ID="mod_taskRec" tipoSelezione="byTask" />
<i>NB: tempi espressi in minuti.centesimi</i>
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="NumTask" DataSourceID="ods" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-info" />
<EmptyDataTemplate>
Nessun Risultato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ItemStyle-Width="2em">
<HeaderTemplate>
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true"><i class="fas fa-sync-alt"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info"><i class="fas fa-search"></i></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="2em"></ItemStyle>
</asp:TemplateField>
<asp:BoundField DataField="NumTask" HeaderText="Commessa" ReadOnly="True" SortExpression="NumTask" />
<asp:BoundField DataField="CodGruppo" HeaderText="Gruppo" SortExpression="CodGruppo" />
<asp:BoundField DataField="CodArt" HeaderText="Articolo" SortExpression="CodArt" />
<asp:BoundField DataField="QtaRic" HeaderText="Qta Ord" SortExpression="QtaRic" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="QtaEv" HeaderText="Qta Ev" SortExpression="QtaEv" ItemStyle-HorizontalAlign="Center" ItemStyle-CssClass="text-success" />
<asp:BoundField DataField="MinTotWrk" HeaderText="Tot Lav." SortExpression="MinTotWrk" DataFormatString="{0:N3}" />
<asp:BoundField DataField="TCMedio" HeaderText="T.Ciclo" SortExpression="TCMedio" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="MinTotFix" HeaderText="Tot Rip." SortExpression="MinTotFix" DataFormatString="{0:N3}"/>
<asp:BoundField DataField="DataIns" HeaderText="Inserita" SortExpression="DataIns" />
<asp:TemplateField HeaderText="St" SortExpression="CurrStatus" ItemStyle-Width="4em">
<ItemTemplate>
<div class="text-center">
<b>
<asp:Label ID="Label1" runat="server" Font-Size="1.3em" Text='<%# Eval("CurrStatus") %>' /></b><br />
<asp:Label ID="Label2" runat="server" Text='<%# tradStatus(Eval("CurrStatus")) %>' />
</div>
</ItemTemplate>
<ItemStyle Width="2em"></ItemStyle>
</asp:TemplateField>
<asp:BoundField DataField="NumTask" HeaderText="Commessa" ReadOnly="True" SortExpression="NumTask" />
<asp:BoundField DataField="CodGruppo" HeaderText="Gruppo" SortExpression="CodGruppo" />
<asp:BoundField DataField="CodArt" HeaderText="Articolo" SortExpression="CodArt" />
<asp:BoundField DataField="QtaRic" HeaderText="Qta Ord" SortExpression="QtaRic" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="QtaEv" HeaderText="Qta Ev" SortExpression="QtaEv" ItemStyle-HorizontalAlign="Center" ItemStyle-CssClass="text-success" />
<asp:BoundField DataField="MinTotWrk" HeaderText="Tot Lav." SortExpression="MinTotWrk" DataFormatString="{0:N3}" />
<asp:BoundField DataField="TCMedio" HeaderText="T.Ciclo" SortExpression="TCMedio" DataFormatString="{0:N2}" />
<asp:BoundField DataField="MinTotFix" HeaderText="Tot Rip." SortExpression="MinTotFix" DataFormatString="{0:N3}" />
<asp:BoundField DataField="TimeEst" HeaderText="T.Prev" SortExpression="TimeEst" DataFormatString="{0:N3}" />
<asp:BoundField DataField="DataIns" HeaderText="Inserita" SortExpression="DataIns" />
<asp:TemplateField HeaderText="St" SortExpression="CurrStatus" ItemStyle-Width="4em">
<ItemTemplate>
<div class="text-center">
<b>
<asp:Label ID="Label1" runat="server" Font-Size="1.3em" Text='<%# Eval("CurrStatus") %>' /></b><br />
<asp:Label ID="Label2" runat="server" Text='<%# tradStatus(Eval("CurrStatus")) %>' />
</div>
</ItemTemplate>
<ItemStyle Width="4em"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-Width="2em">
<ItemTemplate>
<div class="row">
<div class="col text-right">
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm btn-danger" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# Eval("NumRec").ToString()=="0" %>'><i class="fas fa-trash"></i></asp:LinkButton>
<asp:LinkButton ID="lbtReopen" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="reopenTask" CssClass="btn btn-block btn-warning" Visible='<%# Convert.ToBoolean(Eval("Concluso")) %>' ToolTip="Riapertura Commessa" OnClick="lbtReopen_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaReopenTask") %>'><i class="fas fa-angle-double-up"></i></asp:LinkButton>
</div>
</div>
</ItemTemplate>
<ItemStyle Width="4em"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-Width="2em">
<ItemTemplate>
<div class="row">
<div class="col text-right">
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm btn-danger" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# Eval("NumRec").ToString()=="0" %>'><i class="fas fa-trash"></i></asp:LinkButton>
<asp:LinkButton ID="lbtReopen" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="reopenTask" CssClass="btn btn-block btn-warning" Visible='<%# Convert.ToBoolean(Eval("Concluso")) %>' ToolTip="Riapertura Commessa" OnClick="lbtReopen_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaReopenTask") %>'><i class="fas fa-angle-double-up"></i></asp:LinkButton>
</div>
</div>
</ItemTemplate>
<ItemStyle Width="2em"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField runat="server" ID="hfCurrStatus" />
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByFilt" TypeName="AppData.DS_AppTableAdapters.TaskListTableAdapter" DeleteMethod="deleteQuery" OnDeleted="ods_Deleted">
<DeleteParameters>
<asp:Parameter Name="Original_NumTask" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="hfCurrStatus" DefaultValue="0" Name="CurrStatus" PropertyName="Value" Type="Int32" />
<asp:SessionParameter Name="CodArt" SessionField="currCodArt" Type="String" />
<asp:SessionParameter Name="NumTask" SessionField="currNumTask" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
<ItemStyle Width="2em"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField runat="server" ID="hfCurrStatus" />
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByFilt" TypeName="AppData.DS_AppTableAdapters.TaskListTableAdapter" DeleteMethod="deleteQuery" OnDeleted="ods_Deleted">
<DeleteParameters>
<asp:Parameter Name="Original_NumTask" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="hfCurrStatus" DefaultValue="0" Name="CurrStatus" PropertyName="Value" Type="Int32" />
<asp:SessionParameter Name="CodArt" SessionField="currCodArt" Type="String" />
<asp:SessionParameter Name="NumTask" SessionField="currNumTask" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</div>
+2 -2
View File
@@ -5,7 +5,7 @@ using System.Web.UI;
namespace C_TRACK.WebUserControls
{
public partial class mod_taskList : System.Web.UI.UserControl
public partial class mod_taskList : BaseUserControl
{
/// <summary>
/// Gestione load pagina
@@ -153,7 +153,7 @@ namespace C_TRACK.WebUserControls
if (memLayer.ML.StringSessionObj("nextObjCommand") == "reopenTask")
{
// salvo su DB...
dataLayer.man.taTL.updateClose(NumTask, false);
DLMan.taTL.updateClose(NumTask, false);
// tolgo comando reopen...
memLayer.ML.emptySessionVal("nextObjCommand");
// set rimando a BCode con settato Postazione
+676 -671
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -8,12 +8,12 @@ using System.Web.UI.WebControls;
namespace C_TRACK
{
public partial class closeAllRec : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
public partial class closeAllRec : BasePage
{
// chiama la procedura che chiude tutte la fasi rimaste attive...
dataLayer.man.taTR.closePending();
protected void Page_Load(object sender, EventArgs e)
{
// chiama la procedura che chiude tutte la fasi rimaste attive...
DLMan.taTR.closePending();
}
}
}
}
+117 -69
View File
@@ -5,84 +5,132 @@ using System.Text;
namespace C_TRACK
{
public partial class doExport : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
public partial class doExport : BasePage
{
string delimiter = ",";
#region Protected Properties
//prepare the output stream
Response.Clear();
Response.ContentType = "text/csv";
Response.AppendHeader("Content-Disposition", "attachment; filename=ctrack_report.csv");
string value = "";
StringBuilder builder = new StringBuilder();
// recupero oggetti parametrici...
string from = Request.QueryString["from"];
string to = Request.QueryString["to"];
DateTime dateFrom = DateTime.Today.AddYears(-1);
DateTime dateTo = DateTime.Today.AddDays(1);
// se è diverso da vuoto faccio parse...
if (from != "" && from !=null)
{
DateTime.TryParse(from, out dateFrom);
}
if (to != "" && to != null)
{
DateTime.TryParse(to, out dateTo);
}
// leggo tabella
var dt = dataLayer.man.taTR.getByFilt("", dateFrom, dateTo);
//write the csv column headers
for (int i = 0; i < dt.Columns.Count; i++)
{
value = dt.Columns[i].ColumnName;
// Implement special handling for values that contain comma or quote
// Enclose in quotes and double up any double quotes
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
else
protected DateTime dateFrom
{
builder.Append(value);
get
{
DateTime answ = DateTime.Today.AddYears(-1);
// se è diverso da vuoto faccio parse...
if (!string.IsNullOrEmpty(from))
{
DateTime.TryParse(from, out answ);
}
return answ;
}
}
Response.Write(value);
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
builder.Clear();
}
//write the data
foreach (DataRow row in dt.Rows)
{
for (int i = 0; i < dt.Columns.Count; i++)
protected DateTime dateTo
{
value = row[i].ToString();
// Implement special handling for values that contain comma or quote
// Enclose in quotes and double up any double quotes
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
else
{
builder.Append(value);
}
Response.Write(builder.ToString());
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
builder.Clear();
get
{
DateTime answ = DateTime.Today.AddDays(1);
// se è diverso da vuoto faccio parse...
if (!string.IsNullOrEmpty(to))
{
DateTime.TryParse(to, out answ);
}
return answ;
}
}
}
Response.End();
protected string from
{
get
{
return Request.QueryString["from"];
}
}
protected string mode
{
get
{
return Request.QueryString["mode"];
}
}
protected string to
{
get
{
return Request.QueryString["to"];
}
}
#endregion Protected Properties
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
string delimiter = ",";
//prepare the output stream
Response.Clear();
Response.ContentType = "text/csv";
Response.AppendHeader("Content-Disposition", "attachment; filename=ctrack_report.csv");
string value = "";
StringBuilder builder = new StringBuilder();
DataTable dt = new DataTable();
// leggo tabella secondo il MODO
if (mode == "aggr")
{
dt = (DataTable)DLMan.taTRA.getByFilt("", dateFrom, dateTo);
}
else
{
dt = (DataTable)DLMan.taTR.getByFilt("", dateFrom, dateTo);
}
// write the csv column headers
for (int i = 0; i < dt.Columns.Count; i++)
{
value = dt.Columns[i].ColumnName;
// Implement special handling for values that contain comma or quote
// Enclose in quotes and double up any double quotes
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
else
{
builder.Append(value);
}
Response.Write(value);
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
builder.Clear();
}
//write the data
foreach (DataRow row in dt.Rows)
{
for (int i = 0; i < dt.Columns.Count; i++)
{
value = row[i].ToString();
// Implement special handling for values that contain comma or quote
// Enclose in quotes and double up any double quotes
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
else
{
builder.Append(value);
}
Response.Write(builder.ToString());
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
builder.Clear();
}
}
Response.End();
}
#endregion Protected Methods
}
}
}
+19 -10
View File
@@ -3,17 +3,26 @@
<%@ Register Src="~/WebUserControls/mod_checkOpr.ascx" TagPrefix="uc1" TagName="mod_checkOpr" %>
<%@ Register Src="~/WebUserControls/mod_periodo.ascx" TagPrefix="uc1" TagName="mod_periodo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
<div class="card">
<div class="card-header text-center text-primary text-uppercase py-1">
<b>Gestione Commesse</b>
<div class="card">
<div class="card-header text-center text-primary text-uppercase py-1">
<b>Gestione Commesse</b>
</div>
<div class="card-body p-1">
<uc1:mod_checkOpr runat="server" ID="mod_checkOpr" />
<div class="row my-2">
<div class="col-6">
<uc1:mod_periodo runat="server" ID="mod_periodo" />
</div>
<div class="col-3">
<asp:HyperLink runat="server" ID="hlExportFull" Target="_blank" CssClass="btn btn-success text-light btn-block"><i class="fas fa-download"></i> Export FULL</asp:HyperLink>
</div>
<div class="col-3">
<asp:HyperLink runat="server" ID="hlExportComp" Target="_blank" CssClass="btn btn-success text-light btn-block"><i class="fas fa-download"></i> Export Compatto</asp:HyperLink>
</div>
</div>
</div>
</div>
<div class="card-body p-1">
<uc1:mod_checkOpr runat="server" ID="mod_checkOpr" />
<uc1:mod_periodo runat="server" id="mod_periodo" />
</div>
</div>
</asp:Content>
</asp:Content>
+23 -4
View File
@@ -7,11 +7,30 @@ using System.Web.UI.WebControls;
namespace C_TRACK
{
public partial class export : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
public partial class export : System.Web.UI.Page
{
#region Private Methods
private void mod_periodo_eh_doRefresh(object sender, EventArgs e)
{
updateUrl();
}
private void updateUrl()
{
hlExportFull.NavigateUrl = string.Format("~/doExport?mode=full&from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", mod_periodo.dataFrom, mod_periodo.dataTo);
hlExportComp.NavigateUrl = string.Format("~/doExport?mode=aggr&from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", mod_periodo.dataFrom, mod_periodo.dataTo);
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
mod_periodo.eh_doRefresh += mod_periodo_eh_doRefresh;
}
#endregion Protected Methods
}
}
}
+26 -6
View File
@@ -7,11 +7,13 @@
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace C_TRACK {
public partial class export {
namespace C_TRACK
{
public partial class export
{
/// <summary>
/// Controllo mod_checkOpr.
/// </summary>
@@ -20,7 +22,7 @@ namespace C_TRACK {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::C_TRACK.WebUserControls.mod_checkOpr mod_checkOpr;
/// <summary>
/// Controllo mod_periodo.
/// </summary>
@@ -29,5 +31,23 @@ namespace C_TRACK {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::C_TRACK.WebUserControls.mod_periodo mod_periodo;
/// <summary>
/// Controllo hlExportFull.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hlExportFull;
/// <summary>
/// Controllo hlExportComp.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hlExportComp;
}
}
Vendored
+4 -4
View File
@@ -5,7 +5,7 @@ pipeline {
EMAIL_RECIPIENTS = 'samuele@steamware.net'
enableIIS01 = 'Y'
enableIIS02 = 'Y'
enableOVH = 'Y'
enableOVH = 'N'
}
stages {
stage('Checkout') {
@@ -13,9 +13,9 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=223']) {
// env.versionNumber = VersionNumber(versionNumberString : '1.4.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '1.4.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
withEnv(['NEXT_BUILD_NUMBER=229']) {
// env.versionNumber = VersionNumber(versionNumberString : '1.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '1.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILD_DATE_FORMATTED,"ddHH"}', projectStartDate : '2018-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'C.TRACK'
}
}
-15
View File
@@ -1,15 +0,0 @@
A new HTTP handler has been configured in your application for consulting the
error log and its feeds. It is reachable at elmah.axd under your application
root. If, for example, your application is deployed at http://www.example.com,
the URL for ELMAH would be http://www.example.com/elmah.axd. You can, of
course, change this path in your application's configuration file.
ELMAH is also set up to be secure such that it can only be accessed locally.
You can enable remote access but then it is paramount that you secure access
to authorized users or/and roles only. This can be done using standard
authorization rules and configuration already built into ASP.NET. For more
information, see http://code.google.com/p/elmah/wiki/SecuringErrorLogPages on
the project site.
Please review the commented out authorization section under
<location path="elmah.axd"> and make the appropriate changes.
-12
View File
@@ -1,12 +0,0 @@
---------------------------------------------------------------
------- SteamWareLib SDK -------
---------------------------------------------------------------
Libreria di utility base di SteamWare.
Le dipendenze inserite sono necessarie al funzionamento dell'SDK.
Sono inclusi a titolo di esempio vari files di conf:
* example-NLog.config
Attenzione a configurare correttamente il file NLog.xml includendo il rule per la classe, vedere ad esempio il file example-NLog.config allegato.
@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log" >
<!-- optional, add some variabeles
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets async="true">
<target xsi:type="File"
name="SteamWareLib"
fileName="${basedir}/logs/${shortdate}-SteamWare.log"
layout="${longdate} ${uppercase:${level}} ${message}"
/>
</targets>
<rules>
<logger name="SteamWare.*" minlevel="Debug" writeTo="SteamWareLib" />
</rules>
</nlog>
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="SteamWare.Properties.Settings.loggerConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=Flamma_SC;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.SteamWare_VocabolarioConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=SteamWare_Vocabolario;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.DS_AuthConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=SteamWare_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.AnagraficaBremboConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=AnagraficaBrembo;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.SteamWare_BremboConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=SteamWare_Brembo;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.Flamma_AnagraficaConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=Flamma_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.AnagraficaConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=SteamWare_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.SEL_fatture_SteamWareConnectionString" connectionString="Data Source=SQLSTEAM;Initial Catalog=SEL_fatture_SteamWare;User ID=sa;Password=keyhammer;Encrypt=False;TrustServerCertificate=True" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.Equa_AnagraficaConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=Equa_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.GMWConnectionString" connectionString="Data Source=SQL2012DEV;Initial Catalog=GMW;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.MoonProConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16" providerName="System.Data.SqlClient" />
<add name="SteamWare.Properties.Settings.DbConfConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer16" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
@@ -1,30 +0,0 @@
# chiave valore valoreStd note
_adminEmail samuele@steamware.net,info@steamware.net samuele@steamware.net,info@steamware.net info@steamware.net
_allowForceUser true true abilita login forzato
_commonPages menu menu pagina comune
_emailPwd drmfsls16 drmfsls16 drmfsls16
_emailUser steamwarebot@gmail.com steamwarebot@gmail.com steamwarebot@gmail.com
_enableSSL true true true
_fromEmail webmaster@admodelling.org webmaster@admodelling.org email mittente eventuali msg
_righeDataGrid 30 30 Num righe datagrid std
_righeDataGridAnagr 20 20 Num righe datagrid anagrafiche
_righeDataGridLong 30 30 Num righe datagrid long
_righeDataGridMed 15 15 Num righe datagrid med
_righeDataGridShort 10 10 Num righe datagrid short
_smtpCli smtp.gmail.com smtp.gmail.com smtp.gmail.com
_useAIMSmtp false false impiego client posta elettronica alternativo
_useAuthSmtp true true true
AuthCookieName admodellingAuth admodellingAuth Cookie applicativo
autoConfCmd true true Conferma automatica comandi barcode
baseUrl http://site_name http://iis02/site_name URL base del sito
cacheValSec 60 60 Validità cache dati in gestore Barcode
cookieDayExp 365 365 Periodo validità cookie
cookieUsed admodellingAuth admodellingAuth,CTrack_CodOpr,CTrack_CodPost Elenco dei cookie impiegati
enableCookie true true Abilitazione uso cookie
enableLogOut true false Abilita button logout COMPLETO in alto a sx
enablePlain true true Abilitazione decode plain
maxAuth 1000 1000 num auth minimo per NON consumare tokens
serializeSession true true Serializzazione valori in sessione (REDIS)
SiteName iis02/site_name iis02/site_name Nome sito
enableDumpDiag false false abilitazione dumb diagnostico x eccezioni di default
doShrinkFolder true true Imposta compressione area LOGS
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

-53
View File
@@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.UI;
namespace MP_MAG
{
public class BundleConfig
{
// Per altre informazioni sulla creazione di bundle, vedere https://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include(
"~/Scripts/WebForms/WebForms.js",
"~/Scripts/WebForms/WebUIValidation.js",
"~/Scripts/WebForms/MenuStandards.js",
"~/Scripts/WebForms/Focus.js",
"~/Scripts/WebForms/GridView.js",
"~/Scripts/WebForms/DetailsView.js",
"~/Scripts/WebForms/TreeView.js",
"~/Scripts/WebForms/WebParts.js"));
// L'ordine è molto importante per il funzionamento di questi file poiché hanno dipendenze esplicite
bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include(
"~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
// Utilizzare la versione di sviluppo di Modernizr per eseguire attività di sviluppo e formazione. Successivamente, quando si è
// pronti per passare alla produzione, usare lo strumento di compilazione disponibile all'indirizzo https://modernizr.com per selezionare solo i test necessari.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/fontawesome.css",
"~/Content/fonts.css",
"~/Content/site.css"));
// abilito bundle "forzato"!
BundleTable.EnableOptimizations = true;
}
}
}
-13
View File
@@ -1,13 +0,0 @@
using System.Web;
using System.Web.Mvc;
namespace MP_MAG
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
-29
View File
@@ -1,29 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Microsoft.AspNet.FriendlyUrls;
namespace MP_MAG
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
routes.EnableFriendlyUrls(settings);
// aggiungo route x gestione controller code stampa
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
-24
View File
@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace MP_MAG
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Servizi e configurazione dell'API Web
// Route dell'API Web
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}
@@ -1,39 +0,0 @@
using System;
using System.Text;
using System.Web;
using System.Web.Http.Description;
namespace MP_MAG.Areas.HelpPage
{
public static class ApiDescriptionExtensions
{
/// <summary>
/// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
/// </summary>
/// <param name="description">The <see cref="ApiDescription"/>.</param>
/// <returns>The ID as a string.</returns>
public static string GetFriendlyId(this ApiDescription description)
{
string path = description.RelativePath;
string[] urlParts = path.Split('?');
string localPath = urlParts[0];
string queryKeyString = null;
if (urlParts.Length > 1)
{
string query = urlParts[1];
string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
queryKeyString = String.Join("_", queryKeys);
}
StringBuilder friendlyPath = new StringBuilder();
friendlyPath.AppendFormat("{0}-{1}",
description.HttpMethod.Method,
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
if (queryKeyString != null)
{
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
}
return friendlyPath.ToString();
}
}
}
@@ -1,113 +0,0 @@
// Uncomment the following to provide samples for PageResult<T>. Must also add the Microsoft.AspNet.WebApi.OData
// package to your project.
////#define Handle_PageResultOfT
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http.Headers;
using System.Reflection;
using System.Web;
using System.Web.Http;
#if Handle_PageResultOfT
using System.Web.Http.OData;
#endif
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// Use this class to customize the Help Page.
/// For example you can set a custom <see cref="System.Web.Http.Description.IDocumentationProvider"/> to supply the documentation
/// or you can provide the samples for the requests/responses.
/// </summary>
public static class HelpPageConfig
{
[SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
MessageId = "MP_MAG.Areas.HelpPage.TextSample.#ctor(System.String)",
Justification = "End users may choose to merge this string with existing localized resources.")]
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",
MessageId = "bsonspec",
Justification = "Part of a URI.")]
public static void Register(HttpConfiguration config)
{
//// Uncomment the following to use the documentation from XML documentation file.
//config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
//// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type.
//// Also, the string arrays will be used for IEnumerable<string>. The sample objects will be serialized into different media type
//// formats by the available formatters.
//config.SetSampleObjects(new Dictionary<Type, object>
//{
// {typeof(string), "sample string"},
// {typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
//});
// Extend the following to provide factories for types not handled automatically (those lacking parameterless
// constructors) or for which you prefer to use non-default property values. Line below provides a fallback
// since automatic handling will fail and GeneratePageResult handles only a single type.
#if Handle_PageResultOfT
config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult);
#endif
// Extend the following to use a preset object directly as the sample for all actions that support a media
// type, regardless of the body parameter or return type. The lines below avoid display of binary content.
// The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object.
config.SetSampleForMediaType(
new TextSample("Binary JSON content. See http://bsonspec.org for details."),
new MediaTypeHeaderValue("application/bson"));
//// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format
//// and have IEnumerable<string> as the body parameter or return type.
//config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));
//// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values"
//// and action named "Put".
//config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");
//// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png"
//// on the controller named "Values" and action named "Get" with parameter "id".
//config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id");
//// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent<string>.
//// The sample will be generated as if the controller named "Values" and action named "Get" were having string as the body parameter.
//config.SetActualRequestType(typeof(string), "Values", "Get");
//// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent<string>.
//// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string.
//config.SetActualResponseType(typeof(string), "Values", "Post");
}
#if Handle_PageResultOfT
private static object GeneratePageResult(HelpPageSampleGenerator sampleGenerator, Type type)
{
if (type.IsGenericType)
{
Type openGenericType = type.GetGenericTypeDefinition();
if (openGenericType == typeof(PageResult<>))
{
// Get the T in PageResult<T>
Type[] typeParameters = type.GetGenericArguments();
Debug.Assert(typeParameters.Length == 1);
// Create an enumeration to pass as the first parameter to the PageResult<T> constuctor
Type itemsType = typeof(List<>).MakeGenericType(typeParameters);
object items = sampleGenerator.GetSampleObject(itemsType);
// Fill in the other information needed to invoke the PageResult<T> constuctor
Type[] parameterTypes = new Type[] { itemsType, typeof(Uri), typeof(long?), };
object[] parameters = new object[] { items, null, (long)ObjectGenerator.DefaultCollectionSize, };
// Call PageResult(IEnumerable<T> items, Uri nextPageLink, long? count) constructor
ConstructorInfo constructor = type.GetConstructor(parameterTypes);
return constructor.Invoke(parameters);
}
}
return null;
}
#endif
}
}
@@ -1,63 +0,0 @@
using System;
using System.Web.Http;
using System.Web.Mvc;
using MP_MAG.Areas.HelpPage.ModelDescriptions;
using MP_MAG.Areas.HelpPage.Models;
namespace MP_MAG.Areas.HelpPage.Controllers
{
/// <summary>
/// The controller that will handle requests for the help page.
/// </summary>
public class HelpController : Controller
{
private const string ErrorViewName = "Error";
public HelpController()
: this(GlobalConfiguration.Configuration)
{
}
public HelpController(HttpConfiguration config)
{
Configuration = config;
}
public HttpConfiguration Configuration { get; private set; }
public ActionResult Index()
{
ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
}
public ActionResult Api(string apiId)
{
if (!String.IsNullOrEmpty(apiId))
{
HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
if (apiModel != null)
{
return View(apiModel);
}
}
return View(ErrorViewName);
}
public ActionResult ResourceModel(string modelName)
{
if (!String.IsNullOrEmpty(modelName))
{
ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
ModelDescription modelDescription;
if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
{
return View(modelDescription);
}
}
return View(ErrorViewName);
}
}
}
-134
View File
@@ -1,134 +0,0 @@
.help-page h1,
.help-page .h1,
.help-page h2,
.help-page .h2,
.help-page h3,
.help-page .h3,
#body.help-page,
.help-page-table th,
.help-page-table pre,
.help-page-table p {
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
}
.help-page pre.wrapped {
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
}
.help-page .warning-message-container {
margin-top: 20px;
padding: 0 10px;
color: #525252;
background: #EFDCA9;
border: 1px solid #CCCCCC;
}
.help-page-table {
width: 100%;
border-collapse: collapse;
text-align: left;
margin: 0px 0px 20px 0px;
border-top: 1px solid #D4D4D4;
}
.help-page-table th {
text-align: left;
font-weight: bold;
border-bottom: 1px solid #D4D4D4;
padding: 5px 6px 5px 6px;
}
.help-page-table td {
border-bottom: 1px solid #D4D4D4;
padding: 10px 8px 10px 8px;
vertical-align: top;
}
.help-page-table pre,
.help-page-table p {
margin: 0px;
padding: 0px;
font-family: inherit;
font-size: 100%;
}
.help-page-table tbody tr:hover td {
background-color: #F3F3F3;
}
.help-page a:hover {
background-color: transparent;
}
.help-page .sample-header {
border: 2px solid #D4D4D4;
background: #00497E;
color: #FFFFFF;
padding: 8px 15px;
border-bottom: none;
display: inline-block;
margin: 10px 0px 0px 0px;
}
.help-page .sample-content {
display: block;
border-width: 0;
padding: 15px 20px;
background: #FFFFFF;
border: 2px solid #D4D4D4;
margin: 0px 0px 10px 0px;
}
.help-page .api-name {
width: 40%;
}
.help-page .api-documentation {
width: 60%;
}
.help-page .parameter-name {
width: 20%;
}
.help-page .parameter-documentation {
width: 40%;
}
.help-page .parameter-type {
width: 20%;
}
.help-page .parameter-annotations {
width: 20%;
}
.help-page h1,
.help-page .h1 {
font-size: 36px;
line-height: normal;
}
.help-page h2,
.help-page .h2 {
font-size: 24px;
}
.help-page h3,
.help-page .h3 {
font-size: 20px;
}
#body.help-page {
font-size: 14px;
line-height: 143%;
color: #333;
}
.help-page a {
color: #0000EE;
text-decoration: none;
}
@@ -1,26 +0,0 @@
using System.Web.Http;
using System.Web.Mvc;
namespace MP_MAG.Areas.HelpPage
{
public class HelpPageAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "HelpPage";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"HelpPage_Default",
"Help/{action}/{apiId}",
new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
HelpPageConfig.Register(GlobalConfiguration.Configuration);
}
}
}
@@ -1,467 +0,0 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using MP_MAG.Areas.HelpPage.ModelDescriptions;
using MP_MAG.Areas.HelpPage.Models;
namespace MP_MAG.Areas.HelpPage
{
public static class HelpPageConfigurationExtensions
{
private const string ApiModelPrefix = "MS_HelpPageApiModel_";
/// <summary>
/// Sets the documentation provider for help page.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="documentationProvider">The documentation provider.</param>
public static void SetDocumentationProvider(this HttpConfiguration config, IDocumentationProvider documentationProvider)
{
config.Services.Replace(typeof(IDocumentationProvider), documentationProvider);
}
/// <summary>
/// Sets the objects that will be used by the formatters to produce sample requests/responses.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sampleObjects">The sample objects.</param>
public static void SetSampleObjects(this HttpConfiguration config, IDictionary<Type, object> sampleObjects)
{
config.GetHelpPageSampleGenerator().SampleObjects = sampleObjects;
}
/// <summary>
/// Sets the sample request directly for the specified media type and action.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample request.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, new[] { "*" }), sample);
}
/// <summary>
/// Sets the sample request directly for the specified media type and action with parameters.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample request.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, parameterNames), sample);
}
/// <summary>
/// Sets the sample request directly for the specified media type of the action.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample response.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, new[] { "*" }), sample);
}
/// <summary>
/// Sets the sample response directly for the specified media type of the action with specific parameters.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample response.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, parameterNames), sample);
}
/// <summary>
/// Sets the sample directly for all actions with the specified media type.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample.</param>
/// <param name="mediaType">The media type.</param>
public static void SetSampleForMediaType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType), sample);
}
/// <summary>
/// Sets the sample directly for all actions with the specified type and media type.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="type">The parameter type or return type of an action.</param>
public static void SetSampleForType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, Type type)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, type), sample);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate request samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, new[] { "*" }), type);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate request samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, parameterNames), type);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate response samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, new[] { "*" }), type);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate response samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, parameterNames), type);
}
/// <summary>
/// Gets the help page sample generator.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <returns>The help page sample generator.</returns>
public static HelpPageSampleGenerator GetHelpPageSampleGenerator(this HttpConfiguration config)
{
return (HelpPageSampleGenerator)config.Properties.GetOrAdd(
typeof(HelpPageSampleGenerator),
k => new HelpPageSampleGenerator());
}
/// <summary>
/// Sets the help page sample generator.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sampleGenerator">The help page sample generator.</param>
public static void SetHelpPageSampleGenerator(this HttpConfiguration config, HelpPageSampleGenerator sampleGenerator)
{
config.Properties.AddOrUpdate(
typeof(HelpPageSampleGenerator),
k => sampleGenerator,
(k, o) => sampleGenerator);
}
/// <summary>
/// Gets the model description generator.
/// </summary>
/// <param name="config">The configuration.</param>
/// <returns>The <see cref="ModelDescriptionGenerator"/></returns>
public static ModelDescriptionGenerator GetModelDescriptionGenerator(this HttpConfiguration config)
{
return (ModelDescriptionGenerator)config.Properties.GetOrAdd(
typeof(ModelDescriptionGenerator),
k => InitializeModelDescriptionGenerator(config));
}
/// <summary>
/// Gets the model that represents an API displayed on the help page. The model is initialized on the first call and cached for subsequent calls.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="apiDescriptionId">The <see cref="ApiDescription"/> ID.</param>
/// <returns>
/// An <see cref="HelpPageApiModel"/>
/// </returns>
public static HelpPageApiModel GetHelpPageApiModel(this HttpConfiguration config, string apiDescriptionId)
{
object model;
string modelId = ApiModelPrefix + apiDescriptionId;
if (!config.Properties.TryGetValue(modelId, out model))
{
Collection<ApiDescription> apiDescriptions = config.Services.GetApiExplorer().ApiDescriptions;
ApiDescription apiDescription = apiDescriptions.FirstOrDefault(api => String.Equals(api.GetFriendlyId(), apiDescriptionId, StringComparison.OrdinalIgnoreCase));
if (apiDescription != null)
{
model = GenerateApiModel(apiDescription, config);
config.Properties.TryAdd(modelId, model);
}
}
return (HelpPageApiModel)model;
}
private static HelpPageApiModel GenerateApiModel(ApiDescription apiDescription, HttpConfiguration config)
{
HelpPageApiModel apiModel = new HelpPageApiModel()
{
ApiDescription = apiDescription,
};
ModelDescriptionGenerator modelGenerator = config.GetModelDescriptionGenerator();
HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
GenerateUriParameters(apiModel, modelGenerator);
GenerateRequestModelDescription(apiModel, modelGenerator, sampleGenerator);
GenerateResourceDescription(apiModel, modelGenerator);
GenerateSamples(apiModel, sampleGenerator);
return apiModel;
}
private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
{
ApiDescription apiDescription = apiModel.ApiDescription;
foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
{
if (apiParameter.Source == ApiParameterSource.FromUri)
{
HttpParameterDescriptor parameterDescriptor = apiParameter.ParameterDescriptor;
Type parameterType = null;
ModelDescription typeDescription = null;
ComplexTypeModelDescription complexTypeDescription = null;
if (parameterDescriptor != null)
{
parameterType = parameterDescriptor.ParameterType;
typeDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
complexTypeDescription = typeDescription as ComplexTypeModelDescription;
}
// Example:
// [TypeConverter(typeof(PointConverter))]
// public class Point
// {
// public Point(int x, int y)
// {
// X = x;
// Y = y;
// }
// public int X { get; set; }
// public int Y { get; set; }
// }
// Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection.
//
// public class Point
// {
// public int X { get; set; }
// public int Y { get; set; }
// }
// Regular complex class Point will have properties X and Y added to UriParameters collection.
if (complexTypeDescription != null
&& !IsBindableWithTypeConverter(parameterType))
{
foreach (ParameterDescription uriParameter in complexTypeDescription.Properties)
{
apiModel.UriParameters.Add(uriParameter);
}
}
else if (parameterDescriptor != null)
{
ParameterDescription uriParameter =
AddParameterDescription(apiModel, apiParameter, typeDescription);
if (!parameterDescriptor.IsOptional)
{
uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Required" });
}
object defaultValue = parameterDescriptor.DefaultValue;
if (defaultValue != null)
{
uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Default value is " + Convert.ToString(defaultValue, CultureInfo.InvariantCulture) });
}
}
else
{
Debug.Assert(parameterDescriptor == null);
// If parameterDescriptor is null, this is an undeclared route parameter which only occurs
// when source is FromUri. Ignored in request model and among resource parameters but listed
// as a simple string here.
ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string));
AddParameterDescription(apiModel, apiParameter, modelDescription);
}
}
}
}
private static bool IsBindableWithTypeConverter(Type parameterType)
{
if (parameterType == null)
{
return false;
}
return TypeDescriptor.GetConverter(parameterType).CanConvertFrom(typeof(string));
}
private static ParameterDescription AddParameterDescription(HelpPageApiModel apiModel,
ApiParameterDescription apiParameter, ModelDescription typeDescription)
{
ParameterDescription parameterDescription = new ParameterDescription
{
Name = apiParameter.Name,
Documentation = apiParameter.Documentation,
TypeDescription = typeDescription,
};
apiModel.UriParameters.Add(parameterDescription);
return parameterDescription;
}
private static void GenerateRequestModelDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator, HelpPageSampleGenerator sampleGenerator)
{
ApiDescription apiDescription = apiModel.ApiDescription;
foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
{
if (apiParameter.Source == ApiParameterSource.FromBody)
{
Type parameterType = apiParameter.ParameterDescriptor.ParameterType;
apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
apiModel.RequestDocumentation = apiParameter.Documentation;
}
else if (apiParameter.ParameterDescriptor != null &&
apiParameter.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage))
{
Type parameterType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
if (parameterType != null)
{
apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
}
}
}
}
private static void GenerateResourceDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
{
ResponseDescription response = apiModel.ApiDescription.ResponseDescription;
Type responseType = response.ResponseType ?? response.DeclaredType;
if (responseType != null && responseType != typeof(void))
{
apiModel.ResourceDescription = modelGenerator.GetOrCreateModelDescription(responseType);
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as ErrorMessages.")]
private static void GenerateSamples(HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator)
{
try
{
foreach (var item in sampleGenerator.GetSampleRequests(apiModel.ApiDescription))
{
apiModel.SampleRequests.Add(item.Key, item.Value);
LogInvalidSampleAsError(apiModel, item.Value);
}
foreach (var item in sampleGenerator.GetSampleResponses(apiModel.ApiDescription))
{
apiModel.SampleResponses.Add(item.Key, item.Value);
LogInvalidSampleAsError(apiModel, item.Value);
}
}
catch (Exception e)
{
apiModel.ErrorMessages.Add(String.Format(CultureInfo.CurrentCulture,
"An exception has occurred while generating the sample. Exception message: {0}",
HelpPageSampleGenerator.UnwrapException(e).Message));
}
}
private static bool TryGetResourceParameter(ApiDescription apiDescription, HttpConfiguration config, out ApiParameterDescription parameterDescription, out Type resourceType)
{
parameterDescription = apiDescription.ParameterDescriptions.FirstOrDefault(
p => p.Source == ApiParameterSource.FromBody ||
(p.ParameterDescriptor != null && p.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage)));
if (parameterDescription == null)
{
resourceType = null;
return false;
}
resourceType = parameterDescription.ParameterDescriptor.ParameterType;
if (resourceType == typeof(HttpRequestMessage))
{
HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
resourceType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
}
if (resourceType == null)
{
parameterDescription = null;
return false;
}
return true;
}
private static ModelDescriptionGenerator InitializeModelDescriptionGenerator(HttpConfiguration config)
{
ModelDescriptionGenerator modelGenerator = new ModelDescriptionGenerator(config);
Collection<ApiDescription> apis = config.Services.GetApiExplorer().ApiDescriptions;
foreach (ApiDescription api in apis)
{
ApiParameterDescription parameterDescription;
Type parameterType;
if (TryGetResourceParameter(api, config, out parameterDescription, out parameterType))
{
modelGenerator.GetOrCreateModelDescription(parameterType);
}
}
return modelGenerator;
}
private static void LogInvalidSampleAsError(HelpPageApiModel apiModel, object sample)
{
InvalidSample invalidSample = sample as InvalidSample;
if (invalidSample != null)
{
apiModel.ErrorMessages.Add(invalidSample.ErrorMessage);
}
}
}
}
@@ -1,7 +0,0 @@
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class CollectionModelDescription : ModelDescription
{
public ModelDescription ElementDescription { get; set; }
}
}
@@ -1,14 +0,0 @@
using System.Collections.ObjectModel;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class ComplexTypeModelDescription : ModelDescription
{
public ComplexTypeModelDescription()
{
Properties = new Collection<ParameterDescription>();
}
public Collection<ParameterDescription> Properties { get; private set; }
}
}
@@ -1,6 +0,0 @@
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class DictionaryModelDescription : KeyValuePairModelDescription
{
}
}
@@ -1,15 +0,0 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class EnumTypeModelDescription : ModelDescription
{
public EnumTypeModelDescription()
{
Values = new Collection<EnumValueDescription>();
}
public Collection<EnumValueDescription> Values { get; private set; }
}
}
@@ -1,11 +0,0 @@
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class EnumValueDescription
{
public string Documentation { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
}
@@ -1,12 +0,0 @@
using System;
using System.Reflection;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public interface IModelDocumentationProvider
{
string GetDocumentation(MemberInfo member);
string GetDocumentation(Type type);
}
}
@@ -1,9 +0,0 @@
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class KeyValuePairModelDescription : ModelDescription
{
public ModelDescription KeyModelDescription { get; set; }
public ModelDescription ValueModelDescription { get; set; }
}
}
@@ -1,16 +0,0 @@
using System;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
/// <summary>
/// Describes a type model.
/// </summary>
public abstract class ModelDescription
{
public string Documentation { get; set; }
public Type ModelType { get; set; }
public string Name { get; set; }
}
}
@@ -1,451 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Reflection;
using System.Runtime.Serialization;
using System.Web.Http;
using System.Web.Http.Description;
using System.Xml.Serialization;
using Newtonsoft.Json;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
/// <summary>
/// Generates model descriptions for given types.
/// </summary>
public class ModelDescriptionGenerator
{
// Modify this to support more data annotation attributes.
private readonly IDictionary<Type, Func<object, string>> AnnotationTextGenerator = new Dictionary<Type, Func<object, string>>
{
{ typeof(RequiredAttribute), a => "Required" },
{ typeof(RangeAttribute), a =>
{
RangeAttribute range = (RangeAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Range: inclusive between {0} and {1}", range.Minimum, range.Maximum);
}
},
{ typeof(MaxLengthAttribute), a =>
{
MaxLengthAttribute maxLength = (MaxLengthAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Max length: {0}", maxLength.Length);
}
},
{ typeof(MinLengthAttribute), a =>
{
MinLengthAttribute minLength = (MinLengthAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Min length: {0}", minLength.Length);
}
},
{ typeof(StringLengthAttribute), a =>
{
StringLengthAttribute strLength = (StringLengthAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "String length: inclusive between {0} and {1}", strLength.MinimumLength, strLength.MaximumLength);
}
},
{ typeof(DataTypeAttribute), a =>
{
DataTypeAttribute dataType = (DataTypeAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Data type: {0}", dataType.CustomDataType ?? dataType.DataType.ToString());
}
},
{ typeof(RegularExpressionAttribute), a =>
{
RegularExpressionAttribute regularExpression = (RegularExpressionAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Matching regular expression pattern: {0}", regularExpression.Pattern);
}
},
};
// Modify this to add more default documentations.
private readonly IDictionary<Type, string> DefaultTypeDocumentation = new Dictionary<Type, string>
{
{ typeof(Int16), "integer" },
{ typeof(Int32), "integer" },
{ typeof(Int64), "integer" },
{ typeof(UInt16), "unsigned integer" },
{ typeof(UInt32), "unsigned integer" },
{ typeof(UInt64), "unsigned integer" },
{ typeof(Byte), "byte" },
{ typeof(Char), "character" },
{ typeof(SByte), "signed byte" },
{ typeof(Uri), "URI" },
{ typeof(Single), "decimal number" },
{ typeof(Double), "decimal number" },
{ typeof(Decimal), "decimal number" },
{ typeof(String), "string" },
{ typeof(Guid), "globally unique identifier" },
{ typeof(TimeSpan), "time interval" },
{ typeof(DateTime), "date" },
{ typeof(DateTimeOffset), "date" },
{ typeof(Boolean), "boolean" },
};
private Lazy<IModelDocumentationProvider> _documentationProvider;
public ModelDescriptionGenerator(HttpConfiguration config)
{
if (config == null)
{
throw new ArgumentNullException("config");
}
_documentationProvider = new Lazy<IModelDocumentationProvider>(() => config.Services.GetDocumentationProvider() as IModelDocumentationProvider);
GeneratedModels = new Dictionary<string, ModelDescription>(StringComparer.OrdinalIgnoreCase);
}
public Dictionary<string, ModelDescription> GeneratedModels { get; private set; }
private IModelDocumentationProvider DocumentationProvider
{
get
{
return _documentationProvider.Value;
}
}
public ModelDescription GetOrCreateModelDescription(Type modelType)
{
if (modelType == null)
{
throw new ArgumentNullException("modelType");
}
Type underlyingType = Nullable.GetUnderlyingType(modelType);
if (underlyingType != null)
{
modelType = underlyingType;
}
ModelDescription modelDescription;
string modelName = ModelNameHelper.GetModelName(modelType);
if (GeneratedModels.TryGetValue(modelName, out modelDescription))
{
if (modelType != modelDescription.ModelType)
{
throw new InvalidOperationException(
String.Format(
CultureInfo.CurrentCulture,
"A model description could not be created. Duplicate model name '{0}' was found for types '{1}' and '{2}'. " +
"Use the [ModelName] attribute to change the model name for at least one of the types so that it has a unique name.",
modelName,
modelDescription.ModelType.FullName,
modelType.FullName));
}
return modelDescription;
}
if (DefaultTypeDocumentation.ContainsKey(modelType))
{
return GenerateSimpleTypeModelDescription(modelType);
}
if (modelType.IsEnum)
{
return GenerateEnumTypeModelDescription(modelType);
}
if (modelType.IsGenericType)
{
Type[] genericArguments = modelType.GetGenericArguments();
if (genericArguments.Length == 1)
{
Type enumerableType = typeof(IEnumerable<>).MakeGenericType(genericArguments);
if (enumerableType.IsAssignableFrom(modelType))
{
return GenerateCollectionModelDescription(modelType, genericArguments[0]);
}
}
if (genericArguments.Length == 2)
{
Type dictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments);
if (dictionaryType.IsAssignableFrom(modelType))
{
return GenerateDictionaryModelDescription(modelType, genericArguments[0], genericArguments[1]);
}
Type keyValuePairType = typeof(KeyValuePair<,>).MakeGenericType(genericArguments);
if (keyValuePairType.IsAssignableFrom(modelType))
{
return GenerateKeyValuePairModelDescription(modelType, genericArguments[0], genericArguments[1]);
}
}
}
if (modelType.IsArray)
{
Type elementType = modelType.GetElementType();
return GenerateCollectionModelDescription(modelType, elementType);
}
if (modelType == typeof(NameValueCollection))
{
return GenerateDictionaryModelDescription(modelType, typeof(string), typeof(string));
}
if (typeof(IDictionary).IsAssignableFrom(modelType))
{
return GenerateDictionaryModelDescription(modelType, typeof(object), typeof(object));
}
if (typeof(IEnumerable).IsAssignableFrom(modelType))
{
return GenerateCollectionModelDescription(modelType, typeof(object));
}
return GenerateComplexTypeModelDescription(modelType);
}
// Change this to provide different name for the member.
private static string GetMemberName(MemberInfo member, bool hasDataContractAttribute)
{
JsonPropertyAttribute jsonProperty = member.GetCustomAttribute<JsonPropertyAttribute>();
if (jsonProperty != null && !String.IsNullOrEmpty(jsonProperty.PropertyName))
{
return jsonProperty.PropertyName;
}
if (hasDataContractAttribute)
{
DataMemberAttribute dataMember = member.GetCustomAttribute<DataMemberAttribute>();
if (dataMember != null && !String.IsNullOrEmpty(dataMember.Name))
{
return dataMember.Name;
}
}
return member.Name;
}
private static bool ShouldDisplayMember(MemberInfo member, bool hasDataContractAttribute)
{
JsonIgnoreAttribute jsonIgnore = member.GetCustomAttribute<JsonIgnoreAttribute>();
XmlIgnoreAttribute xmlIgnore = member.GetCustomAttribute<XmlIgnoreAttribute>();
IgnoreDataMemberAttribute ignoreDataMember = member.GetCustomAttribute<IgnoreDataMemberAttribute>();
NonSerializedAttribute nonSerialized = member.GetCustomAttribute<NonSerializedAttribute>();
ApiExplorerSettingsAttribute apiExplorerSetting = member.GetCustomAttribute<ApiExplorerSettingsAttribute>();
bool hasMemberAttribute = member.DeclaringType.IsEnum ?
member.GetCustomAttribute<EnumMemberAttribute>() != null :
member.GetCustomAttribute<DataMemberAttribute>() != null;
// Display member only if all the followings are true:
// no JsonIgnoreAttribute
// no XmlIgnoreAttribute
// no IgnoreDataMemberAttribute
// no NonSerializedAttribute
// no ApiExplorerSettingsAttribute with IgnoreApi set to true
// no DataContractAttribute without DataMemberAttribute or EnumMemberAttribute
return jsonIgnore == null &&
xmlIgnore == null &&
ignoreDataMember == null &&
nonSerialized == null &&
(apiExplorerSetting == null || !apiExplorerSetting.IgnoreApi) &&
(!hasDataContractAttribute || hasMemberAttribute);
}
private string CreateDefaultDocumentation(Type type)
{
string documentation;
if (DefaultTypeDocumentation.TryGetValue(type, out documentation))
{
return documentation;
}
if (DocumentationProvider != null)
{
documentation = DocumentationProvider.GetDocumentation(type);
}
return documentation;
}
private void GenerateAnnotations(MemberInfo property, ParameterDescription propertyModel)
{
List<ParameterAnnotation> annotations = new List<ParameterAnnotation>();
IEnumerable<Attribute> attributes = property.GetCustomAttributes();
foreach (Attribute attribute in attributes)
{
Func<object, string> textGenerator;
if (AnnotationTextGenerator.TryGetValue(attribute.GetType(), out textGenerator))
{
annotations.Add(
new ParameterAnnotation
{
AnnotationAttribute = attribute,
Documentation = textGenerator(attribute)
});
}
}
// Rearrange the annotations
annotations.Sort((x, y) =>
{
// Special-case RequiredAttribute so that it shows up on top
if (x.AnnotationAttribute is RequiredAttribute)
{
return -1;
}
if (y.AnnotationAttribute is RequiredAttribute)
{
return 1;
}
// Sort the rest based on alphabetic order of the documentation
return String.Compare(x.Documentation, y.Documentation, StringComparison.OrdinalIgnoreCase);
});
foreach (ParameterAnnotation annotation in annotations)
{
propertyModel.Annotations.Add(annotation);
}
}
private CollectionModelDescription GenerateCollectionModelDescription(Type modelType, Type elementType)
{
ModelDescription collectionModelDescription = GetOrCreateModelDescription(elementType);
if (collectionModelDescription != null)
{
return new CollectionModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
ElementDescription = collectionModelDescription
};
}
return null;
}
private ModelDescription GenerateComplexTypeModelDescription(Type modelType)
{
ComplexTypeModelDescription complexModelDescription = new ComplexTypeModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
Documentation = CreateDefaultDocumentation(modelType)
};
GeneratedModels.Add(complexModelDescription.Name, complexModelDescription);
bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
PropertyInfo[] properties = modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo property in properties)
{
if (ShouldDisplayMember(property, hasDataContractAttribute))
{
ParameterDescription propertyModel = new ParameterDescription
{
Name = GetMemberName(property, hasDataContractAttribute)
};
if (DocumentationProvider != null)
{
propertyModel.Documentation = DocumentationProvider.GetDocumentation(property);
}
GenerateAnnotations(property, propertyModel);
complexModelDescription.Properties.Add(propertyModel);
propertyModel.TypeDescription = GetOrCreateModelDescription(property.PropertyType);
}
}
FieldInfo[] fields = modelType.GetFields(BindingFlags.Public | BindingFlags.Instance);
foreach (FieldInfo field in fields)
{
if (ShouldDisplayMember(field, hasDataContractAttribute))
{
ParameterDescription propertyModel = new ParameterDescription
{
Name = GetMemberName(field, hasDataContractAttribute)
};
if (DocumentationProvider != null)
{
propertyModel.Documentation = DocumentationProvider.GetDocumentation(field);
}
complexModelDescription.Properties.Add(propertyModel);
propertyModel.TypeDescription = GetOrCreateModelDescription(field.FieldType);
}
}
return complexModelDescription;
}
private DictionaryModelDescription GenerateDictionaryModelDescription(Type modelType, Type keyType, Type valueType)
{
ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
return new DictionaryModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
KeyModelDescription = keyModelDescription,
ValueModelDescription = valueModelDescription
};
}
private EnumTypeModelDescription GenerateEnumTypeModelDescription(Type modelType)
{
EnumTypeModelDescription enumDescription = new EnumTypeModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
Documentation = CreateDefaultDocumentation(modelType)
};
bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
foreach (FieldInfo field in modelType.GetFields(BindingFlags.Public | BindingFlags.Static))
{
if (ShouldDisplayMember(field, hasDataContractAttribute))
{
EnumValueDescription enumValue = new EnumValueDescription
{
Name = field.Name,
Value = field.GetRawConstantValue().ToString()
};
if (DocumentationProvider != null)
{
enumValue.Documentation = DocumentationProvider.GetDocumentation(field);
}
enumDescription.Values.Add(enumValue);
}
}
GeneratedModels.Add(enumDescription.Name, enumDescription);
return enumDescription;
}
private KeyValuePairModelDescription GenerateKeyValuePairModelDescription(Type modelType, Type keyType, Type valueType)
{
ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
return new KeyValuePairModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
KeyModelDescription = keyModelDescription,
ValueModelDescription = valueModelDescription
};
}
private ModelDescription GenerateSimpleTypeModelDescription(Type modelType)
{
SimpleTypeModelDescription simpleModelDescription = new SimpleTypeModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
Documentation = CreateDefaultDocumentation(modelType)
};
GeneratedModels.Add(simpleModelDescription.Name, simpleModelDescription);
return simpleModelDescription;
}
}
}
@@ -1,18 +0,0 @@
using System;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
/// <summary>
/// Use this attribute to change the name of the <see cref="ModelDescription"/> generated for a type.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)]
public sealed class ModelNameAttribute : Attribute
{
public ModelNameAttribute(string name)
{
Name = name;
}
public string Name { get; private set; }
}
}
@@ -1,36 +0,0 @@
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
internal static class ModelNameHelper
{
// Modify this to provide custom model name mapping.
public static string GetModelName(Type type)
{
ModelNameAttribute modelNameAttribute = type.GetCustomAttribute<ModelNameAttribute>();
if (modelNameAttribute != null && !String.IsNullOrEmpty(modelNameAttribute.Name))
{
return modelNameAttribute.Name;
}
string modelName = type.Name;
if (type.IsGenericType)
{
// Format the generic type name to something like: GenericOfAgurment1AndArgument2
Type genericType = type.GetGenericTypeDefinition();
Type[] genericArguments = type.GetGenericArguments();
string genericTypeName = genericType.Name;
// Trim the generic parameter counts from the name
genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
string[] argumentTypeNames = genericArguments.Select(t => GetModelName(t)).ToArray();
modelName = String.Format(CultureInfo.InvariantCulture, "{0}Of{1}", genericTypeName, String.Join("And", argumentTypeNames));
}
return modelName;
}
}
}
@@ -1,11 +0,0 @@
using System;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class ParameterAnnotation
{
public Attribute AnnotationAttribute { get; set; }
public string Documentation { get; set; }
}
}
@@ -1,21 +0,0 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class ParameterDescription
{
public ParameterDescription()
{
Annotations = new Collection<ParameterAnnotation>();
}
public Collection<ParameterAnnotation> Annotations { get; private set; }
public string Documentation { get; set; }
public string Name { get; set; }
public ModelDescription TypeDescription { get; set; }
}
}
@@ -1,6 +0,0 @@
namespace MP_MAG.Areas.HelpPage.ModelDescriptions
{
public class SimpleTypeModelDescription : ModelDescription
{
}
}
@@ -1,108 +0,0 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http.Headers;
using System.Web.Http.Description;
using MP_MAG.Areas.HelpPage.ModelDescriptions;
namespace MP_MAG.Areas.HelpPage.Models
{
/// <summary>
/// The model that represents an API displayed on the help page.
/// </summary>
public class HelpPageApiModel
{
/// <summary>
/// Initializes a new instance of the <see cref="HelpPageApiModel"/> class.
/// </summary>
public HelpPageApiModel()
{
UriParameters = new Collection<ParameterDescription>();
SampleRequests = new Dictionary<MediaTypeHeaderValue, object>();
SampleResponses = new Dictionary<MediaTypeHeaderValue, object>();
ErrorMessages = new Collection<string>();
}
/// <summary>
/// Gets or sets the <see cref="ApiDescription"/> that describes the API.
/// </summary>
public ApiDescription ApiDescription { get; set; }
/// <summary>
/// Gets or sets the <see cref="ParameterDescription"/> collection that describes the URI parameters for the API.
/// </summary>
public Collection<ParameterDescription> UriParameters { get; private set; }
/// <summary>
/// Gets or sets the documentation for the request.
/// </summary>
public string RequestDocumentation { get; set; }
/// <summary>
/// Gets or sets the <see cref="ModelDescription"/> that describes the request body.
/// </summary>
public ModelDescription RequestModelDescription { get; set; }
/// <summary>
/// Gets the request body parameter descriptions.
/// </summary>
public IList<ParameterDescription> RequestBodyParameters
{
get
{
return GetParameterDescriptions(RequestModelDescription);
}
}
/// <summary>
/// Gets or sets the <see cref="ModelDescription"/> that describes the resource.
/// </summary>
public ModelDescription ResourceDescription { get; set; }
/// <summary>
/// Gets the resource property descriptions.
/// </summary>
public IList<ParameterDescription> ResourceProperties
{
get
{
return GetParameterDescriptions(ResourceDescription);
}
}
/// <summary>
/// Gets the sample requests associated with the API.
/// </summary>
public IDictionary<MediaTypeHeaderValue, object> SampleRequests { get; private set; }
/// <summary>
/// Gets the sample responses associated with the API.
/// </summary>
public IDictionary<MediaTypeHeaderValue, object> SampleResponses { get; private set; }
/// <summary>
/// Gets the error messages associated with this model.
/// </summary>
public Collection<string> ErrorMessages { get; private set; }
private static IList<ParameterDescription> GetParameterDescriptions(ModelDescription modelDescription)
{
ComplexTypeModelDescription complexTypeModelDescription = modelDescription as ComplexTypeModelDescription;
if (complexTypeModelDescription != null)
{
return complexTypeModelDescription.Properties;
}
CollectionModelDescription collectionModelDescription = modelDescription as CollectionModelDescription;
if (collectionModelDescription != null)
{
complexTypeModelDescription = collectionModelDescription.ElementDescription as ComplexTypeModelDescription;
if (complexTypeModelDescription != null)
{
return complexTypeModelDescription.Properties;
}
}
return null;
}
}
}
@@ -1,444 +0,0 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http.Description;
using System.Xml.Linq;
using Newtonsoft.Json;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// This class will generate the samples for the help page.
/// </summary>
public class HelpPageSampleGenerator
{
/// <summary>
/// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class.
/// </summary>
public HelpPageSampleGenerator()
{
ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>();
ActionSamples = new Dictionary<HelpPageSampleKey, object>();
SampleObjects = new Dictionary<Type, object>();
SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>>
{
DefaultSampleObjectFactory,
};
}
/// <summary>
/// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>.
/// </summary>
public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; }
/// <summary>
/// Gets the objects that are used directly as samples for certain actions.
/// </summary>
public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; }
/// <summary>
/// Gets the objects that are serialized as samples by the supported formatters.
/// </summary>
public IDictionary<Type, object> SampleObjects { get; internal set; }
/// <summary>
/// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
/// stopping when the factory successfully returns a non-<see langref="null"/> object.
/// </summary>
/// <remarks>
/// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use
/// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and
/// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures",
Justification = "This is an appropriate nesting of generic types")]
public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; }
/// <summary>
/// Gets the request body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api)
{
return GetSample(api, SampleDirection.Request);
}
/// <summary>
/// Gets the response body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api)
{
return GetSample(api, SampleDirection.Response);
}
/// <summary>
/// Gets the request or response body samples.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The samples keyed by media type.</returns>
public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection)
{
if (api == null)
{
throw new ArgumentNullException("api");
}
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters);
var samples = new Dictionary<MediaTypeHeaderValue, object>();
// Use the samples provided directly for actions
var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection);
foreach (var actionSample in actionSamples)
{
samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value));
}
// Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage.
// Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters.
if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type))
{
object sampleObject = GetSampleObject(type);
foreach (var formatter in formatters)
{
foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
{
if (!samples.ContainsKey(mediaType))
{
object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection);
// If no sample found, try generate sample using formatter and sample object
if (sample == null && sampleObject != null)
{
sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType);
}
samples.Add(mediaType, WrapSampleIfString(sample));
}
}
}
}
return samples;
}
/// <summary>
/// Search for samples that are provided directly through <see cref="ActionSamples"/>.
/// </summary>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="type">The CLR type.</param>
/// <param name="formatter">The formatter.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The sample that matches the parameters.</returns>
public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
{
object sample;
// First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
// If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
// If still not found, try to get the sample provided for the specified mediaType and type.
// Finally, try to get the sample provided for the specified mediaType.
if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
{
return sample;
}
return null;
}
/// <summary>
/// Gets the sample object that will be serialized by the formatters.
/// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create
/// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other
/// factories in <see cref="SampleObjectFactories"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>The sample object.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")]
public virtual object GetSampleObject(Type type)
{
object sampleObject;
if (!SampleObjects.TryGetValue(type, out sampleObject))
{
// No specific object available, try our factories.
foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories)
{
if (factory == null)
{
continue;
}
try
{
sampleObject = factory(this, type);
if (sampleObject != null)
{
break;
}
}
catch
{
// Ignore any problems encountered in the factory; go on to the next one (if any).
}
}
}
return sampleObject;
}
/// <summary>
/// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The type.</returns>
public virtual Type ResolveHttpRequestMessageType(ApiDescription api)
{
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters);
}
/// <summary>
/// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param>
/// <param name="formatters">The formatters.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")]
public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters)
{
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
{
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
}
if (api == null)
{
throw new ArgumentNullException("api");
}
Type type;
if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) ||
ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type))
{
// Re-compute the supported formatters based on type
Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>();
foreach (var formatter in api.ActionDescriptor.Configuration.Formatters)
{
if (IsFormatSupported(sampleDirection, formatter, type))
{
newFormatters.Add(formatter);
}
}
formatters = newFormatters;
}
else
{
switch (sampleDirection)
{
case SampleDirection.Request:
ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody);
type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
formatters = api.SupportedRequestBodyFormatters;
break;
case SampleDirection.Response:
default:
type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
formatters = api.SupportedResponseFormatters;
break;
}
}
return type;
}
/// <summary>
/// Writes the sample object using formatter.
/// </summary>
/// <param name="formatter">The formatter.</param>
/// <param name="value">The value.</param>
/// <param name="type">The type.</param>
/// <param name="mediaType">Type of the media.</param>
/// <returns></returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")]
public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType)
{
if (formatter == null)
{
throw new ArgumentNullException("formatter");
}
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
object sample = String.Empty;
MemoryStream ms = null;
HttpContent content = null;
try
{
if (formatter.CanWriteType(type))
{
ms = new MemoryStream();
content = new ObjectContent(type, value, formatter, mediaType);
formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();
ms.Position = 0;
StreamReader reader = new StreamReader(ms);
string serializedSampleString = reader.ReadToEnd();
if (mediaType.MediaType.ToUpperInvariant().Contains("XML"))
{
serializedSampleString = TryFormatXml(serializedSampleString);
}
else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON"))
{
serializedSampleString = TryFormatJson(serializedSampleString);
}
sample = new TextSample(serializedSampleString);
}
else
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.",
mediaType,
formatter.GetType().Name,
type.Name));
}
}
catch (Exception e)
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}",
formatter.GetType().Name,
mediaType.MediaType,
UnwrapException(e).Message));
}
finally
{
if (ms != null)
{
ms.Dispose();
}
if (content != null)
{
content.Dispose();
}
}
return sample;
}
internal static Exception UnwrapException(Exception exception)
{
AggregateException aggregateException = exception as AggregateException;
if (aggregateException != null)
{
return aggregateException.Flatten().InnerException;
}
return exception;
}
// Default factory for sample objects
private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
{
// Try to create a default sample object
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type);
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatJson(string str)
{
try
{
object parsedJson = JsonConvert.DeserializeObject(str);
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
}
catch
{
// can't parse JSON, return the original string
return str;
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatXml(string str)
{
try
{
XDocument xml = XDocument.Parse(str);
return xml.ToString();
}
catch
{
// can't parse XML, return the original string
return str;
}
}
private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
{
switch (sampleDirection)
{
case SampleDirection.Request:
return formatter.CanReadType(type);
case SampleDirection.Response:
return formatter.CanWriteType(type);
}
return false;
}
private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection)
{
HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
foreach (var sample in ActionSamples)
{
HelpPageSampleKey sampleKey = sample.Key;
if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
(sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
sampleDirection == sampleKey.SampleDirection)
{
yield return sample;
}
}
}
private static object WrapSampleIfString(object sample)
{
string stringSample = sample as string;
if (stringSample != null)
{
return new TextSample(stringSample);
}
return sample;
}
}
}
@@ -1,172 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net.Http.Headers;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// This is used to identify the place where the sample should be applied.
/// </summary>
public class HelpPageSampleKey
{
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type.
/// </summary>
/// <param name="mediaType">The media type.</param>
public HelpPageSampleKey(MediaTypeHeaderValue mediaType)
{
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
ActionName = String.Empty;
ControllerName = String.Empty;
MediaType = mediaType;
ParameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
}
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type and CLR type.
/// </summary>
/// <param name="mediaType">The media type.</param>
/// <param name="type">The CLR type.</param>
public HelpPageSampleKey(MediaTypeHeaderValue mediaType, Type type)
: this(mediaType)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
ParameterType = type;
}
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on <see cref="SampleDirection"/>, controller name, action name and parameter names.
/// </summary>
/// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public HelpPageSampleKey(SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
{
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
{
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
}
if (controllerName == null)
{
throw new ArgumentNullException("controllerName");
}
if (actionName == null)
{
throw new ArgumentNullException("actionName");
}
if (parameterNames == null)
{
throw new ArgumentNullException("parameterNames");
}
ControllerName = controllerName;
ActionName = actionName;
ParameterNames = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
SampleDirection = sampleDirection;
}
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type, <see cref="SampleDirection"/>, controller name, action name and parameter names.
/// </summary>
/// <param name="mediaType">The media type.</param>
/// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public HelpPageSampleKey(MediaTypeHeaderValue mediaType, SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
: this(sampleDirection, controllerName, actionName, parameterNames)
{
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
MediaType = mediaType;
}
/// <summary>
/// Gets the name of the controller.
/// </summary>
/// <value>
/// The name of the controller.
/// </value>
public string ControllerName { get; private set; }
/// <summary>
/// Gets the name of the action.
/// </summary>
/// <value>
/// The name of the action.
/// </value>
public string ActionName { get; private set; }
/// <summary>
/// Gets the media type.
/// </summary>
/// <value>
/// The media type.
/// </value>
public MediaTypeHeaderValue MediaType { get; private set; }
/// <summary>
/// Gets the parameter names.
/// </summary>
public HashSet<string> ParameterNames { get; private set; }
public Type ParameterType { get; private set; }
/// <summary>
/// Gets the <see cref="SampleDirection"/>.
/// </summary>
public SampleDirection? SampleDirection { get; private set; }
public override bool Equals(object obj)
{
HelpPageSampleKey otherKey = obj as HelpPageSampleKey;
if (otherKey == null)
{
return false;
}
return String.Equals(ControllerName, otherKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
String.Equals(ActionName, otherKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
(MediaType == otherKey.MediaType || (MediaType != null && MediaType.Equals(otherKey.MediaType))) &&
ParameterType == otherKey.ParameterType &&
SampleDirection == otherKey.SampleDirection &&
ParameterNames.SetEquals(otherKey.ParameterNames);
}
public override int GetHashCode()
{
int hashCode = ControllerName.ToUpperInvariant().GetHashCode() ^ ActionName.ToUpperInvariant().GetHashCode();
if (MediaType != null)
{
hashCode ^= MediaType.GetHashCode();
}
if (SampleDirection != null)
{
hashCode ^= SampleDirection.GetHashCode();
}
if (ParameterType != null)
{
hashCode ^= ParameterType.GetHashCode();
}
foreach (string parameterName in ParameterNames)
{
hashCode ^= parameterName.ToUpperInvariant().GetHashCode();
}
return hashCode;
}
}
}
@@ -1,41 +0,0 @@
using System;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// This represents an image sample on the help page. There's a display template named ImageSample associated with this class.
/// </summary>
public class ImageSample
{
/// <summary>
/// Initializes a new instance of the <see cref="ImageSample"/> class.
/// </summary>
/// <param name="src">The URL of an image.</param>
public ImageSample(string src)
{
if (src == null)
{
throw new ArgumentNullException("src");
}
Src = src;
}
public string Src { get; private set; }
public override bool Equals(object obj)
{
ImageSample other = obj as ImageSample;
return other != null && Src == other.Src;
}
public override int GetHashCode()
{
return Src.GetHashCode();
}
public override string ToString()
{
return Src;
}
}
}
@@ -1,37 +0,0 @@
using System;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class.
/// </summary>
public class InvalidSample
{
public InvalidSample(string errorMessage)
{
if (errorMessage == null)
{
throw new ArgumentNullException("errorMessage");
}
ErrorMessage = errorMessage;
}
public string ErrorMessage { get; private set; }
public override bool Equals(object obj)
{
InvalidSample other = obj as InvalidSample;
return other != null && ErrorMessage == other.ErrorMessage;
}
public override int GetHashCode()
{
return ErrorMessage.GetHashCode();
}
public override string ToString()
{
return ErrorMessage;
}
}
}
@@ -1,456 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// This class will create an object of a given type and populate it with sample data.
/// </summary>
public class ObjectGenerator
{
internal const int DefaultCollectionSize = 2;
private readonly SimpleTypeObjectGenerator SimpleObjectGenerator = new SimpleTypeObjectGenerator();
/// <summary>
/// Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types:
/// Simple types: <see cref="int"/>, <see cref="string"/>, <see cref="Enum"/>, <see cref="DateTime"/>, <see cref="Uri"/>, etc.
/// Complex types: POCO types.
/// Nullables: <see cref="Nullable{T}"/>.
/// Arrays: arrays of simple types or complex types.
/// Key value pairs: <see cref="KeyValuePair{TKey,TValue}"/>
/// Tuples: <see cref="Tuple{T1}"/>, <see cref="Tuple{T1,T2}"/>, etc
/// Dictionaries: <see cref="IDictionary{TKey,TValue}"/> or anything deriving from <see cref="IDictionary{TKey,TValue}"/>.
/// Collections: <see cref="IList{T}"/>, <see cref="IEnumerable{T}"/>, <see cref="ICollection{T}"/>, <see cref="IList"/>, <see cref="IEnumerable"/>, <see cref="ICollection"/> or anything deriving from <see cref="ICollection{T}"/> or <see cref="IList"/>.
/// Queryables: <see cref="IQueryable"/>, <see cref="IQueryable{T}"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>An object of the given type.</returns>
public object GenerateObject(Type type)
{
return GenerateObject(type, new Dictionary<Type, object>());
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Here we just want to return null if anything goes wrong.")]
private object GenerateObject(Type type, Dictionary<Type, object> createdObjectReferences)
{
try
{
if (SimpleTypeObjectGenerator.CanGenerateObject(type))
{
return SimpleObjectGenerator.GenerateObject(type);
}
if (type.IsArray)
{
return GenerateArray(type, DefaultCollectionSize, createdObjectReferences);
}
if (type.IsGenericType)
{
return GenerateGenericType(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IDictionary))
{
return GenerateDictionary(typeof(Hashtable), DefaultCollectionSize, createdObjectReferences);
}
if (typeof(IDictionary).IsAssignableFrom(type))
{
return GenerateDictionary(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IList) ||
type == typeof(IEnumerable) ||
type == typeof(ICollection))
{
return GenerateCollection(typeof(ArrayList), DefaultCollectionSize, createdObjectReferences);
}
if (typeof(IList).IsAssignableFrom(type))
{
return GenerateCollection(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IQueryable))
{
return GenerateQueryable(type, DefaultCollectionSize, createdObjectReferences);
}
if (type.IsEnum)
{
return GenerateEnum(type);
}
if (type.IsPublic || type.IsNestedPublic)
{
return GenerateComplexObject(type, createdObjectReferences);
}
}
catch
{
// Returns null if anything fails
return null;
}
return null;
}
private static object GenerateGenericType(Type type, int collectionSize, Dictionary<Type, object> createdObjectReferences)
{
Type genericTypeDefinition = type.GetGenericTypeDefinition();
if (genericTypeDefinition == typeof(Nullable<>))
{
return GenerateNullable(type, createdObjectReferences);
}
if (genericTypeDefinition == typeof(KeyValuePair<,>))
{
return GenerateKeyValuePair(type, createdObjectReferences);
}
if (IsTuple(genericTypeDefinition))
{
return GenerateTuple(type, createdObjectReferences);
}
Type[] genericArguments = type.GetGenericArguments();
if (genericArguments.Length == 1)
{
if (genericTypeDefinition == typeof(IList<>) ||
genericTypeDefinition == typeof(IEnumerable<>) ||
genericTypeDefinition == typeof(ICollection<>))
{
Type collectionType = typeof(List<>).MakeGenericType(genericArguments);
return GenerateCollection(collectionType, collectionSize, createdObjectReferences);
}
if (genericTypeDefinition == typeof(IQueryable<>))
{
return GenerateQueryable(type, collectionSize, createdObjectReferences);
}
Type closedCollectionType = typeof(ICollection<>).MakeGenericType(genericArguments[0]);
if (closedCollectionType.IsAssignableFrom(type))
{
return GenerateCollection(type, collectionSize, createdObjectReferences);
}
}
if (genericArguments.Length == 2)
{
if (genericTypeDefinition == typeof(IDictionary<,>))
{
Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(genericArguments);
return GenerateDictionary(dictionaryType, collectionSize, createdObjectReferences);
}
Type closedDictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments[0], genericArguments[1]);
if (closedDictionaryType.IsAssignableFrom(type))
{
return GenerateDictionary(type, collectionSize, createdObjectReferences);
}
}
if (type.IsPublic || type.IsNestedPublic)
{
return GenerateComplexObject(type, createdObjectReferences);
}
return null;
}
private static object GenerateTuple(Type type, Dictionary<Type, object> createdObjectReferences)
{
Type[] genericArgs = type.GetGenericArguments();
object[] parameterValues = new object[genericArgs.Length];
bool failedToCreateTuple = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < genericArgs.Length; i++)
{
parameterValues[i] = objectGenerator.GenerateObject(genericArgs[i], createdObjectReferences);
failedToCreateTuple &= parameterValues[i] == null;
}
if (failedToCreateTuple)
{
return null;
}
object result = Activator.CreateInstance(type, parameterValues);
return result;
}
private static bool IsTuple(Type genericTypeDefinition)
{
return genericTypeDefinition == typeof(Tuple<>) ||
genericTypeDefinition == typeof(Tuple<,>) ||
genericTypeDefinition == typeof(Tuple<,,>) ||
genericTypeDefinition == typeof(Tuple<,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,,,>);
}
private static object GenerateKeyValuePair(Type keyValuePairType, Dictionary<Type, object> createdObjectReferences)
{
Type[] genericArgs = keyValuePairType.GetGenericArguments();
Type typeK = genericArgs[0];
Type typeV = genericArgs[1];
ObjectGenerator objectGenerator = new ObjectGenerator();
object keyObject = objectGenerator.GenerateObject(typeK, createdObjectReferences);
object valueObject = objectGenerator.GenerateObject(typeV, createdObjectReferences);
if (keyObject == null && valueObject == null)
{
// Failed to create key and values
return null;
}
object result = Activator.CreateInstance(keyValuePairType, keyObject, valueObject);
return result;
}
private static object GenerateArray(Type arrayType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type type = arrayType.GetElementType();
Array result = Array.CreateInstance(type, size);
bool areAllElementsNull = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
result.SetValue(element, i);
areAllElementsNull &= element == null;
}
if (areAllElementsNull)
{
return null;
}
return result;
}
private static object GenerateDictionary(Type dictionaryType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type typeK = typeof(object);
Type typeV = typeof(object);
if (dictionaryType.IsGenericType)
{
Type[] genericArgs = dictionaryType.GetGenericArguments();
typeK = genericArgs[0];
typeV = genericArgs[1];
}
object result = Activator.CreateInstance(dictionaryType);
MethodInfo addMethod = dictionaryType.GetMethod("Add") ?? dictionaryType.GetMethod("TryAdd");
MethodInfo containsMethod = dictionaryType.GetMethod("Contains") ?? dictionaryType.GetMethod("ContainsKey");
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object newKey = objectGenerator.GenerateObject(typeK, createdObjectReferences);
if (newKey == null)
{
// Cannot generate a valid key
return null;
}
bool containsKey = (bool)containsMethod.Invoke(result, new object[] { newKey });
if (!containsKey)
{
object newValue = objectGenerator.GenerateObject(typeV, createdObjectReferences);
addMethod.Invoke(result, new object[] { newKey, newValue });
}
}
return result;
}
private static object GenerateEnum(Type enumType)
{
Array possibleValues = Enum.GetValues(enumType);
if (possibleValues.Length > 0)
{
return possibleValues.GetValue(0);
}
return null;
}
private static object GenerateQueryable(Type queryableType, int size, Dictionary<Type, object> createdObjectReferences)
{
bool isGeneric = queryableType.IsGenericType;
object list;
if (isGeneric)
{
Type listType = typeof(List<>).MakeGenericType(queryableType.GetGenericArguments());
list = GenerateCollection(listType, size, createdObjectReferences);
}
else
{
list = GenerateArray(typeof(object[]), size, createdObjectReferences);
}
if (list == null)
{
return null;
}
if (isGeneric)
{
Type argumentType = typeof(IEnumerable<>).MakeGenericType(queryableType.GetGenericArguments());
MethodInfo asQueryableMethod = typeof(Queryable).GetMethod("AsQueryable", new[] { argumentType });
return asQueryableMethod.Invoke(null, new[] { list });
}
return Queryable.AsQueryable((IEnumerable)list);
}
private static object GenerateCollection(Type collectionType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type type = collectionType.IsGenericType ?
collectionType.GetGenericArguments()[0] :
typeof(object);
object result = Activator.CreateInstance(collectionType);
MethodInfo addMethod = collectionType.GetMethod("Add");
bool areAllElementsNull = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
addMethod.Invoke(result, new object[] { element });
areAllElementsNull &= element == null;
}
if (areAllElementsNull)
{
return null;
}
return result;
}
private static object GenerateNullable(Type nullableType, Dictionary<Type, object> createdObjectReferences)
{
Type type = nullableType.GetGenericArguments()[0];
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type, createdObjectReferences);
}
private static object GenerateComplexObject(Type type, Dictionary<Type, object> createdObjectReferences)
{
object result = null;
if (createdObjectReferences.TryGetValue(type, out result))
{
// The object has been created already, just return it. This will handle the circular reference case.
return result;
}
if (type.IsValueType)
{
result = Activator.CreateInstance(type);
}
else
{
ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes);
if (defaultCtor == null)
{
// Cannot instantiate the type because it doesn't have a default constructor
return null;
}
result = defaultCtor.Invoke(new object[0]);
}
createdObjectReferences.Add(type, result);
SetPublicProperties(type, result, createdObjectReferences);
SetPublicFields(type, result, createdObjectReferences);
return result;
}
private static void SetPublicProperties(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
{
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
ObjectGenerator objectGenerator = new ObjectGenerator();
foreach (PropertyInfo property in properties)
{
if (property.CanWrite)
{
object propertyValue = objectGenerator.GenerateObject(property.PropertyType, createdObjectReferences);
property.SetValue(obj, propertyValue, null);
}
}
}
private static void SetPublicFields(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
{
FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance);
ObjectGenerator objectGenerator = new ObjectGenerator();
foreach (FieldInfo field in fields)
{
object fieldValue = objectGenerator.GenerateObject(field.FieldType, createdObjectReferences);
field.SetValue(obj, fieldValue);
}
}
private class SimpleTypeObjectGenerator
{
private long _index = 0;
private static readonly Dictionary<Type, Func<long, object>> DefaultGenerators = InitializeGenerators();
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple type factories and cannot be split up.")]
private static Dictionary<Type, Func<long, object>> InitializeGenerators()
{
return new Dictionary<Type, Func<long, object>>
{
{ typeof(Boolean), index => true },
{ typeof(Byte), index => (Byte)64 },
{ typeof(Char), index => (Char)65 },
{ typeof(DateTime), index => DateTime.Now },
{ typeof(DateTimeOffset), index => new DateTimeOffset(DateTime.Now) },
{ typeof(DBNull), index => DBNull.Value },
{ typeof(Decimal), index => (Decimal)index },
{ typeof(Double), index => (Double)(index + 0.1) },
{ typeof(Guid), index => Guid.NewGuid() },
{ typeof(Int16), index => (Int16)(index % Int16.MaxValue) },
{ typeof(Int32), index => (Int32)(index % Int32.MaxValue) },
{ typeof(Int64), index => (Int64)index },
{ typeof(Object), index => new object() },
{ typeof(SByte), index => (SByte)64 },
{ typeof(Single), index => (Single)(index + 0.1) },
{
typeof(String), index =>
{
return String.Format(CultureInfo.CurrentCulture, "sample string {0}", index);
}
},
{
typeof(TimeSpan), index =>
{
return TimeSpan.FromTicks(1234567);
}
},
{ typeof(UInt16), index => (UInt16)(index % UInt16.MaxValue) },
{ typeof(UInt32), index => (UInt32)(index % UInt32.MaxValue) },
{ typeof(UInt64), index => (UInt64)index },
{
typeof(Uri), index =>
{
return new Uri(String.Format(CultureInfo.CurrentCulture, "http://webapihelppage{0}.com", index));
}
},
};
}
public static bool CanGenerateObject(Type type)
{
return DefaultGenerators.ContainsKey(type);
}
public object GenerateObject(Type type)
{
return DefaultGenerators[type](++_index);
}
}
}
}
@@ -1,11 +0,0 @@
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// Indicates whether the sample is used for request or response
/// </summary>
public enum SampleDirection
{
Request = 0,
Response
}
}
@@ -1,37 +0,0 @@
using System;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class.
/// </summary>
public class TextSample
{
public TextSample(string text)
{
if (text == null)
{
throw new ArgumentNullException("text");
}
Text = text;
}
public string Text { get; private set; }
public override bool Equals(object obj)
{
TextSample other = obj as TextSample;
return other != null && Text == other.Text;
}
public override int GetHashCode()
{
return Text.GetHashCode();
}
public override string ToString()
{
return Text;
}
}
}
@@ -1,22 +0,0 @@
@using System.Web.Http
@using MP_MAG.Areas.HelpPage.Models
@model HelpPageApiModel
@{
var description = Model.ApiDescription;
ViewBag.Title = description.HttpMethod.Method + " " + description.RelativePath;
}
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
<div id="body" class="help-page">
<section class="featured">
<div class="content-wrapper">
<p>
@Html.ActionLink("Help Page Home", "Index")
</p>
</div>
</section>
<section class="content-wrapper main-content clear-fix">
@Html.DisplayForModel()
</section>
</div>
@@ -1,41 +0,0 @@
@using System.Web.Http
@using System.Web.Http.Controllers
@using System.Web.Http.Description
@using MP_MAG.Areas.HelpPage
@using MP_MAG.Areas.HelpPage.Models
@model IGrouping<HttpControllerDescriptor, ApiDescription>
@{
var controllerDocumentation = ViewBag.DocumentationProvider != null ?
ViewBag.DocumentationProvider.GetDocumentation(Model.Key) :
null;
}
<h2 id="@Model.Key.ControllerName">@Model.Key.ControllerName</h2>
@if (!String.IsNullOrEmpty(controllerDocumentation))
{
<p>@controllerDocumentation</p>
}
<table class="help-page-table">
<thead>
<tr><th>API</th><th>Description</th></tr>
</thead>
<tbody>
@foreach (var api in Model)
{
<tr>
<td class="api-name"><a href="@Url.Action("Api", "Help", new { apiId = api.GetFriendlyId() })">@api.HttpMethod.Method @api.RelativePath</a></td>
<td class="api-documentation">
@if (api.Documentation != null)
{
<p>@api.Documentation</p>
}
else
{
<p>No documentation available.</p>
}
</td>
</tr>
}
</tbody>
</table>
@@ -1,6 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model CollectionModelDescription
@if (Model.ElementDescription is ComplexTypeModelDescription)
{
@Html.DisplayFor(m => m.ElementDescription)
}
@@ -1,3 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model ComplexTypeModelDescription
@Html.DisplayFor(m => m.Properties, "Parameters")
@@ -1,4 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model DictionaryModelDescription
Dictionary of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]
and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]
@@ -1,24 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model EnumTypeModelDescription
<p>Possible enumeration values:</p>
<table class="help-page-table">
<thead>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
</thead>
<tbody>
@foreach (EnumValueDescription value in Model.Values)
{
<tr>
<td class="enum-name"><b>@value.Name</b></td>
<td class="enum-value">
<p>@value.Value</p>
</td>
<td class="enum-description">
<p>@value.Documentation</p>
</td>
</tr>
}
</tbody>
</table>
@@ -1,67 +0,0 @@
@using System.Web.Http
@using System.Web.Http.Description
@using MP_MAG.Areas.HelpPage.Models
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model HelpPageApiModel
@{
ApiDescription description = Model.ApiDescription;
}
<h1>@description.HttpMethod.Method @description.RelativePath</h1>
<div>
<p>@description.Documentation</p>
<h2>Request Information</h2>
<h3>URI Parameters</h3>
@Html.DisplayFor(m => m.UriParameters, "Parameters")
<h3>Body Parameters</h3>
<p>@Model.RequestDocumentation</p>
@if (Model.RequestModelDescription != null)
{
@Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription })
if (Model.RequestBodyParameters != null)
{
@Html.DisplayFor(m => m.RequestBodyParameters, "Parameters")
}
}
else
{
<p>None.</p>
}
@if (Model.SampleRequests.Count > 0)
{
<h3>Request Formats</h3>
@Html.DisplayFor(m => m.SampleRequests, "Samples")
}
<h2>Response Information</h2>
<h3>Resource Description</h3>
<p>@description.ResponseDescription.Documentation</p>
@if (Model.ResourceDescription != null)
{
@Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription })
if (Model.ResourceProperties != null)
{
@Html.DisplayFor(m => m.ResourceProperties, "Parameters")
}
}
else
{
<p>None.</p>
}
@if (Model.SampleResponses.Count > 0)
{
<h3>Response Formats</h3>
@Html.DisplayFor(m => m.SampleResponses, "Samples")
}
</div>
@@ -1,4 +0,0 @@
@using MP_MAG.Areas.HelpPage
@model ImageSample
<img src="@Model.Src" />
@@ -1,13 +0,0 @@
@using MP_MAG.Areas.HelpPage
@model InvalidSample
@if (HttpContext.Current.IsDebuggingEnabled)
{
<div class="warning-message-container">
<p>@Model.ErrorMessage</p>
</div>
}
else
{
<p>Sample not available.</p>
}
@@ -1,4 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model KeyValuePairModelDescription
Pair of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]
and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]
@@ -1,26 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model Type
@{
ModelDescription modelDescription = ViewBag.modelDescription;
if (modelDescription is ComplexTypeModelDescription || modelDescription is EnumTypeModelDescription)
{
if (Model == typeof(Object))
{
@:Object
}
else
{
@Html.ActionLink(modelDescription.Name, "ResourceModel", "Help", new { modelName = modelDescription.Name }, null)
}
}
else if (modelDescription is CollectionModelDescription)
{
var collectionDescription = modelDescription as CollectionModelDescription;
var elementDescription = collectionDescription.ElementDescription;
@:Collection of @Html.DisplayFor(m => elementDescription.ModelType, "ModelDescriptionLink", new { modelDescription = elementDescription })
}
else
{
@Html.DisplayFor(m => modelDescription)
}
}
@@ -1,48 +0,0 @@
@using System.Collections.Generic
@using System.Collections.ObjectModel
@using System.Web.Http.Description
@using System.Threading
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model IList<ParameterDescription>
@if (Model.Count > 0)
{
<table class="help-page-table">
<thead>
<tr><th>Name</th><th>Description</th><th>Type</th><th>Additional information</th></tr>
</thead>
<tbody>
@foreach (ParameterDescription parameter in Model)
{
ModelDescription modelDescription = parameter.TypeDescription;
<tr>
<td class="parameter-name">@parameter.Name</td>
<td class="parameter-documentation">
<p>@parameter.Documentation</p>
</td>
<td class="parameter-type">
@Html.DisplayFor(m => modelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = modelDescription })
</td>
<td class="parameter-annotations">
@if (parameter.Annotations.Count > 0)
{
foreach (var annotation in parameter.Annotations)
{
<p>@annotation.Documentation</p>
}
}
else
{
<p>None.</p>
}
</td>
</tr>
}
</tbody>
</table>
}
else
{
<p>None.</p>
}
@@ -1,30 +0,0 @@
@using System.Net.Http.Headers
@model Dictionary<MediaTypeHeaderValue, object>
@{
// Group the samples into a single tab if they are the same.
Dictionary<string, object> samples = Model.GroupBy(pair => pair.Value).ToDictionary(
pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()),
pair => pair.Key);
var mediaTypes = samples.Keys;
}
<div>
@foreach (var mediaType in mediaTypes)
{
<h4 class="sample-header">@mediaType</h4>
<div class="sample-content">
<span><b>Sample:</b></span>
@{
var sample = samples[mediaType];
if (sample == null)
{
<p>Sample not available.</p>
}
else
{
@Html.DisplayFor(s => sample);
}
}
</div>
}
</div>
@@ -1,3 +0,0 @@
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model SimpleTypeModelDescription
@Model.Documentation
@@ -1,6 +0,0 @@
@using MP_MAG.Areas.HelpPage
@model TextSample
<pre class="wrapped">
@Model.Text
</pre>
@@ -1,46 +0,0 @@
@using System.Web.Http
@using System.Web.Http.Controllers
@using System.Web.Http.Description
@using System.Collections.ObjectModel
@using MP_MAG.Areas.HelpPage.Models
@model Collection<ApiDescription>
@{
ViewBag.Title = "ASP.NET Web API Help Page";
// Group APIs by controller
ILookup<HttpControllerDescriptor, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor);
}
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
<div class="row">
<div class="col-12">
<header class="help-page">
<div class="content-wrapper">
<div class="float-left">
<h1>@ViewBag.Title</h1>
</div>
</div>
</header>
</div>
</div>
<div class="row">
<div class="col-12">
<div id="body" class="help-page">
<section class="featured">
<div class="content-wrapper">
<h2>MP-MAG</h2>
<p>
Qui di seguito sono riprotate le classi REST definite nel progetto
</p>
</div>
</section>
<section class="content-wrapper main-content clear-fix">
@foreach (var group in apiGroups)
{
@Html.DisplayFor(m => group, "ApiGroup")
}
</section>
</div>
</div>
</div>
@@ -1,19 +0,0 @@
@using System.Web.Http
@using MP_MAG.Areas.HelpPage.ModelDescriptions
@model ModelDescription
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
<div id="body" class="help-page">
<section class="featured">
<div class="content-wrapper">
<p>
@Html.ActionLink("Help Page Home", "Index")
</p>
</div>
</section>
<h1>@Model.Name</h1>
<p>@Model.Documentation</p>
<section class="content-wrapper main-content clear-fix">
@Html.DisplayFor(m => Model)
</section>
</div>
@@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@RenderSection("scripts", required: false)
</head>
<body>
@RenderBody()
</body>
</html>
-41
View File
@@ -1,41 +0,0 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
</system.web>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
@@ -1,4 +0,0 @@
@{
// Change the Layout path below to blend the look and feel of the help page with your existing web pages
Layout = "~/Views/Shared/_Layout.cshtml";
}
@@ -1,161 +0,0 @@
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Xml.XPath;
using MP_MAG.Areas.HelpPage.ModelDescriptions;
namespace MP_MAG.Areas.HelpPage
{
/// <summary>
/// A custom <see cref="IDocumentationProvider"/> that reads the API documentation from an XML documentation file.
/// </summary>
public class XmlDocumentationProvider : IDocumentationProvider, IModelDocumentationProvider
{
private XPathNavigator _documentNavigator;
private const string TypeExpression = "/doc/members/member[@name='T:{0}']";
private const string MethodExpression = "/doc/members/member[@name='M:{0}']";
private const string PropertyExpression = "/doc/members/member[@name='P:{0}']";
private const string FieldExpression = "/doc/members/member[@name='F:{0}']";
private const string ParameterExpression = "param[@name='{0}']";
/// <summary>
/// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class.
/// </summary>
/// <param name="documentPath">The physical path to XML document.</param>
public XmlDocumentationProvider(string documentPath)
{
if (documentPath == null)
{
throw new ArgumentNullException("documentPath");
}
XPathDocument xpath = new XPathDocument(documentPath);
_documentNavigator = xpath.CreateNavigator();
}
public string GetDocumentation(HttpControllerDescriptor controllerDescriptor)
{
XPathNavigator typeNode = GetTypeNode(controllerDescriptor.ControllerType);
return GetTagValue(typeNode, "summary");
}
public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
return GetTagValue(methodNode, "summary");
}
public virtual string GetDocumentation(HttpParameterDescriptor parameterDescriptor)
{
ReflectedHttpParameterDescriptor reflectedParameterDescriptor = parameterDescriptor as ReflectedHttpParameterDescriptor;
if (reflectedParameterDescriptor != null)
{
XPathNavigator methodNode = GetMethodNode(reflectedParameterDescriptor.ActionDescriptor);
if (methodNode != null)
{
string parameterName = reflectedParameterDescriptor.ParameterInfo.Name;
XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName));
if (parameterNode != null)
{
return parameterNode.Value.Trim();
}
}
}
return null;
}
public string GetResponseDocumentation(HttpActionDescriptor actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
return GetTagValue(methodNode, "returns");
}
public string GetDocumentation(MemberInfo member)
{
string memberName = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(member.DeclaringType), member.Name);
string expression = member.MemberType == MemberTypes.Field ? FieldExpression : PropertyExpression;
string selectExpression = String.Format(CultureInfo.InvariantCulture, expression, memberName);
XPathNavigator propertyNode = _documentNavigator.SelectSingleNode(selectExpression);
return GetTagValue(propertyNode, "summary");
}
public string GetDocumentation(Type type)
{
XPathNavigator typeNode = GetTypeNode(type);
return GetTagValue(typeNode, "summary");
}
private XPathNavigator GetMethodNode(HttpActionDescriptor actionDescriptor)
{
ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor;
if (reflectedActionDescriptor != null)
{
string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo));
return _documentNavigator.SelectSingleNode(selectExpression);
}
return null;
}
private static string GetMemberName(MethodInfo method)
{
string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(method.DeclaringType), method.Name);
ParameterInfo[] parameters = method.GetParameters();
if (parameters.Length != 0)
{
string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray();
name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames));
}
return name;
}
private static string GetTagValue(XPathNavigator parentNode, string tagName)
{
if (parentNode != null)
{
XPathNavigator node = parentNode.SelectSingleNode(tagName);
if (node != null)
{
return node.Value.Trim();
}
}
return null;
}
private XPathNavigator GetTypeNode(Type type)
{
string controllerTypeName = GetTypeName(type);
string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName);
return _documentNavigator.SelectSingleNode(selectExpression);
}
private static string GetTypeName(Type type)
{
string name = type.FullName;
if (type.IsGenericType)
{
// Format the generic type name to something like: Generic{System.Int32,System.String}
Type genericType = type.GetGenericTypeDefinition();
Type[] genericArguments = type.GetGenericArguments();
string genericTypeName = genericType.FullName;
// Trim the generic parameter counts from the name
genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray();
name = String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", genericTypeName, String.Join(",", argumentTypeNames));
}
if (type.IsNested)
{
// Changing the nested type name from OuterType+InnerType to OuterType.InnerType to match the XML documentation syntax.
name = name.Replace("+", ".");
}
return name;
}
}
}
-305
View File
@@ -1,305 +0,0 @@
using MagData;
using Newtonsoft.Json;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MP_MAG
{
public class BaseUserControl : System.Web.UI.UserControl
{
/// <summary>
/// Generico evento di richiesta refresh a aprent
/// </summary>
public event EventHandler eh_doRefresh;
/// <summary>
/// Generico evento di richiesta refresh a aprent
/// </summary>
public event EventHandler eh_doReset;
/// <summary>
/// Chiamata evento
/// </summary>
public void raiseEvent()
{
// se qualcuno ascolta sollevo evento nuovo valore...
if (eh_doRefresh != null)
{
eh_doRefresh(this, new EventArgs());
}
}
/// <summary>
/// Chiamata evento
/// </summary>
public void raiseReset()
{
// se qualcuno ascolta sollevo evento nuovo valore...
if (eh_doReset != null)
{
eh_doReset(this, new EventArgs());
}
}
/// <summary>
/// Wrapper traduzione termini
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return SteamWare.user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// Codice operatore salvato in cookie
/// </summary>
protected string cookieCodOpr
{
get
{
return memLayer.ML.getCookieVal("CTrack_CodOpr");
}
}
/// <summary>
/// Codice post salvato in cookie
/// </summary>
protected string cookieCodPost
{
get
{
return memLayer.ML.getCookieVal("CTrack_CodPost");
}
}
/// <summary>
/// Chiave redis dei dati di prod correnti
/// </summary>
public string redProdKey
{
get
{
return memLayer.ML.redHash(memLayer.ML.CRS("redProdKey"));
}
}
/// <summary>
/// TTL dati redis x prod
/// </summary>
public int redProdKeyTTL
{
get
{
return memLayer.ML.CRI("redProdKeyTTL");
}
}
/// <summary>
/// Dati correnti di produzione
/// </summary>
public prodData currProdData
{
get
{
prodData answ = null;
try
{
string rawData = memLayer.ML.getRSV("redProdKey");
answ = JsonConvert.DeserializeObject<prodData>(rawData);
}
catch
{ }
// se vuoto leggo da DB
if (answ == null)
{
answ = getProdDataDb;
// salvo in sessione
currProdData = answ;
}
return answ;
}
set
{
string rawData = JsonConvert.SerializeObject(value);
memLayer.ML.setRSV(redProdKey, rawData, redProdKeyTTL);
}
}
public bool resetProdData()
{
bool answ = false;
try
{
currProdData = getProdDataDb;
answ = true;
}
catch
{ }
return answ;
}
/// <summary>
/// Rilegge i dati di prod da DB
/// </summary>
protected prodData getProdDataDb
{
get
{
prodData answ = null;
// leggo da DB ODL...
var tabOdl = MagDataLayer.man.taODL.getOpenByPost(cookieCodPost);
if (tabOdl.Count == 1)
{
var rigaOdl = tabOdl[0];
var tabArt = MagDataLayer.man.taAA.getByKey(rigaOdl.CodArticolo);
string descrArt = "ND";
if (tabArt.Count == 1)
{
descrArt = tabArt[0].DescrArt;
}
answ = new prodData()
{
CodPost = cookieCodPost,
CodOpr = cookieCodOpr,
RifExt = rigaOdl.KeyRichiesta,
CurrODL = $"{rigaOdl.IdxODL}",
CurrArtCod = rigaOdl.CodArticolo,
CurrArtDesc = descrArt
};
// ora descr articolo
}
return answ;
}
}
/// <summary>
/// Codice operatore
/// </summary>
public string CodOpr
{
get
{
return currProdData.CodOpr;
}
}
/// <summary>
/// Codice post
/// </summary>
public string CodPost
{
get
{
return currProdData.CodPost;
}
}
/// <summary>
/// Rif esterno (da ODL)
/// </summary>
public string RifExt
{
get
{
return currProdData.RifExt;
}
}
/// <summary>
/// ODL corrente x post
/// </summary>
public string CurrOdl
{
get
{
return currProdData.CurrODL;
}
}
/// <summary>
/// ODL corrente x post
/// </summary>
public string CurrOdlDesc
{
get
{
return $"ODL: {currProdData.CurrODL}";
}
}
/// <summary>
/// Articolo corrente x post
/// </summary>
public string CurrCodArt
{
get
{
return currProdData.CurrArtCod;
}
}
/// <summary>
/// Verifica se il cod articolo passato (tipicamente Eval DataGrid) sia OK con articolo corrente
/// </summary>
/// <param name="_codArt"></param>
/// <returns></returns>
public bool codArtOk(object _codArt)
{
bool answ = false;
if (_codArt != null)
{
if (!string.IsNullOrEmpty(_codArt.ToString()))
{
answ = _codArt.ToString() == CurrCodArt;
}
}
return answ;
}
/// <summary>
/// Descr Articolo corrente x post
/// </summary>
public string CurrArtDesc
{
get
{
var dati = currProdData;
return $"{dati.CurrArtCod} | {dati.CurrArtDesc}";
}
}
#if false
protected Dictionary<int, string> anagMateriali
{
set
{
string jsonData = JsonConvert.SerializeObject(value);
memLayer.ML.setRSV("anagMateriali", jsonData, 60);
}
get
{
Dictionary<int, string> answ = new Dictionary<int, string>();
//cerco in redis...
string rawData = memLayer.ML.getRSV("anagMateriali");
if (!string.IsNullOrEmpty(rawData))
{
answ = JsonConvert.DeserializeObject<Dictionary<int, string>>(rawData);
}
// sennò nel DB e salvo in redis...
else
{
var tabMat = DataLayer.man.taMat.GetData();
foreach (var item in tabMat)
{
answ.Add(item.MatID, item.MatDesc);
}
// salvo in redis
anagMateriali = answ;
}
// restituisco
return answ;
}
}
public string matByKey(object _matId)
{
string answ = "";
int matId = 0;
int.TryParse(_matId.ToString(), out matId);
try
{
answ = anagMateriali[matId];
}
catch
{ }
return answ;
}
#endif
}
}

Some files were not shown because too many files have changed in this diff Show More