Compare commits

...

564 Commits

Author SHA1 Message Date
Samuele Locatelli 7de72d3bf8 Merge tag 'AddParamLimitCheck01' into develop
Fix controllo parametri inviato in range ammissibile
2023-09-05 14:01:27 +02:00
Samuele Locatelli 21139721b8 Merge branch 'release/AddParamLimitCheck01' 2023-09-05 14:01:11 +02:00
Samuele Locatelli b76c7de6f9 Fix paginatore (hoard coded) 2023-09-05 13:23:47 +02:00
Samuele Locatelli 45f17da3d7 codemaid su classe GWMSDataService 2023-09-05 13:12:19 +02:00
Samuele Locatelli 430ac3373c refresh vari 2023-09-05 13:11:53 +02:00
Samuele Locatelli b6bb9a93d6 SendParam:
- aggiunto controlo parametro calcolato (ammissibile SOLO tra min/max)
2023-09-05 13:11:18 +02:00
Samuele Locatelli 0c014e5bcf YAML:
- rimozione stage test inutilizzato che da errori
2023-05-16 18:33:05 +02:00
Samuele Locatelli 5d24a718ca Merge tag 'AddVendutoOnStorico01' into develop
Aggiunto qta venduto in storico + fix typo vari
2023-05-16 18:28:50 +02:00
Samuele Locatelli dc4b4e016e Merge branch 'release/AddVendutoOnStorico01' 2023-05-16 18:28:32 +02:00
Samuele Locatelli b8edda48d3 - vari typo
- updsate display venduto in storico
2023-05-16 18:28:04 +02:00
Samuele Locatelli d1f0264e7d Aggiunta calcolo qta venduta in DTO LevelSummary 2023-05-16 18:27:10 +02:00
Samuele Locatelli 246ba5c3f4 refresh vers number 2023-01-26 15:06:24 +01:00
Samuele Locatelli 62856f93cc Merge tag 'FixGenOrdini' into develop
Update condizione generazione ordini
2023-01-26 11:47:08 +01:00
Samuele Locatelli bf35260327 Merge branch 'release/FixGenOrdini' 2023-01-26 11:46:58 +01:00
Samuele Locatelli 9bad2a2f27 Cambio condizione generaizone ordini:
- ignora ordini eventualmente mal creati (ordine > inizio fill)
2023-01-26 11:46:38 +01:00
Samuele Locatelli f19ff17228 Merge tag 'AddPiz10Img' into develop
Agfgiunta img temporanea x PIZ10 + alcuni aggiustamenti in home
2022-12-12 18:34:15 +01:00
Samuele Locatelli 84d933e17c Merge branch 'release/AddPiz10Img' 2022-12-12 18:33:54 +01:00
Samuele Locatelli d66d328468 Minor fix grafici 2022-12-12 18:32:34 +01:00
Samuele Locatelli 8c5f032194 Merge branch 'develop' 2022-12-12 18:15:16 +01:00
Samuele Locatelli d204b0d211 Aggiunta copia impianto PIZ09 --> PIZ10 2022-12-12 18:15:08 +01:00
Samuele Locatelli 3f01132a72 Merge tag 'UpdatePlantStatusLayout' into develop
Update x nuovo display a 6 blocchi x PlantStatus
2022-12-12 18:14:48 +01:00
Samuele Locatelli 88f05d72e7 Merge branch 'release/UpdatePlantStatusLayout' 2022-12-12 18:13:54 +01:00
Samuele Locatelli ec0fc6c697 Riorganizzazione scheda plant x 6 impianti 2022-12-12 18:11:44 +01:00
Samuele Locatelli d672979655 Merge tag 'UpdateSmtpAddress' into develop
Update account invio email
2022-06-21 09:06:44 +02:00
Samuele Locatelli 1a4387f2ad Merge branch 'release/UpdateSmtpAddress' 2022-06-21 09:06:35 +02:00
marco.locatelli@steamware.net b7495e4f13 Cambio da gmail ad outlook per invio notifiche 2022-06-20 17:57:19 +02:00
Samuele Locatelli 1f9dcbd773 Merge tag 'UpdateIconsAndGraph' into develop
Fix icona e buttons vari
2022-03-11 08:58:28 +01:00
Samuele Locatelli ba0a82b7ee Merge branch 'release/UpdateIconsAndGraph' 2022-03-11 08:58:16 +01:00
Samuele Locatelli c2c088e33b Merge remote-tracking branch 'origin/develop' into develop 2022-03-11 08:57:52 +01:00
marco.locatelli@steamware.net 34a144e688 Update nuova icona SVG bianca 2022-03-08 18:10:35 +01:00
marco.locatelli@steamware.net d6668f467e Update nuove icone Egalware 2022-03-08 17:28:34 +01:00
marco.locatelli@steamware.net 5bf2c194ca Correzione - Href to Button in Index 2022-03-08 11:37:02 +01:00
Samuele Locatelli bcaca9e7cf Merge tag 'UpdateDotNet6' into develop
Aggiornamento globale a dotNet6
2022-03-02 15:46:19 +01:00
Samuele Locatelli 40662a80a2 Merge branch 'release/UpdateDotNet6' 2022-03-02 15:46:04 +01:00
marco.salvi 1b3c581357 Modifica target framework per passaggio net6.0 2022-03-02 11:53:52 +01:00
marco.salvi 36c33aa5c9 Modifica campo data scheda trasportatore 2022-03-02 10:50:48 +01:00
Samuele Locatelli f1965d4253 Fix altre componenti base 2022-03-01 18:47:59 +01:00
Samuele Locatelli 45f7f1d4e4 Fix display grafico + date storico impianto 2022-03-01 18:40:49 +01:00
Samuele Locatelli 0728b898eb Fix prima apgina stato impianti con net6 2022-03-01 17:20:53 +01:00
Samuele Locatelli 5bdd97b722 Fixed display x chart vari 2022-03-01 16:04:23 +01:00
Samuele Locatelli 66ea0e4f82 Primo update globale componenti x net6 2022-03-01 15:15:35 +01:00
Samuele Locatelli c6cb60b1d1 Inizio porting net6 2022-03-01 14:36:30 +01:00
Samuele Locatelli 541a1a22e3 Merge tag 'updateColorStatus' into develop
Fix colore verde --> blu
2022-02-18 09:14:31 +01:00
Samuele Locatelli 7579dcc7ec Merge branch 'release/updateColorStatus' 2022-02-18 09:14:09 +01:00
marco.locatelli@steamware.net 6ad8c5b4bd nuovo minor fix colori (tolto verde acceso) 2022-02-17 12:51:52 +01:00
Samuele Locatelli dd96869f7c Merge tag 'Fix_setObjItems' into develop
Update procedura setObjItems
2022-02-17 11:17:38 +01:00
Samuele Locatelli f91d2086a4 Merge branch 'release/Fix_setObjItems' 2022-02-17 11:17:13 +01:00
Samuele Locatelli ce577e3427 Merge remote-tracking branch 'origin/develop' into develop 2022-02-17 11:16:10 +01:00
Samuele Locatelli 3dd1128c5f refresh 2022-02-17 11:16:01 +01:00
Samuele Locatelli 774215368c fix set taskType x errore avvio IOB GWMS 2022-02-17 11:15:57 +01:00
marco.locatelli@steamware.net cfdd308c84 minifix UX - colors 2022-02-16 16:45:34 +01:00
Samuele Locatelli 1eac43bf65 Merge tag 'FixDisplayBarraLivello' into develop
Fix display barra livello + fix menu top
2022-02-15 11:50:18 +01:00
Samuele Locatelli 4fae5108d8 Merge branch 'release/FixDisplayBarraLivello' 2022-02-15 11:50:07 +01:00
Samuele Locatelli a1e0552cfd Merge remote-tracking branch 'origin/develop' into develop 2022-02-15 11:49:37 +01:00
Samuele Locatelli f1b1b2de74 refresh 2022-02-15 11:48:41 +01:00
Samuele Locatelli 599ff6aaba Semplificaizone menù top 2022-02-15 11:48:25 +01:00
marco.locatelli@steamware.net 7b833a6383 fix list-group + ordinamento corretto navigazione 2022-02-14 14:53:07 +01:00
Samuele Locatelli b457ed905f refresh vers 2022-02-09 19:06:11 +01:00
Samuele Locatelli ace3f1062f cleanup & refactor codice 2022-02-09 19:06:05 +01:00
Samuele Locatelli 073ebcaf41 Merge tag 'FixCalcoloVenduto' into develop
Fix calcolo venduto
2022-02-03 10:03:37 +01:00
Samuele Locatelli 29ead2e26c Merge branch 'release/FixCalcoloVenduto' 2022-02-03 10:03:28 +01:00
Samuele Locatelli d88f2a5d12 Merge branch 'testProd' into develop 2022-02-03 10:03:09 +01:00
Samuele Locatelli 9243321336 refresh 2022-02-03 10:03:05 +01:00
Samuele Locatelli 45a2d1aa81 Fix calcolo venduto x dati mancanti gg 2022-02-03 10:02:23 +01:00
Samuele Locatelli cd108c1327 Merge branch 'develop' 2022-02-03 09:46:48 +01:00
Samuele Locatelli c445941aa2 wip x calcolo 2022-02-03 09:46:41 +01:00
Samuele Locatelli d5858dc440 altro fix && --> || x condizioni null 2022-02-03 09:25:40 +01:00
Samuele Locatelli 61a2c5547d Fix controllo valori nulli x livello rilevato 2022-02-03 09:22:17 +01:00
Samuele Locatelli db290137a1 Merge branch 'develop' 2022-02-02 11:04:09 +01:00
marco.locatelli@steamware.net 49a38e1d92 Gestione N-ordini per calcolo venduto 2022-02-02 11:03:27 +01:00
Samuele Locatelli 6eab14cd1d Merge tag 'InclusioneDatiVenduto' into develop
Inclusione dati venduto
2022-02-02 09:22:13 +01:00
Samuele Locatelli a2a0ea66c9 Merge branch 'release/InclusioneDatiVenduto' 2022-02-02 09:22:07 +01:00
Samuele Locatelli 9b8e6be1fa Refresh versione 2022-02-02 09:21:55 +01:00
marco.locatelli@steamware.net a8b04afc04 gestione venduto ieri+oggi 2022-02-01 17:36:45 +01:00
Samuele Locatelli b68464a23e Merge tag 'TraduzioneClaimsRuoli' into develop
Update metodo traduzione claims/valore opzione
2022-01-31 16:21:03 +01:00
Samuele Locatelli 88465c26b9 Merge branch 'release/TraduzioneClaimsRuoli' 2022-01-31 16:20:43 +01:00
Samuele Locatelli 75782c27c0 Update traduzione claims/ruoli 2022-01-31 16:20:14 +01:00
Samuele Locatelli cc2b7cc093 Merge tag 'AddResetCache' into develop
Aggiunta pagina reset cache
2022-01-31 15:17:36 +01:00
Samuele Locatelli d775c44c10 Merge branch 'release/AddResetCache' 2022-01-31 15:17:18 +01:00
Samuele Locatelli 3be9d4ab38 Invalidazione cache su richiesta 2022-01-31 15:16:52 +01:00
Samuele Locatelli 153a5343c2 Merge tag 'FixDefaultOrderSearch' into develop
Sistemazione calcolo trasp/suppl di default
2022-01-31 15:02:03 +01:00
Samuele Locatelli 9d69e407ea Merge branch 'release/FixDefaultOrderSearch' 2022-01-31 15:01:52 +01:00
Samuele Locatelli bcd0e8f0d5 Fix calcolo consegna settimanale 1 = ND 2022-01-31 15:00:58 +01:00
Samuele Locatelli 05f945196e Merge tag 'FixQrCode' into develop
Fix QRCode utenti in .*json
2022-01-26 16:21:06 +01:00
Samuele Locatelli 5f4bb45293 Merge branch 'release/FixQrCode' 2022-01-26 16:20:48 +01:00
marco.locatelli@steamware.net 880f3ecb95 Merge branch 'develop' of https://gitlab.steamware.net/steamware/gwms into develop 2022-01-26 16:17:30 +01:00
marco.locatelli@steamware.net d86464e89d QRcode corretto 2022-01-26 16:16:29 +01:00
Samuele Locatelli d95fca4d47 Merge tag 'FixHomeButtons' into develop
Aggiunta home buttons
2022-01-26 15:48:20 +01:00
Samuele Locatelli 8a5e79597e Merge branch 'release/FixHomeButtons' 2022-01-26 15:48:06 +01:00
marco.locatelli@steamware.net da77586543 Navigazione home page 2022-01-26 15:41:28 +01:00
Samuele Locatelli 8c0b3cea80 Merge tag 'FixQrAndHomeBtn' into develop
Fix gestione url rimando QR + buttons in home
2022-01-26 11:53:52 +01:00
Samuele Locatelli 812a88f781 Merge branch 'release/FixQrAndHomeBtn' 2022-01-26 11:53:38 +01:00
Samuele Locatelli f1508ecb97 Update x link corretto QRCode + button in home 2022-01-26 11:53:04 +01:00
Samuele Locatelli 8d51af5b01 Merge branch 'master' into develop 2022-01-21 12:52:30 +01:00
Samuele Locatelli 4b28b5924e Merge tag 'AddClaimIdTranslation' into develop
Merge gestione pure per ruoli utenti filtrabili
2022-01-21 12:52:21 +01:00
Samuele Locatelli 6d55ecef79 Aggiunta gestione ruolo 2022-01-21 12:51:54 +01:00
Samuele Locatelli 68beb7f6b7 Merge branch 'release/AddClaimIdTranslation' 2022-01-21 12:45:27 +01:00
Samuele Locatelli 74208e7a4b Update: edit utente da selettore supplier/plant/transp a tendina 2022-01-21 12:45:05 +01:00
Samuele Locatelli 8e5a366315 Merge tag 'AddClipboardCopyQRCode' into develop
Aggiunta copia clipboard
2022-01-21 10:20:37 +01:00
Samuele Locatelli c9d2e4528f Merge branch 'release/AddClipboardCopyQRCode' 2022-01-21 10:20:30 +01:00
Samuele Locatelli bb9b89b3e0 Aggiunta copia clipboard + link modificato x prod 2022-01-21 10:18:28 +01:00
Samuele Locatelli c2087179d0 Merge branch 'master' into develop 2022-01-21 10:02:47 +01:00
Samuele Locatelli da4db76f15 Ancora update url con baseAppPath 2022-01-21 10:02:38 +01:00
Samuele Locatelli e0da86f71b Merge branch 'develop' 2022-01-21 09:44:14 +01:00
Samuele Locatelli 637da2dbd7 Update base url da config 2022-01-21 09:44:08 +01:00
Samuele Locatelli de40678633 Merge tag 'AddUserQrcode' into develop
Aggiunta componente display qrcode utente
2022-01-21 09:29:19 +01:00
Samuele Locatelli 03befe8559 Merge branch 'release/AddUserQrcode' 2022-01-21 09:29:08 +01:00
Samuele Locatelli 97c96c6a0c Fix QrcodeDisplay 2022-01-21 09:28:28 +01:00
Samuele Locatelli 718d99d35f test Qrcode Display(KO) 2022-01-21 09:11:45 +01:00
Samuele Locatelli e812d2b076 typo 2022-01-21 09:11:31 +01:00
Samuele Locatelli 925376388b Spostamento classe qr js in file incluso 2022-01-21 09:11:01 +01:00
Samuele Locatelli a320902dbc Completata modifica x login jumper da URL + params 2022-01-21 08:35:23 +01:00
Samuele Locatelli 1de09ad0d6 Migliorata gestione jumper in login 2022-01-20 18:59:04 +01:00
Samuele Locatelli cec1de29e0 Inizio modifica x avere login via URL con id + email... 2022-01-20 18:06:05 +01:00
Samuele Locatelli 82e90f7f63 Merge tag 'UpdateVersatoOrdinato' into develop
Update visualizzazione plant analisys
2022-01-20 16:35:33 +01:00
Samuele Locatelli 91a65a0b62 Merge branch 'release/UpdateVersatoOrdinato' 2022-01-20 16:34:17 +01:00
Samuele Locatelli f63d7ba3ba Update visualizzazione plant analisys x ordini e versato e editing 2022-01-20 16:22:45 +01:00
Samuele Locatelli 74e438aa99 Aggiunta TS Ordinato / Versato nel DTO dei summary livello 2022-01-20 16:22:01 +01:00
Samuele Locatelli 1b9321cef7 Merge tag 'FixConfermaFLog' into develop
Fix conferma esecuzione FLog
2021-12-20 13:09:27 +01:00
Samuele Locatelli 90c446696f Merge branch 'release/FixConfermaFLog' 2021-12-20 13:09:20 +01:00
Samuele Locatelli 0a66fb6895 Update x notifica esecuzione task salvataggio FLOG 2021-12-20 13:08:51 +01:00
Samuele Locatelli ecae528287 Merge tag 'FixCloseScanner' into develop
Fix close scanner
2021-11-25 17:17:25 +01:00
Samuele Locatelli e2276798ed Merge branch 'release/FixCloseScanner' 2021-11-25 17:17:19 +01:00
Samuele Locatelli fce3d154fc Fix close button x scanner QR 2021-11-25 17:17:01 +01:00
Samuele Locatelli a0cd17dd07 Merge tag 'TestCambioXZing' into develop
Update versione stabile con nuova lib XZing
2021-11-25 17:11:35 +01:00
Samuele Locatelli e6d5a4bfe1 Merge branch 'release/TestCambioXZing' 2021-11-25 17:11:23 +01:00
Samuele Locatelli c3d0c9d2d8 COmpleto cambio libreria XZing 2021-11-25 17:10:41 +01:00
Samuele Locatelli cab87ecf63 Test modifica componente XZing 2021-11-25 17:02:39 +01:00
Samuele Locatelli bc1cab41da refresh develop 2021-11-25 15:45:42 +01:00
Samuele Locatelli 9849f28f3f Merge branch 'master' into develop 2021-11-25 15:29:54 +01:00
Samuele Locatelli 33777d7d3e Merge branch 'develop' 2021-11-25 15:29:46 +01:00
Samuele Locatelli d76ab0e115 refresh vers 2021-11-25 15:29:42 +01:00
Samuele Locatelli 18ab7e08ea Refresh versione 2021-11-25 15:29:28 +01:00
Samuele Locatelli ac0c14817c Merge branch 'master' into develop 2021-11-25 14:52:20 +01:00
Samuele Locatelli 8b7908b14a Rimozione completa HEALTHCHECK 2021-11-25 14:52:11 +01:00
Samuele Locatelli fd1453507f Merge branch 'develop' 2021-11-25 14:49:23 +01:00
Samuele Locatelli d2ddab281f uPDATE CLASSE db X TRANSIENT SERVICE 2021-11-25 14:49:17 +01:00
Samuele Locatelli a22d3c1e9d Merge branch 'develop' 2021-11-25 14:34:19 +01:00
Samuele Locatelli 9d8600ee7b Aggiunta semaforo processing in decodifica barcode (x evitare tante chiamate insieme) 2021-11-25 14:34:10 +01:00
Samuele Locatelli c36e7db974 Merge branch 'master' into develop 2021-11-25 13:08:08 +01:00
Samuele Locatelli 9df0aa79d1 Merge branch 'develop' 2021-11-25 13:07:54 +01:00
Samuele Locatelli 6dc3212bc5 update vers 2021-11-25 13:07:49 +01:00
Samuele Locatelli 117dd188d3 Merge branch 'master' into develop 2021-11-25 13:07:30 +01:00
Samuele Locatelli 66992a4d7a Aggiunto ritorno pagine corretto 2021-11-25 13:07:21 +01:00
Samuele Locatelli 0cae56932f Merge branch 'develop' 2021-11-25 12:33:05 +01:00
Samuele Locatelli 75325e7479 Update versione con 2 pagine gas station + load 2021-11-25 12:32:54 +01:00
Samuele Locatelli 538ac1e7fd Merge tag 'FixUserDisplayPagination' into develop
Fix user pagination
2021-11-24 11:04:54 +01:00
Samuele Locatelli 24d395001d Merge branch 'release/FixUserDisplayPagination' 2021-11-24 11:04:46 +01:00
Samuele Locatelli 391d55b7f9 Fix display tutti utenti GWMS 2021-11-24 10:37:12 +01:00
Samuele Locatelli 6df93c020d Merge tag 'FixFavicon' into develop
Fix gestioen favicon con rendering classe parziale + fix
safari/android/iOS
2021-11-12 09:48:44 +01:00
Samuele Locatelli bcbc9ea92c Merge branch 'release/FixFavicon' 2021-11-12 09:48:13 +01:00
Samuele Locatelli 50e29dc0b9 refresh 2021-11-12 09:47:48 +01:00
Samuele Locatelli 0416e5eb1e fix nav menu x home 2021-11-12 09:47:45 +01:00
Samuele Locatelli ac8ff44e16 Fix partial x favicons 2021-11-12 09:47:37 +01:00
Samuele Locatelli 7105323fde componente favicon 2021-11-12 09:36:13 +01:00
Samuele Locatelli d613ac56cf fix gestione favicon 2021-11-12 09:36:06 +01:00
Samuele Locatelli 400d26a989 modifica anche di host 2021-11-11 16:27:03 +01:00
Samuele Locatelli 2b17e0b79f update conf x base path + refresh 2021-11-11 16:18:59 +01:00
Samuele Locatelli a8b1552fe1 update barcode scanner 2021-11-11 15:19:52 +01:00
Samuele Locatelli b354ff3c59 update pacchetto barcodescanner 2021-11-11 15:18:54 +01:00
Samuele Locatelli 61dd35311d fix html come iniziale x sito 2021-11-11 13:01:23 +01:00
Samuele Locatelli 8c15c33533 test modifica host 2021-11-11 12:39:50 +01:00
Samuele Locatelli 1c27e4b550 Merge tag 'fixStr2doubleValConvLog' into develop
fix conversione string --> double x valore PlantLog
2021-11-11 09:24:19 +01:00
Samuele Locatelli eb1e301d5f Merge branch 'release/fixStr2doubleValConvLog' 2021-11-11 09:24:05 +01:00
Samuele Locatelli c0c26c8d7a refresh vers 2021-11-11 09:23:37 +01:00
Samuele Locatelli 3c94b7453a Aggiunto immagine plant Guardamiglio 2021-11-11 09:23:34 +01:00
Samuele Locatelli 36f495a1dc Fix ed unificazione conversione string2double 2021-11-11 09:23:20 +01:00
Samuele Locatelli 5fdf7e4253 Aggiunta img x 5° impianto + setup seed con guardamiglio 2021-11-04 17:44:23 +01:00
Samuele Locatelli 0fa063d803 Merge tag 'FixStatusPAge' into develop
Fix status page display + refresh + lento
2021-11-04 10:32:20 +01:00
Samuele Locatelli fab87251b7 Merge branch 'release/FixStatusPAge' 2021-11-04 10:32:01 +01:00
Samuele Locatelli e6e68951e9 refresh parametri 2021-11-04 10:31:45 +01:00
Samuele Locatelli 35ffe90e75 Update pagina overview refresh e display piccoli 2021-11-04 10:31:40 +01:00
Samuele Locatelli a69ee64671 Merge tag 'ReloadStatusPage' into develop
Aggiunta reload in main status page
2021-11-03 19:29:05 +01:00
Samuele Locatelli 720a171600 Merge branch 'release/ReloadStatusPage' 2021-11-03 19:28:56 +01:00
Samuele Locatelli e136c48dd2 Reload pagina anche su PlantStatus 2021-11-03 19:28:35 +01:00
Samuele Locatelli 67b6a5e6c2 Merge tag 'FixGetMemConf' into develop
Fix metodo salvataggio conf memoria con MEDIANA
2021-11-03 19:11:59 +01:00
Samuele Locatelli 15d393584e Refresh 2021-11-03 19:11:14 +01:00
Samuele Locatelli ab8ff5dea1 FIX enum x func mediana in calcolo VC 2021-11-03 19:11:05 +01:00
Samuele Locatelli 469de5dde1 Merge branch 'develop' 2021-11-03 17:38:53 +01:00
Samuele Locatelli 811af16935 Merge tag 'FixDisplayOrdini' into develop
Update display ordini + allarmi
2021-11-03 17:07:51 +01:00
Samuele Locatelli 758c2382e4 Merge branch 'release/FixDisplayOrdini' 2021-11-03 17:07:43 +01:00
Samuele Locatelli 96ce5f8b60 Update x fix invio email allarmi 2021-11-03 17:07:03 +01:00
Samuele Locatelli fa8203bd44 Merge branch 'master' into develop 2021-11-02 16:05:57 +01:00
Samuele Locatelli b190113d13 refresh 2021-11-02 16:05:40 +01:00
Samuele Locatelli 810c0790bd refresh 2021-11-02 16:04:18 +01:00
Samuele Locatelli c17eec87d1 Merge remote-tracking branch 'origin/develop' into develop 2021-11-02 16:03:53 +01:00
Samuele Locatelli f507574bb0 refresh 2021-11-02 16:02:44 +01:00
Samuele Locatelli a06d87ee90 Display qta caricata effettiva in lista storico 2021-11-02 16:02:41 +01:00
Samuele E. Locatelli 55162f3788 Merge tag 'SendAlarmVariations' into develop
Aggiunta invio email post registrazione log allarmi
2021-10-30 17:10:40 +02:00
Samuele E. Locatelli 97e25c7b74 Merge branch 'release/SendAlarmVariations' 2021-10-30 17:10:21 +02:00
Samuele E. Locatelli e22b35eae8 refresh 2021-10-30 17:09:50 +02:00
Samuele E. Locatelli 04123158d4 Aggiunta invio email post log allarmi (2 test!) 2021-10-30 17:09:47 +02:00
Samuele Locatelli cde398efdb Merge tag 'FixOrderStationLoad' into develop
Fix pagina caricamento ordini con QRCode scanner
2021-10-30 10:04:38 +02:00
Samuele Locatelli f3980a9aa8 Merge branch 'release/FixOrderStationLoad' 2021-10-30 10:04:22 +02:00
Samuele Locatelli a63ab90026 Completata review e fix pagina stazione 2021-10-30 10:03:59 +02:00
Samuele Locatelli 2eb97a8300 ancora code cleanup 2021-10-30 10:00:15 +02:00
Samuele Locatelli 5c73f921b5 Modifiche pagina stazione x evitare problema load 2021-10-30 09:55:53 +02:00
Samuele Locatelli dc1232f6ba RImozione pagina load (inutile x nuovo flusso) 2021-10-30 09:55:41 +02:00
Samuele Locatelli 8fc515b94e Merge tag 'FixDisplayChartBackward' into develop
fix calcolo decimazione grafico
2021-10-29 17:18:21 +02:00
Samuele Locatelli 97b4f9b12e Merge branch 'release/FixDisplayChartBackward' 2021-10-29 17:18:15 +02:00
Samuele Locatelli 6f743950c2 fix decimazione record grafici backward 2021-10-29 17:17:50 +02:00
Samuele Locatelli 218e7eab5e Merge tag 'FixDisplayCarico' into develop
Fix display smat + pagina elenco ordini
2021-10-29 17:01:33 +02:00
Samuele Locatelli 47fe7dbe3d Merge branch 'release/FixDisplayCarico' 2021-10-29 17:01:22 +02:00
Samuele Locatelli c8f817a2dc Fix resyle x grafica SMART device 2021-10-29 16:58:09 +02:00
Samuele Locatelli 74a3551b5e Aggiunta colonna distinta variazione/confermato 2021-10-29 16:17:58 +02:00
Samuele Locatelli 2eeb00a751 Merge tag 'AlarmDecoded01' into develop
Update ordinamento (refresh x forzare)
2021-10-28 17:51:25 +02:00
Samuele Locatelli 1b29546a89 Merge branch 'release/AlarmDecoded01' 2021-10-28 17:51:02 +02:00
Samuele Locatelli 40deea8938 Cambio button reset --> refresh 2021-10-28 17:50:45 +02:00
Samuele Locatelli 42c3d9b4e4 Merge tag 'AlarmDecoded' into develop
Fix ricezione allarmi decodificati
2021-10-28 17:28:19 +02:00
Samuele Locatelli 34a19d89c2 Merge branch 'release/AlarmDecoded' 2021-10-28 17:28:11 +02:00
Samuele Locatelli 46b611b930 COmpletata review x caricamento allarmi con traduzione 2021-10-28 17:27:49 +02:00
Samuele Locatelli f2e0d4084f Merge tag 'AlarmLogPage' into develop
Fix pagina display allarmi
2021-10-28 15:57:36 +02:00
Samuele Locatelli 75aec43ec0 Merge branch 'release/AlarmLogPage' 2021-10-28 15:57:21 +02:00
Samuele Locatelli 8819993161 Completata review pagina display allarmi 2021-10-28 15:56:45 +02:00
Samuele Locatelli 2de0c7e215 Init display allarmi 2021-10-28 15:33:21 +02:00
Samuele Locatelli ef3260224f Fix ridenominazione colonna allarmi 2021-10-28 15:33:13 +02:00
Samuele Locatelli 13e447d3d9 Merge tag 'AlarmLogInsertDraft' into develop
Draft registrazione allarmi
2021-10-28 12:59:46 +02:00
Samuele Locatelli 477e67f6f3 Merge branch 'release/AlarmLogInsertDraft' 2021-10-28 12:59:38 +02:00
Samuele Locatelli 6a7cb4aaa8 Update registrazione allarmi GWMS 2021-10-28 12:59:06 +02:00
Samuele Locatelli 2ac3f3a0a6 aggiunta migration x log allarmi 2021-10-28 12:29:06 +02:00
Samuele Locatelli 07062f6c60 Aggiunta classe DB x log allarmi 2021-10-28 12:28:58 +02:00
Samuele Locatelli e18c30e50c Merge tag 'SetParametersSend' into develop
Fix setup invio parametri programmato + check
2021-10-28 12:11:06 +02:00
Samuele Locatelli af443c3796 Merge branch 'release/SetParametersSend' 2021-10-28 12:10:53 +02:00
Samuele Locatelli f9fc315451 refresh procedura set send parametri 2021-10-28 12:10:15 +02:00
Samuele Locatelli 5e195207ff COmpletata gestione abilitazione send parametri 2021-10-28 11:43:11 +02:00
Samuele Locatelli 7564fda672 Update metodi x refresh typo 2021-10-27 19:29:59 +02:00
Samuele Locatelli a52ee34f4f migrazioni update x gestione parameteres send 2021-10-27 19:29:40 +02:00
Samuele Locatelli f1e44513ba Aggiunta classi x gestione tab ParamSend 2021-10-27 19:29:30 +02:00
Samuele Locatelli ba42ebdf49 Merge tag 'SetParametersCurve' into develop
Fix procedura setup parametri
2021-10-27 17:48:27 +02:00
Samuele Locatelli eff6394308 Merge branch 'release/SetParametersCurve' 2021-10-27 17:48:20 +02:00
Samuele Locatelli c3da657b26 Update gestione setup parametri a scadenza 2021-10-27 17:47:56 +02:00
Samuele Locatelli 26bf1c3017 Abbozzo gestione schedulazione parametri 2021-10-27 11:49:15 +02:00
Samuele Locatelli 9a659b15f5 Aggiunta a controlli metodi CRUD x ParamSet 2021-10-27 11:31:25 +02:00
Samuele Locatelli 1fef63cad5 refresh paramset 2021-10-27 11:15:21 +02:00
Samuele Locatelli bf1650a9a4 Modifica migrationx gestione ParamSet (mancavano dati PLANT e UID parametro) 2021-10-27 11:15:10 +02:00
Samuele Locatelli f16e08852b Aggiunta migrazione ParamSet 2021-10-27 11:11:31 +02:00
Samuele Locatelli 32d87212da Modifica modelli: aggiunto ParamSet 2021-10-27 11:11:21 +02:00
Samuele Locatelli fc61a411e7 Modifica comportamento update parametro singolo 2021-10-27 11:01:27 +02:00
Samuele Locatelli bba7f2f149 Merge tag 'ParamDisplay' into develop
Fix display parametri
2021-10-27 09:53:15 +02:00
Samuele Locatelli 627317bb8e Merge branch 'release/ParamDisplay' 2021-10-27 09:53:05 +02:00
Samuele Locatelli 7b353b1817 refresh controller 2021-10-27 09:52:46 +02:00
Samuele Locatelli c8619473c2 fix ricezione parametri 2021-10-27 09:52:41 +02:00
Samuele Locatelli 36c29fd79f update display UM 2021-10-27 09:52:18 +02:00
Samuele Locatelli 250ca6c169 Merge tag 'PlantOrderMan01' into develop
Fix procedura inizio/fine carico GNL
2021-10-26 15:06:53 +02:00
Samuele Locatelli 9e393cdff1 Fix order update da EFCore x inizio/fine carico impianto 2021-10-26 15:06:16 +02:00
Samuele Locatelli 8a255be19f Merge branch 'develop' 2021-10-26 14:18:35 +02:00
Samuele Locatelli 93c1624430 ulteriore fix x livello 2021-10-26 14:17:47 +02:00
Samuele Locatelli 79390e544e Merge tag 'FixLevelComeca' into develop
Fix gestione livello x comeca
2021-10-26 14:05:46 +02:00
Samuele Locatelli d0f2e21061 Merge branch 'hotfix/FixLevelComeca' 2021-10-26 14:05:39 +02:00
Samuele Locatelli 51a037cd74 refresh 2021-10-26 14:05:31 +02:00
Samuele Locatelli 05fff8d7ca Aggiunta conf x UM opzionale + refresh 2021-10-26 14:04:40 +02:00
Samuele Locatelli 9e54f037f5 fix conversione stringa con "," x siemensComeca 2021-10-26 14:04:26 +02:00
Samuele Locatelli 4647663cc0 Merge tag 'ParamEditTest03' into develop
Add reload timer su pagina parametri
2021-10-25 17:22:42 +02:00
Samuele Locatelli fee0faf8da Merge branch 'release/ParamEditTest03' 2021-10-25 17:22:28 +02:00
Samuele Locatelli 6ce1c6a227 Aggiunta timer reload parametri 2021-10-25 17:22:11 +02:00
Samuele Locatelli 881972d469 Merge tag 'ParamEditTest02' into develop
Aggiunta eliminazione parametri "orfani"
2021-10-25 16:44:00 +02:00
Samuele Locatelli c857126fa3 Merge branch 'release/ParamEditTest02' 2021-10-25 16:43:45 +02:00
Samuele Locatelli 78c8e78caa Update eliminazione parametri (da testare) 2021-10-25 16:43:32 +02:00
Samuele Locatelli 7f4a678b94 Merge tag 'ParamEditTest' into develop
Beta gestione edit parametri
2021-10-25 10:29:52 +02:00
Samuele Locatelli da1aa7c008 Merge branch 'release/ParamEditTest' 2021-10-25 10:29:41 +02:00
Samuele Locatelli 3b3756603c completo pagina prameterEdit 2021-10-25 10:29:11 +02:00
Samuele Locatelli 63e60a82a7 aggiunta componente editing parametri 2021-10-25 10:29:03 +02:00
Samuele Locatelli ea056ea089 Fix livello gestioen dati cache redis 2021-10-25 10:28:54 +02:00
Samuele E. Locatelli 7bef5e6154 Merge branch 'feature/AddParametersPage' into develop 2021-10-23 19:15:41 +02:00
Samuele E. Locatelli 02f072dc6c Completata prima release visualizzazione parametri 2021-10-23 19:15:16 +02:00
Samuele E. Locatelli dcfd321b37 Continuo setup preliminare pagina parametri 2021-10-23 19:03:55 +02:00
Samuele E. Locatelli 6fb3ed9664 refresh 2021-10-23 18:38:59 +02:00
Samuele E. Locatelli f4472a9ead Aggiunta preliminare pagina parametri impianto 2021-10-23 18:38:51 +02:00
Samuele Locatelli a25c38ed19 Merge tag 'TaskParFunc' into develop
COmpletata scrittura metodi IOB in GWMS x gestioen aprametri (quali
legge/scrive e infrastruttura x invio)
2021-10-22 19:38:30 +02:00
Samuele Locatelli ae583786dc Merge branch 'release/TaskParFunc' 2021-10-22 19:37:24 +02:00
Samuele Locatelli 7cc76b5fa6 code refactor 2021-10-22 19:35:16 +02:00
Samuele Locatelli 541cbb8dd2 Ottimizzazioni varie e fix codice async/await 2021-10-22 19:33:59 +02:00
Samuele Locatelli 42b2ca1159 Completata review metodo DB/Redis/Controller IOB x gestione parametri/Task 2021-10-22 19:20:09 +02:00
Samuele Locatelli c72864563c Completata review controller IOB x metodi necessari a invio parametri 2021-10-22 18:58:11 +02:00
Samuele Locatelli c6735a7dfc Aggiunti metodi add/get/rem Task2Exe x macchina 2021-10-22 16:02:46 +02:00
Samuele Locatelli 069f231bc8 Merge tag 'RemoveLocalUserTable' into develop
Fix rimozione tab users locale
2021-10-22 08:45:18 +02:00
Samuele Locatelli eefaf16541 Merge branch 'release/RemoveLocalUserTable' 2021-10-22 08:45:08 +02:00
Samuele Locatelli 70be2891f0 Update strategia migrazione e check health x rimozione users locali 2021-10-22 08:44:36 +02:00
Samuele Locatelli 8f05d9dd23 Modifica struttura x eliminazione tab utenti non + impiegata + migrazione 2021-10-22 08:44:21 +02:00
Samuele Locatelli 2d3f0c9894 Merge tag 'FixOldUserManFunc' into develop
FIx recupero utenti da IdentityFramework
2021-10-21 19:42:32 +02:00
Samuele Locatelli de9260eb98 Merge branch 'release/FixOldUserManFunc' 2021-10-21 19:42:19 +02:00
Samuele Locatelli 42d83239ef COmpletata review recupero dati utente da IDentityFramework 2021-10-21 19:42:10 +02:00
Samuele Locatelli 7b08668f74 Cambio metodi x recuperare utente da UserIdentity con claims + ruoli 2021-10-21 19:03:51 +02:00
Samuele Locatelli f7dcfc6838 Eliminazione anche di UserEditor 2021-10-21 18:33:16 +02:00
Samuele Locatelli be92e549a2 RImozione pagina UserManager obsoleta 2021-10-21 18:32:27 +02:00
Samuele Locatelli aa342df617 Merge tag 'ChangeRefillLevel' into develop
Livello refill minimo > 399kg
2021-10-21 16:36:19 +02:00
Samuele Locatelli 2344b2a12d Merge branch 'release/ChangeRefillLevel' 2021-10-21 16:36:10 +02:00
Samuele Locatelli 7353d22571 limite x rilievo carico: 399 kg 2021-10-21 16:35:50 +02:00
Samuele Locatelli a320c3b957 Merge tag 'addEmailSend' into develop
Aggiunta gestione invio email 8da testare in prod)
2021-10-21 16:24:33 +02:00
Samuele Locatelli bae8f72946 Merge branch 'release/addEmailSend' 2021-10-21 16:24:17 +02:00
Samuele Locatelli 38e0a5cfe5 Merge remote-tracking branch 'origin/develop' into develop 2021-10-21 16:19:05 +02:00
Samuele Locatelli 108bba2fba MOdifica gestioen check livelli con invio email alla bisogna 2021-10-21 16:16:38 +02:00
Samuele Locatelli 98ea55c07d inserito metodi test invio email 2021-10-21 16:16:27 +02:00
Samuele Locatelli 411442dc14 PAgina test x invio email 2021-10-21 16:16:18 +02:00
Samuele E. Locatelli f9b9bdfbb8 Merge tag 'FixDataInsertOverflow' into develop
Fix Errore dataflow insert orario con loop infinito: errore calcolo nuovi record x arrotondamento al minuto che dava esito FLOOR invece di ceiling e infinite-loop
2021-10-01 19:56:51 +02:00
Samuele E. Locatelli 755423cf78 Merge branch 'release/FixDataInsertOverflow' 2021-10-01 19:56:08 +02:00
Samuele E. Locatelli 36f6dc50bc Completata review senza log verboso e con decimazione dati a 1 h 2021-10-01 19:55:28 +02:00
Samuele E. Locatelli a43383557b Modifica metodo ceiling minuti x fix overfow insert 2021-10-01 19:48:51 +02:00
Samuele Locatelli daff2dce2b arrotondamento date limite x inserimento 2021-10-01 17:21:06 +02:00
Samuele Locatelli 4ccef56363 Aumento log inserting 2021-10-01 17:16:19 +02:00
Samuele Locatelli 6b48308ffa test cambio calcolo item da inserire 2021-10-01 17:11:47 +02:00
Samuele Locatelli 2c22f46061 Fix calcolo candidati da inserire (maybe) 2021-10-01 16:55:35 +02:00
Samuele Locatelli 36b800f1d6 forzo scrittura ogni 2minuti x esasperare ricalcolo 2021-10-01 16:41:37 +02:00
Samuele Locatelli 7b74df99e6 Aggiunti log trace x esecuzione PlantLogInsert 2021-10-01 16:40:06 +02:00
Samuele Locatelli 32e0a73d48 Merge tag 'TestSimUfficio02' into develop
Miglioramento SIM livello x GWMS
2021-10-01 16:11:33 +02:00
Samuele Locatelli ddf5d8ab40 Merge branch 'release/TestSimUfficio02' 2021-10-01 16:11:12 +02:00
Samuele Locatelli c300547118 refresh parametri 2021-10-01 16:10:56 +02:00
Samuele Locatelli bebfbcf75a Merge tag 'TestSimUfficio01' into develop
Fix sim x ufficio Ok --> OK x risposta SIM
2021-10-01 15:00:38 +02:00
Samuele Locatelli 1ba07bff35 Merge branch 'release/TestSimUfficio01' 2021-10-01 15:00:24 +02:00
Samuele Locatelli 92ad0517c2 FIx restituzione valore Ok --> OK x SIM 2021-10-01 15:00:04 +02:00
Samuele Locatelli 580c488e4c Rimesso UI x check health 2021-09-30 18:21:34 +02:00
Samuele Locatelli f6fb441dec Merge tag 'TestHealthCheck02' into develop
test senza interfaccia UI health
2021-09-30 17:16:23 +02:00
Samuele Locatelli b5635c4cf7 Merge branch 'release/TestHealthCheck02' 2021-09-30 17:16:13 +02:00
Samuele Locatelli 516623d5a0 Eliminata interfaccia check UI x ridurre presisone RAM 2021-09-30 17:15:57 +02:00
Samuele Locatelli bb5a44ff7c Merge tag 'TestHealthCheck01' into develop
test checks + frequenti
2021-09-30 16:23:46 +02:00
Samuele Locatelli 8e3cd6a2c8 Merge branch 'release/TestHealthCheck01' 2021-09-30 16:23:36 +02:00
Samuele Locatelli a185f9754a health check + frequenti x test 2021-09-30 16:21:21 +02:00
Samuele Locatelli e77ec8d5ff tolto timers inutilizzato 2021-09-30 16:21:01 +02:00
Samuele Locatelli d026fb7353 Merge tag 'AddPlantSetup' into develop
Aggiunta gestione parametri PlantSetup
2021-09-29 16:43:22 +02:00
Samuele Locatelli 4d24590902 Merge branch 'release/AddPlantSetup' 2021-09-29 16:43:12 +02:00
Samuele Locatelli c1f1705856 Aggiunta gestione parametri setup impianti 2021-09-29 16:42:51 +02:00
Samuele Locatelli 3769bd8e0f Merge tag 'FixDbCOntext' into develop
Fix DB COntext (x evitare dispose brutali)
2021-09-29 14:06:20 +02:00
Samuele Locatelli bbd3fc4998 Merge branch 'release/FixDbCOntext' 2021-09-29 14:06:08 +02:00
Samuele Locatelli e1f0b7e0f5 COmpletata review metodi x usare sempre contesti disosable 2021-09-29 14:05:17 +02:00
Samuele Locatelli 9e5e9bc66c Update gestione dbCtx con using locale 2021-09-29 13:19:45 +02:00
Samuele Locatelli 48286d15bc Eliminazione reset controller preliminare da apgine 2021-09-29 12:47:46 +02:00
Samuele Locatelli e4a0c17731 Merge tag 'FixMigrateError' into develop
Fix migrate error in creazione dbCtx
2021-09-29 12:15:55 +02:00
Samuele Locatelli fac885cd89 Merge branch 'release/FixMigrateError' 2021-09-29 12:15:35 +02:00
Samuele Locatelli 77754d6779 ancora udpate migrations 2021-09-29 12:12:24 +02:00
Samuele Locatelli e56aa02c38 Update x evitare troppe chiamate migrations 2021-09-29 12:12:16 +02:00
Samuele Locatelli cc71653a7a Merge branch 'develop' 2021-09-29 09:52:38 +02:00
Samuele Locatelli 2b4ee79730 refresh 2021-09-29 09:52:12 +02:00
Samuele Locatelli cf74810a34 Refresh 2021-09-29 09:51:54 +02:00
Samuele Locatelli 96c5ba5a54 Aggiunta pag test con auth anonimo 2021-09-29 09:51:48 +02:00
Samuele Locatelli 5a09496266 Merge branch 'develop' 2021-09-28 19:05:05 +02:00
Samuele Locatelli 7ca8af530e init date rivisto 2021-09-28 19:04:58 +02:00
Samuele Locatelli d2be5171bf Update x fondoscala costante 30'000 x tutti i plant 2021-09-28 18:50:06 +02:00
Samuele Locatelli f293c754f9 Merge tag 'RecTOutParam' into develop
Fix ricezione timeout aprametrica
2021-09-28 17:53:34 +02:00
Samuele Locatelli dec2787cd6 Refresh 2021-09-28 17:52:31 +02:00
Samuele Locatelli f5792d10aa Fix timeout display online parametrico 2021-09-28 17:52:23 +02:00
Samuele Locatelli 4ca8d4c236 Merge branch 'develop' 2021-09-24 14:59:42 +02:00
Samuele Locatelli 27ed5e0d8e Pagina Load esplicita 2021-09-24 14:59:28 +02:00
Samuele Locatelli 8c0cf93305 Merge tag 'FixQrCodeScanner' into develop
Fix QrScanner GasStation --> GastStationLoad
2021-09-24 14:45:48 +02:00
Samuele Locatelli 049ec8bbdb Merge branch 'hotfix/FixQrCodeScanner' 2021-09-24 14:45:27 +02:00
Samuele Locatelli 7500e1abfb Merge branch 'develop' into hotfix/FixQrCodeScanner 2021-09-24 14:45:18 +02:00
Samuele Locatelli bfb5bc15a1 Refresh versione 2021-09-24 14:45:11 +02:00
Samuele Locatelli 3c61ef3976 RImbalzo GastStation --> GasStationLoad x reload ordine 2021-09-24 14:44:26 +02:00
Samuele Locatelli a53c557bec Merge tag 'HistPlantPage' into develop
Aggiunta pagina x analisi storico ordini e carichi
2021-09-23 15:37:45 +02:00
Samuele Locatelli 1d4cc9d174 Merge branch 'release/HistPlantPage' 2021-09-23 15:37:35 +02:00
Samuele Locatelli 19a15ea9f2 Completato editing ed update ordini mancanti 2021-09-23 15:36:49 +02:00
Samuele Locatelli dd91fe353c Fix comportamento cambio selezione data 2021-09-23 11:57:56 +02:00
Samuele Locatelli 08df606bf2 Fix display icone con span intorno a fontawesome 2021-09-23 11:24:53 +02:00
Samuele Locatelli 132718ee79 Update identity 2021-09-23 10:53:02 +02:00
Samuele Locatelli 3f35dfe505 Update Nuget MySql 2021-09-23 10:52:31 +02:00
Samuele Locatelli 44a3e2d093 Update Nuget EFCore 2021-09-23 10:52:13 +02:00
Samuele Locatelli 2d32617d3c NUget Update NLog + Blazorise 2021-09-23 10:51:10 +02:00
Samuele Locatelli 0f8593a4a3 Update x mostrare dati anailsi carichi 2021-09-23 10:50:35 +02:00
Samuele Locatelli 3cad5ac58b Fix selezione e bozza pagina storico impianti 2021-09-23 10:02:42 +02:00
Samuele Locatelli a6a1afa826 Aggiunto DTO x calcolo livelli summary quotidiani 2021-09-23 10:02:30 +02:00
Samuele Locatelli 052c56b903 Correzione chiamate InvokeAsync inutili 2021-09-22 19:18:46 +02:00
Samuele Locatelli 1df85b32ee Merge tag 'PubNexusFix' into develop
Fix pubblicazione Nexus (path versioni)
2021-09-22 19:04:00 +02:00
Samuele Locatelli e1cc60a5c9 Merge branch 'release/PubNexusFix' 2021-09-22 19:03:50 +02:00
Samuele Locatelli 7f7370f6fe Fix posizione resources x install nexus 2021-09-22 19:02:06 +02:00
Samuele Locatelli 861911eb64 Test deploy unstable 2021-09-22 18:58:20 +02:00
Samuele Locatelli ed33783f49 Merge tag 'PageMarginFix' into develop
Page Margin Fix
2021-09-22 18:29:49 +02:00
Samuele Locatelli e3433962fa Merge branch 'release/PageMarginFix' 2021-09-22 18:29:30 +02:00
Samuele Locatelli 442d419460 Update grafico x visualizzazione 2021-09-22 18:28:53 +02:00
Samuele Locatelli c82cd1ed8b Refresh layout 2021-09-10 19:30:38 +02:00
Samuele Locatelli 23f7e9c726 Refresh log refresh 2021-09-10 19:30:11 +02:00
Samuele Locatelli c71a592ab3 Merge tag 'Jenkins2GitLab' into develop
Completato porting conf tag win x test nuovi runners
2021-09-02 12:11:43 +02:00
Samuele Locatelli c848168552 Merge branch 'release/Jenkins2GitLab' 2021-09-02 12:11:24 +02:00
Samuele Locatelli d95a19af32 Taggato job come "win" x selezionare runners 2021-09-02 11:39:52 +02:00
Samuele Locatelli c5e4f95b94 update nav menu 2021-09-02 11:30:29 +02:00
Samuele Locatelli 35e00bdb71 Aggiunta update await x lettura in transporters 2021-09-02 11:30:25 +02:00
Samuele Locatelli 8948984b44 Merge tag 'RC11' into develop
Test modifica suppliers/transporters
2021-09-01 09:36:47 +02:00
Samuele Locatelli 58f8d2aee3 Merge branch 'release/RC11' 2021-09-01 09:36:38 +02:00
Samuele Locatelli 951a704b52 Pérova modifica reset controller per errore online 2021-09-01 09:36:23 +02:00
Samuele Locatelli d518861228 Merge tag 'RC10' into develop
Test fix catena reload data
2021-09-01 09:04:59 +02:00
Samuele Locatelli 32a0fa1287 Merge branch 'release/RC10' 2021-09-01 09:04:50 +02:00
Samuele Locatelli 33212941c8 Test modifica naming x chiamate che danno errori in OVH 2021-09-01 09:04:34 +02:00
Samuele Locatelli 59975a335d Merge tag 'RC9' into develop
Fix reanming local db context
2021-08-31 16:49:12 +02:00
Samuele Locatelli 390046a0c7 Merge branch 'release/RC9' 2021-08-31 16:49:02 +02:00
Samuele Locatelli 149f6251f7 Renaming localDbCtx 2021-08-31 16:48:48 +02:00
Samuele Locatelli 46a0efe748 Merge tag 'RC8' into develop
Fix display grafici su mobile
2021-08-31 16:32:02 +02:00
Samuele Locatelli ace620b09d Merge branch 'release/RC8' 2021-08-31 16:31:36 +02:00
Samuele Locatelli 3d87f28004 Fix QRCode size on small device 2021-08-31 16:31:06 +02:00
Samuele Locatelli b7071dcbe1 Fix display QRCode (test) 2021-08-31 16:26:11 +02:00
Samuele Locatelli fdf937131c Fix display grafici 2021-08-31 16:21:57 +02:00
Samuele Locatelli 1b8a19b036 Merge tag 'RC7' into develop
Update indicazione aggiornamento dati realtime/vecchi
2021-08-30 12:39:31 +02:00
Samuele Locatelli 86bd0f375c Merge branch 'release/RC7' 2021-08-30 12:39:06 +02:00
Samuele Locatelli 9e1d437563 Aggiunta indicazione trasmisisone RTime / vecchia 2021-08-30 12:38:20 +02:00
Samuele Locatelli 6bd54468dd Modifica logging (meno verboso) e rallentamento check UI 2021-08-30 12:13:27 +02:00
Samuele Locatelli 52a71d236d Merge tag 'RC6' into develop
Inserite trappole x log + verboso
2021-08-30 11:58:51 +02:00
Samuele Locatelli c2fd4870c7 Merge branch 'release/RC6' 2021-08-30 11:58:42 +02:00
Samuele Locatelli b67fae281b Aggiunto log livello debug x controllers IOB 2021-08-30 11:58:26 +02:00
Samuele Locatelli 22f4455356 Merge tag 'RC5' into develop
Fix problema dimensioen QRCode
2021-08-30 09:42:11 +02:00
Samuele Locatelli 8107ba51b9 Merge branch 'release/RC5' 2021-08-30 09:42:01 +02:00
Samuele Locatelli b3062b04fc pulizia varia codice x classi non impiegate 2021-08-30 09:38:49 +02:00
Samuele Locatelli 3739225a28 riduzione canvas QRCode (raw fix) 2021-08-30 09:38:37 +02:00
Samuele Locatelli 2db1fbc8d6 Merge tag 'RC4' into develop
Completata migrazione QRCode js + fix vari x check e librerie
2021-08-27 13:03:02 +02:00
Samuele Locatelli 85944da9ed Merge branch 'release/RC4' 2021-08-27 13:02:40 +02:00
Samuele Locatelli a598c6793a Refresh versione delle 13 2021-08-27 13:02:18 +02:00
Samuele Locatelli bf30e006c3 Merge branch 'feature/QrCodeUpgrade' into develop 2021-08-27 13:01:51 +02:00
Samuele Locatelli e799fdf10a Rimozione check x pagina QRCode ext 2021-08-27 13:01:31 +02:00
Samuele Locatelli 34ce093ca9 Completata modifica x riprotare QRCode js (no img ext) 2021-08-27 12:56:56 +02:00
Samuele Locatelli c1d39b73e9 Integrato localmente JQuery e Popper 2021-08-27 12:42:40 +02:00
Samuele Locatelli 567b966157 COmpleto CHartJs locale + blazorise upgrade 2021-08-27 12:34:25 +02:00
Samuele Locatelli e076bc3f6b Upgrade Blazorise NuGet + ChartJs locale 2021-08-27 12:33:50 +02:00
Samuele Locatelli fd027e424f Merge tag 'FixOvhRamCpuIssue' into develop
Fix gestione ram: parameto ServerGC collector va messo a true x linux
virtual (errore RAM/CPU/Disco di OVH)
2021-08-27 12:17:46 +02:00
Samuele Locatelli 3bd8ee233b Merge branch 'hotfix/FixOvhRamCpuIssue' 2021-08-27 12:17:00 +02:00
Samuele Locatelli bb9e9ce7d5 Refresh version 2021-08-27 12:16:53 +02:00
Samuele Locatelli a5f5a55e34 Fix configurazione GC x server (su CPU fisica OK, su OVH c'erano problemi ram/disco) 2021-08-27 12:14:19 +02:00
Samuele Locatelli 2ecc7338e6 Merge tag 'RC3' into develop
Riduzione dimensione installer (èacchetti nuget, target framework, code
analysis...)
2021-08-27 11:56:36 +02:00
Samuele Locatelli 66c069fb35 Merge branch 'release/RC3' 2021-08-27 11:56:17 +02:00
Samuele Locatelli 361d4338a6 Merge branch 'feature/CodeCleanup' into develop 2021-08-27 11:55:58 +02:00
Samuele Locatelli 9a964330e3 Aggiunta conf x GarbageCollection + restrittiva sui processi 2021-08-27 11:54:13 +02:00
Samuele Locatelli 0e65410340 update Nuget AspNetCore 2021-08-27 11:53:56 +02:00
Samuele Locatelli b0e5d54061 Rimozione componenti analisi codice 2021-08-27 11:50:12 +02:00
Samuele Locatelli 9c979582d4 test sintassi pubblicazione SOLO linux 2021-08-27 11:41:52 +02:00
Samuele Locatelli 11cae94995 Update NLog 2021-08-27 11:39:45 +02:00
Samuele Locatelli 05ca047b5c Completo profili compilazione x64 Win/Linux 2021-08-27 11:39:20 +02:00
Samuele Locatelli cd533c190b Gestione profili compilazione Win/Linux x64 2021-08-27 11:39:04 +02:00
Samuele Locatelli efd84437b5 Rimozione elmah e quartz 2021-08-27 10:15:29 +02:00
Samuele Locatelli 1c36305304 Appunti log debug linux 2021-08-27 10:14:48 +02:00
Samuele Locatelli f1f1e784da Correzione jscript x generazione img-fluid 2021-08-26 19:41:35 +02:00
Samuele Locatelli 512d25f513 Merge tag 'RC2' into develop
Fix display main x spazio orizzontale (HOPE!)
2021-08-26 19:33:13 +02:00
Samuele Locatelli f1628818f3 Merge branch 'release/RC2' 2021-08-26 19:33:00 +02:00
Samuele Locatelli b57d20420b Corretto css e main class x display! 2021-08-26 19:32:36 +02:00
Samuele Locatelli cbf97a2eb6 Fix grafici x header/footer (non ancora ok) 2021-08-26 19:24:30 +02:00
Samuele Locatelli 284f7ff241 Merge tag 'RC1' into develop
Rilascio vers produzione con fix QR, fix search user, fix graph
2021-08-26 18:38:51 +02:00
Samuele Locatelli 888c7398f7 Merge branch 'release/RC1' 2021-08-26 18:38:29 +02:00
Samuele Locatelli 4926cb4715 Merge branch 'feature/DisplayFix' into develop 2021-08-26 18:37:56 +02:00
Samuele Locatelli e2c7615826 Completato revers grafici + revisione detail 2021-08-26 18:37:46 +02:00
Samuele Locatelli dc8ce10b51 Update x ricerca utenti 2021-08-26 18:02:01 +02:00
Samuele Locatelli ffb4c9872d Aggiunta paginazione utenti 2021-08-26 17:48:59 +02:00
Samuele Locatelli a415d175d9 Update gestione QR da JScript x trasportatori 2021-08-26 17:33:42 +02:00
Samuele Locatelli 60b069cd28 Merge tag 'PageAuthManRC' into develop
Fix versione page auth
2021-08-26 13:05:25 +02:00
Samuele Locatelli 7a63caa377 Merge branch 'release/PageAuthManRC' 2021-08-26 13:04:25 +02:00
Samuele Locatelli df970e0a69 Refresh progetto 2021-08-26 13:02:34 +02:00
Samuele Locatelli c5c40f67cd Merge branch 'feature/PageRoleSetup' into develop 2021-08-26 12:59:53 +02:00
Samuele Locatelli f8d2212ff3 Completata integrazione trasportatori 2021-08-26 12:59:40 +02:00
Samuele Locatelli 38bcffe135 Nuovo ruolo ( + migrazione) 2021-08-26 12:59:34 +02:00
Samuele Locatelli 02e7224736 inizio gestione supplier page 2021-08-26 12:23:52 +02:00
Samuele Locatelli 820ae5ce11 typo + fix menu 2021-08-26 12:23:43 +02:00
Samuele Locatelli 1f645b3aa2 Fix immagini lente a scaricare 2021-08-26 12:10:28 +02:00
Samuele Locatelli 9ff00ce0b6 Completata integrazioen controllo claim x pagine User+ 2021-08-26 12:02:58 +02:00
Samuele Locatelli 586d281736 revisione menu x visualizzazione condizionata ruolo 2021-08-26 11:17:48 +02:00
Samuele Locatelli 9441ee0e66 Revisione grafica pagie auth 2021-08-26 11:17:29 +02:00
Samuele Locatelli be61e174c0 Refresh 2021-08-26 10:39:35 +02:00
Samuele Locatelli 46f70964f0 Fix conf librerie locali 2021-08-26 10:38:44 +02:00
Samuele Locatelli c337bbb7da Fix bootstrap 5--> 4 2021-08-26 10:38:29 +02:00
Samuele Locatelli c007abe4a5 Aggiunta conf librerie locali 2021-08-26 10:22:45 +02:00
Samuele Locatelli 74ffe5983b Agfgiunta libreria locale bootstrap 2021-08-26 10:20:13 +02:00
Samuele Locatelli a6642512c3 refresh pagina 2021-08-25 19:14:43 +02:00
Samuele Locatelli f5389907f0 Update pagine x user login/logout/... 2021-08-25 18:59:10 +02:00
Samuele Locatelli 37ca1d9a70 INserito profilatura preliminare permessi encessari x vari ruoli 2021-08-25 18:00:16 +02:00
Samuele Locatelli a52199d4e3 Merge tag 'UserManRC' into develop
Inclusione prima versione gestione utenti con Identity Framework
2021-08-25 17:23:29 +02:00
Samuele Locatelli a6ab150e8d Merge branch 'release/UserManRC' 2021-08-25 17:23:09 +02:00
Samuele Locatelli b2afa672fc Merge branch 'feature/MoveUserUI' into develop 2021-08-25 16:32:22 +02:00
Samuele Locatelli 41e70fab62 Refresh 2021-08-25 16:32:07 +02:00
Samuele Locatelli 8bbb114c04 Controllo presenza utente samuele in login come SuperAdmin 2021-08-25 16:32:02 +02:00
Samuele Locatelli 435d12cb5b altri fix grafici 2021-08-25 16:31:41 +02:00
Samuele Locatelli d40cb20693 Fix vari css e layout 2021-08-25 16:31:34 +02:00
Samuele Locatelli 0fd554464e Sistemazione menù TOP 2021-08-25 16:31:17 +02:00
Samuele Locatelli ea04ae6245 Bozza gest user in navBar 2021-08-25 13:26:15 +02:00
Samuele Locatelli 4d717e9237 Prima integrazione funzionante (creando user) 2021-08-25 13:16:32 +02:00
Samuele Locatelli e6589a5438 Base rebuild post spostamento classi in UI 2021-08-25 13:10:45 +02:00
Samuele Locatelli 787283d239 ripristino TableCount obj 2021-08-25 13:08:58 +02:00
Samuele Locatelli 3f97f11c41 Aggiunte lib x QR + fontawesome locale 2021-08-25 13:08:48 +02:00
Samuele Locatelli cc62039aa4 Aggiunta area Identity di base 2021-08-25 13:08:29 +02:00
Samuele Locatelli 839ef56668 Merge branch 'feature/UserAuthCompletion' into develop 2021-08-25 12:35:38 +02:00
Samuele Locatelli a86eb452de Fix metodi await x users 2021-08-25 12:35:26 +02:00
Samuele Locatelli 318be3f7e0 Fix role/claims read/display 2021-08-25 12:23:55 +02:00
Samuele Locatelli 4c1ed660b2 Continuo identit: user + roles + claims 2021-08-25 12:03:45 +02:00
Samuele Locatelli 1778dd9290 Continuo integrazione librerie client (fontawesome) 2021-08-25 09:31:40 +02:00
Samuele Locatelli fef078b3bb update readme 2021-08-25 09:31:28 +02:00
Samuele Locatelli d3ebef281b Aggiunta libreria font-awesome 2021-08-25 09:21:29 +02:00
Samuele Locatelli f9999e6900 Merge branch 'feature/UserAuth' into develop 2021-08-24 19:29:43 +02:00
Samuele Locatelli 74ba4373f3 OK editing ruolo! 2021-08-24 19:29:28 +02:00
Samuele Locatelli 79436685d7 Ok fix gestione editing ruolo 2021-08-24 18:57:37 +02:00
Samuele Locatelli e9173e9735 Bozza pagina editing utenti (DA RIVEDERE!) 2021-08-24 17:48:29 +02:00
Samuele Locatelli d59ba7525f Ancora update admin utenti 2021-08-24 17:20:51 +02:00
Samuele Locatelli 38d7f0e8a0 Update verbosità LOG 2021-08-24 17:20:43 +02:00
Samuele Locatelli b25aeaa312 refresh pagina admin 2021-08-24 17:15:36 +02:00
Samuele Locatelli 227e7ded81 Continuo implementazione gestione utenti 2021-08-24 17:15:28 +02:00
Samuele Locatelli 65c17437f8 Fix migration x nuovo ruolo senza eliminare i precedenti 2021-08-24 16:43:23 +02:00
Samuele Locatelli c14f031fc5 Aggiunta preliminare migration (da validare) 2021-08-24 16:40:24 +02:00
Samuele Locatelli f6ecbb5761 Fix gestione auth richeista + eccezione in HOME 2021-08-24 16:08:10 +02:00
Samuele Locatelli 9150df1286 Inserito migration dati, gestione ruoli testata 2021-08-24 15:46:12 +02:00
Samuele Locatelli d0ab2df2ba rimozione Table COunters 2021-08-24 15:23:46 +02:00
Samuele Locatelli d364a16a58 aggiunta view auth x testing 2021-08-24 15:18:52 +02:00
Samuele Locatelli 75ab78ace4 aggiunta preliminare conf ruoli 2021-08-24 15:18:37 +02:00
Samuele Locatelli 0d34e61940 refresh site css 2021-08-24 15:02:19 +02:00
Samuele Locatelli 104e4acd93 Modifiche x sperimentare gestione ruoli auth 2021-08-24 14:59:11 +02:00
Samuele Locatelli bf7acb2b08 update gitignore 2021-08-24 14:59:00 +02:00
Samuele Locatelli 5e6453f53e Inizio setup x gestione QRCode 2021-08-24 14:15:36 +02:00
Samuele Locatelli d0e29fa6b4 Aggiunta classi x identity 2021-08-24 14:15:28 +02:00
Samuele Locatelli 32162c66ec refresh 2021-08-24 13:18:46 +02:00
Samuele Locatelli b01703f12f Minor fix grafici aprte UI AUTH 2021-08-24 13:18:43 +02:00
Samuele Locatelli 0db3604ade Merge branch 'develop' 2021-08-24 12:58:05 +02:00
Samuele Locatelli 379723889e Fix dotnet restore 2021-08-24 12:57:03 +02:00
Samuele Locatelli 17f3aa7c6e Merge branch 'develop' 2021-08-24 12:55:34 +02:00
Samuele Locatelli ab0c242e6d udpate Yaml 2021-08-24 12:55:06 +02:00
Samuele Locatelli cdba46bc45 Merge tag 'BetaLog' into develop
Rilascio versione con 2 sln separate
2021-08-24 12:52:28 +02:00
Samuele Locatelli 40353cfc03 Merge branch 'release/BetaLog' 2021-08-24 12:52:13 +02:00
Samuele Locatelli be46d09654 Cleanup e split progetti 2021-08-24 12:51:24 +02:00
Samuele Locatelli ef54e6f0cc Merge tag 'DemoAuthAndLogSignal-r' into develop
Inserimento log x debug signal-r richeisto da Marco e prima versione
Auth identity
2021-08-24 12:44:06 +02:00
Samuele Locatelli 29b084ae0e Merge branch 'release/DemoAuthAndLogSignal-r' 2021-08-24 12:43:49 +02:00
Samuele Locatelli 6564077260 Merge branch 'feature/UserAuth' into develop 2021-08-24 12:43:15 +02:00
Samuele Locatelli 9f495197d0 Aggiunta classi x gestione auth/identity 2021-08-24 12:42:52 +02:00
Samuele Locatelli a9286062c1 Fix logging x signal-r 2021-08-24 12:42:29 +02:00
Samuele Locatelli 1ea8e13a14 Appunti classe mailsender 2021-08-24 12:42:15 +02:00
Samuele Locatelli de0e9b990c Ancora update x AUTH 2021-08-24 12:41:59 +02:00
Samuele Locatelli c63116f871 Integrato MailKIT e testato invio email ad utente 2021-08-24 12:03:57 +02:00
Samuele Locatelli f956f010c3 Merge tag 'FixWeekPlanDisplay' into develop
Correzione problema display WeekPlan (mancavano include dei vari item di
dettaglio collegati in lettura EFCore)
2021-08-24 10:14:31 +02:00
Samuele Locatelli 51edaa918a Merge branch 'hotfix/FixWeekPlanDisplay' 2021-08-24 10:13:57 +02:00
Samuele Locatelli 655048645b refresh vers numb 2021-08-24 10:13:46 +02:00
Samuele Locatelli 42e3e44cd2 Fix errore display WeekPlan 2021-08-24 10:13:06 +02:00
Samuele Locatelli 6717945249 Merge tag 'BetaTest' into develop
Inserita navigabilità x smart device + sel trasportatore libera (da
gestire auth...)
2021-08-24 09:30:35 +02:00
Samuele Locatelli 82caec9287 Merge branch 'release/BetaTest' 2021-08-24 09:30:18 +02:00
Samuele Locatelli 36c79829b5 Filtro trasportatore libero (pre auth) 2021-08-24 09:29:43 +02:00
Samuele Locatelli bc0ff628fe Cleanup 2021-08-24 08:58:27 +02:00
Samuele Locatelli 527d29eac3 Aggiunta estensione x recupero QueryString 2021-08-24 08:58:12 +02:00
Samuele Locatelli 51686f4ed7 Fix display menù laterale 2021-08-24 08:46:34 +02:00
Samuele Locatelli ae30f49d13 Fix display ordini su mobile 2021-08-23 19:53:52 +02:00
Samuele Locatelli 156ef822d3 Merge tag 'UpdateSmartDisplay' into develop
Update x scalabilità cellulari
2021-08-23 19:29:46 +02:00
Samuele Locatelli bb83c88275 Merge branch 'release/UpdateSmartDisplay' 2021-08-23 19:29:35 +02:00
Samuele Locatelli b1275a5b98 refresh 2021-08-23 19:28:29 +02:00
Samuele Locatelli 7b2e722b9f Update scalabilità cellulari 2021-08-23 19:27:22 +02:00
Samuele Locatelli 65a9e544e8 Update comportamento display e riduzione menù laterale 2021-08-23 19:10:17 +02:00
Samuele Locatelli 1c93191a3c Merge branch 'develop' 2021-08-23 16:09:18 +02:00
Samuele Locatelli adfda41ecb Merge branch 'release/CameraSel' 2021-08-23 16:08:47 +02:00
Samuele Locatelli 5e07882384 Merge tag 'FixDataOrderByExtraction' into develop
Fix estrazione dati ordine DESC data
2021-08-23 16:05:57 +02:00
Samuele Locatelli 1598e4d3df Merge branch 'hotfix/FixDataOrderByExtraction' 2021-08-23 16:05:48 +02:00
Samuele Locatelli 732b09c5db refresh versione 2021-08-23 16:05:41 +02:00
Samuele Locatelli 97c372f0d7 gestione numero eventi > 10gg 2021-08-23 16:04:58 +02:00
Samuele Locatelli 6d61b675a5 Fix ordinamento dati estratti x serie temporali 2021-08-23 16:04:33 +02:00
Samuele Locatelli 786766c402 Editing e conferma qta evasa 2021-08-23 15:48:05 +02:00
Samuele Locatelli 76d8c027ea Fix update method x gestione carico/scarico da cellulare 2021-08-23 14:36:35 +02:00
Samuele Locatelli 8cc5def978 Update pagina editing esteso ordine 2021-08-20 09:21:08 +02:00
Samuele Locatelli 8bf61b66e0 Abbozzato gestione execution qty 2021-08-19 20:03:05 +02:00
Samuele Locatelli 2f716385a5 Ancora udpate x selezione plant corretto 2021-08-19 19:40:47 +02:00
Samuele Locatelli 16973a3203 Ancora aggiornamenti x update componente carico ordine 2021-08-19 19:25:34 +02:00
Samuele Locatelli 5157366942 Aggiunta componenti x gestione carico da Gas Station 2021-08-19 18:45:10 +02:00
Samuele Locatelli 4f49625022 Fix selezione show/hide camera sel 2021-08-19 17:23:17 +02:00
Samuele Locatelli e4272e2571 Merge tag 'ScannerQr' into develop
GEstione scanner con show/ide da URL
2021-08-19 15:52:26 +02:00
Samuele Locatelli a344c71a41 Merge branch 'release/ScannerQr' 2021-08-19 15:52:08 +02:00
Samuele Locatelli 16084755d4 Correzione comportamento scanner 2021-08-19 15:51:48 +02:00
Samuele Locatelli 677842f5e2 Merge tag 'ForwHeadersù' into develop
Aggiunta forwarders headers coem suggerito da Marco x nginx proxy
2021-08-19 11:05:55 +02:00
Samuele Locatelli e52c9f56fa Merge branch 'release/ForwHeadersù' 2021-08-19 11:05:39 +02:00
Samuele Locatelli 871bec2cf3 Fix forwarders headers x nginx 2021-08-19 11:05:10 +02:00
Samuele Locatelli 0a5ea3ad64 Merge tag 'QRCodeTest' into develop
Release iniziale lettura QRCode
2021-08-11 19:08:06 +02:00
Samuele Locatelli 11557de866 Merge branch 'release/QRCodeTest' 2021-08-11 19:07:57 +02:00
Samuele Locatelli 0a1fb88174 Abbozzata gestione acquisizione QRCode 2021-08-11 19:06:38 +02:00
Samuele Locatelli 1b28ddd007 Merge branch 'master' into develop 2021-08-11 18:34:30 +02:00
Samuele Locatelli 447c1d1d90 Test preliminare QRCode reader 2021-08-11 18:34:12 +02:00
Samuele Locatelli 050637948a Merge branch 'release/FixMobileTrasporters' 2021-08-11 18:21:30 +02:00
Samuele Locatelli 0497d6aaa5 Aggiunto filtro in URL x trasportatore 2021-08-11 18:21:02 +02:00
Samuele Locatelli be56ae95c5 Refresh 2021-08-11 18:14:30 +02:00
Samuele Locatelli c8603a2a34 OK pagina trasportatore (tranne filtro...) 2021-08-11 13:34:56 +02:00
Samuele Locatelli 3b2e8eefa4 Continuo modifiche x ppagina trasportatori (SMART-mobile) 2021-08-11 13:15:06 +02:00
Samuele Locatelli 06f2f7c9ea Inizio modifiche x pagina mobile 2021-08-11 13:14:53 +02:00
Samuele Locatelli 3908ee690d Gestione supplier filtrato (inizio) 2021-08-11 11:45:23 +02:00
Samuele Locatelli a15279766f Merge tag 'FullOrderEditing' into develop
Completato review editing ordini completo x user admin
2021-08-10 16:13:00 +02:00
633 changed files with 205069 additions and 3884 deletions
-90
View File
@@ -4,96 +4,6 @@
*.pdb
.vs/*
#--------------------------------
# Area VersGen
#--------------------------------
/VersGen/bin/*
/VersGen/obj/*
#--------------------------------
# area MapoDb
#--------------------------------
/MapoDb/bin/*
/MapoDb/obj/*
#--------------------------------
# area MP
#--------------------------------
/MP/bin/*
/MP/obj/*
MP/logs/*.txt
MP/logs/*.zip
MP-LAND/logs/
#--------------------------------
# Area MP-MON (MoonPro-MONitor)
#--------------------------------
/MP-MON/logs/*.zip
/MP-MON/logs/*.txt
/MP-MON/bin/*
/MP-MON/obj/*
/MP-MON/WebCharts/*.png
#--------------------------------
# Area MP-IO (MoonPro-IO)
#--------------------------------
/MP-IO/logs/*.zip
/MP-IO/logs/*.txt
/MP-IO/bin/*
/MP-IO/obj/*
/MP-IO/fileUpload/
!/MP-IO/fileUpload/.PlaceHolder.file
#--------------------------------
# Area MP-Admin
#--------------------------------
/MP-Admin/logs/*.zip
/MP-Admin/logs/*.txt
/MP-Admin/bin/*
/MP-Admin/obj/*
/MP-ADM/logs/*.zip
/MP-ADM/logs/*.txt
/MP-ADM/bin/*
/MP-ADM/obj/*
#--------------------------------
# Area ES3
#--------------------------------
/ES3/logs/*.zip
/ES3/logs/*.txt
/ES3/bin/*
/ES3/obj/*
#--------------------------------
# Area MoonProTablet
#--------------------------------
/MP-TAB/logs/*.zip
/MP-TAB/logs/*.txt
/MP-TAB/bin/*
/MP-TAB/obj/*
/MP-TAB/WebCharts/*.png
/MP-TAB/images/macchine/*.*
!/MP-TAB/images/macchine/Steamware.png
/MP-TAB/Files/Disegni/*.pdf
!/MP-TAB/Files/Disegni/ND.pdf
MP-TAB/logs/
#--------------------------------
# Area MoonPro
#--------------------------------
/MP-Site/logs/*.zip
/MP-Site/logs/*.txt
/MP-Site/bin/*
/MP-Site/obj/*
/MP-Site/WebCharts/*.png
/MP-Site/images/macchine/*.*
!/MP-Site/images/macchine/Steamware.png
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
+18 -49
View File
@@ -1,10 +1,4 @@
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\GPW\Release'
# DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
# NEW_REL: ''
VERS_MAIN: '0.9'
NEXUS_PATH: 'GWMS'
APP_NAME: 'GWMS.UI'
@@ -14,9 +8,9 @@ variables:
- |
$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 http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
}
echo $hasSource
@@ -52,64 +46,35 @@ variables:
$File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/$FileName
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$VersNumb/$FileName
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
}
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/manifest.xml
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/ChangeLog.html
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
stages:
- build
- test
# - deploy
- installer
- release
build:
stage: build
tags:
- win
before_script:
- *nuget-fix
- dotnet restore
- dotnet restore GWMS.sln
script:
- dotnet build
test:
stage: test
only:
- develop
needs: ["build"]
script:
- dotnet test
# IIS01:deploy:
# stage: deploy
# only:
# - develop
# needs: ["test"]
# # before_script:
# # - *nuget-fix
# # - dotnet restore
# script:
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true GWMS.UI/GWMS.UI.csproj
# IIS02:deploy:
# stage: deploy
# only:
# - master
# needs: ["build"]
# # before_script:
# # - *nuget-fix
# # - dotnet restore
# script:
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true GWMS.UI/GWMS.UI.csproj
# - dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true GWMS.UI/GWMS.UI.csproj
- dotnet build -p:Configuration=Release GWMS.UI/GWMS.UI.csproj
installer:
stage: installer
tags:
- win
only:
- develop
- master
@@ -118,13 +83,17 @@ installer:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
# pubblico solo installer Linux x64: https://docs.microsoft.com/en-us/dotnet/core/deploying/
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish -r linux-x64 --self-contained false
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
release:
stage: release
tags:
- win
only:
#- feature/Deploy_CI_CD
# - master
+35
View File
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/GWMS.UI/bin/Debug/net6.0/GWMS.UI.dll",
"args": [],
"cwd": "${workspaceFolder}/GWMS.UI",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
+42
View File
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/GWMS.UI/GWMS.UI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/GWMS.UI/GWMS.UI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/GWMS.UI/GWMS.UI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -28,7 +28,7 @@ namespace GWMS.Data
_configuration = configuration;
}
public AdminContext(DbContextOptions<GWMSContext> options) : base(options)
public AdminContext(DbContextOptions<AdminContext> options) : base(options)
{
}
File diff suppressed because it is too large Load Diff
+97
View File
@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DTO
{
public class PlantLevSumDTO
{
#region Public Properties
public int PlantId { get; set; }
public string PlantCode { get; set; } = "";
public string PlantDesc { get; set; } = "";
public DateTime DataRif { get; set; } = DateTime.Today;
public double LevelStart { get; set; } = 0;
public double LevelMin { get; set; } = 0;
public double LevelMax { get; set; } = 99999;
public double LevelEnd { get; set; } = 0;
public DateTime FillStart { get; set; } = DateTime.Today;
public DateTime FillEnd { get; set; } = DateTime.Today;
/// <summary>
/// Valore minimo x determinare un carico (399kg)
/// </summary>
public double DeltaMin { get; set; } = 399;
public bool HasRefill
{
get
{
return (LevelMax > LevelStart + DeltaMin) && ((LevelStart + LevelEnd) > 0);
}
}
public bool HasExecution
{
get
{
return ExecutionTS.Count > 0;
}
}
public bool HasOrder
{
get
{
return OrderTS.Count > 0;
}
}
public double QtaOrdinata
{
get
{
double answ = 0;
if (OrderTS.Count > 0)
{
answ = OrderTS.Sum(x => x.ValDouble);
}
return answ;
}
}
public double QtaVersata
{
get
{
double answ = 0;
if (ExecutionTS.Count > 0)
{
answ = ExecutionTS.Sum(x => x.ValDouble);
}
return answ;
}
}
public double QtaVenduta
{
get
{
double answ = LevelStart-LevelEnd + QtaVersata;
return answ;
}
}
public List<TSData> LevelTS { get; set; } = new List<TSData>();
public List<TSData> ExecutionTS { get; set; } = new List<TSData>();
public List<TSData> OrderTS { get; set; } = new List<TSData>();
public List<int> OrdersIds { get; set; } = new List<int>();
#endregion Public Properties
}
}
+29 -2
View File
@@ -14,16 +14,17 @@ namespace GWMS.Data.DTO
{
#region Public Properties
public int PlantId { get; set; }
public string PlantCode { get; set; } = "";
public string PlantDesc { get; set; } = "";
public DateTime LastUpdate { get; set; } = DateTime.Today.AddYears(-10);
public double LevelMax { get; set; } = 99999;
public double LevelAct { get; set; } = 0;
public double LevelReorder { get; set; } = 0;
public double OrderQtyStd { get; set; } = 0;
public double MidnightQty { get; set; } = 0;
public int LevelRatio
{
@@ -36,9 +37,35 @@ namespace GWMS.Data.DTO
}
}
public double ReorderRatio
{
get
{
double answ = 0;
double denom = LevelMax == 0 ? 1 : LevelMax;
answ = Math.Round((double)(LevelReorder * 100 / denom), 2);
return answ;
}
set
{
LevelReorder = value * LevelMax / 100;
}
}
/// <summary>
/// Storico Livelli
/// </summary>
public List<TSData> LevelTS { get; set; } = new List<TSData>();
/// <summary>
/// Storico Ordini
/// </summary>
public List<TSData> OrderTS { get; set; } = new List<TSData>();
/// <summary>
/// Storico Vendite
/// </summary>
public List<TSData> SoldTS { get; set; } = new List<TSData>();
public double TempMax { get; set; } = 40;
+57
View File
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella dati Plant (log storico)
/// </summary>
[Table("AlarmLog")]
public class AlarmLogModel
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int AlarmLogId { get; set; }
/// <summary>
/// Data registazione
/// </summary>
public DateTime DtEvent { get; set; } = DateTime.Now;
/// <summary>
/// Impianto di riferimento
/// </summary>
public int PlantId { get; set; }
/// <summary>
/// Indirizzo area memoria allarme
/// </summary>
[MaxLength(50)]
public string MemAddress { get; set; } = "";
/// <summary>
/// Indice nel banco allarmi
/// </summary>
public int Index { get; set; } = 0;
/// <summary>
/// Valore banco allarmi
/// </summary>
public uint Status { get; set; } = 0;
/// <summary>
/// Valore decodificato (opzionale)
/// </summary>
public string ValDecoded { get; set; } = "";
[ForeignKey("PlantId")]
public virtual PlantDetailModel Plant { get; set; }
}
}
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella Setup aprametri
/// </summary>
[Table("ParamSend")]
public class ParamSendModel
{
#region Public Properties
/// <summary>
/// Plant di riferimento
/// </summary>
public int PlantId { get; set; } = 0;
/// <summary>
/// Uid parametro
/// </summary>
public string ParamUid { get; set; } = "";
/// <summary>
/// Ultimo invio registrato
/// </summary>
public DateTime LastSend { get; set; } = DateTime.Today.AddDays(-7);
/// <summary>
/// Veto invio programmato
/// </summary>
public DateTime VetoSend { get; set; } = DateTime.Today.AddDays(-7);
/// <summary>
/// Invio automatico abilitato
/// </summary>
public bool enabled { get; set; } = false;
/// <summary>
/// Inizio finestra oraria in cui inviare parametri
/// </summary>
public int windStart { get; set; } = 1;
/// <summary>
/// Fine finestra oraria in cui inviare parametri
/// </summary>
public int windEnd { get; set; } = 2;
#endregion Public Properties
}
}
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella Setup aprametri
/// </summary>
[Table("ParamSet")]
public class ParamSetModel
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ParamSetId { get; set; }
public int PlantId { get; set; } = 0;
public string ParamUid { get; set; } = "";
public DateTime Scadenza { get; set; } = DateTime.Today;
public decimal TargetVal { get; set; } = 0;
[MaxLength(250)]
public string Note { get; set; } = "";
#endregion Public Properties
}
}
@@ -32,18 +32,6 @@ namespace GWMS.Data.DatabaseModels
public double OrderQtyStd { get; set; } = 1000;
//public double LastLevelMax { get; set; } = 0;
//public double PressAct { get; set; } = 0;
//public double PressBHMax { get; set; } = 9999;
//public double PressBHAct { get; set; } = 0;
//public double PressBLMax { get; set; } = 9999;
//public double PressBLAct { get; set; } = 0;
#endregion Public Properties
}
}
+3
View File
@@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Classe fake x il conteggio tabelle e check preliminari
/// </summary>
[Keyless]
public class TableCount
{
+1 -1
View File
@@ -30,7 +30,7 @@ namespace GWMS.Data.DatabaseModels
public double PositionLongitude { get; set; }
public DateTime PositionUpdated { get; set; } = DateTime.Now;
public DateTime PositionUpdated { get; set; }
#endregion Public Properties
}
-64
View File
@@ -1,64 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella Users
/// </summary>
[Table("Users")]
public class UserModel
{
#region Public Properties
[Key, Column(Order = 0), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
[Column(Order = 1), MaxLength(50)]
public string UserName { get; set; } = "";
[Column(Order = 1), MaxLength(250)]
public string SaltPasswd { get; set; } = "";
[Column(Order = 3), MaxLength(50)]
public string Lastname { get; set; } = "";
[Column(Order = 4), MaxLength(50)]
public string Firstname { get; set; } = "";
[Column(Order = 5), MaxLength(250)]
public string Email { get; set; } = "";
[Column(Order = 6), MaxLength(10)]
public string Lang { get; set; } = "IT";
[Column(Order = 7), MaxLength(100)]
public string AuthKey { get; set; } = "";
[Column(Order = 8)]
public bool IsActive { get; set; } = true;
[Column(Order = 9)]
public UserLevel Livello { get; set; } = UserLevel.ND;
[Column(Order = 10)]
public int MaskPlantId { get; set; } = 9999;
[Column(Order = 11)]
public int MaskSupplierId { get; set; } = 9999;
[Column(Order = 12)]
public int MaskTranspId { get; set; } = 9999;
#endregion Public Properties
}
}
+4 -6
View File
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using NLog;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.Data
{
+1 -6
View File
@@ -1,9 +1,4 @@
using GWMS.Data.DatabaseModels;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
namespace GWMS.Data
+77 -1
View File
@@ -43,6 +43,77 @@ namespace GWMS.Data
String
}
/// <summary>
/// Elenco task ammessi (x IOB-WIN da eseguire...)
/// </summary>
public enum taskType
{
/// <summary>
/// Task nullo / fake
/// </summary>
nihil,
/// <summary>
/// Rimanda a PLC eventuale segnale NON in setup (MA NON RESETTA)
/// </summary>
fixStopSetup,
/// <summary>
/// Indica al PLC di forzare il reset del contapezzi
/// </summary>
forceResetPzCount,
/// <summary>
/// Indica al PLC di forzare il NUOVO valore di contapezzi (impostato come value)
/// </summary>
forceSetPzCount,
/// <summary>
/// Imposta Articolo su PLC
/// </summary>
setArt,
/// <summary>
/// Imposta Commessa su PLC
/// </summary>
setComm,
/// <summary>
/// Set di un PARAMETRO su PLC (in value avremo un JSON object)
/// </summary>
setParameter,
/// <summary>
/// Set Programma CNC su PLC
/// </summary>
setProg,
/// <summary>
/// Indica al PLC di impostare il numero di pezzi da produrre per la commessa (impostato come value)
/// </summary>
setPzComm,
/// <summary>
/// Indica al PLC iniziato setup (e secondo casi ferma contapezzi /resetta)
/// </summary>
startSetup,
/// <summary>
/// Indica al PLC finito setup (e secondo casi ferma contapezzi /resetta)
/// </summary>
stopSetup,
/// <summary>
/// Richiesta invio watchdog a PLC
/// </summary>
sendWatchDogMes2Plc,
/// <summary>
/// Indica che è FINITA la produzione (e quindi cancello dati backup)
/// </summary>
endProd,
}
public enum UserLevel
{
ND = 0,
@@ -75,6 +146,11 @@ namespace GWMS.Data
/// <summary>
/// Valore minimo del periodo
/// </summary>
MIN
MIN,
/// <summary>
/// Calcolo MEDIANA
/// </summary>
MEDIAN
}
}
+14 -11
View File
@@ -1,29 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Controllers\GWMS.Data.DbController.cs" />
<Compile Remove="DatabaseModels\UserModel.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.7">
<PackageReference Include="MailKit" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.7">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="NLog" Version="4.7.10" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
</ItemGroup>
</Project>
+38 -18
View File
@@ -1,11 +1,9 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration;
using GWMS.Data.DatabaseModels;
using NLog;
using System.Linq;
using GWMS.Data.Controllers;
namespace GWMS.Data
{
@@ -28,13 +26,6 @@ namespace GWMS.Data
public GWMSContext(IConfiguration configuration)
{
_configuration = configuration;
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{ }
}
public GWMSContext(DbContextOptions<GWMSContext> options) : base(options)
@@ -45,7 +36,9 @@ namespace GWMS.Data
Database.Migrate();
}
catch (Exception exc)
{ }
{
Log.Error(exc, "Exception during context initialization 02");
}
}
#endregion Public Constructors
@@ -53,20 +46,34 @@ namespace GWMS.Data
#region Public Properties
public virtual DbSet<RebootLogModel> DbRebootLog { get; set; }
public virtual DbSet<AlarmLogModel> DbSetAlarmLog { get; set; }
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
public virtual DbSet<ItemModel> DbSetItems { get; set; }
public virtual DbSet<AnKeyValModel> DbSetKeyVal { get; set; }
public virtual DbSet<ListValModel> DbSetListVal { get; set; }
public virtual DbSet<OrderModel> DbSetOrders { get; set; }
public virtual DbSet<ParamSendModel> DbSetParamSend { get; set; }
public virtual DbSet<ParamSetModel> DbSetParamSet { get; set; }
public virtual DbSet<PlantDetailModel> DbSetPlant { get; set; }
public virtual DbSet<PlantLogModel> DbSetPlantLog { get; set; }
public virtual DbSet<PlantStatusModel> DbSetPlantStatus { get; set; }
public virtual DbSet<WeekPlanModel> DbSetPlantSupplWeekPlan { get; set; }
public virtual DbSet<SupplierModel> DbSetSupplier { get; set; }
public virtual DbSet<TransporterModel> DbSetTransporter { get; set; }
public virtual DbSet<UserModel> DbSetUser { get; set; }
#endregion Public Properties
@@ -86,13 +93,6 @@ namespace GWMS.Data
// tento setup da config
try
{
//string server = _configuration["DbConfig:Server"];
//string nKey = _configuration["DbConfig:nKey"];
//string sKey = _configuration["DbConfig:sKey"];
//DbConfig.InitDb(server, nKey, sKey);
//DbConfig.CheckUser(nKey, sKey);
// uso conn string calcolata
connString = DbConfig.CONNECTION_STRING;
}
@@ -123,11 +123,31 @@ namespace GWMS.Data
modelBuilder.Entity<PlantStatusModel>().HasKey(c => new { c.PlantId, c.FluxType });
modelBuilder.Entity<ParamSendModel>().HasKey(c => new { c.PlantId, c.ParamUid });
modelBuilder.Seed();
OnModelCreatingPartial(modelBuilder);
}
#endregion Protected Methods
#region Public Methods
public void DbForceMigrate()
{
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
Log.Info("DbForceMigrate: done!");
}
catch (Exception exc)
{
Log.Error(exc, "DbForceMigrate: Exception during context initialization 01");
}
}
#endregion Public Methods
}
}
+54
View File
@@ -65,6 +65,11 @@ namespace GWMS.Data
[JsonConverter(typeof(StringEnumConverter))]
public plcDataType tipoMem { get; set; } = plcDataType.Int;
/// <summary>
/// Unità di misura del parametro
/// </summary>
public string unit { get; set; } = "";
/// <summary>
/// Valore parametro (come stringa, decimali con ",", default VUOTO), poi LETTO da PLC (o appena scritto)
/// </summary>
@@ -191,6 +196,40 @@ namespace GWMS.Data
/// </summary>
public string name { get; set; } = "";
/// <summary>
/// Wrapper valore richiesto come decimal
/// </summary>
public decimal reqValDec
{
get
{
decimal answ = 0;
decimal.TryParse(reqValue, out answ);
return answ;
}
set
{
reqValue = $"{value}";
}
}
/// <summary>
/// Wrapper valore richiesto come INT
/// </summary>
public int reqValInt
{
get
{
int answ = 0;
int.TryParse(reqValue, out answ);
return answ;
}
set
{
reqValue = $"{value}";
}
}
/// <summary>
/// Indica il NUOVO valore richiesto x l'item
/// </summary>
@@ -201,6 +240,21 @@ namespace GWMS.Data
/// </summary>
public string uid { get; set; } = "";
/// <summary>
/// Unità Misura parametro
/// </summary>
public string UM { get; set; }
/// <summary>
/// Valore MASSIMO (SE impostato)
/// </summary>
public int valMax { get; set; }
/// <summary>
/// Valore minimo (SE impostato)
/// </summary>
public int valMin { get; set; }
/// <summary>
/// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC
/// </summary>
+65
View File
@@ -0,0 +1,65 @@
using MailKit.Net.Smtp;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.Extensions.Options;
using MimeKit;
using MimeKit.Text;
using System.Threading.Tasks;
namespace GWMS.Data
{
/// <summary>
/// Implementazione interfaccia email con pacchetto MailKIT
///
/// https://www.ryadel.com/en/asp-net-core-send-email-messages-smtp-mailkit/
/// </summary>
public class MailKitEmailSender : IEmailSender
{
#region Public Constructors
public MailKitEmailSender(IOptions<MailKitEmailSenderOptions> options)
{
this.Options = options.Value;
}
#endregion Public Constructors
#region Public Properties
public MailKitEmailSenderOptions Options { get; set; }
#endregion Public Properties
#region Public Methods
public Task Execute(string to, string subject, string message)
{
// create message
var email = new MimeMessage();
email.Sender = MailboxAddress.Parse(Options.Sender_EMail);
if (!string.IsNullOrEmpty(Options.Sender_Name))
email.Sender.Name = Options.Sender_Name;
email.From.Add(email.Sender);
email.To.Add(MailboxAddress.Parse(to));
email.Subject = subject;
email.Body = new TextPart(TextFormat.Html) { Text = message };
// send email
using (var smtp = new SmtpClient())
{
smtp.Connect(Options.Host_Address, Options.Host_Port, Options.Host_SecureSocketOptions);
smtp.Authenticate(Options.Host_Username, Options.Host_Password);
smtp.Send(email);
smtp.Disconnect(true);
}
return Task.FromResult(true);
}
public Task SendEmailAsync(string email, string subject, string message)
{
return Execute(email, subject, message);
}
#endregion Public Methods
}
}
+31
View File
@@ -0,0 +1,31 @@
using MailKit.Security;
namespace GWMS.Data
{
public class MailKitEmailSenderOptions
{
#region Public Constructors
public MailKitEmailSenderOptions()
{
Host_SecureSocketOptions = SecureSocketOptions.Auto;
}
#endregion Public Constructors
#region Public Properties
public string Host_Address { get; set; }
public string Host_Password { get; set; }
public int Host_Port { get; set; }
public SecureSocketOptions Host_SecureSocketOptions { get; set; }
public string Host_Username { get; set; }
public string Sender_EMail { get; set; }
public string Sender_Name { get; set; }
#endregion Public Properties
}
}
+301
View File
@@ -0,0 +1,301 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.User.Migrations
{
[DbContext(typeof(UserIdentityDbContext))]
[Migration("20210824132434_RolesAdded")]
partial class RolesAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.8");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
b.HasData(
new
{
Id = "24a790ae-8eac-4c9f-9043-aa688b626169",
ConcurrencyStamp = "c9adff6c-ffac-48e3-899b-8549ca443071",
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new
{
Id = "7a024dca-5e5d-47be-b754-75c8921d88bf",
ConcurrencyStamp = "3b9aab89-73b6-4051-9825-d5381d2896da",
Name = "User",
NormalizedName = "USER"
},
new
{
Id = "0a5335f9-64b2-4196-9d5b-db873cb48d94",
ConcurrencyStamp = "25097cab-df45-4bdd-8616-041962c72050",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d",
ConcurrencyStamp = "3c222fe9-d5e5-4ba0-9767-4c1777677105",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("RoleId")
.HasColumnType("varchar(255)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Value")
.HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,48 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.User.Migrations
{
public partial class RolesAdded : Migration
{
#region Protected Methods
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "0a5335f9-64b2-4196-9d5b-db873cb48d94");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "24a790ae-8eac-4c9f-9043-aa688b626169");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "7a024dca-5e5d-47be-b754-75c8921d88bf");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d");
}
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "24a790ae-8eac-4c9f-9043-aa688b626169", "c9adff6c-ffac-48e3-899b-8549ca443071", "ExtUser", "EXTUSER" },
{ "7a024dca-5e5d-47be-b754-75c8921d88bf", "3b9aab89-73b6-4051-9825-d5381d2896da", "User", "USER" },
{ "0a5335f9-64b2-4196-9d5b-db873cb48d94", "25097cab-df45-4bdd-8616-041962c72050", "Admin", "ADMIN" },
{ "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d", "3c222fe9-d5e5-4ba0-9767-4c1777677105", "SuperAdmin", "SUPERADMIN" }
});
}
#endregion Protected Methods
}
}
@@ -0,0 +1,308 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.User.Migrations
{
[DbContext(typeof(UserIdentityDbContext))]
[Migration("20210824143900_UndefRoleAdd")]
partial class UndefRoleAdd
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.8");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
b.HasData(
new
{
Id = "bf698c1c-ead1-4d88-83ef-536098876807",
ConcurrencyStamp = "28d97b49-8df4-4d20-8680-1d3abbf4ed94",
Name = "Undef",
NormalizedName = "UNDEF"
},
new
{
Id = "a1280bf2-7e5a-447b-b070-3bea27ba2239",
ConcurrencyStamp = "d361332c-1ae0-486c-b1d8-1f2c9c36ad88",
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new
{
Id = "533995b8-8561-471a-b613-a03685141065",
ConcurrencyStamp = "773db769-a518-406f-9144-31e1fd9f7a76",
Name = "User",
NormalizedName = "USER"
},
new
{
Id = "d4790e4e-600b-4bae-876d-04c619adc9b0",
ConcurrencyStamp = "70529623-7648-4640-b69e-a1e0ddff10ed",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "3e7ddc7b-94eb-4364-b4d5-311c76dad5b1",
ConcurrencyStamp = "1d59afd3-30f6-492c-87eb-cddf0b251f85",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("RoleId")
.HasColumnType("varchar(255)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Value")
.HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.User.Migrations
{
public partial class UndefRoleAdd : Migration
{
#region Protected Methods
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "bf698c1c-ead1-4d88-83ef-536098876807");
}
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "bf698c1c-ead1-4d88-83ef-536098876807", "28d97b49-8df4-4d20-8680-1d3abbf4ed94", "Undef", "UNDEF" }
});
}
#endregion Protected Methods
}
}
@@ -0,0 +1,308 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.User.Migrations
{
[DbContext(typeof(UserIdentityDbContext))]
[Migration("20210824155840_FixRolesName")]
partial class FixRolesName
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.8");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
b.HasData(
new
{
Id = "5287113c-6493-4419-bbc9-2cb2f6455006",
ConcurrencyStamp = "00059b0a-3e8c-406e-a578-2ae40c52435a",
Name = "Undef",
NormalizedName = "UNDEF"
},
new
{
Id = "f27a0416-02cc-4e4c-8983-29cb51eb4f9a",
ConcurrencyStamp = "b58874fc-02b5-4efa-b4d5-61bfda8b7c67",
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new
{
Id = "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145",
ConcurrencyStamp = "cd1f0ba9-9f42-42f3-8271-1627ef55d36f",
Name = "User",
NormalizedName = "USER"
},
new
{
Id = "5b928219-a530-49c6-be33-f65253865a98",
ConcurrencyStamp = "6de09bee-9a83-416a-90c4-27bb643519f6",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "e9befc87-9732-4c21-b91e-7aea6a289d35",
ConcurrencyStamp = "f2bf6c1c-4043-4344-8b68-c8b2122ab88f",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("RoleId")
.HasColumnType("varchar(255)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Value")
.HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,91 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.User.Migrations
{
public partial class FixRolesName : Migration
{
#region Protected Methods
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "5287113c-6493-4419-bbc9-2cb2f6455006");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "5b928219-a530-49c6-be33-f65253865a98");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "e9befc87-9732-4c21-b91e-7aea6a289d35");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "f27a0416-02cc-4e4c-8983-29cb51eb4f9a");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "bf698c1c-ead1-4d88-83ef-536098876807", "28d97b49-8df4-4d20-8680-1d3abbf4ed94", "Undef", "UNDEF" },
{ "24a790ae-8eac-4c9f-9043-aa688b626169", "c9adff6c-ffac-48e3-899b-8549ca443071", "ExtUser", "EXTUSER" },
{ "7a024dca-5e5d-47be-b754-75c8921d88bf", "3b9aab89-73b6-4051-9825-d5381d2896da", "User", "USER" },
{ "0a5335f9-64b2-4196-9d5b-db873cb48d94", "25097cab-df45-4bdd-8616-041962c72050", "Admin", "ADMIN" },
{ "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d", "3c222fe9-d5e5-4ba0-9767-4c1777677105", "SuperAdmin", "SUPERADMIN" }
});
}
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "0a5335f9-64b2-4196-9d5b-db873cb48d94");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "24a790ae-8eac-4c9f-9043-aa688b626169");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "7a024dca-5e5d-47be-b754-75c8921d88bf");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "bf698c1c-ead1-4d88-83ef-536098876807");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "f6aa57e0-fac5-45b7-8e27-fd01d8eff87d");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "5287113c-6493-4419-bbc9-2cb2f6455006", "00059b0a-3e8c-406e-a578-2ae40c52435a", "Undef", "UNDEF" },
{ "f27a0416-02cc-4e4c-8983-29cb51eb4f9a", "b58874fc-02b5-4efa-b4d5-61bfda8b7c67", "ExtUser", "EXTUSER" },
{ "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145", "cd1f0ba9-9f42-42f3-8271-1627ef55d36f", "User", "USER" },
{ "5b928219-a530-49c6-be33-f65253865a98", "6de09bee-9a83-416a-90c4-27bb643519f6", "Admin", "ADMIN" },
{ "e9befc87-9732-4c21-b91e-7aea6a289d35", "f2bf6c1c-4043-4344-8b68-c8b2122ab88f", "SuperAdmin", "SUPERADMIN" }
});
}
#endregion Protected Methods
}
}
@@ -0,0 +1,326 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.User.Migrations
{
[DbContext(typeof(UserIdentityDbContext))]
[Migration("20210826102940_AddTransporterRule")]
partial class AddTransporterRule
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.7");
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
{
b.Property<int>("Count")
.HasColumnType("int");
b.Property<string>("TableName")
.HasColumnType("longtext");
b.ToTable("DbSetCounts");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
b.HasData(
new
{
Id = "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d",
ConcurrencyStamp = "3caf0732-df97-4b81-ba2c-9fb51e34532a",
Name = "Undef",
NormalizedName = "UNDEF"
},
new
{
Id = "47c8d4fb-6925-4ef0-a830-5df33e705d7a",
ConcurrencyStamp = "9671ece6-f70a-4ca6-88db-64562e007c72",
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new
{
Id = "2d87821f-5c6d-4d9e-98d7-7ae801030100",
ConcurrencyStamp = "9ee56f2f-558f-4579-9ad7-4a6150e3d822",
Name = "ExtTransp",
NormalizedName = "EXTTRANSP"
},
new
{
Id = "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c",
ConcurrencyStamp = "3244e9d3-ab0e-45ae-97b6-c8c74f57cf64",
Name = "User",
NormalizedName = "USER"
},
new
{
Id = "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb",
ConcurrencyStamp = "a0a109e5-ab8e-4e20-9aa8-eba3c429fd12",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b",
ConcurrencyStamp = "549b8a8d-ba83-4b79-be88-fde0bd4cc60f",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("RoleId")
.HasColumnType("varchar(255)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Value")
.HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,109 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.User.Migrations
{
public partial class AddTransporterRule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "5287113c-6493-4419-bbc9-2cb2f6455006");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "5b928219-a530-49c6-be33-f65253865a98");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "e9befc87-9732-4c21-b91e-7aea6a289d35");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "f27a0416-02cc-4e4c-8983-29cb51eb4f9a");
migrationBuilder.CreateTable(
name: "DbSetCounts",
columns: table => new
{
Count = table.Column<int>(type: "int", nullable: false),
TableName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d", "3caf0732-df97-4b81-ba2c-9fb51e34532a", "Undef", "UNDEF" },
{ "47c8d4fb-6925-4ef0-a830-5df33e705d7a", "9671ece6-f70a-4ca6-88db-64562e007c72", "ExtUser", "EXTUSER" },
{ "2d87821f-5c6d-4d9e-98d7-7ae801030100", "9ee56f2f-558f-4579-9ad7-4a6150e3d822", "ExtTransp", "EXTTRANSP" },
{ "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c", "3244e9d3-ab0e-45ae-97b6-c8c74f57cf64", "User", "USER" },
{ "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb", "a0a109e5-ab8e-4e20-9aa8-eba3c429fd12", "Admin", "ADMIN" },
{ "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b", "549b8a8d-ba83-4b79-be88-fde0bd4cc60f", "SuperAdmin", "SUPERADMIN" }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DbSetCounts");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "2d87821f-5c6d-4d9e-98d7-7ae801030100");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "47c8d4fb-6925-4ef0-a830-5df33e705d7a");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ "5287113c-6493-4419-bbc9-2cb2f6455006", "00059b0a-3e8c-406e-a578-2ae40c52435a", "Undef", "UNDEF" },
{ "f27a0416-02cc-4e4c-8983-29cb51eb4f9a", "b58874fc-02b5-4efa-b4d5-61bfda8b7c67", "ExtUser", "EXTUSER" },
{ "00e6b3ed-dd0e-4cd5-8d3d-f88d8ae5e145", "cd1f0ba9-9f42-42f3-8271-1627ef55d36f", "User", "USER" },
{ "5b928219-a530-49c6-be33-f65253865a98", "6de09bee-9a83-416a-90c4-27bb643519f6", "Admin", "ADMIN" },
{ "e9befc87-9732-4c21-b91e-7aea6a289d35", "f2bf6c1c-4043-4344-8b68-c8b2122ab88f", "SuperAdmin", "SUPERADMIN" }
});
}
}
}
@@ -0,0 +1,617 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211022064058_RemoveLocalUser")]
partial class RemoveLocalUser
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,98 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class RemoveLocalUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 1,
column: "PositionUpdated",
value: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 2,
column: "PositionUpdated",
value: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
UserId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AuthKey = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Firstname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
Lang = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Lastname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Livello = table.Column<int>(type: "int", nullable: false),
MaskPlantId = table.Column<int>(type: "int", nullable: false),
MaskSupplierId = table.Column<int>(type: "int", nullable: false),
MaskTranspId = table.Column<int>(type: "int", nullable: false),
SaltPasswd = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.UserId);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 1,
column: "PositionUpdated",
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092));
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 2,
column: "PositionUpdated",
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470));
migrationBuilder.InsertData(
table: "Users",
columns: new[] { "UserId", "AuthKey", "Email", "Firstname", "IsActive", "Lang", "Lastname", "Livello", "MaskPlantId", "MaskSupplierId", "MaskTranspId", "SaltPasswd", "UserName" },
values: new object[,]
{
{ 1, "th1sIsTh3R1vrOfThNgt98", "samuele@steamware.net", "Samuele", true, "IT", "Locatelli", 1, 0, 0, 0, "", "samuele.locatelli" },
{ 2, "th1sIsTh3R1vrOfThNgt91", "giancarlo@steamware.net", "Giancarlo", true, "IT", "Rottoli", 1, 0, 0, 0, "", "giancarlo.rottoli" },
{ 3, "th1sIsTh3R1vrOfThNgt93", "info@steamware.net", "Steamware", true, "IT", "Admin", 1, 0, 0, 0, "", "steamw.admin" },
{ 4, "th1sIsTh3R1vrOfThNgt97", "a.pizzaferri@pizzaferripetroli.it", "Angelo", true, "IT", "Pizzaferri", 2, 0, 0, 0, "", "angelo.pizzaferri" },
{ 5, "th1sIsTh3R1vrOfThNgt99", "andrei.valeanu@winnlab.it", "Andrei", true, "IT", "Valeanu", 2, 0, 0, 0, "", "andrei.valeanu" },
{ 6, "th1sIsTh3R1vrOfThNgt92", "info@steamware.net", "User", true, "IT", "LIQUIGAS", 4, 0, 1, 0, "", "liquigas.user01" },
{ 7, "th1sIsTh3R1vrOfThNgt94", "info@steamware.net", "User", true, "IT", "VULKANGAS", 4, 0, 2, 0, "", "vulkangas.user01" },
{ 8, "th1sIsTh3R1vrOfThNgt95", "info@steamware.net", "User", true, "IT", "LEVORATO", 4, 0, 0, 1, "", "levorato.user01" },
{ 9, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "User", true, "IT", "TRAFFIK", 4, 0, 0, 2, "", "traffik.user01" },
{ 10, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Collecchio", 3, 1, 0, 0, "", "piz03.user01" },
{ 11, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Noceto", 3, 2, 0, 0, "", "piz04.user01" },
{ 12, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Baganzola", 3, 3, 0, 0, "", "piz05.user01" },
{ 13, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Pilastrello", 3, 4, 0, 0, "", "piz08.user01" }
});
}
}
}
@@ -0,0 +1,644 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211027091446_ParamSetAdded")]
partial class ParamSetAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,38 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class ParamSetAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ParamSet",
columns: table => new
{
ParamSetId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
PlantId = table.Column<int>(type: "int", nullable: false),
ParamUid = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Scadenza = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TargetVal = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
Note = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ParamSet", x => x.ParamSetId);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ParamSet");
}
}
}
@@ -0,0 +1,672 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211027172923_ParamSendTable")]
partial class ParamSendTable
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,36 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class ParamSendTable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ParamSend",
columns: table => new
{
PlantId = table.Column<int>(type: "int", nullable: false),
ParamUid = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LastSend = table.Column<DateTime>(type: "datetime(6)", nullable: false),
VetoSend = table.Column<DateTime>(type: "datetime(6)", nullable: false),
enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
windStart = table.Column<int>(type: "int", nullable: false),
windEnd = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ParamSend", x => new { x.PlantId, x.ParamUid });
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ParamSend");
}
}
}
+715
View File
@@ -0,0 +1,715 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211028102841_AlarmLog")]
partial class AlarmLog
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogIdId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogIdId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class AlarmLog : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AlarmLog",
columns: table => new
{
AlarmLogIdId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DtEvent = table.Column<DateTime>(type: "datetime(6)", nullable: false),
PlantId = table.Column<int>(type: "int", nullable: false),
MemAddress = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Index = table.Column<int>(type: "int", nullable: false),
Status = table.Column<uint>(type: "int unsigned", nullable: false),
ValDecoded = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AlarmLog", x => x.AlarmLogIdId);
table.ForeignKey(
name: "FK_AlarmLog_PlantDetail_PlantId",
column: x => x.PlantId,
principalTable: "PlantDetail",
principalColumn: "PlantId",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AlarmLog_PlantId",
table: "AlarmLog",
column: "PlantId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AlarmLog");
}
}
}
@@ -0,0 +1,715 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211028133250_AlarmLogFix")]
partial class AlarmLogFix
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class AlarmLogFix : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AlarmLogIdId",
table: "AlarmLog",
newName: "AlarmLogId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AlarmLogId",
table: "AlarmLog",
newName: "AlarmLogIdId");
}
}
}
+101 -267
View File
@@ -15,7 +15,39 @@ namespace GWMS.Data.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.7");
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
@@ -183,6 +215,61 @@ namespace GWMS.Data.Migrations
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
@@ -391,7 +478,7 @@ namespace GWMS.Data.Migrations
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092),
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
@@ -400,276 +487,12 @@ namespace GWMS.Data.Migrations
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470),
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b =>
{
b.Property<int>("UserId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("AuthKey")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("Email")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Firstname")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Lang")
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<string>("Lastname")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("Livello")
.HasColumnType("int");
b.Property<int>("MaskPlantId")
.HasColumnType("int");
b.Property<int>("MaskSupplierId")
.HasColumnType("int");
b.Property<int>("MaskTranspId")
.HasColumnType("int");
b.Property<string>("SaltPasswd")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("UserName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("UserId");
b.ToTable("Users");
b.HasData(
new
{
UserId = 1,
AuthKey = "th1sIsTh3R1vrOfThNgt98",
Email = "samuele@steamware.net",
Firstname = "Samuele",
IsActive = true,
Lang = "IT",
Lastname = "Locatelli",
Livello = 1,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "samuele.locatelli"
},
new
{
UserId = 2,
AuthKey = "th1sIsTh3R1vrOfThNgt91",
Email = "giancarlo@steamware.net",
Firstname = "Giancarlo",
IsActive = true,
Lang = "IT",
Lastname = "Rottoli",
Livello = 1,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "giancarlo.rottoli"
},
new
{
UserId = 3,
AuthKey = "th1sIsTh3R1vrOfThNgt93",
Email = "info@steamware.net",
Firstname = "Steamware",
IsActive = true,
Lang = "IT",
Lastname = "Admin",
Livello = 1,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "steamw.admin"
},
new
{
UserId = 4,
AuthKey = "th1sIsTh3R1vrOfThNgt97",
Email = "a.pizzaferri@pizzaferripetroli.it",
Firstname = "Angelo",
IsActive = true,
Lang = "IT",
Lastname = "Pizzaferri",
Livello = 2,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "angelo.pizzaferri"
},
new
{
UserId = 5,
AuthKey = "th1sIsTh3R1vrOfThNgt99",
Email = "andrei.valeanu@winnlab.it",
Firstname = "Andrei",
IsActive = true,
Lang = "IT",
Lastname = "Valeanu",
Livello = 2,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "andrei.valeanu"
},
new
{
UserId = 6,
AuthKey = "th1sIsTh3R1vrOfThNgt92",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "LIQUIGAS",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 1,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "liquigas.user01"
},
new
{
UserId = 7,
AuthKey = "th1sIsTh3R1vrOfThNgt94",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "VULKANGAS",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 2,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "vulkangas.user01"
},
new
{
UserId = 8,
AuthKey = "th1sIsTh3R1vrOfThNgt95",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "LEVORATO",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 1,
SaltPasswd = "",
UserName = "levorato.user01"
},
new
{
UserId = 9,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "TRAFFIK",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 2,
SaltPasswd = "",
UserName = "traffik.user01"
},
new
{
UserId = 10,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Collecchio",
Livello = 3,
MaskPlantId = 1,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz03.user01"
},
new
{
UserId = 11,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Noceto",
Livello = 3,
MaskPlantId = 2,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz04.user01"
},
new
{
UserId = 12,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Baganzola",
Livello = 3,
MaskPlantId = 3,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz05.user01"
},
new
{
UserId = 13,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Pilastrello",
Livello = 3,
MaskPlantId = 4,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz08.user01"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
@@ -798,6 +621,17 @@ namespace GWMS.Data.Migrations
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
@@ -17,6 +17,17 @@ namespace GWMS.User.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.7");
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
{
b.Property<int>("Count")
.HasColumnType("int");
b.Property<string>("TableName")
.HasColumnType("longtext");
b.ToTable("DbSetCounts");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
@@ -41,6 +52,50 @@ namespace GWMS.User.Migrations
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
b.HasData(
new
{
Id = "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d",
ConcurrencyStamp = "3caf0732-df97-4b81-ba2c-9fb51e34532a",
Name = "Undef",
NormalizedName = "UNDEF"
},
new
{
Id = "47c8d4fb-6925-4ef0-a830-5df33e705d7a",
ConcurrencyStamp = "9671ece6-f70a-4ca6-88db-64562e007c72",
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new
{
Id = "2d87821f-5c6d-4d9e-98d7-7ae801030100",
ConcurrencyStamp = "9ee56f2f-558f-4579-9ad7-4a6150e3d822",
Name = "ExtTransp",
NormalizedName = "EXTTRANSP"
},
new
{
Id = "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c",
ConcurrencyStamp = "3244e9d3-ab0e-45ae-97b6-c8c74f57cf64",
Name = "User",
NormalizedName = "USER"
},
new
{
Id = "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb",
ConcurrencyStamp = "a0a109e5-ab8e-4e20-9aa8-eba3c429fd12",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b",
ConcurrencyStamp = "549b8a8d-ba83-4b79-be88-fde0bd4cc60f",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
+6 -7
View File
@@ -1,10 +1,6 @@
using GWMS.Data.DatabaseModels;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data
{
@@ -18,6 +14,7 @@ namespace GWMS.Data
/// <param name="modelBuilder"></param>
public static void Seed(this ModelBuilder modelBuilder)
{
#if false
// inizializzazione dei valori di default x USER
modelBuilder.Entity<UserModel>().HasData(
new UserModel { UserId = 1, AuthKey = "th1sIsTh3R1vrOfThNgt98", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "samuele.locatelli", Email = "samuele@steamware.net", Firstname = "Samuele", Lastname = "Locatelli" },
@@ -34,13 +31,15 @@ namespace GWMS.Data
new UserModel { UserId = 12, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 3, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz05.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Baganzola" },
new UserModel { UserId = 13, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 4, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz08.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Pilastrello" }
);
#endif
// inizializzazione dei valori di default x Plant
modelBuilder.Entity<PlantDetailModel>().HasData(
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 9000 },
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000, OrderQtyStd = 9000 },
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 9000 }
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 5, PlantCode = "PIZ09", PlantDesc = "Guardamiglio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 }
// new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
//new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
//new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
+25
View File
@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace GWMS.Data
{
public class RoleConfiguration : IEntityTypeConfiguration<IdentityRole>
{
#region Public Methods
public void Configure(EntityTypeBuilder<IdentityRole> builder)
{
builder.HasData(
new IdentityRole { Name = "Undef", NormalizedName = "UNDEF" },
new IdentityRole { Name = "ExtUser", NormalizedName = "EXTUSER" },
new IdentityRole { Name = "ExtTransp", NormalizedName = "EXTTRANSP" },
new IdentityRole { Name = "User", NormalizedName = "USER" },
new IdentityRole { Name = "Admin", NormalizedName = "ADMIN" },
new IdentityRole { Name = "SuperAdmin", NormalizedName = "SUPERADMIN" }
);
}
#endregion Public Methods
}
}
+25
View File
@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data
{
/// <summary>
/// Classe generalizzaizone identity (user + roles + claims) x gestione semplificata in editing
/// </summary>
public class UserData
{
#region Public Properties
public List<System.Security.Claims.Claim> Claims { get; set; }
public IdentityUser Identity { get; set; }
public List<string> Roles { get; set; }
#endregion Public Properties
}
}
+23 -3
View File
@@ -2,9 +2,6 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GWMS.Data
{
@@ -14,13 +11,29 @@ namespace GWMS.Data
public UserIdentityDbContext()
{
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{ }
}
public UserIdentityDbContext(DbContextOptions<UserIdentityDbContext> options)
: base(options)
{
#if false
// se non ci fosse... crea!
Database.EnsureCreated();
#endif
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{ }
}
#endregion Public Constructors
@@ -43,6 +56,13 @@ namespace GWMS.Data
}
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ApplyConfiguration(new RoleConfiguration());
}
#endregion Protected Methods
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
namespace GWMS.Data
{
public class chartJsData
{
#region Public Classes
public class chartJsTSerie
{
#region Public Properties
public DateTime x { get; set; }
public double y { get; set; }
#endregion Public Properties
}
public class chartJsXY
{
#region Public Properties
public double x { get; set; }
public double y { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
+5
View File
@@ -0,0 +1,5 @@
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": []
}
+8 -1
View File
@@ -1,5 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {}
"tools": {
"dotnet-ef": {
"version": "6.0.2",
"commands": [
"dotnet-ef"
]
}
}
}
+12 -10
View File
@@ -1,10 +1,12 @@
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
@@ -0,0 +1,27 @@
using System;
using GWMS.Data;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
[assembly: HostingStartup(typeof(GWMS.UI.Areas.Identity.IdentityHostingStartup))]
namespace GWMS.UI.Areas.Identity
{
public class IdentityHostingStartup : IHostingStartup
{
#region Public Methods
public void Configure(IWebHostBuilder builder)
{
builder.ConfigureServices((context, services) =>
{
});
}
#endregion Public Methods
}
}
@@ -0,0 +1,10 @@
@page
@model AccessDeniedModel
@{
ViewData["Title"] = "Access denied";
}
<header>
<h1 class="text-danger">@ViewData["Title"]</h1>
<p class="text-danger">You do not have access to this resource.</p>
</header>
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
public class AccessDeniedModel : PageModel
{
#region Public Methods
public void OnGet()
{
}
#endregion Public Methods
}
}
@@ -0,0 +1,21 @@
@page
@model ConfirmEmailModel
@{
ViewData["Title"] = "Conferma Effettuata";
}
<div class="card">
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
<div class="card-body">
<div class="alert alert-success">
<p>L'email è stata confermata! ora puoi effettuare il login all'applicazione</p>
</div>
<div class="card-footer">
<div class="row">
<div class="col-6">
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-sm btn-success btn-block"><i class="fas fa-sign-in-alt"></i> Login Page</a>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ConfirmEmailModel : PageModel
{
#region Private Fields
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ConfirmEmailModel(UserManager<IdentityUser> userManager)
{
_userManager = userManager;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync(string userId, string code)
{
if (userId == null || code == null)
{
return RedirectToPage("/Index");
}
var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound($"Unable to load user with ID '{userId}'.");
}
code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await _userManager.ConfirmEmailAsync(user, code);
StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email.";
return Page();
}
#endregion Public Methods
}
}
@@ -0,0 +1,8 @@
@page
@model ConfirmEmailChangeModel
@{
ViewData["Title"] = "Confirm email change";
}
<h1>@ViewData["Title"]</h1>
<partial name="_StatusMessage" model="Model.StatusMessage" />
@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ConfirmEmailChangeModel : PageModel
{
#region Private Fields
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ConfirmEmailChangeModel(UserManager<IdentityUser> userManager, SignInManager<IdentityUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync(string userId, string email, string code)
{
if (userId == null || email == null || code == null)
{
return RedirectToPage("/Index");
}
var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound($"Unable to load user with ID '{userId}'.");
}
code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await _userManager.ChangeEmailAsync(user, email, code);
if (!result.Succeeded)
{
StatusMessage = "Error changing email.";
return Page();
}
// In our UI email and user name are one and the same, so when we update the email
// we need to update the user name.
var setUserNameResult = await _userManager.SetUserNameAsync(user, email);
if (!setUserNameResult.Succeeded)
{
StatusMessage = "Error changing user name.";
return Page();
}
await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Thank you for confirming your email change.";
return Page();
}
#endregion Public Methods
}
}
@@ -0,0 +1,33 @@
@page
@model ExternalLoginModel
@{
ViewData["Title"] = "Register";
}
<h1>@ViewData["Title"]</h1>
<h4 id="external-login-title">Associate your @Model.ProviderDisplayName account.</h4>
<hr />
<p id="external-login-description" class="text-info">
You've successfully authenticated with <strong>@Model.ProviderDisplayName</strong>.
Please enter an email address for this site below and click the Register button to finish
logging in.
</p>
<div class="row">
<div class="col-md-4">
<form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.Email"></label>
<input asp-for="Input.Email" class="form-control" />
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Register</button>
</form>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,191 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ExternalLoginModel : PageModel
{
#region Private Fields
private readonly IEmailSender _emailSender;
private readonly ILogger<ExternalLoginModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ExternalLoginModel(
SignInManager<IdentityUser> signInManager,
UserManager<IdentityUser> userManager,
ILogger<ExternalLoginModel> logger,
IEmailSender emailSender)
{
_signInManager = signInManager;
_userManager = userManager;
_logger = logger;
_emailSender = emailSender;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string ErrorMessage { get; set; }
[BindProperty]
public InputModel Input { get; set; }
public string ProviderDisplayName { get; set; }
public string ReturnUrl { get; set; }
#endregion Public Properties
#region Public Methods
public IActionResult OnGetAsync()
{
return RedirectToPage("./Login");
}
public async Task<IActionResult> OnGetCallbackAsync(string returnUrl = null, string remoteError = null)
{
returnUrl = returnUrl ?? Url.Content("~/");
if (remoteError != null)
{
ErrorMessage = $"Error from external provider: {remoteError}";
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
}
var info = await _signInManager.GetExternalLoginInfoAsync();
if (info == null)
{
ErrorMessage = "Error loading external login information.";
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
}
// Sign in the user with this external login provider if the user already has a login.
var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false, bypassTwoFactor: true);
if (result.Succeeded)
{
_logger.LogInformation("{Name} logged in with {LoginProvider} provider.", info.Principal.Identity.Name, info.LoginProvider);
return LocalRedirect(returnUrl);
}
if (result.IsLockedOut)
{
return RedirectToPage("./Lockout");
}
else
{
// If the user does not have an account, then ask the user to create an account.
ReturnUrl = returnUrl;
ProviderDisplayName = info.ProviderDisplayName;
if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email))
{
Input = new InputModel
{
Email = info.Principal.FindFirstValue(ClaimTypes.Email)
};
}
return Page();
}
}
public IActionResult OnPost(string provider, string returnUrl = null)
{
// Request a redirect to the external login provider.
var redirectUrl = Url.Page("./ExternalLogin", pageHandler: "Callback", values: new { returnUrl });
var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);
return new ChallengeResult(provider, properties);
}
public async Task<IActionResult> OnPostConfirmationAsync(string returnUrl = null)
{
returnUrl = returnUrl ?? Url.Content("~/");
// Get the information about the user from the external login provider
var info = await _signInManager.GetExternalLoginInfoAsync();
if (info == null)
{
ErrorMessage = "Error loading external login information during confirmation.";
return RedirectToPage("./Login", new { ReturnUrl = returnUrl });
}
if (ModelState.IsValid)
{
var user = new IdentityUser { UserName = Input.Email, Email = Input.Email };
var result = await _userManager.CreateAsync(user);
if (result.Succeeded)
{
result = await _userManager.AddLoginAsync(user, info);
if (result.Succeeded)
{
_logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider);
var userId = await _userManager.GetUserIdAsync(user);
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
var callbackUrl = Url.Page(
"/Account/ConfirmEmail",
pageHandler: null,
values: new { area = "Identity", userId = userId, code = code },
protocol: Request.Scheme);
await _emailSender.SendEmailAsync(Input.Email, "Confirm your email", $"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
// If account confirmation is required, we need to show the link if we don't have a real email sender
if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
}
await _signInManager.SignInAsync(user, isPersistent: false, info.LoginProvider);
return LocalRedirect(returnUrl);
}
}
foreach (var error in result.Errors)
{
ModelState.AddModelError(string.Empty, error.Description);
}
}
ProviderDisplayName = info.ProviderDisplayName;
ReturnUrl = returnUrl;
return Page();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Required]
[EmailAddress]
public string Email { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,30 @@
@page
@model ForgotPasswordModel
@{
ViewData["Title"] = "Password dimenticata?";
}
<div class="card">
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
<div class="card-body">
<h4>Inserire l'account email registrato</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form method="post">
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.Email"></label>
<input asp-for="Input.Email" class="form-control" />
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary btn-block"><i class="fas fa-envelope"></i> Inoltra richiesta reset password</button>
</form>
</div>
</div>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Encodings.Web;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ForgotPasswordModel : PageModel
{
#region Private Fields
private readonly IEmailSender _emailSender;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ForgotPasswordModel(UserManager<IdentityUser> userManager, IEmailSender emailSender)
{
_userManager = userManager;
_emailSender = emailSender;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnPostAsync()
{
if (ModelState.IsValid)
{
var user = await _userManager.FindByEmailAsync(Input.Email);
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
{
// Don't reveal that the user does not exist or is not confirmed
return RedirectToPage("./ForgotPasswordConfirmation");
}
// For more information on how to enable account confirmation and password reset please
// visit https://go.microsoft.com/fwlink/?LinkID=532713
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
var callbackUrl = Url.Page(
"/Account/ResetPassword",
pageHandler: null,
values: new { area = "Identity", code },
protocol: Request.Scheme);
await _emailSender.SendEmailAsync(
Input.Email,
"Reset Password",
$"Please reset your password by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
return RedirectToPage("./ForgotPasswordConfirmation");
}
return Page();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Required]
[EmailAddress]
public string Email { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,21 @@
@page
@model ForgotPasswordConfirmation
@{
ViewData["Title"] = "Password dimenticata";
}
<div class="card">
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<p>
Prego verificare l'account email per le istruzioni relative alla reimpostazione della password.
</p>
</div>
<div class="col-md-4">
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-primary btn-block"><i class="fas fa-sign-in-alt"></i> Login Page</a>
</div>
</div>
</div>
</div>
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ForgotPasswordConfirmation : PageModel
{
#region Public Methods
public void OnGet()
{
}
#endregion Public Methods
}
}
@@ -0,0 +1,10 @@
@page
@model LockoutModel
@{
ViewData["Title"] = "Locked out";
}
<header>
<h1 class="text-danger">@ViewData["Title"]</h1>
<p class="text-danger">This account has been locked out, please try again later.</p>
</header>
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class LockoutModel : PageModel
{
#region Public Methods
public void OnGet()
{
}
#endregion Public Methods
}
}
@@ -1,15 +1,40 @@
@page
@using Microsoft.AspNetCore.Identity
@attribute [IgnoreAntiforgeryToken]
@inject SignInManager<IdentityUser> SignInManager
@functions {
public async Task<IActionResult> OnPost()
{
if (SignInManager.IsSignedIn(User))
{
await SignInManager.SignOutAsync();
}
return Redirect("~/");
}
@model LogoutModel
@{
ViewData["Title"] = "Log out";
}
<div class="card">
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
<div class="card-body">
@{
if (User.Identity.IsAuthenticated)
{
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post">
<div class="row">
<div class="col-12">
<p>Premendo sul pulsante effettuerai il logout dal sistema.</p>
</div>
<div class="col-6">
<button type="submit" class="nav-link btn btn-warning"><i class="fas fa-sign-out-alt"></i> Clicca per Logout</button>
</div>
</div>
</form>
}
else
{
<div class="row">
<div class="col-12">
<p>Disconnesisone effettuata.</p>
</div>
<div class="col-6">
<a title="Home" href="~/" class="btn btn-sm btn-primary btn-block"><i class="fas fa-home"></i> Home Page</a>
</div>
<div class="col-6">
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-sm btn-success btn-block"><i class="fas fa-sign-in-alt"></i> Login Page</a>
</div>
</div>
}
}
</div>
</div>
@@ -0,0 +1,96 @@
@page
@model LoginModel
@{
ViewData["Title"] = "Log in";
}
<div class="card">
<div class="card-header"><h1>@ViewData["Title"]</h1></div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<section>
<form id="account" method="post">
<h4>Effettuare login con l'account registrato.</h4>
<hr />
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.Email"></label>
<input asp-for="Input.Email" class="form-control" />
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Input.Password"></label>
<input asp-for="Input.Password" class="form-control" />
<span asp-validation-for="Input.Password" class="text-danger"></span>
</div>
<div class="form-group">
<div class="checkbox">
<label asp-for="Input.RememberMe">
<input asp-for="Input.RememberMe" />
@Html.DisplayNameFor(m => m.Input.RememberMe)
</label>
</div>
</div>
<div class="form-row">
<div class="col">
<button type="submit" class="btn btn-block btn-primary"><i class="fas fa-sign-in-alt"></i> Log in</button>
</div>
<div class="col">
<a asp-page="./Register" class="btn btn-block btn-outline-primary" asp-route-returnUrl="@Model.ReturnUrl"><i class="fas fa-edit"></i> Registra account</a>
</div>
</div>
<div class="form-row mt-2">
<div class="col">
<a id="forgot-password" class="btn btn-block btn-outline-info" asp-page="./ForgotPassword"><i class="far fa-life-ring"></i> Password dimenticata?</a>
</div>
<div class="col">
<a id="resend-confirmation" class="btn btn-block btn-outline-dark" asp-page="./ResendEmailConfirmation"><i class="far fa-envelope"></i> (Re)Invia email conferma</a>
</div>
</div>
</form>
</section>
<div class="col-md-6">
@if (User.Identity.IsAuthenticated)
{
<h2>USER OK!</h2>
}
</div>
</div>
@*<div class="col-md-6 col-md-offset-2">
<section>
<h4>Use another service to log in.</h4>
<hr />
@{
if ((Model.ExternalLogins?.Count ?? 0) == 0)
{
<div>
<p>
There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
for details on setting up this ASP.NET application to support logging in via external services.
</p>
</div>
}
else
{
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
<div>
<p>
@foreach (var provider in Model.ExternalLogins)
{
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
}
</p>
</div>
</form>
}
}
</section>
</div>*@
</div>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,240 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class LoginModel : PageModel
{
#region Private Fields
private IConfiguration _configuration;
private readonly ILogger<LoginModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public LoginModel(SignInManager<IdentityUser> signInManager,
ILogger<LoginModel> logger,
UserManager<IdentityUser> userManager,
IConfiguration configuration)
{
_userManager = userManager;
_signInManager = signInManager;
_logger = logger;
_configuration = configuration;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string ErrorMessage { get; set; }
public IList<AuthenticationScheme> ExternalLogins { get; set; }
[BindProperty]
public InputModel Input { get; set; }
public string ReturnUrl { get; set; }
#endregion Public Properties
#region Private Methods
private async Task<string> checkJumpLogin()
{
string nextPage = "";
string uid = getReqPar("uid", "");
string uem = getReqPar("uem", "");
string pag = getReqPar("pag", "Transporters");
string jumpRedir = _configuration["jumpRedir"];
await Task.Delay(1);
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(uem))
{
var user = await _userManager.FindByEmailAsync(uem);
//var userById = await _userManager.FindByIdAsync(userId);
if (user != null)
{
if (user.Id == uid)
{
// se corrispondono --> signini!
await _signInManager.SignInAsync(user, false);
_logger.LogInformation("Forced User log in via URL token");
// salto a pagina target da conf + req
nextPage = string.IsNullOrEmpty(pag) ? jumpRedir : $"{jumpRedir}{pag}";
}
}
}
return nextPage;
}
private async Task CheckSuperAdmin()
{
// se non ci fosse --> creo samuele come superadmin
string superUser = "samuele@steamware.net";
string superPwd = "viaDante16!";
string ADMIN_ROLE = "SuperAdmin";
var user = await _userManager.FindByEmailAsync(superUser);
if (user == null)
{
// Insert new user
var NewUser =
new IdentityUser
{
UserName = superUser,
Email = superUser,
EmailConfirmed = true
};
var CreateResult = await _userManager.CreateAsync(NewUser, superPwd);
if (CreateResult.Succeeded)
{
user = await _userManager.FindByEmailAsync(superUser);
}
}
// verifico ruoli...
if (user != null)
{
bool needCreate = true;
// Gestione salvataggio ruoli... SE VARIATO...
var UserRoles = await _userManager.GetRolesAsync(user);
if (UserRoles != null && UserRoles.Count > 0)
{
var oldRole = UserRoles.Where(x => x == ADMIN_ROLE).FirstOrDefault();
needCreate = (oldRole == null);
}
if (needCreate)
{
// aggiungo a ruolo admin
await _userManager.AddToRoleAsync(user, ADMIN_ROLE);
}
}
}
/// <summary>
/// Restituisce valore da Request (se presente) oppure defaultVal
/// </summary>
/// <param name="key"></param>
/// <param name="defaultVal"></param>
/// <returns></returns>
private string getReqPar(string key, string defaultVal = "")
{
string answ = defaultVal;
var rawQuery = Request.Query;
if (rawQuery != null)
{
if (rawQuery.ContainsKey(key))
{
answ = rawQuery[key];
}
}
return answ;
}
#endregion Private Methods
#region Public Methods
public async Task<IActionResult> OnGetAsync(string returnUrl = null)
{
await CheckSuperAdmin();
if (!string.IsNullOrEmpty(ErrorMessage))
{
ModelState.AddModelError(string.Empty, ErrorMessage);
}
returnUrl ??= Url.Content("~/");
// Clear the existing external cookie to ensure a clean login process
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
ReturnUrl = returnUrl;
var nextPage = await checkJumpLogin();
if (!string.IsNullOrEmpty(nextPage))
{
return LocalRedirect(nextPage);
}
return Page();
}
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
{
returnUrl ??= Url.Content("~/");
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
if (ModelState.IsValid)
{
// This doesn't count login failures towards account lockout
// To enable password failures to trigger account lockout, set lockoutOnFailure: true
var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
if (result.Succeeded)
{
_logger.LogInformation("User logged in.");
return LocalRedirect(returnUrl);
}
if (result.RequiresTwoFactor)
{
return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe });
}
if (result.IsLockedOut)
{
_logger.LogWarning("User account locked out.");
return RedirectToPage("./Lockout");
}
else
{
ModelState.AddModelError(string.Empty, "Invalid login attempt.");
return Page();
}
}
// If we got this far, something failed, redisplay form
return Page();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,41 @@
@page
@model LoginWith2faModel
@{
ViewData["Title"] = "Two-factor authentication";
}
<h1>@ViewData["Title"]</h1>
<hr />
<p>Your login is protected with an authenticator app. Enter your authenticator code below.</p>
<div class="row">
<div class="col-md-4">
<form method="post" asp-route-returnUrl="@Model.ReturnUrl">
<input asp-for="RememberMe" type="hidden" />
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.TwoFactorCode"></label>
<input asp-for="Input.TwoFactorCode" class="form-control" autocomplete="off" />
<span asp-validation-for="Input.TwoFactorCode" class="text-danger"></span>
</div>
<div class="form-group">
<div class="checkbox">
<label asp-for="Input.RememberMachine">
<input asp-for="Input.RememberMachine" />
@Html.DisplayNameFor(m => m.Input.RememberMachine)
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Log in</button>
</div>
</form>
</div>
</div>
<p>
Don't have access to your authenticator device? You can
<a id="recovery-code-login" asp-page="./LoginWithRecoveryCode" asp-route-returnUrl="@Model.ReturnUrl">log in with a recovery code</a>.
</p>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class LoginWith2faModel : PageModel
{
#region Private Fields
private readonly ILogger<LoginWith2faModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
#endregion Private Fields
#region Public Constructors
public LoginWith2faModel(SignInManager<IdentityUser> signInManager, ILogger<LoginWith2faModel> logger)
{
_signInManager = signInManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
public bool RememberMe { get; set; }
public string ReturnUrl { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync(bool rememberMe, string returnUrl = null)
{
// Ensure the user has gone through the username & password screen first
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
}
ReturnUrl = returnUrl;
RememberMe = rememberMe;
return Page();
}
public async Task<IActionResult> OnPostAsync(bool rememberMe, string returnUrl = null)
{
if (!ModelState.IsValid)
{
return Page();
}
returnUrl = returnUrl ?? Url.Content("~/");
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
}
var authenticatorCode = Input.TwoFactorCode.Replace(" ", string.Empty).Replace("-", string.Empty);
var result = await _signInManager.TwoFactorAuthenticatorSignInAsync(authenticatorCode, rememberMe, Input.RememberMachine);
if (result.Succeeded)
{
_logger.LogInformation("User with ID '{UserId}' logged in with 2fa.", user.Id);
return LocalRedirect(returnUrl);
}
else if (result.IsLockedOut)
{
_logger.LogWarning("User with ID '{UserId}' account locked out.", user.Id);
return RedirectToPage("./Lockout");
}
else
{
_logger.LogWarning("Invalid authenticator code entered for user with ID '{UserId}'.", user.Id);
ModelState.AddModelError(string.Empty, "Invalid authenticator code.");
return Page();
}
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Display(Name = "Remember this machine")]
public bool RememberMachine { get; set; }
[Required]
[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Text)]
[Display(Name = "Authenticator code")]
public string TwoFactorCode { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,29 @@
@page
@model LoginWithRecoveryCodeModel
@{
ViewData["Title"] = "Recovery code verification";
}
<h1>@ViewData["Title"]</h1>
<hr />
<p>
You have requested to log in with a recovery code. This login will not be remembered until you provide
an authenticator app code at log in or disable 2FA and log in again.
</p>
<div class="row">
<div class="col-md-4">
<form method="post">
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.RecoveryCode"></label>
<input asp-for="Input.RecoveryCode" class="form-control" autocomplete="off" />
<span asp-validation-for="Input.RecoveryCode" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Log in</button>
</form>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class LoginWithRecoveryCodeModel : PageModel
{
#region Private Fields
private readonly ILogger<LoginWithRecoveryCodeModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
#endregion Private Fields
#region Public Constructors
public LoginWithRecoveryCodeModel(SignInManager<IdentityUser> signInManager, ILogger<LoginWithRecoveryCodeModel> logger)
{
_signInManager = signInManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
public string ReturnUrl { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync(string returnUrl = null)
{
// Ensure the user has gone through the username & password screen first
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
}
ReturnUrl = returnUrl;
return Page();
}
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
{
if (!ModelState.IsValid)
{
return Page();
}
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
throw new InvalidOperationException($"Unable to load two-factor authentication user.");
}
var recoveryCode = Input.RecoveryCode.Replace(" ", string.Empty);
var result = await _signInManager.TwoFactorRecoveryCodeSignInAsync(recoveryCode);
if (result.Succeeded)
{
_logger.LogInformation("User with ID '{UserId}' logged in with a recovery code.", user.Id);
return LocalRedirect(returnUrl ?? Url.Content("~/"));
}
if (result.IsLockedOut)
{
_logger.LogWarning("User with ID '{UserId}' account locked out.", user.Id);
return RedirectToPage("./Lockout");
}
else
{
_logger.LogWarning("Invalid recovery code entered for user with ID '{UserId}' ", user.Id);
ModelState.AddModelError(string.Empty, "Invalid recovery code entered.");
return Page();
}
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[BindProperty]
[Required]
[DataType(DataType.Text)]
[Display(Name = "Recovery Code")]
public string RecoveryCode { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class LogoutModel : PageModel
{
#region Private Fields
private readonly ILogger<LogoutModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
#endregion Private Fields
#region Public Constructors
public LogoutModel(SignInManager<IdentityUser> signInManager, ILogger<LogoutModel> logger)
{
_signInManager = signInManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Methods
public void OnGet()
{
}
public async Task<IActionResult> OnPost(string returnUrl = null)
{
await _signInManager.SignOutAsync();
_logger.LogInformation("User logged out.");
if (returnUrl != null)
{
return LocalRedirect(returnUrl);
}
else
{
return RedirectToPage();
}
}
#endregion Public Methods
}
}
@@ -0,0 +1,36 @@
@page
@model ChangePasswordModel
@{
ViewData["Title"] = "Change password";
ViewData["ActivePage"] = ManageNavPages.ChangePassword;
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" for="StatusMessage" />
<div class="row">
<div class="col-md-6">
<form id="change-password-form" method="post">
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.OldPassword"></label>
<input asp-for="Input.OldPassword" class="form-control" />
<span asp-validation-for="Input.OldPassword" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Input.NewPassword"></label>
<input asp-for="Input.NewPassword" class="form-control" />
<span asp-validation-for="Input.NewPassword" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Input.ConfirmPassword"></label>
<input asp-for="Input.ConfirmPassword" class="form-control" />
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Update password</button>
</form>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class ChangePasswordModel : PageModel
{
#region Private Fields
private readonly ILogger<ChangePasswordModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ChangePasswordModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager,
ILogger<ChangePasswordModel> logger)
{
_userManager = userManager;
_signInManager = signInManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var hasPassword = await _userManager.HasPasswordAsync(user);
if (!hasPassword)
{
return RedirectToPage("./SetPassword");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
if (!ModelState.IsValid)
{
return Page();
}
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var changePasswordResult = await _userManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
if (!changePasswordResult.Succeeded)
{
foreach (var error in changePasswordResult.Errors)
{
ModelState.AddModelError(string.Empty, error.Description);
}
return Page();
}
await _signInManager.RefreshSignInAsync(user);
_logger.LogInformation("User changed their password successfully.");
StatusMessage = "Your password has been changed.";
return RedirectToPage();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,33 @@
@page
@model DeletePersonalDataModel
@{
ViewData["Title"] = "Delete Personal Data";
ViewData["ActivePage"] = ManageNavPages.PersonalData;
}
<h4>@ViewData["Title"]</h4>
<div class="alert alert-warning" role="alert">
<p>
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
</p>
</div>
<div>
<form id="delete-user" method="post" class="form-group">
<div asp-validation-summary="All" class="text-danger"></div>
@if (Model.RequirePassword)
{
<div class="form-group">
<label asp-for="Input.Password"></label>
<input asp-for="Input.Password" class="form-control" />
<span asp-validation-for="Input.Password" class="text-danger"></span>
</div>
}
<button class="btn btn-danger" type="submit">Delete data and close my account</button>
</form>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,107 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class DeletePersonalDataModel : PageModel
{
#region Private Fields
private readonly ILogger<DeletePersonalDataModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public DeletePersonalDataModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager,
ILogger<DeletePersonalDataModel> logger)
{
_userManager = userManager;
_signInManager = signInManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
public bool RequirePassword { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGet()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
RequirePassword = await _userManager.HasPasswordAsync(user);
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
RequirePassword = await _userManager.HasPasswordAsync(user);
if (RequirePassword)
{
if (!await _userManager.CheckPasswordAsync(user, Input.Password))
{
ModelState.AddModelError(string.Empty, "Incorrect password.");
return Page();
}
}
var result = await _userManager.DeleteAsync(user);
var userId = await _userManager.GetUserIdAsync(user);
if (!result.Succeeded)
{
throw new InvalidOperationException($"Unexpected error occurred deleting user with ID '{userId}'.");
}
await _signInManager.SignOutAsync();
_logger.LogInformation("User with ID '{UserId}' deleted themselves.", userId);
return Redirect("~/");
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,25 @@
@page
@model Disable2faModel
@{
ViewData["Title"] = "Disable two-factor authentication (2FA)";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<h2>@ViewData["Title"]</h2>
<div class="alert alert-warning" role="alert">
<p>
<strong>This action only disables 2FA.</strong>
</p>
<p>
Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key
used in an authenticator app you should <a asp-page="./ResetAuthenticator">reset your authenticator keys.</a>
</p>
</div>
<div>
<form method="post" class="form-group">
<button class="btn btn-danger" type="submit">Disable 2FA</button>
</form>
</div>
@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class Disable2faModel : PageModel
{
#region Private Fields
private readonly ILogger<Disable2faModel> _logger;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public Disable2faModel(
UserManager<IdentityUser> userManager,
ILogger<Disable2faModel> logger)
{
_userManager = userManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGet()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
if (!await _userManager.GetTwoFactorEnabledAsync(user))
{
throw new InvalidOperationException($"Cannot disable 2FA for user with ID '{_userManager.GetUserId(User)}' as it's not currently enabled.");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var disable2faResult = await _userManager.SetTwoFactorEnabledAsync(user, false);
if (!disable2faResult.Succeeded)
{
throw new InvalidOperationException($"Unexpected error occurred disabling 2FA for user with ID '{_userManager.GetUserId(User)}'.");
}
_logger.LogInformation("User with ID '{UserId}' has disabled 2fa.", _userManager.GetUserId(User));
StatusMessage = "2fa has been disabled. You can reenable 2fa when you setup an authenticator app";
return RedirectToPage("./TwoFactorAuthentication");
}
#endregion Public Methods
}
}
@@ -0,0 +1,12 @@
@page
@model DownloadPersonalDataModel
@{
ViewData["Title"] = "Download Your Data";
ViewData["ActivePage"] = ManageNavPages.PersonalData;
}
<h4>@ViewData["Title"]</h4>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class DownloadPersonalDataModel : PageModel
{
#region Private Fields
private readonly ILogger<DownloadPersonalDataModel> _logger;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public DownloadPersonalDataModel(
UserManager<IdentityUser> userManager,
ILogger<DownloadPersonalDataModel> logger)
{
_userManager = userManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Methods
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
_logger.LogInformation("User with ID '{UserId}' asked for their personal data.", _userManager.GetUserId(User));
// Only include personal data for download
var personalData = new Dictionary<string, string>();
var personalDataProps = typeof(IdentityUser).GetProperties().Where(
prop => Attribute.IsDefined(prop, typeof(PersonalDataAttribute)));
foreach (var p in personalDataProps)
{
personalData.Add(p.Name, p.GetValue(user)?.ToString() ?? "null");
}
var logins = await _userManager.GetLoginsAsync(user);
foreach (var l in logins)
{
personalData.Add($"{l.LoginProvider} external login provider key", l.ProviderKey);
}
Response.Headers.Add("Content-Disposition", "attachment; filename=PersonalData.json");
return new FileContentResult(JsonSerializer.SerializeToUtf8Bytes(personalData), "application/json");
}
#endregion Public Methods
}
}
@@ -0,0 +1,43 @@
@page
@model EmailModel
@{
ViewData["Title"] = "Manage Email";
ViewData["ActivePage"] = ManageNavPages.Email;
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" model="Model.StatusMessage" />
<div class="row">
<div class="col-md-6">
<form id="email-form" method="post">
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label asp-for="Email"></label>
@if (Model.IsEmailConfirmed)
{
<div class="input-group">
<input asp-for="Email" class="form-control" disabled />
<div class="input-group-append">
<span class="input-group-text text-success font-weight-bold">✓</span>
</div>
</div>
}
else
{
<input asp-for="Email" class="form-control" disabled />
<button id="email-verification" type="submit" asp-page-handler="SendVerificationEmail" class="btn btn-link">Send verification email</button>
}
</div>
<div class="form-group">
<label asp-for="Input.NewEmail"></label>
<input asp-for="Input.NewEmail" class="form-control" />
<span asp-validation-for="Input.NewEmail" class="text-danger"></span>
</div>
<button id="change-email-button" type="submit" asp-page-handler="ChangeEmail" class="btn btn-primary">Change email</button>
</form>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Text.Encodings.Web;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public partial class EmailModel : PageModel
{
#region Private Fields
private readonly IEmailSender _emailSender;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public EmailModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager,
IEmailSender emailSender)
{
_userManager = userManager;
_signInManager = signInManager;
_emailSender = emailSender;
}
#endregion Public Constructors
#region Public Properties
public string Email { get; set; }
[BindProperty]
public InputModel Input { get; set; }
public bool IsEmailConfirmed { get; set; }
[TempData]
public string StatusMessage { get; set; }
public string Username { get; set; }
#endregion Public Properties
#region Private Methods
private async Task LoadAsync(IdentityUser user)
{
var email = await _userManager.GetEmailAsync(user);
Email = email;
Input = new InputModel
{
NewEmail = email,
};
IsEmailConfirmed = await _userManager.IsEmailConfirmedAsync(user);
}
#endregion Private Methods
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
await LoadAsync(user);
return Page();
}
public async Task<IActionResult> OnPostChangeEmailAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
if (!ModelState.IsValid)
{
await LoadAsync(user);
return Page();
}
var email = await _userManager.GetEmailAsync(user);
if (Input.NewEmail != email)
{
var userId = await _userManager.GetUserIdAsync(user);
var code = await _userManager.GenerateChangeEmailTokenAsync(user, Input.NewEmail);
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
var callbackUrl = Url.Page(
"/Account/ConfirmEmailChange",
pageHandler: null,
values: new { userId = userId, email = Input.NewEmail, code = code },
protocol: Request.Scheme);
await _emailSender.SendEmailAsync(
Input.NewEmail,
"Confirm your email",
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
StatusMessage = "Confirmation link to change email sent. Please check your email.";
return RedirectToPage();
}
StatusMessage = "Your email is unchanged.";
return RedirectToPage();
}
public async Task<IActionResult> OnPostSendVerificationEmailAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
if (!ModelState.IsValid)
{
await LoadAsync(user);
return Page();
}
var userId = await _userManager.GetUserIdAsync(user);
var email = await _userManager.GetEmailAsync(user);
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
var callbackUrl = Url.Page(
"/Account/ConfirmEmail",
pageHandler: null,
values: new { area = "Identity", userId = userId, code = code },
protocol: Request.Scheme);
await _emailSender.SendEmailAsync(
email,
"Confirm your email",
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
StatusMessage = "Verification email sent. Please check your email.";
return RedirectToPage();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Required]
[EmailAddress]
[Display(Name = "New email")]
public string NewEmail { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,63 @@
@page
@model EnableAuthenticatorModel
@{
ViewData["Title"] = "Configure authenticator app";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div>
<p>To use an authenticator app go through the following steps:</p>
<ol class="list">
<li>
<p>
Download a two-factor authenticator app like Microsoft Authenticator for
<a href="https://go.microsoft.com/fwlink/?Linkid=825072">Android</a> and
<a href="https://go.microsoft.com/fwlink/?Linkid=825073">iOS</a> or
Google Authenticator for
<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&amp;hl=en">Android</a> and
<a href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8">iOS</a>.
</p>
</li>
<li>
<p>Scan the QR Code or enter this key <kbd>@Model.SharedKey</kbd> into your two factor authenticator app. Spaces and casing do not matter.</p>
@*<div class="alert alert-info">Learn how to <a href="https://go.microsoft.com/fwlink/?Linkid=852423">enable QR code generation</a>.</div>*@
<div id="qrCode"></div>
<div id="qrCodeData" data-url="@Html.Raw(@Model.AuthenticatorUri)"></div>
</li>
<li>
<p>
Once you have scanned the QR code or input the key above, your two factor authentication app will provide you
with a unique code. Enter the code in the confirmation box below.
</p>
<div class="row">
<div class="col-md-6">
<form id="send-code" method="post">
<div class="form-group">
<label asp-for="Input.Code" class="control-label">Verification Code</label>
<input asp-for="Input.Code" class="form-control" autocomplete="off" />
<span asp-validation-for="Input.Code" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Verify</button>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
</form>
</div>
</div>
</li>
</ol>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
<script type="text/javascript" src="~/lib/qrcode.js"></script>
<script type="text/javascript">
new QRCode(document.getElementById("qrCode"),
{
text: "@Html.Raw(Model.AuthenticatorUri)",
width: 150,
height: 150
});
</script>
}
@@ -0,0 +1,183 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using System.Text;
using System.Text.Encodings.Web;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class EnableAuthenticatorModel : PageModel
{
#region Private Fields
private const string AuthenticatorUriFormat = "otpauth://totp/{0}:{1}?secret={2}&issuer={0}&digits=6";
private readonly ILogger<EnableAuthenticatorModel> _logger;
private readonly UrlEncoder _urlEncoder;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public EnableAuthenticatorModel(
UserManager<IdentityUser> userManager,
ILogger<EnableAuthenticatorModel> logger,
UrlEncoder urlEncoder)
{
_userManager = userManager;
_logger = logger;
_urlEncoder = urlEncoder;
}
#endregion Public Constructors
#region Public Properties
public string AuthenticatorUri { get; set; }
[BindProperty]
public InputModel Input { get; set; }
[TempData]
public string[] RecoveryCodes { get; set; }
public string SharedKey { get; set; }
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Private Methods
private string FormatKey(string unformattedKey)
{
var result = new StringBuilder();
int currentPosition = 0;
while (currentPosition + 4 < unformattedKey.Length)
{
result.Append(unformattedKey.Substring(currentPosition, 4)).Append(" ");
currentPosition += 4;
}
if (currentPosition < unformattedKey.Length)
{
result.Append(unformattedKey.Substring(currentPosition));
}
return result.ToString().ToLowerInvariant();
}
private string GenerateQrCodeUri(string email, string unformattedKey)
{
return string.Format(
AuthenticatorUriFormat,
_urlEncoder.Encode("GWMS.UI"),
_urlEncoder.Encode(email),
unformattedKey);
}
private async Task LoadSharedKeyAndQrCodeUriAsync(IdentityUser user)
{
// Load the authenticator key & QR code URI to display on the form
var unformattedKey = await _userManager.GetAuthenticatorKeyAsync(user);
if (string.IsNullOrEmpty(unformattedKey))
{
await _userManager.ResetAuthenticatorKeyAsync(user);
unformattedKey = await _userManager.GetAuthenticatorKeyAsync(user);
}
SharedKey = FormatKey(unformattedKey);
var email = await _userManager.GetEmailAsync(user);
AuthenticatorUri = GenerateQrCodeUri(email, unformattedKey);
}
#endregion Private Methods
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
await LoadSharedKeyAndQrCodeUriAsync(user);
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
if (!ModelState.IsValid)
{
await LoadSharedKeyAndQrCodeUriAsync(user);
return Page();
}
// Strip spaces and hypens
var verificationCode = Input.Code.Replace(" ", string.Empty).Replace("-", string.Empty);
var is2faTokenValid = await _userManager.VerifyTwoFactorTokenAsync(
user, _userManager.Options.Tokens.AuthenticatorTokenProvider, verificationCode);
if (!is2faTokenValid)
{
ModelState.AddModelError("Input.Code", "Verification code is invalid.");
await LoadSharedKeyAndQrCodeUriAsync(user);
return Page();
}
await _userManager.SetTwoFactorEnabledAsync(user, true);
var userId = await _userManager.GetUserIdAsync(user);
_logger.LogInformation("User with ID '{UserId}' has enabled 2FA with an authenticator app.", userId);
StatusMessage = "Your authenticator app has been verified.";
if (await _userManager.CountRecoveryCodesAsync(user) == 0)
{
var recoveryCodes = await _userManager.GenerateNewTwoFactorRecoveryCodesAsync(user, 10);
RecoveryCodes = recoveryCodes.ToArray();
return RedirectToPage("./ShowRecoveryCodes");
}
else
{
return RedirectToPage("./TwoFactorAuthentication");
}
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Required]
[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Text)]
[Display(Name = "Verification Code")]
public string Code { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,53 @@
@page
@model ExternalLoginsModel
@{
ViewData["Title"] = "Manage your external logins";
ViewData["ActivePage"] = ManageNavPages.ExternalLogins;
}
<partial name="_StatusMessage" for="StatusMessage" />
@if (Model.CurrentLogins?.Count > 0)
{
<h4>Registered Logins</h4>
<table class="table">
<tbody>
@foreach (var login in Model.CurrentLogins)
{
<tr>
<td id="@($"login-provider-{login.LoginProvider}")">@login.ProviderDisplayName</td>
<td>
@if (Model.ShowRemoveButton)
{
<form id="@($"remove-login-{login.LoginProvider}")" asp-page-handler="RemoveLogin" method="post">
<div>
<input asp-for="@login.LoginProvider" name="LoginProvider" type="hidden" />
<input asp-for="@login.ProviderKey" name="ProviderKey" type="hidden" />
<button type="submit" class="btn btn-primary" title="Remove this @login.ProviderDisplayName login from your account">Remove</button>
</div>
</form>
}
else
{
@: &nbsp;
}
</td>
</tr>
}
</tbody>
</table>
}
@if (Model.OtherLogins?.Count > 0)
{
<h4>Add another service to log in.</h4>
<hr />
<form id="link-login-form" asp-page-handler="LinkLogin" method="post" class="form-horizontal">
<div id="socialLoginList">
<p>
@foreach (var provider in Model.OtherLogins)
{
<button id="@($"link-login-button-{provider.Name}")" type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
}
</p>
</div>
</form>
}
@@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class ExternalLoginsModel : PageModel
{
#region Private Fields
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ExternalLoginsModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}
#endregion Public Constructors
#region Public Properties
public IList<UserLoginInfo> CurrentLogins { get; set; }
public IList<AuthenticationScheme> OtherLogins { get; set; }
public bool ShowRemoveButton { get; set; }
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID 'user.Id'.");
}
CurrentLogins = await _userManager.GetLoginsAsync(user);
OtherLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync())
.Where(auth => CurrentLogins.All(ul => auth.Name != ul.LoginProvider))
.ToList();
ShowRemoveButton = user.PasswordHash != null || CurrentLogins.Count > 1;
return Page();
}
public async Task<IActionResult> OnGetLinkLoginCallbackAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID 'user.Id'.");
}
var info = await _signInManager.GetExternalLoginInfoAsync(user.Id);
if (info == null)
{
throw new InvalidOperationException($"Unexpected error occurred loading external login info for user with ID '{user.Id}'.");
}
var result = await _userManager.AddLoginAsync(user, info);
if (!result.Succeeded)
{
StatusMessage = "The external login was not added. External logins can only be associated with one account.";
return RedirectToPage();
}
// Clear the existing external cookie to ensure a clean login process
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
StatusMessage = "The external login was added.";
return RedirectToPage();
}
public async Task<IActionResult> OnPostLinkLoginAsync(string provider)
{
// Clear the existing external cookie to ensure a clean login process
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
// Request a redirect to the external login provider to link a login for the current user
var redirectUrl = Url.Page("./ExternalLogins", pageHandler: "LinkLoginCallback");
var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User));
return new ChallengeResult(provider, properties);
}
public async Task<IActionResult> OnPostRemoveLoginAsync(string loginProvider, string providerKey)
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID 'user.Id'.");
}
var result = await _userManager.RemoveLoginAsync(user, loginProvider, providerKey);
if (!result.Succeeded)
{
StatusMessage = "The external login was not removed.";
return RedirectToPage();
}
await _signInManager.RefreshSignInAsync(user);
StatusMessage = "The external login was removed.";
return RedirectToPage();
}
#endregion Public Methods
}
}
@@ -0,0 +1,27 @@
@page
@model GenerateRecoveryCodesModel
@{
ViewData["Title"] = "Generate two-factor authentication (2FA) recovery codes";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div class="alert alert-warning" role="alert">
<p>
<span class="glyphicon glyphicon-warning-sign"></span>
<strong>Put these codes in a safe place.</strong>
</p>
<p>
If you lose your device and don't have the recovery codes you will lose access to your account.
</p>
<p>
Generating new recovery codes does not change the keys used in authenticator apps. If you wish to change the key
used in an authenticator app you should <a asp-page="./ResetAuthenticator">reset your authenticator keys.</a>
</p>
</div>
<div>
<form method="post" class="form-group">
<button class="btn btn-danger" type="submit">Generate Recovery Codes</button>
</form>
</div>
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class GenerateRecoveryCodesModel : PageModel
{
#region Private Fields
private readonly ILogger<GenerateRecoveryCodesModel> _logger;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public GenerateRecoveryCodesModel(
UserManager<IdentityUser> userManager,
ILogger<GenerateRecoveryCodesModel> logger)
{
_userManager = userManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string[] RecoveryCodes { get; set; }
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var isTwoFactorEnabled = await _userManager.GetTwoFactorEnabledAsync(user);
if (!isTwoFactorEnabled)
{
var userId = await _userManager.GetUserIdAsync(user);
throw new InvalidOperationException($"Cannot generate recovery codes for user with ID '{userId}' because they do not have 2FA enabled.");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var isTwoFactorEnabled = await _userManager.GetTwoFactorEnabledAsync(user);
var userId = await _userManager.GetUserIdAsync(user);
if (!isTwoFactorEnabled)
{
throw new InvalidOperationException($"Cannot generate recovery codes for user with ID '{userId}' as they do not have 2FA enabled.");
}
var recoveryCodes = await _userManager.GenerateNewTwoFactorRecoveryCodesAsync(user, 10);
RecoveryCodes = recoveryCodes.ToArray();
_logger.LogInformation("User with ID '{UserId}' has generated new 2FA recovery codes.", userId);
StatusMessage = "You have generated new recovery codes.";
return RedirectToPage("./ShowRecoveryCodes");
}
#endregion Public Methods
}
}
@@ -0,0 +1,30 @@
@page
@model IndexModel
@{
ViewData["Title"] = "Profile";
ViewData["ActivePage"] = ManageNavPages.Index;
}
<h4>@ViewData["Title"]</h4>
<partial name="_StatusMessage" model="Model.StatusMessage" />
<div class="row">
<div class="col-md-6">
<form id="profile-form" method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Username"></label>
<input asp-for="Username" class="form-control" disabled />
</div>
<div class="form-group">
<label asp-for="Input.PhoneNumber"></label>
<input asp-for="Input.PhoneNumber" class="form-control" />
<span asp-validation-for="Input.PhoneNumber" class="text-danger"></span>
</div>
<button id="update-profile-button" type="submit" class="btn btn-primary">Save</button>
</form>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public partial class IndexModel : PageModel
{
#region Private Fields
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public IndexModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
[TempData]
public string StatusMessage { get; set; }
public string Username { get; set; }
#endregion Public Properties
#region Private Methods
private async Task LoadAsync(IdentityUser user)
{
var userName = await _userManager.GetUserNameAsync(user);
var phoneNumber = await _userManager.GetPhoneNumberAsync(user);
Username = userName;
Input = new InputModel
{
PhoneNumber = phoneNumber
};
}
#endregion Private Methods
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
await LoadAsync(user);
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
if (!ModelState.IsValid)
{
await LoadAsync(user);
return Page();
}
var phoneNumber = await _userManager.GetPhoneNumberAsync(user);
if (Input.PhoneNumber != phoneNumber)
{
var setPhoneResult = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
if (!setPhoneResult.Succeeded)
{
StatusMessage = "Unexpected error when trying to set phone number.";
return RedirectToPage();
}
}
await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Your profile has been updated";
return RedirectToPage();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public static class ManageNavPages
{
#region Public Properties
public static string ChangePassword => "ChangePassword";
public static string DeletePersonalData => "DeletePersonalData";
public static string DownloadPersonalData => "DownloadPersonalData";
public static string Email => "Email";
public static string ExternalLogins => "ExternalLogins";
public static string Index => "Index";
public static string PersonalData => "PersonalData";
public static string TwoFactorAuthentication => "TwoFactorAuthentication";
#endregion Public Properties
#region Private Methods
private static string PageNavClass(ViewContext viewContext, string page)
{
var activePage = viewContext.ViewData["ActivePage"] as string
?? System.IO.Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
return string.Equals(activePage, page, StringComparison.OrdinalIgnoreCase) ? "active" : null;
}
#endregion Private Methods
#region Public Methods
public static string ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword);
public static string DeletePersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DeletePersonalData);
public static string DownloadPersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DownloadPersonalData);
public static string EmailNavClass(ViewContext viewContext) => PageNavClass(viewContext, Email);
public static string ExternalLoginsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ExternalLogins);
public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index);
public static string PersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, PersonalData);
public static string TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication);
#endregion Public Methods
}
}
@@ -0,0 +1,27 @@
@page
@model PersonalDataModel
@{
ViewData["Title"] = "Personal Data";
ViewData["ActivePage"] = ManageNavPages.PersonalData;
}
<h4>@ViewData["Title"]</h4>
<div class="row">
<div class="col-md-6">
<p>Your account contains personal data that you have given us. This page allows you to download or delete that data.</p>
<p>
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
</p>
<form id="download-data" asp-page="DownloadPersonalData" method="post" class="form-group">
<button class="btn btn-primary" type="submit">Download</button>
</form>
<p>
<a id="delete" asp-page="DeletePersonalData" class="btn btn-secondary">Delete</a>
</p>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,45 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class PersonalDataModel : PageModel
{
#region Private Fields
private readonly ILogger<PersonalDataModel> _logger;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public PersonalDataModel(
UserManager<IdentityUser> userManager,
ILogger<PersonalDataModel> logger)
{
_userManager = userManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Methods
public async Task<IActionResult> OnGet()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
return Page();
}
#endregion Public Methods
}
}
@@ -0,0 +1,24 @@
@page
@model ResetAuthenticatorModel
@{
ViewData["Title"] = "Reset authenticator key";
ViewData["ActivePage"] = ManageNavPages.TwoFactorAuthentication;
}
<partial name="_StatusMessage" for="StatusMessage" />
<h4>@ViewData["Title"]</h4>
<div class="alert alert-warning" role="alert">
<p>
<span class="glyphicon glyphicon-warning-sign"></span>
<strong>If you reset your authenticator key your authenticator app will not work until you reconfigure it.</strong>
</p>
<p>
This process disables 2FA until you verify your authenticator app.
If you do not complete your authenticator app configuration you may lose access to your account.
</p>
</div>
<div>
<form id="reset-authenticator-form" method="post" class="form-group">
<button id="reset-authenticator-button" class="btn btn-danger" type="submit">Reset authenticator key</button>
</form>
</div>
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class ResetAuthenticatorModel : PageModel
{
#region Private Fields
private readonly SignInManager<IdentityUser> _signInManager;
private ILogger<ResetAuthenticatorModel> _logger;
private UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public ResetAuthenticatorModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager,
ILogger<ResetAuthenticatorModel> logger)
{
_userManager = userManager;
_signInManager = signInManager;
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGet()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
await _userManager.SetTwoFactorEnabledAsync(user, false);
await _userManager.ResetAuthenticatorKeyAsync(user);
_logger.LogInformation("User with ID '{UserId}' has reset their authentication app key.", user.Id);
await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Your authenticator app key has been reset, you will need to configure your authenticator app using the new key.";
return RedirectToPage("./EnableAuthenticator");
}
#endregion Public Methods
}
}
@@ -0,0 +1,35 @@
@page
@model SetPasswordModel
@{
ViewData["Title"] = "Set password";
ViewData["ActivePage"] = ManageNavPages.ChangePassword;
}
<h4>Set your password</h4>
<partial name="_StatusMessage" for="StatusMessage" />
<p class="text-info">
You do not have a local username/password for this site. Add a local
account so you can log in without an external login.
</p>
<div class="row">
<div class="col-md-6">
<form id="set-password-form" method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.NewPassword"></label>
<input asp-for="Input.NewPassword" class="form-control" />
<span asp-validation-for="Input.NewPassword" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Input.ConfirmPassword"></label>
<input asp-for="Input.ConfirmPassword" class="form-control" />
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Set password</button>
</form>
</div>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace GWMS.UI.Areas.Identity.Pages.Account.Manage
{
public class SetPasswordModel : PageModel
{
#region Private Fields
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors
public SetPasswordModel(
UserManager<IdentityUser> userManager,
SignInManager<IdentityUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}
#endregion Public Constructors
#region Public Properties
[BindProperty]
public InputModel Input { get; set; }
[TempData]
public string StatusMessage { get; set; }
#endregion Public Properties
#region Public Methods
public async Task<IActionResult> OnGetAsync()
{
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var hasPassword = await _userManager.HasPasswordAsync(user);
if (hasPassword)
{
return RedirectToPage("./ChangePassword");
}
return Page();
}
public async Task<IActionResult> OnPostAsync()
{
if (!ModelState.IsValid)
{
return Page();
}
var user = await _userManager.GetUserAsync(User);
if (user == null)
{
return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
}
var addPasswordResult = await _userManager.AddPasswordAsync(user, Input.NewPassword);
if (!addPasswordResult.Succeeded)
{
foreach (var error in addPasswordResult.Errors)
{
ModelState.AddModelError(string.Empty, error.Description);
}
return Page();
}
await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Your password has been set.";
return RedirectToPage();
}
#endregion Public Methods
#region Public Classes
public class InputModel
{
#region Public Properties
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}

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