134 Commits

Author SHA1 Message Date
Samuele Locatelli 40fa485b33 Refresh riferimenti URL repo (tolti) 2023-05-26 12:08:47 +02:00
Samuele Locatelli 691deb40ee Aggiornata conf x recupero report da servizio locale app 2023-05-26 12:07:48 +02:00
Samuele Locatelli a4828875f7 Fix vista x OrdersStatus 2023-05-26 11:58:33 +02:00
Samuele Locatelli 5cac2f22ec Fix compilazione ruoli 2023-05-26 10:47:29 +02:00
zaccaria.majid 98de9ea6be Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-26 10:13:45 +02:00
zaccaria.majid 367e2be94c inizio fix claims 2023-05-26 10:12:50 +02:00
Samuele Locatelli 9a071bfc52 Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-26 10:12:23 +02:00
Samuele Locatelli 6f320d38b5 RepViewer CORE:
- Completato report x ordini
- gestione integrata con stored
2023-05-26 10:11:23 +02:00
Samuele Locatelli ab3acadafe ancora update gest dataser report 2023-05-25 20:00:09 +02:00
Samuele Locatelli e27aff7ad2 Update gestione report con dataset espliciti da array 2023-05-25 20:00:02 +02:00
Samuele Locatelli 512f37654a Demo inclusione report in CORE class 2023-05-25 17:21:52 +02:00
zaccaria.majid 5a1f5c2da9 vari fix grafici 2023-05-25 17:06:30 +02:00
zaccaria.majid cc3b32f1d9 fix ricalcolo porta post save 2023-05-25 13:02:33 +02:00
zaccaria.majid 57d3f9433d fix report ordine 2023-05-25 08:04:08 +02:00
Samuele Locatelli 191ca5f2a2 WebDoorSrv:
- aggiunta in SDK metodi x reset della sola coda processing a request
2023-05-24 18:55:58 +02:00
Samuele Locatelli 1b491bd8a0 refresh ext prog, ma escluso da solution VB 2023-05-24 18:49:28 +02:00
Samuele Locatelli badf940391 Aggiunta gestione coda Processing con sblocco
- veto configurabile (5sec) prima di sbloccare
-gestione con chiamata REST
2023-05-24 17:58:59 +02:00
Samuele Locatelli e157770076 Refresh Ordine:
- Spostamento procedura calcolo DDF/SVG
- fix btn ricalcolo SVG
2023-05-24 16:22:42 +02:00
zaccaria.majid 6c8e118a46 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-24 15:51:50 +02:00
zaccaria.majid 1beb1c54d4 Aggiunto pulsante recalc 2023-05-24 15:51:44 +02:00
Samuele Locatelli d4d8cc9204 Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-24 15:51:18 +02:00
Samuele Locatelli 77a7294cf0 Aggiunta servizio queue x reset da lista doors 2023-05-24 15:51:08 +02:00
zaccaria.majid c8ed62ad82 fix traduzione objId e card x hw single instance 2023-05-24 15:23:15 +02:00
zaccaria.majid c2eae8ad9e ok pulizia generale 2023-05-24 08:20:46 +02:00
zaccaria.majid 249035756f Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-24 08:00:28 +02:00
zaccaria.majid cabd291b63 inizio pulizia codice 2023-05-24 08:00:24 +02:00
Samuele Locatelli 2586f443b0 Merge tag 'UpdateDemoApp01' into develop
Update vari: versione, reports pdf, ...
2023-05-23 19:11:01 +02:00
Samuele Locatelli 1698e326a2 Merge branch 'release/UpdateDemoApp01' 2023-05-23 19:10:35 +02:00
Samuele Locatelli b2fed86c03 aggiunta btn ricalcolo sopra door preview 2023-05-23 19:09:43 +02:00
Samuele Locatelli c7218c0941 minor fix animazione 2023-05-23 19:02:02 +02:00
Samuele Locatelli 4beae1d55c Fix conf x download reports pdf 2023-05-23 18:57:40 +02:00
Samuele Locatelli 8be28cd5b6 Script calcolo release + integrazione build 2023-05-23 16:58:10 +02:00
Samuele Locatelli c3da3a0aa3 Setup iniziale file x rel calc 2023-05-23 16:52:41 +02:00
Samuele Locatelli d4a03a3fd6 Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-23 16:37:40 +02:00
Samuele Locatelli 8df4d68fc2 Gestione cmp footer 2023-05-23 16:35:53 +02:00
zaccaria.majid fb070c030a fix creazione porta 2023-05-23 15:12:46 +02:00
Samuele Locatelli 393613cb1a Fix image missing x API 2023-05-23 11:45:46 +02:00
Samuele Locatelli a4e62dc681 Fix display ordini 2023-05-23 11:41:34 +02:00
Samuele Locatelli 8e2ea5c312 Update con ConfigTable x report & co 2023-05-23 10:22:56 +02:00
Samuele Locatelli 0da0fa9fa4 Merge tag 'AddImagePngService01' into develop
Fix compilazione senza classe Utils
2023-05-22 18:03:55 +02:00
Samuele Locatelli 0ba8cf6ef0 Merge branch 'release/AddImagePngService01' 2023-05-22 18:03:47 +02:00
Samuele Locatelli 5940e1262d Fix compilazione: rimozione classe utils (non necessaria) 2023-05-22 18:03:30 +02:00
Samuele Locatelli 1f9923ff8f Merge tag 'AddImagePngService' into develop
Aggiunto servizio png/svh in API x generazione img porta
2023-05-22 18:00:40 +02:00
Samuele Locatelli 06feff5655 Merge branch 'release/AddImagePngService' 2023-05-22 18:00:22 +02:00
Samuele Locatelli 1a498357c1 WebAPI:
- aggiunta doorImage service
- conversione png + svg inclusa
2023-05-22 17:59:57 +02:00
Samuele Locatelli e24a76accd Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-22 17:55:51 +02:00
Samuele Locatelli f7cf1727c9 Aggiunta in API export doorImage (SVG+PNG) 2023-05-22 17:55:48 +02:00
zaccaria.majid f93b79bbf0 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-22 17:07:58 +02:00
zaccaria.majid ac8e8a8682 fix grafico 2023-05-22 17:07:53 +02:00
Samuele Locatelli 635457aef5 Merge tag 'updateProdSite01' into develop
update sito in prod seriate.egalware x test remoti
2023-05-22 15:38:04 +02:00
Samuele Locatelli 057da27842 Merge branch 'release/updateProdSite01' 2023-05-22 15:37:41 +02:00
Samuele Locatelli 15d2d0244b ancora pubxml 2023-05-22 15:37:09 +02:00
Samuele Locatelli a5d7992b28 iis04:
- update pubxml
- fix png immagini
2023-05-22 15:37:02 +02:00
Samuele Locatelli 3997aa97e9 Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-22 09:01:26 +02:00
Samuele Locatelli d10933c76e Update note to-do 2023-05-22 09:01:17 +02:00
zaccaria.majid 1d9ec9be58 fix grafico 2023-05-22 08:47:34 +02:00
Samuele Locatelli 11ca037e8e Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-19 17:25:13 +02:00
Samuele Locatelli bb078ac88f Ancora update x gestione API ordini 2023-05-19 17:25:11 +02:00
zaccaria.majid e9ff15f07f inizio recalc automatico post clone 2023-05-19 17:13:11 +02:00
zaccaria.majid fbfcb9d012 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 16:40:42 +02:00
zaccaria.majid 3cd968d148 fix bottoni porte 2023-05-19 16:40:37 +02:00
Samuele Locatelli 4f620f3441 Fix duplicati da merge repo 2023-05-19 16:33:35 +02:00
zaccaria.majid 4a5601c8c5 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 16:31:30 +02:00
zaccaria.majid b29398c673 ok modal 2023-05-19 16:30:55 +02:00
Samuele Locatelli 4a2808a955 Merge branch 'feature/CostingDtoSetup' into develop 2023-05-19 16:30:03 +02:00
Samuele Locatelli b02481ef33 Completato spostsamento servizio webdoor in DATA 2023-05-19 16:29:52 +02:00
Samuele Locatelli 8287ff68ef Spostamento DoorService in DATA (inizio) 2023-05-19 16:02:24 +02:00
Samuele Locatelli dc7ee1eb00 Inizio setup controller API 2023-05-19 16:02:09 +02:00
Samuele Locatelli 4d3eafc7e7 Aggiunta DTO Preliminari 2023-05-19 16:01:53 +02:00
zaccaria.majid c4f832cc59 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 15:29:29 +02:00
zaccaria.majid 6f7b917c12 Spostate tutte le pagine in SINGLE PAGE 2023-05-19 15:29:24 +02:00
Emmanuele Sassi 509e9c4c6b Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 12:25:41 +02:00
Emmanuele Sassi 0d803d552d - migliorata gestione perdita ping con riavvio quando torna
- aggiunti stati ping ed alive
2023-05-19 12:25:18 +02:00
zaccaria.majid 84e715f7d9 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 12:22:33 +02:00
zaccaria.majid f01f3542ac pulizia generale 2023-05-19 12:22:27 +02:00
Samuele Locatelli 4c0e96e89f Ancora qualche fix cambio colore/animazione 2023-05-19 12:11:07 +02:00
Samuele Locatelli cba65097ee Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-19 12:05:16 +02:00
Samuele Locatelli 3a3e3a3fd1 Demo animazione 2023-05-19 12:05:12 +02:00
zaccaria.majid 9beadf6e35 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 11:29:59 +02:00
zaccaria.majid a0580332f5 aggiunto bottone close 2023-05-19 11:29:52 +02:00
Emmanuele Sassi de7ab813bc Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 11:11:55 +02:00
Emmanuele Sassi f5e44de50c - migliorie gestione processi 2023-05-19 11:06:43 +02:00
Samuele Locatelli c6f8b9fc75 Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-19 10:53:35 +02:00
Samuele Locatelli c4922c3c23 update pagina test blocchi 2023-05-19 10:53:07 +02:00
zaccaria.majid 6213564693 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-19 10:51:43 +02:00
zaccaria.majid 61198818a5 Merge branch 'feature/doorOptModal' into develop 2023-05-19 10:50:53 +02:00
zaccaria.majid 5fb1f3a170 ok bulk add num porte 2023-05-19 10:46:39 +02:00
zaccaria.majid 725b847770 agginta delete door a modale 2023-05-19 10:38:49 +02:00
zaccaria.majid 0459a458de ok anteprima porta in modale 2023-05-19 09:58:50 +02:00
Samuele Locatelli bcfb5f3b13 modifica x test ping diretto 2023-05-19 09:58:36 +02:00
zaccaria.majid f354330756 aggiunto componente modale + comportamento chiusura 2023-05-19 08:42:29 +02:00
Samuele Locatelli 4d4b7c4cd0 Cache DDF --> settimana 2023-05-19 08:09:18 +02:00
zaccaria.majid 092315ccc8 bozza modal 2023-05-18 18:02:39 +02:00
Samuele Locatelli 014a52ad34 Aggiunto options display 2023-05-18 16:49:31 +02:00
Samuele Locatelli 36359ab59a Merge branch 'develop' of https://gitlab.steamware.net/egalware/webdoorcreator into develop 2023-05-18 16:47:25 +02:00
Samuele Locatelli 8d8b5931c4 Completata gestione comportamenti... 2023-05-18 16:46:50 +02:00
zaccaria.majid e8878df82e fix componenti fissi doorList 2023-05-18 16:39:38 +02:00
Samuele Locatelli 75409430c4 Aggiunto calcolo e display 3° cerchio 2023-05-18 15:58:55 +02:00
zaccaria.majid 7bb73093a7 fix grafico testata order 2023-05-18 15:58:06 +02:00
Samuele Locatelli 75a37728d3 inizio parametrizzazione cerchi opzionali 2023-05-18 15:43:58 +02:00
zaccaria.majid ea71e26a16 ok navigazione generale 2023-05-18 15:21:57 +02:00
zaccaria.majid d80d005925 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-18 13:11:37 +02:00
zaccaria.majid d8abd9d08c pulizia generale 2023-05-18 13:11:27 +02:00
Samuele Locatelli edb1778b82 Update x btn +/- 2023-05-18 13:11:13 +02:00
Samuele Locatelli 4c4b90a336 fix tab in missing grigia 2023-05-18 12:54:48 +02:00
Samuele Locatelli 8127654ce3 Fix missing img 2023-05-18 12:54:26 +02:00
zaccaria.majid 37e8ff9001 Aggiunto costo 2023-05-18 12:38:45 +02:00
zaccaria.majid 7a704f5a02 ok navigazione orders 2023-05-18 12:30:30 +02:00
zaccaria.majid 8086f27140 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-18 11:55:54 +02:00
zaccaria.majid 7b3fab1f31 Merge branch 'feature/animNavOrder01' into develop 2023-05-18 11:55:34 +02:00
zaccaria.majid 2cdb87496b ok spostato elemento doorDetails 2023-05-18 11:55:03 +02:00
Emmanuele Sassi a359b73191 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-18 11:18:36 +02:00
Emmanuele Sassi 731bd5ccdc - piccole modifiche per miglioramento gestione thread e restart 2023-05-18 11:18:25 +02:00
zaccaria.majid d50b167b9d inizio anim 2023-05-18 11:13:48 +02:00
Samuele Locatelli 2c02e27e5d fix tinta verde x plus 2023-05-18 11:12:14 +02:00
Samuele Locatelli 9193d45fb0 HwSvgObj:
- Fix comportamento buttons navigazione
- aggiunta svg
2023-05-18 11:08:36 +02:00
Samuele Locatelli 6eed928af5 ancora nuova modifica HwSvgObj x nuova modalità 2023-05-18 10:40:14 +02:00
Samuele Locatelli 9e65f9dce1 Modifica controllo sw x gestione HwInstance:
- ridotto num metodi
- gestione con actionReq
2023-05-18 10:39:59 +02:00
Samuele Locatelli e23d29a72a fix local launch settings 2023-05-18 08:05:50 +02:00
Samuele E. Locatelli (MBA) 955529ac1c update launchSettings 2023-05-17 21:34:43 +02:00
Samuele E. Locatelli (MBA) 78604b3f54 Update x link DoorsList + launch settings 2023-05-17 21:29:16 +02:00
Samuele E. Locatelli (MBA) c673dcc627 Update logo su nav menu top 2023-05-17 21:23:21 +02:00
Samuele E. Locatelli (MBA) 9ff4d56137 Conf x base url su IIS, con base, staging, prod 2023-05-17 21:14:21 +02:00
Samuele Locatelli 6844b6edd3 Modifiche x migliorare fit immagine svg porta:
- da testare con oggetto image + svg embedded
2023-05-17 19:25:29 +02:00
Samuele Locatelli 7d7d65e250 Fix conteggio istanze in HwDetails 2023-05-17 19:11:59 +02:00
Samuele Locatelli 4f92e44024 Fix vari rename ABH --> DCA 2023-05-17 18:52:52 +02:00
Samuele Locatelli cf7211e08e Aggiunta gestione delete singola porta 2023-05-17 18:40:19 +02:00
Samuele Locatelli 1f1bd8ebaa Fix ombreggiatura orderDetails 2023-05-17 16:17:52 +02:00
Emmanuele Sassi 41d67c3686 - correzione valutazione stato thread 2023-05-17 15:00:31 +02:00
Emmanuele Sassi b544524fd9 - migliorato riavvio 2023-05-17 14:49:04 +02:00
Emmanuele Sassi 4ab48e3b18 Merge intermedio 2023-05-17 14:02:58 +02:00
Emmanuele Sassi 2bcb89ba14 Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-17 13:49:51 +02:00
Emmanuele Sassi ead026a15e Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop 2023-05-17 12:08:54 +02:00
Emmanuele Sassi 44e62b8798 - migliorata gestione riavvio thread 2023-05-17 12:04:24 +02:00
199 changed files with 14433 additions and 3115 deletions
+35 -25
View File
@@ -1,8 +1,10 @@
# Elenco ToDo
Di seguito l'elenco dei todo da completare
## Framework
Traduzione OVUNQUE x ogni termine/etichetta/button
Traduzione OVUNQUE x ogni termine/etichetta/button..
## Pagine
@@ -17,52 +19,60 @@ Traduzione OVUNQUE x ogni termine/etichetta/button
### Orders Home page
Per completare
- <del>aggiunta paginatore</del>
- <del>aggiunta stato ordine</del>
- <del>aggiunta filtri ricerca
- [x] aggiunta paginatore
- [x] aggiunta stato ordine
- [x] aggiunta filtri ricerca
- periodo da-a
- search generico
- stato ordine</del>
- <del>ordinamento</del>
- stato ordine
- [x] ordinamento
### DCA Order Man
### DCA Order Mans
FORSE la Orders home Page NON VA bene x gli utenti backoffice, oppure va estesa, perché x confermare quotazione, indicare avanzamento ordini gli operatori ABH/DCA devono avere una pagina operativa...
### OrderDetails
Per completare:
- <del>aggiunta button x il cambio stato da end-user</del>
- <del>sistemare con paginatore max 3 righe x 4 porte</del>
- <del>fix button verde add-new</del>
- [x] aggiunta button x il cambio stato da end-user
- [x] sistemare con paginatore max 3 righe x 4 porte
- [x] fix button verde add-new
- [x] ombreggiatura blocco
### DoorDefinition BaseParams
- <del>conteggio num modifiche da salvare</del>
- <del>armonizzare il cancel/save nella pagina</del>
- <del>revisione testata fino al btn del salva generale</del>
- <del>sostituire il salva generale con 2 buttons:
- [x] conteggio num modifiche da salvare
- [x] armonizzare il cancel/save nella pagina
- [x] revisione testata fino al btn del salva generale
- [x] sostituire il salva generale con 2 buttons:
- salva, o meglio RECALC PNG = update PNG, potrebbe andare in automatico DOPO i vari SALVA nella pagina (opzione x auto-recalc?!?)
- get 3D obj (in new window/tab)</del>
- get 3D obj (in new window/tab)
- [x] delete singola porta da ordine
- [x] navigazione in ritorno come da FIGMA in HwNewInst
- [x] refresh conteggi su approvazione
- [x] conteggio istanze in aggiunta HW
### DoorDefinition Hardware
Sistemare:
- <del>da implementare davvero lettura pdf (da cartella pdf di esempi)</del>
- <del>fix cancel/save: globale x Hardware oppure x ognuno con icona?</del>
- verificare perché NON si aggiorna al salvataggio pagina dei 18 hw
- <del>mancano il totale componenti x ogni hw attivato</del>
- [x] da implementare davvero lettura pdf (da cartella pdf di esempi)
- [x] fix cancel/save: globale x Hardware oppure x ognuno con icona?
- [ ] verificare perché NON si aggiorna al salvataggio pagina dei 18 hw
- [x] mancano il totale componenti x ogni hw attivato
#### Report
<del>Va inserita una lista dei componenti + elenco quote.</del>
Va pensato esportabile in pdf, comprensivo di "check pdf fatto da tizio alle ..."
- [x] Va inserita una lista dei componenti + elenco quote.
- [ ] Va pensato esportabile in pdf, comprensivo di "check pdf fatto da tizio alle ..."
## Componenti
### Top
Da sistemare
- <del>btn effettivi</del>
- <del>dinamico da user-role?</del>
- <del>fix responsive</del>
- [x] btn effettivi
- [x] dinamico da user-role?
- [x] fix responsive
Binary file not shown.
File diff suppressed because one or more lines are too long
+29
View File
@@ -0,0 +1,29 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: {{CURRENT-REL}}</h4>
<br /> Release note:
<ul>
<li>
<b>Last Changes:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.0.* &rarr;</b>
<ul>
<li>First CORE UI</li>
<li>First CORE API rest services</li>
<li>integration with EgtEngine server</li>
<li>Release dotnet6</li>
<li>EFCore Engine</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="LogoEgw.png" />
</div>
<div style="float: right;">
<a href="https://www.egalware.net/" target="_blank">&copy; Egalware 2022+</a>
</div>
</div>
</body>
+29
View File
@@ -0,0 +1,29 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: 0.9.2305.2612</h4>
<br /> Release note:
<ul>
<li>
<b>Last Changes:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.0.* &rarr;</b>
<ul>
<li>First CORE UI</li>
<li>First CORE API rest services</li>
<li>integration with EgtEngine server</li>
<li>Release dotnet6</li>
<li>EFCore Engine</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="LogoEgw.png" />
</div>
<div style="float: right;">
<a href="https://www.egalware.net/" target="_blank">&copy; Egalware 2022+</a>
</div>
</div>
</body>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+1
View File
@@ -0,0 +1 @@
0.9.
+1
View File
@@ -0,0 +1 @@
0.9.2305.2612
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.0.0</version>
<url>http://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2305.2612</version>
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+75
View File
@@ -0,0 +1,75 @@
// See https://aka.ms/new-console-template for more information
using System.Diagnostics;
int lineCount = 0;
void OutputHandler(object sender, DataReceivedEventArgs e)
{
if (!string.IsNullOrEmpty(e.Data))
{
Console.WriteLine($"RIPOSTA PROCESSO [{lineCount}] - {e.Data}");
if (e.Data == "SUCCESS")
{
lineCount += 1;
}
}
};
var domanda = "Sai chi ti saluta tantissimo?";
Console.WriteLine(domanda);
// Create a new process object
Process p = new Process();
// Specify the file name of the external exe
p.StartInfo.FileName = @"C:\Temp\TestEcho.bat";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
//var stdIn = p.StandardInput;
p.OutputDataReceived += (s, e) => OutputHandler(s, e);
// Optionally, specify any arguments for the exe
//p.StartInfo.Arguments = domanda;
// Start the process
p.Start();
p.StandardInput.WriteLine(domanda);
p.BeginOutputReadLine();
while (!p.HasExited)
{
//Console.WriteLine(output.ToString());
Thread.Sleep(500);
//var inVar = Console.ReadLine();
//// mando nuovo input...
//p.StandardInput.WriteLine(domanda);
Thread.Sleep(500);
// mando nuovo input...
p.StandardInput.WriteLine(domanda);
Thread.Sleep(500);
// mando nuovo input...
p.StandardInput.WriteLine(domanda);
Thread.Sleep(500);
// mando nuovo input...
p.StandardInput.WriteLine(domanda);
Thread.Sleep(500);
// mando nuovo input...
p.StandardInput.WriteLine("escape");
}
// Optionally, wait for the process to exit
p.WaitForExit();
p.Close();
Console.WriteLine("Ho finito...");
Console.WriteLine("...press return to close");
Console.ReadLine();
+10
View File
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
@@ -0,0 +1,86 @@
using Microsoft.AspNetCore.Mvc;
using NLog;
using Svg;
using System.Drawing;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class DoorImageController : ControllerBase
{
#region Public Constructors
public DoorImageController(IConfiguration configuration, QueueDataService DataService)
{
Log.Info("Starting DoorImageController");
_configuration = configuration;
QDataServ = DataService;
Log.Info("Avviato DoorImageController");
}
#endregion Public Constructors
#region Public Methods
// GET: api/Alive
[HttpGet]
public string Get()
{
return "OK";
}
[HttpGet("GetImage.png")]
public async Task<IActionResult> GetImagePng(int DoorId)
{
byte[] result = new byte[0];
string svgContent = await QDataServ.DoorGetLastSvg(DoorId);
if (!string.IsNullOrEmpty(svgContent))
{
var mySvg = SvgDocument.FromSvg<SvgDocument>(svgContent);
//result = System.Text.Encoding.UTF8.GetBytes(svgContent);
var myBmp = mySvg.Draw();
result = ImageToByte2(myBmp);
}
return File(result, "image/png");
}
[HttpGet("GetImage.svg")]
public async Task<IActionResult> GetImageSvg(int DoorId)
{
string svgContent = await QDataServ.DoorGetLastSvg(DoorId);
var result = System.Text.Encoding.UTF8.GetBytes(svgContent);
return File(result, "image/svg+xml");
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Properties
private QueueDataService QDataServ { get; set; } = null!;
#endregion Private Properties
#region Private Methods
private byte[] ImageToByte2(Image img)
{
using (var stream = new MemoryStream())
{
img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
return stream.ToArray();
}
}
#endregion Private Methods
}
}
@@ -0,0 +1,79 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NLog;
using WebDoorCreator.Data.DTO;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class OrderController : ControllerBase
{
public OrderController(IConfiguration configuration, WebDoorCreatorService DataService)
{
Log.Info("Starting OrderController");
_configuration = configuration;
WDCService = DataService;
Log.Info("Avviato OrderController");
}
/// <summary>
/// GET: api/Order
/// </summary>
/// <returns></returns>
[HttpGet]
public string Get()
{
return "OK";
}
/// <summary>
/// GET: api/Order/GetCurrent
/// Recupera ordini degli ultimi 6 mesi dato cliente e stato
/// </summary>
/// <returns></returns>
[HttpGet("GetCurrent")]
public async Task<List<int>> GetCurrent(int id, int ordStatus)
{
List<int> answ = new List<int>();
DateTime dtEnd = DateTime.Now;
DateTime dtStart = dtEnd.AddMonths(-1);
var rawData = await WDCService.OrderStatusGetFilt(id, ordStatus, dtStart, dtEnd);
if (rawData != null)
{
answ = rawData.Select(x => x.OrderId).ToList();
}
return answ;
}
/// <summary>
/// Order detail for cost evaluation
/// </summary>
/// <param name="OrderId"></param>
/// <returns></returns>
[HttpGet("OrderDetail")]
public async Task<OrderDetailsDTO> OrderDetail(int OrderId)
{
OrderDetailsDTO answ = new OrderDetailsDTO()
{
OrderId = OrderId
};
// recupero info ordine
var rawOrder = await WDCService.OrderGetByKey(OrderId);
if (rawOrder != null)
{
answ.OrderDescript = rawOrder.OrderDescript;
answ.OrderExtCode = rawOrder.OrderExtCode;
// recupero info customer
// recuper elenco porte...
//answ. = rawOrder.OrderDescript;
}
// popolo con dati specifica...
return answ;
}
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
private WebDoorCreatorService WDCService { get; set; } = null!;
}
}
@@ -81,6 +81,19 @@ namespace WebDoorCreator.API.Controllers
return answ;
}
/// <summary>
/// Reset della coda di processing x evitare condizioni di "stuck in calc"
/// </summary>
/// <returns></returns>
[HttpPost("ResetQueueProcessing")]
public async Task<string> ResetQueueProcessing()
{
string answ = "NA";
bool fatto = await QDataServ.ResetQueueProcessing();
answ = fatto ? "OK" : "NO";
return answ;
}
/// <summary>
/// Invio elenco risultati elaborazioni (modalità boolean di esecuzione corretta)
/// </summary>
@@ -0,0 +1,155 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.Reporting.NETCore;
using NLog;
using System.Data;
using ToDataTable;
using WebDoorCreator.Core.ReportViewer;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ReportController : ControllerBase
{
#region Public Constructors
public ReportController(IConfiguration configuration, WebDoorCreatorService DataService)
{
Log.Info("Starting ReportController");
_configuration = configuration;
WDCService = DataService;
Log.Info("Avviato ReportController");
}
#endregion Public Constructors
#region Public Methods
// GET: api/Alive
[HttpGet]
public string Get()
{
return "OK";
}
/// <summary>
/// Restituisce report dato ordine e formato
/// </summary>
/// <param name="OrderId">ID univoco ordine</param>
/// <param name="Format">Formato: PDF/HTML/DOCX/XLSX</param>
/// <returns></returns>
[HttpGet("GetOrderReport")]
public async Task<IActionResult> GetOrderReport(int OrderId, string Format)
{
// dato il servizio è impostato il file rdlc e la struttura data DS da passare
await Task.Delay(1);
// inizializzo parametri report di default
Core.ReportViewer.Report.RenderParams currParams = new Core.ReportViewer.Report.RenderParams(Format);
currParams.FileName= $"DCA-Order-{OrderId:00000000}";
// restituisco oggetto ReportOrder specifico
return await OrderReportGet(OrderId, currParams);
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Properties
private WebDoorCreatorService WDCService { get; set; } = null!;
#endregion Private Properties
#region Private Methods
#if false
/// <summary>
/// Restituisce filestream del report DEMO
/// </summary>
/// <param name="FileName">Nome file desiderato x download</param>
/// <param name="RenderFormat"></param>
/// <param name="FileExt"></param>
/// <param name="MimeType"></param>
/// <returns></returns>
private IActionResult ReportDemoGet(int OrderId, Core.ReportViewer.Report.RenderParams CurrParams)
{
using (var report = new LocalReport())
{
// setup parametri
List<ReportParameter> RepParams = new List<ReportParameter>();
RepParams.Add(new ReportParameter("Title", "Invoice 4/2020"));
// setup DsReport
Dictionary<string, DataTable> DsDict = new Dictionary<string, DataTable>();
Random rnd = new Random();
decimal WidgetPrice = 204.99m;
decimal GizmoPrice = 2.41m;
var items = new[] {
new ReportItem { Description = "Widget 6000", Price = WidgetPrice, Qty = rnd.Next(1,5) },
new ReportItem { Description = "Gizmo MAX", Price = GizmoPrice, Qty = rnd.Next(10,50) },
new ReportItem { Description = "Pippo", Price = 1.2m, Qty = rnd.Next(3,9) },
new ReportItem { Description = "Paperino", Price = 1.74m, Qty = rnd.Next(5,15) }
}.ToList();
var totaQty = items.Sum(x => x.Qty);
var avgPrice = items.Sum(x => x.Qty * x.Price) / totaQty;
items.Add(new ReportItem() { Description = "Total", Qty = totaQty, Price = Math.Round(avgPrice, 2) });
DataTable tabDati = items.ToDataTable();
tabDati.TableName = "Items";
// aggiungo dizionario
DsDict.Add("Items", tabDati);
// carico dati nel report...
Core.ReportViewer.Report.Load(report, "Report.rdlc", RepParams, DsDict);
var rawData = report.Render(CurrParams.RenderFormat);
return File(rawData, CurrParams.MimeType, $"{CurrParams.FileName}.{CurrParams.Extension}");
}
}
#endif
/// <summary>
/// Restituisce filestream del report richiesto
/// </summary>
/// <param name="OrderId">ID Ordine</param>
/// <param name="CurrParams">Parametri rendering report</param>
/// <returns></returns>
private async Task<IActionResult> OrderReportGet(int OrderId, Core.ReportViewer.Report.RenderParams CurrParams)
{
using (var report = new LocalReport())
{
// setup parametri
List<ReportParameter> RepParams = new List<ReportParameter>();
RepParams.Add(new ReportParameter("OrderID", $"{OrderId}"));
// setup DsReport
Dictionary<string, DataTable> DsDict = new Dictionary<string, DataTable>();
// recupero tab dati config...
var confList = await WDCService.ConfigGetAll();
DataTable tabDatiConf = confList.ToDataTable();
tabDatiConf.TableName = "DataSetConfig";
// aggiungo a dizionario
DsDict.Add("DataSetConfig", tabDatiConf);
// recupero dati veri del report...
var repDetailData = await WDCService.PreRepOrderGetByKey(OrderId);
DataTable tabDati = repDetailData.ToDataTable();
tabDati.TableName = "DataSetOrderReportExpl";
// aggiungo dizionario
DsDict.Add("DataSetOrderReportExpl", tabDati);
// carico dati nel report...
Core.ReportViewer.Report.Load(report, "ReportOrder.rdlc", RepParams, DsDict);
var rawData = report.Render(CurrParams.RenderFormat);
return File(rawData, CurrParams.MimeType, $"{CurrParams.FileName}.{CurrParams.Extension}");
}
}
#endregion Private Methods
}
}
+1
View File
@@ -57,6 +57,7 @@ builder.Services.AddStackExchangeRedisExtensions<NewtonsoftSerializer>((options)
});
builder.Services.AddSingleton<QueueDataService>();
builder.Services.AddSingleton<WebDoorCreatorService>();
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
var app = builder.Build();
@@ -8,12 +8,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://iis04.egalware.com/WDC/SRV/swagger/index.html</SiteUrlToLaunchAfterPublish>
<SiteUrlToLaunchAfterPublish>https://seriate.egalware.com/WDC/SRV/swagger/index.html</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis04.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/WDC/SRV</DeployIisAppPath>
<DeployIisAppPath>seriate.egalware.com/WDC/SRV</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
@@ -7,7 +7,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAB43BVhUmznhAu3pUfV1IfOAAAAAASAAACgAAAAEAAAAEV8hgbujDFfsMjS77NS2oYYAAAAUHPGFaVWgRqQPDU4wk5KGABmVHKko4/9FAAAANtaROBOcPHljx4RnmQHj5aHdtYk</EncryptedPassword>
<History>True|2023-05-11T15:35:09.5858697Z;True|2022-01-27T10:34:09.2346456+01:00;True|2022-01-27T10:13:36.3080675+01:00;True|2022-01-27T10:05:45.6649507+01:00;True|2022-01-26T14:34:16.5263189+01:00;True|2022-01-26T13:04:22.2336648+01:00;False|2022-01-26T13:04:06.0677616+01:00;True|2021-11-08T09:03:37.7855257+01:00;True|2021-11-08T09:03:34.8263479+01:00;True|2021-11-08T09:03:31.8889390+01:00;True|2021-10-29T16:19:33.6539408+02:00;True|2021-10-29T16:19:28.2082360+02:00;True|2021-10-26T16:12:11.7740950+02:00;True|2021-10-26T16:11:56.2014641+02:00;True|2021-10-26T16:11:22.2897842+02:00;False|2021-10-26T16:10:58.3733037+02:00;False|2021-10-26T16:10:29.4793991+02:00;True|2021-10-21T17:35:11.9761128+02:00;True|2021-10-18T20:22:00.9305399+02:00;True|2021-10-18T18:32:29.4558070+02:00;True|2021-10-18T18:32:22.8950294+02:00;True|2021-10-18T18:16:13.7563877+02:00;True|2021-10-18T18:15:48.5678387+02:00;True|2021-10-18T12:45:45.7228681+02:00;True|2021-10-18T12:14:22.3221605+02:00;True|2021-10-18T12:14:15.7373530+02:00;True|2021-10-18T12:10:43.8607301+02:00;</History>
<History>True|2023-05-22T13:37:00.8611764Z;True|2023-05-11T17:35:09.5858697+02:00;True|2022-01-27T10:34:09.2346456+01:00;True|2022-01-27T10:13:36.3080675+01:00;True|2022-01-27T10:05:45.6649507+01:00;True|2022-01-26T14:34:16.5263189+01:00;True|2022-01-26T13:04:22.2336648+01:00;False|2022-01-26T13:04:06.0677616+01:00;True|2021-11-08T09:03:37.7855257+01:00;True|2021-11-08T09:03:34.8263479+01:00;True|2021-11-08T09:03:31.8889390+01:00;True|2021-10-29T16:19:33.6539408+02:00;True|2021-10-29T16:19:28.2082360+02:00;True|2021-10-26T16:12:11.7740950+02:00;True|2021-10-26T16:11:56.2014641+02:00;True|2021-10-26T16:11:22.2897842+02:00;False|2021-10-26T16:10:58.3733037+02:00;False|2021-10-26T16:10:29.4793991+02:00;True|2021-10-21T17:35:11.9761128+02:00;True|2021-10-18T20:22:00.9305399+02:00;True|2021-10-18T18:32:29.4558070+02:00;True|2021-10-18T18:32:22.8950294+02:00;True|2021-10-18T18:16:13.7563877+02:00;True|2021-10-18T18:15:48.5678387+02:00;True|2021-10-18T12:45:45.7228681+02:00;True|2021-10-18T12:14:22.3221605+02:00;True|2021-10-18T12:14:15.7373530+02:00;True|2021-10-18T12:10:43.8607301+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
+447
View File
@@ -0,0 +1,447 @@
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="LocalSource">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties>
<rd:DataSourceID>bd60bef3-b3d9-477e-9052-ab58c6f1ec86</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="Items">
<Query>
<DataSourceName>LocalSource</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="Description">
<DataField>Description</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Price">
<DataField>Price</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Qty">
<DataField>Qty</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="Total">
<DataField>Total</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>LocalSource</rd:DataSetName>
<rd:TableName>Items</rd:TableName>
<rd:ObjectDataSourceType>ReportViewerCore.ReportItem</rd:ObjectDataSourceType>
</rd:DataSetInfo>
</DataSet>
</DataSets>
<ReportSections>
<ReportSection>
<Body>
<ReportItems>
<Tablix Name="Tablix1">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>8.31785cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.51905cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.51905cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.51905cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.67938cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Description</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Price</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox5">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Qty</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Total</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.67938cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Description">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Description.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Description</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Price">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Price.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Price</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Qty">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Qty.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Qty</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Total">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Total.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Total</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
</TablixMember>
<TablixMember>
<Group Name="Details" />
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>Items</DataSetName>
<Top>2.85433cm</Top>
<Left>0.3175cm</Left>
<Height>1.35875cm</Height>
<Width>15.875cm</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Tablix>
<Textbox Name="Textbox6">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Title.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontSize>26pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox6</rd:DefaultName>
<Top>0.26141cm</Top>
<Left>0.3175cm</Left>
<Height>1.79062cm</Height>
<Width>15.875cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>2in</Height>
<Style />
</Body>
<Width>6.5in</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>
<LeftMargin>2cm</LeftMargin>
<RightMargin>2cm</RightMargin>
<TopMargin>2cm</TopMargin>
<BottomMargin>2cm</BottomMargin>
<ColumnSpacing>0.13cm</ColumnSpacing>
<Style />
</Page>
</ReportSection>
</ReportSections>
<ReportParameters>
<ReportParameter Name="Title">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<ReportParametersLayout>
<GridLayoutDefinition>
<NumberOfColumns>4</NumberOfColumns>
<NumberOfRows>2</NumberOfRows>
<CellDefinitions>
<CellDefinition>
<ColumnIndex>0</ColumnIndex>
<RowIndex>0</RowIndex>
<ParameterName>Title</ParameterName>
</CellDefinition>
</CellDefinitions>
</GridLayoutDefinition>
</ReportParametersLayout>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>156b21d2-9542-4902-99ef-7ec823774bb2</rd:ReportID>
</Report>
File diff suppressed because it is too large Load Diff
@@ -24,6 +24,7 @@
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="9.1.0" />
<PackageReference Include="StackExchange.Redis.Extensions.Core" Version="9.1.0" />
<PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft" Version="9.1.0" />
<PackageReference Include="Svg" Version="3.4.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
@@ -32,4 +33,15 @@
<ProjectReference Include="..\WebDoorCreator.Data\WebDoorCreator.Data.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Reports\Report.rdlc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Reports\ReportOrder.rdlc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>
+3
View File
@@ -26,5 +26,8 @@
"Admin": "samuele@steamware.net",
"ProjCheck": "samuele.locatelli@egalware.com,mara.baroni@egalware.com",
"TimbCheck": "samuele.locatelli@egalware.com,mara.baroni@egalware.com"
},
"RumtimeOpt": {
"VetoRemoveProcessing": 5
}
}
+32
View File
@@ -0,0 +1,32 @@
param([string]$ProjectDir, [string]$ProjectPath);
$MainVers="..\Resources\MainVers.txt"
$FileVers="..\Resources\VersNum.txt"
$FileManIn="..\Resources\manifest-original.xml"
$FileManOut="..\Resources\manifest.xml"
$FileCLogIn="..\Resources\ChangeLog-original.html"
$FileCLogOut="..\Resources\ChangeLog.html"
$MajMin=Get-Content $MainVers #"0.9."
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum=$MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$csproj = Get-Content $ProjectPath
$csprojUpdated = $csproj -replace $find, $replace
Set-Content -Path $ProjectPath -Value $csprojUpdated
Set-Content -Path $FileVers -Value $currRelNum
# replace x manifest
$manData = Get-Content $FileManIn
$manData = $manData -replace "1.0.0.0", $currRelNum
$manData = $manData -replace "{{DIRNAME}}", "WDC"
$manData = $manData -replace "{{BRANCHNAME}}", "stable"
$manData = $manData -replace "{{PACKNAME}}", "WDC.API"
Set-Content -Path $FileManOut -Value $manData
# replace x ChangeLog
$clogData = Get-Content $FileCLogIn
$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum
Set-Content -Path $FileCLogOut -Value $clogData
@@ -0,0 +1,23 @@
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 210 297"
version="1.1"
id="svg41"
inkscape:version="1.0.2-2 (e86c870879, 2021-01-15)"
sodipodi:docname="Missing.svg">
<g
inkscape:label="Livello 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#454c55;stroke:none;stroke-width:0.460184"
d="M 67.284871,27.840094 C 54.209292,29.845169 46.354698,40.041553 37.483749,49.537223 30.786635,56.705844 22.139596,63.788212 18.364192,73.342671 13.425835,85.840068 15.688899,101.95827 15.688899,115.24029 v 83.31911 42.37372 c 0,7.58822 -0.702068,15.87777 3.692177,22.37522 8.317054,12.29838 27.557626,8.09577 39.897523,8.09577 h 79.617931 c 12.51202,0 26.8348,2.07774 39.14178,-0.29328 20.95597,-4.03694 15.56774,-34.14276 15.56774,-50.65042 V 90.482618 57.154964 c 0,-6.779801 0.48839,-13.912333 -2.82399,-19.996591 C 184.24273,25.145859 170.34873,27.636197 159.357,27.636197 H 97.975587 c -9.965149,0 -20.828764,-1.308344 -30.690716,0.203897 M 65.950496,40.491145 V 68.58159 c 0,3.334243 0.635156,8.230973 -1.880591,10.762918 -2.011793,2.023943 -4.923857,1.615918 -7.460068,1.615918 -5.485632,0 -10.971706,-0.02807 -16.457327,3.51e-4 -3.463614,0.01808 -8.012815,1.523078 -7.777343,6.188941 0.285906,5.66571 6.133826,5.71331 10.001297,5.71331 9.131159,0 21.653851,2.511 28.904873,-4.80536 C 76.981364,82.306261 76.62552,75.34031 76.62552,67.629244 V 39.538921 h 78.72834 c 6.51178,0 22.20629,-3.148174 26.00571,3.816212 2.13101,3.906515 1.12667,9.914114 1.12667,14.275944 v 32.375431 120.931732 37.1365 c 0,5.08581 -0.86957,10.76627 -6.6719,11.37664 -12.057,1.26788 -24.7972,0.0499 -36.91781,0.0499 H 64.616109 38.818123 c -3.881264,0 -8.102032,0.52467 -10.615648,-3.37704 -2.606754,-4.04646 -1.39376,-10.98766 -1.39376,-15.66733 V 202.84434 121.42967 94.767548 c 0,-5.82043 -0.394349,-11.702756 1.918165,-17.139934 2.59243,-6.095472 7.972696,-10.587133 12.315209,-15.235482 6.361872,-6.809749 15.302659,-20.997658 24.908407,-21.901027 M 82.852622,149.04404 v -0.47611 c 2.228416,-1.68019 4.853137,-4.06073 6.164829,-6.66553 2.329384,-4.62682 -1.57368,-9.44601 -6.164829,-8.43713 -3.058838,0.67179 -5.856141,4.41734 -7.561479,7.00881 -2.09231,-2.23963 -4.330057,-5.57095 -7.116681,-6.80503 -4.373656,-1.9373 -8.256257,2.08393 -7.460067,6.80503 0.576892,3.41988 5.655983,5.35289 5.655983,8.56996 0,4.59303 -10.127493,8.24193 -4.321609,14.09569 5.910848,5.95899 8.604069,-4.54684 13.241932,-4.54684 3.099767,0 4.747268,5.79806 8.451512,6.10419 3.582359,0.29567 6.831128,-3.17374 5.852131,-7.08307 -0.79484,-3.17279 -4.32427,-6.70886 -6.741722,-8.56997 M 122.88576,133.6857 c -9.48787,3.93362 2.64207,11.32569 2.64207,15.35834 0,2.57527 -4.14146,4.93963 -5.25034,7.14164 -1.98378,3.9398 0.69032,8.54283 4.83046,8.52854 2.37029,-0.008 4.14858,-1.65495 5.7823,-3.31039 0.99056,-1.00411 2.41256,-3.18612 4.00314,-2.73905 3.99602,1.12314 5.45272,7.87723 10.67459,5.7376 5.41757,-2.22011 3.38931,-8.28002 0.43857,-11.54947 -0.94741,-1.04934 -2.98768,-2.58336 -2.57001,-4.28498 0.66941,-2.72953 4.0823,-4.4221 5.14402,-7.14163 1.96465,-5.03392 -2.79463,-10.02972 -7.46007,-7.53253 -2.13189,1.14124 -4.21841,5.60143 -6.6719,5.60143 -4.45949,0 -5.69601,-8.24194 -11.56283,-5.8095 m -24.46539,56.98172 c -11.577511,1.64734 -22.445577,5.80805 -31.580295,13.80716 -3.447589,3.019 -10.885415,12.52215 -1.77917,14.39182 5.186728,1.06506 11.254602,-7.31684 15.567751,-9.8983 9.005719,-5.39003 19.519294,-7.81533 29.801124,-6.46365 7.65399,1.00649 15.44988,3.90551 21.79485,8.6428 3.52988,2.63526 7.64111,8.85895 12.45376,7.69677 3.41067,-0.82366 5.02037,-5.08246 3.47917,-8.3819 -1.80408,-3.86172 -6.4366,-7.01927 -9.70583,-9.35316 -11.39247,-8.13337 -26.34952,-12.38788 -40.03136,-10.44154 z"
id="path22" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

@@ -0,0 +1,20 @@
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 210 297"
version="1.1"
id="svg41"
inkscape:version="1.0.2-2 (e86c870879, 2021-01-15)"
sodipodi:docname="MissingOrange.svg">
<g id="layer1">
<path
style="fill:#FD8C00;stroke:none;stroke-width:0.460184"
d="M 67.284871,27.840094 C 54.209292,29.845169 46.354698,40.041553 37.483749,49.537223 30.786635,56.705844 22.139596,63.788212 18.364192,73.342671 13.425835,85.840068 15.688899,101.95827 15.688899,115.24029 v 83.31911 42.37372 c 0,7.58822 -0.702068,15.87777 3.692177,22.37522 8.317054,12.29838 27.557626,8.09577 39.897523,8.09577 h 79.617931 c 12.51202,0 26.8348,2.07774 39.14178,-0.29328 20.95597,-4.03694 15.56774,-34.14276 15.56774,-50.65042 V 90.482618 57.154964 c 0,-6.779801 0.48839,-13.912333 -2.82399,-19.996591 C 184.24273,25.145859 170.34873,27.636197 159.357,27.636197 H 97.975587 c -9.965149,0 -20.828764,-1.308344 -30.690716,0.203897 M 65.950496,40.491145 V 68.58159 c 0,3.334243 0.635156,8.230973 -1.880591,10.762918 -2.011793,2.023943 -4.923857,1.615918 -7.460068,1.615918 -5.485632,0 -10.971706,-0.02807 -16.457327,3.51e-4 -3.463614,0.01808 -8.012815,1.523078 -7.777343,6.188941 0.285906,5.66571 6.133826,5.71331 10.001297,5.71331 9.131159,0 21.653851,2.511 28.904873,-4.80536 C 76.981364,82.306261 76.62552,75.34031 76.62552,67.629244 V 39.538921 h 78.72834 c 6.51178,0 22.20629,-3.148174 26.00571,3.816212 2.13101,3.906515 1.12667,9.914114 1.12667,14.275944 v 32.375431 120.931732 37.1365 c 0,5.08581 -0.86957,10.76627 -6.6719,11.37664 -12.057,1.26788 -24.7972,0.0499 -36.91781,0.0499 H 64.616109 38.818123 c -3.881264,0 -8.102032,0.52467 -10.615648,-3.37704 -2.606754,-4.04646 -1.39376,-10.98766 -1.39376,-15.66733 V 202.84434 121.42967 94.767548 c 0,-5.82043 -0.394349,-11.702756 1.918165,-17.139934 2.59243,-6.095472 7.972696,-10.587133 12.315209,-15.235482 6.361872,-6.809749 15.302659,-20.997658 24.908407,-21.901027 M 82.852622,149.04404 v -0.47611 c 2.228416,-1.68019 4.853137,-4.06073 6.164829,-6.66553 2.329384,-4.62682 -1.57368,-9.44601 -6.164829,-8.43713 -3.058838,0.67179 -5.856141,4.41734 -7.561479,7.00881 -2.09231,-2.23963 -4.330057,-5.57095 -7.116681,-6.80503 -4.373656,-1.9373 -8.256257,2.08393 -7.460067,6.80503 0.576892,3.41988 5.655983,5.35289 5.655983,8.56996 0,4.59303 -10.127493,8.24193 -4.321609,14.09569 5.910848,5.95899 8.604069,-4.54684 13.241932,-4.54684 3.099767,0 4.747268,5.79806 8.451512,6.10419 3.582359,0.29567 6.831128,-3.17374 5.852131,-7.08307 -0.79484,-3.17279 -4.32427,-6.70886 -6.741722,-8.56997 M 122.88576,133.6857 c -9.48787,3.93362 2.64207,11.32569 2.64207,15.35834 0,2.57527 -4.14146,4.93963 -5.25034,7.14164 -1.98378,3.9398 0.69032,8.54283 4.83046,8.52854 2.37029,-0.008 4.14858,-1.65495 5.7823,-3.31039 0.99056,-1.00411 2.41256,-3.18612 4.00314,-2.73905 3.99602,1.12314 5.45272,7.87723 10.67459,5.7376 5.41757,-2.22011 3.38931,-8.28002 0.43857,-11.54947 -0.94741,-1.04934 -2.98768,-2.58336 -2.57001,-4.28498 0.66941,-2.72953 4.0823,-4.4221 5.14402,-7.14163 1.96465,-5.03392 -2.79463,-10.02972 -7.46007,-7.53253 -2.13189,1.14124 -4.21841,5.60143 -6.6719,5.60143 -4.45949,0 -5.69601,-8.24194 -11.56283,-5.8095 m -24.46539,56.98172 c -11.577511,1.64734 -22.445577,5.80805 -31.580295,13.80716 -3.447589,3.019 -10.885415,12.52215 -1.77917,14.39182 5.186728,1.06506 11.254602,-7.31684 15.567751,-9.8983 9.005719,-5.39003 19.519294,-7.81533 29.801124,-6.46365 7.65399,1.00649 15.44988,3.90551 21.79485,8.6428 3.52988,2.63526 7.64111,8.85895 12.45376,7.69677 3.41067,-0.82366 5.02037,-5.08246 3.47917,-8.3819 -1.80408,-3.86172 -6.4366,-7.01927 -9.70583,-9.35316 -11.39247,-8.13337 -26.34952,-12.38788 -40.03136,-10.44154 z"
id="path22" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

File diff suppressed because it is too large Load Diff
+3
View File
@@ -36,12 +36,15 @@ namespace WebDoorCreator.Core
// classi utilità x cache REDIS dati DB
public const string redisBaseAddr = "WDC";
public const string rKeyConfig = $"{redisBaseAddr}:Cache:Config";
public const string rKeyCompany = $"{redisBaseAddr}:Cache:Company";
public const string rKeyDoor = $"{redisBaseAddr}:Cache:Door";
public const string rKeyDoorOp = $"{redisBaseAddr}:Cache:DoorOp";
public const string rKeyDoorOpType = $"{redisBaseAddr}:Cache:DoorOpType";
public const string rKeyGraphicParameters = $"{redisBaseAddr}:Cache:GraphicParameters";
public const string rKeyListValues = $"{redisBaseAddr}:Cache:ListValues";
public const string rKeyDoorLast = $"{redisBaseAddr}:Cache:DoorList";
public const string rKeyDoorsByOrder = $"{redisBaseAddr}:Cache:DoorsByOrder";
public const string rKeyOrderDetail = $"{redisBaseAddr}:Cache:OrderDetail";
public const string rKeyOrderStatus = $"{redisBaseAddr}:Cache:OrderStatus";
public const string rKeyRoles = $"{redisBaseAddr}:Cache:Roles";
+102
View File
@@ -0,0 +1,102 @@
using Microsoft.Reporting.NETCore;
using Microsoft.ReportingServices.ReportProcessing.ReportObjectModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
namespace WebDoorCreator.Core.ReportViewer
{
/// <summary>
/// Gestione report dotNet core
///
/// https://github.com/lkosson/reportviewercore/
/// </summary>
public class Report
{
/// <summary>
/// Effettua setup del Report corrente
/// </summary>
/// <param name="ReportObj">Oggetto LocalReport da impiegare</param>
/// <param name="FileNameRdlc">Nome del Report (file rdlc) da usare</param>
/// <param name="RepParams">Parametri opzionali report</param>
/// <param name="ReportDatasets">Dizionario dei dataset del report (DsName + DataTable relativa)</param>
public static void Load(LocalReport ReportObj, string FileNameRdlc, List<ReportParameter> RepParams, Dictionary<string, DataTable> ReportDatasets)
{
// setup preliminari
ReportObj.EnableExternalImages = true;
// calcolo path complessivo
string reportPath = Path.Combine(AppContext.BaseDirectory, "Reports", FileNameRdlc);
/*------------------------------------------------------------------------------------------
* NB: SE volessi includere i ReportObj come EMBEDDED potrei usare una versione alternativa,
* ad esempio (x ReportObj inclusi in area WebDoorCreator.Core\ReportViewer\Report.rdlc
*
* using var rs = Assembly.GetExecutingAssembly().GetManifestResourceStream("WebDoorCreator.Core.ReportViewer.Report.rdlc");
* ReportObj.LoadReportDefinition(rs);
*
* oppure con filestream
* using (FileStream fs = File.OpenRead(reportPath))
* {
* ReportObj.LoadReportDefinition(fs);
* ....
* }
*
* ------------------------------------------------------------------------------------------*/
ReportObj.ReportPath = reportPath;
foreach (var item in ReportDatasets)
{
ReportObj.DataSources.Add(new ReportDataSource(item.Key, item.Value));
}
ReportObj.SetParameters(RepParams);
}
/// <summary>
/// Parametri associati al report
/// </summary>
public class RenderParams
{
public string FileName { get; set; } = "";
public string Extension { get; set; } = "";
public string MimeType { get; set; } = "";
public string RenderFormat { get; set; } = "";
/// <summary>
/// Crea setup parametri report dato formato desiderato
/// </summary>
/// <param name="OutFormat"></param>
public RenderParams(string OutFormat)
{
this.FileName = $"{DateTime.Now:yyyyMMdd_HHmmss}";
switch (OutFormat.ToUpper())
{
case "HTML":
this.Extension = "html";
this.RenderFormat = "HTML5";
this.MimeType = "text/html";
break;
case "DOCX":
this.Extension = "docx";
this.RenderFormat = "WORDOPENXML";
this.MimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
break;
case "XLSX":
this.Extension = "xlsx";
this.RenderFormat = "EXCELOPENXML";
this.MimeType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
break;
case "PDF":
default:
this.Extension = "pdf";
this.RenderFormat = "PDF";
this.MimeType = "application/pdf";
break;
}
}
}
}
}
@@ -0,0 +1,447 @@
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="LocalSource">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties>
<rd:DataSourceID>bd60bef3-b3d9-477e-9052-ab58c6f1ec86</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="Items">
<Query>
<DataSourceName>LocalSource</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="Description">
<DataField>Description</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Price">
<DataField>Price</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Qty">
<DataField>Qty</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="Total">
<DataField>Total</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>LocalSource</rd:DataSetName>
<rd:TableName>Items</rd:TableName>
<rd:ObjectDataSourceType>ReportViewerCore.ReportItem</rd:ObjectDataSourceType>
</rd:DataSetInfo>
</DataSet>
</DataSets>
<ReportSections>
<ReportSection>
<Body>
<ReportItems>
<Tablix Name="Tablix1">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>8.31785cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.51905cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.51905cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.51905cm</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.67938cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Description</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Price</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox5">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Qty</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Total</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.67938cm</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Description">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Description.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Description</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Price">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Price.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Price</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Qty">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Qty.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Qty</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Total">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Total.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Total</rd:DefaultName>
<Style>
<Border>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
</TablixMember>
<TablixMember>
<Group Name="Details" />
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>Items</DataSetName>
<Top>2.85433cm</Top>
<Left>0.3175cm</Left>
<Height>1.35875cm</Height>
<Width>15.875cm</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Tablix>
<Textbox Name="Textbox6">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Title.Value</Value>
<Style>
<FontFamily>Cambria</FontFamily>
<FontSize>26pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox6</rd:DefaultName>
<Top>0.26141cm</Top>
<Left>0.3175cm</Left>
<Height>1.79062cm</Height>
<Width>15.875cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>2in</Height>
<Style />
</Body>
<Width>6.5in</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>
<LeftMargin>2cm</LeftMargin>
<RightMargin>2cm</RightMargin>
<TopMargin>2cm</TopMargin>
<BottomMargin>2cm</BottomMargin>
<ColumnSpacing>0.13cm</ColumnSpacing>
<Style />
</Page>
</ReportSection>
</ReportSections>
<ReportParameters>
<ReportParameter Name="Title">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<ReportParametersLayout>
<GridLayoutDefinition>
<NumberOfColumns>4</NumberOfColumns>
<NumberOfRows>2</NumberOfRows>
<CellDefinitions>
<CellDefinition>
<ColumnIndex>0</ColumnIndex>
<RowIndex>0</RowIndex>
<ParameterName>Title</ParameterName>
</CellDefinition>
</CellDefinitions>
</GridLayoutDefinition>
</ReportParametersLayout>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>156b21d2-9542-4902-99ef-7ec823774bb2</rd:ReportID>
</Report>
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WebDoorCreator.Core.ReportViewer
{
public class ReportItem
{
public string Description { get; set; }
public decimal Price { get; set; }
public int Qty { get; set; }
public decimal Total => Price * Qty;
}
}
@@ -6,11 +6,27 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="ReportViewer\ReportExtUtils.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="ReportViewer\Report.rdlc" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EntityFrameworkCore.SqlServer.HierarchyId" Version="3.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.14" />
<PackageReference Include="NLog" Version="5.1.2" />
<PackageReference Include="ReportViewerCore.NETCore" Version="15.1.17" />
<PackageReference Include="ToDataTable" Version="0.1.2" />
<PackageReference Include="YamlDotNet" Version="13.1.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ReportViewer\Report.rdlc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
</Project>
@@ -0,0 +1,37 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.Reflection.Emit;
using WebDoorCreator.Data.DbModels;
namespace WebDoorCreator.Data
{
public class ConfigConfiguration : IEntityTypeConfiguration<ConfigModel>
{
#region Public Methods
public void Configure(EntityTypeBuilder<ConfigModel> builder)
{
// aggiungo config URL x generazione immagini report
builder.HasData(
seedConfig("prt_ImageCodeBaseUrl", "https://iis01.egalware.com/WDC/SRV/api/", "https://seriate.egalware.com/WDC/SRV/api/", "URL di base per recupero immagini png"),
seedConfig("prt_ReportServerUrl", "http://w2019-sql-steam/reportserver?/Test/WebDoor/", "http://w2019-sql-steam/reportserver?/Test/WebDoor/", "URL di base del Report Server")
);
}
#endregion Public Methods
protected ConfigModel seedConfig(string chaive, string valore, string valoreStd, string note)
{
var newRec = new ConfigModel()
{
chiave = chaive,
valore = valore,
valoreStd = valoreStd,
note = note
};
return newRec;
}
}
}
@@ -1,7 +1,5 @@
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.Extensions.Configuration;
using NLog;
using System.Data;
@@ -23,6 +21,59 @@ namespace WebDoorCreator.Data.Controllers
#region Public Methods
/// <summary>
/// Adding a new User
/// </summary>
/// <param name="addEditRec">Record to edit or add</param>
/// <returns></returns>
public async Task<bool> UserAddMod(AspNetUsers addEditRec)
{
bool fatto = false;
//List<ItemModel> dbResult = new List<ItemModel>();
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
var currRec = localDbCtx
.DbSetUsers
.Where(x => x.Id == addEditRec.Id)
.FirstOrDefault();
//if is not null edit the record found
if (currRec != null)
{
currRec.Id = addEditRec.Id;
currRec.UserName = addEditRec.UserName;
currRec.NormalizedUserName = addEditRec.NormalizedUserName;
currRec.Email = addEditRec.Email;
currRec.EmailConfirmed = addEditRec.EmailConfirmed;
currRec.LockoutEnabled = addEditRec.LockoutEnabled;
currRec.LockoutEnd = addEditRec.LockoutEnd;
currRec.ConcurrencyStamp = addEditRec.ConcurrencyStamp;
currRec.SecurityStamp = addEditRec.SecurityStamp;
currRec.AccessFailedCount = addEditRec.AccessFailedCount;
currRec.PhoneNumberConfirmed = addEditRec.PhoneNumberConfirmed;
currRec.PhoneNumber = addEditRec.PhoneNumber;
currRec.TwoFactorEnabled = addEditRec.TwoFactorEnabled;
localDbCtx.Entry(currRec).State = EntityState.Modified;
}
//if is null add the record as new in the table
else
{
localDbCtx
.DbSetUsers
.Add(addEditRec);
}
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante CompanyAddMod: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Adding a new company
/// </summary>
@@ -138,6 +189,25 @@ namespace WebDoorCreator.Data.Controllers
return fatto;
}
/// <summary>
/// Lista configurazione
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<ConfigModel> ConfigGetAll()
{
List<ConfigModel> dbResult = new List<ConfigModel>();
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
dbResult = localDbCtx
.DbSetConfig
.OrderBy(x => x.chiave)
.ToList();
}
return dbResult;
}
public void Dispose()
{
// Clear database context
@@ -218,7 +288,7 @@ namespace WebDoorCreator.Data.Controllers
/// <param name="doorId">Record id to edit or add</param>
/// <param name="isAdd">States if it has to be added or removing a door</param>
/// <returns></returns>
public async Task<bool> DoorModQty(int doorId, bool isAdd)
public async Task<bool> DoorModQty(int NewQty, int doorId, bool isAdd)
{
/* crea nuovo metodo per modifica singola quantità porta: DOORMODQTY */
bool fatto = false;
@@ -233,7 +303,11 @@ namespace WebDoorCreator.Data.Controllers
.FirstOrDefault();
if (currRec != null) //if is not null edit the record found
{
if (isAdd)
if (NewQty > 0)
{
currRec.Quantity = NewQty;
}
else if (isAdd)
{
currRec.Quantity = currRec.Quantity + 1;
}
@@ -254,6 +328,66 @@ namespace WebDoorCreator.Data.Controllers
return fatto;
}
/// <summary>
/// Delete doorOp instance
/// </summary>
/// <param name="modOpRec">Record to delete</param>
/// <returns></returns>
public async Task<bool> DoorOpDelete(DoorOpModel modOpRec)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
var currRec = localDbCtx
.DbSetDoorOp
.Where(x => x.DoorId == modOpRec.DoorId && x.DoorOpId == modOpRec.DoorOpId)
.FirstOrDefault();
//if is not null edit the record found
if (currRec != null)
{
var recToRem = localDbCtx
.DbSetDoorOp
.Remove(currRec);
await localDbCtx.SaveChangesAsync();
fatto = true;
}
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DoorOpDelete: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Delete doorOp list
/// </summary>
/// <param name="modOpRec">Record to delete</param>
/// <returns></returns>
public async Task<bool> DoorOpDeleteRange(List<DoorOpModel> listOpRec)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
localDbCtx
.DbSetDoorOp
.RemoveRange(listOpRec);
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DoorOpDeleteRange: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Retrieving current data from door
/// </summary>
@@ -278,6 +412,7 @@ namespace WebDoorCreator.Data.Controllers
}
return dbResult;
}
/// <summary>
/// Retrieving current door operations by id
/// </summary>
@@ -295,7 +430,7 @@ namespace WebDoorCreator.Data.Controllers
.Where(x => x.DoorOpId == doorOpId)
.FirstOrDefault();
if(temp != null)
if (temp != null)
{
dbResult = temp;
}
@@ -333,106 +468,6 @@ namespace WebDoorCreator.Data.Controllers
}
return fatto;
}
/// <summary>
/// Update door's OP
/// </summary>
/// <param name="modOpRec">Records to add</param>
/// <returns></returns>
public async Task<bool> DoorOpUpdate(List<DoorOpModel> modOpRec)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
foreach (var item in modOpRec)
{
var currRec = localDbCtx
.DbSetDoorOp
.Where(x => x.DoorId == item.DoorId && x.DoorOpId == item.DoorOpId)
.FirstOrDefault();
if (currRec != null) //if is not null edit the record found
{
currRec.JsoncActVal = item.JsoncActVal;
currRec.JsoncConfigVal = item.JsoncConfigVal;
currRec.userConfirm = item.userConfirm;
currRec.DtConfirm = item.DtConfirm;
localDbCtx.Entry(currRec).State = EntityState.Modified;
}
}
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DoorOpUpdate: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Delete doorOp instance
/// </summary>
/// <param name="modOpRec">Record to delete</param>
/// <returns></returns>
public async Task<bool> DoorOpDelete(DoorOpModel modOpRec)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
var currRec = localDbCtx
.DbSetDoorOp
.Where(x => x.DoorId == modOpRec.DoorId && x.DoorOpId == modOpRec.DoorOpId)
.FirstOrDefault();
//if is not null edit the record found
if (currRec != null)
{
var recToRem = localDbCtx
.DbSetDoorOp
.Remove(currRec);
await localDbCtx.SaveChangesAsync();
fatto = true;
}
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DoorOpDelete: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Delete doorOp list
/// </summary>
/// <param name="modOpRec">Record to delete</param>
/// <returns></returns>
public async Task<bool> DoorOpDeleteRange(List<DoorOpModel> listOpRec)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
localDbCtx
.DbSetDoorOp
.RemoveRange(listOpRec);
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DoorOpDeleteRange: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Adding a new DoorOpType
@@ -534,7 +569,45 @@ namespace WebDoorCreator.Data.Controllers
}
/// <summary>
/// Getting door data by orderId
/// Update door's OP
/// </summary>
/// <param name="modOpRec">Records to add</param>
/// <returns></returns>
public async Task<bool> DoorOpUpdate(List<DoorOpModel> modOpRec)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
foreach (var item in modOpRec)
{
var currRec = localDbCtx
.DbSetDoorOp
.Where(x => x.DoorId == item.DoorId && x.DoorOpId == item.DoorOpId)
.FirstOrDefault();
if (currRec != null) //if is not null edit the record found
{
currRec.JsoncActVal = item.JsoncActVal;
currRec.JsoncConfigVal = item.JsoncConfigVal;
currRec.userConfirm = item.userConfirm;
currRec.DtConfirm = item.DtConfirm;
localDbCtx.Entry(currRec).State = EntityState.Modified;
}
}
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DoorOpUpdate: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Getting door data by numRec
/// </summary>
/// <returns></returns>
public List<DoorModel> DoorsGetByOrderId(int orderId)
@@ -563,6 +636,36 @@ namespace WebDoorCreator.Data.Controllers
return dbResult;
}
/// <summary>
/// Getting door list (last numRec)
/// </summary>
/// <returns></returns>
public List<DoorModel> DoorsGetLast(int numRec)
{
List<DoorModel> dbResult = new List<DoorModel>();
// retrieving data from db
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
// extracting entire set
dbResult = localDbCtx
.DbSetDoor
.Include(o => o.OrderNav)
.Include(t => t.TypeNav)
.OrderByDescending(x => x.DoorId)
.Take(numRec)
.AsNoTracking()
.ToList();
}
catch (Exception exc)
{
Log.Error($"Error in DoorsGetLast:{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Modifying or adding a new door
/// </summary>
@@ -626,6 +729,47 @@ namespace WebDoorCreator.Data.Controllers
return dbResult;
}
/// <summary>
/// Adding a new list value
/// </summary>
/// <param name="addRec">Record to add</param>
/// <returns></returns>
public async Task<bool> ListValuesAdd(List<ListValuesTempModel> addList)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
// stored di reset ListValues
var storedRes = localDbCtx
.Database
.ExecuteSqlRaw("exec dbo.stp_ListVal_Prepare");
await localDbCtx.SaveChangesAsync();
// import massivo dati in tab temp
localDbCtx
.DbSetValuesTemp
.AddRange(addList);
await localDbCtx.SaveChangesAsync();
// stored di merge dati in vocabolario
storedRes = localDbCtx
.Database
.ExecuteSqlRaw("exec dbo.stp_ListVal_Import");
fatto = true;
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ListValuesAdd: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// ListValues list (All)
/// </summary>
@@ -640,7 +784,6 @@ namespace WebDoorCreator.Data.Controllers
{
if (tableName != "*" && fieldName != "*")
{
// extracting entire set
dbResult = localDbCtx
.DbSetValues
@@ -673,49 +816,6 @@ namespace WebDoorCreator.Data.Controllers
return dbResult;
}
/// <summary>
/// Adding a new list value
/// </summary>
/// <param name="addRec">Record to add</param>
/// <returns></returns>
public async Task<bool> ListValuesAdd(List<ListValuesTempModel> addList)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
// stored di reset ListValues
var storedRes = localDbCtx
.Database
.ExecuteSqlRaw("exec dbo.stp_ListVal_Prepare");
await localDbCtx.SaveChangesAsync();
// import massivo dati in tab temp
localDbCtx
.DbSetValuesTemp
.AddRange(addList);
await localDbCtx.SaveChangesAsync();
// stored di merge dati in vocabolario
storedRes = localDbCtx
.Database
.ExecuteSqlRaw("exec dbo.stp_ListVal_Import");
fatto = true;
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante ListValuesAdd: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Adding a new order
/// </summary>
@@ -742,38 +842,29 @@ namespace WebDoorCreator.Data.Controllers
return fatto;
}
/// <summary>
/// Updating an order status
/// </summary>
/// <param name="orderId"></param>
/// <param name="newStatus"></param>
/// <returns></returns>
public async Task<bool> OrderUpdate(int orderId, int newStatus)
public OrderModel OrderGetByKey(int orderId)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
OrderModel dbResult = new OrderModel();
using (var dbCtx = new WDCDataContext(_configuration))
{
try
{
var currRec = localDbCtx
.DbSetOrders
.Where(x => x.OrderId == orderId)
.FirstOrDefault();
//if is not null edit the record found
if (currRec != null)
var rawData = dbCtx
.DbSetOrders
.Where(x => x.OrderId == orderId)
.AsNoTracking()
.FirstOrDefault();
if (rawData != null)
{
currRec.Status = newStatus;
localDbCtx.Entry(currRec).State = EntityState.Modified;
dbResult = rawData;
}
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OrderUpdate: {Environment.NewLine}{exc}");
Log.Error($"Error in OrderGetByKey:{Environment.NewLine}{exc}");
}
}
return fatto;
return dbResult;
}
/// <summary>
@@ -841,6 +932,40 @@ namespace WebDoorCreator.Data.Controllers
return dbResult;
}
/// <summary>
/// Updating an order status
/// </summary>
/// <param name="orderId"></param>
/// <param name="newStatus"></param>
/// <returns></returns>
public async Task<bool> OrderUpdate(int orderId, int newStatus)
{
bool fatto = false;
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
{
try
{
var currRec = localDbCtx
.DbSetOrders
.Where(x => x.OrderId == orderId)
.FirstOrDefault();
//if is not null edit the record found
if (currRec != null)
{
currRec.Status = newStatus;
localDbCtx.Entry(currRec).State = EntityState.Modified;
}
await localDbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OrderUpdate: {Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Adding a new graphic param
/// </summary>
@@ -892,6 +1017,34 @@ namespace WebDoorCreator.Data.Controllers
return dbResult;
}
/// <summary>
/// Order Data for report printing
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public List<PrtRepOrderModel> PreRepOrderGetByKey(int orderId)
{
List<PrtRepOrderModel> dbResult = new List<PrtRepOrderModel>();
using (var dbCtx = new WDCDataContext(_configuration))
{
try
{
var OrderId = new SqlParameter("@OrderId", orderId);
dbResult = dbCtx
.DbSetPrtRepOrder
.FromSqlRaw("exec dbo.stp_prt_OrderReportExpl @OrderId", OrderId)
.AsNoTracking()
.ToList();
}
catch (Exception exc)
{
Log.Error($"Error in PreRepOrderGetByKey:{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Retrieving data from roles table
/// </summary>
@@ -1051,6 +1204,7 @@ namespace WebDoorCreator.Data.Controllers
}
return dbResult;
}
public Dictionary<string, Dictionary<string, string>> VocLemmaGetAll()
{
Dictionary<string, Dictionary<string, string>> DTOResult = new Dictionary<string, Dictionary<string, string>>();
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebDoorCreator.Data.DTO
{
public class CostingDTO
{
/// <summary>
/// Order's UID
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// Dictionary of evaluated unit cost for each Door in Order
/// </summary>
public Dictionary<int, double> DoorUnitCost { get; set; } = new Dictionary<int, double>();
}
}
+59
View File
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebDoorCreator.Data.DTO
{
/// <summary>
/// COmpany data DTO
/// </summary>
[Serializable]
public class CustomerDTO
{
public int CompanyId { get; set; }
/// <summary>
/// Codice esterno x riferimento (es ERP)
/// </summary>
[MaxLength(250)]
public string CompanyExtCode { get; set; } = "";
/// <summary>
/// Nome / ragione Sociale
/// </summary>
[MaxLength(500)]
public string CompanyName { get; set; } = "";
/// <summary>
/// indirizzo
/// </summary>
[MaxLength(250)]
public string Address { get; set; } = "";
/// <summary>
/// CAP
/// </summary>
public int ZipCode { get; set; } = 0;
/// <summary>
/// Citta
/// </summary>
[MaxLength(50)]
public string City { get; set; } = "";
/// <summary>
/// Stato
/// </summary>
[MaxLength(50)]
public string State { get; set; } = "";
/// <summary>
/// VAT / P.Iva
/// </summary>
[MaxLength(50)]
public string VAT { get; set; } = "";
}
}
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebDoorCreator.Data.DTO
{
/// <summary>
/// Serialized door data for cost evaluation
/// </summary>
[Serializable]
public class DoorCostingDTO
{
public int DoorId { get; set; } = 0;
public double SizeX { get; set; } = 0;
public double SizeY { get; set; } = 0;
public double SizeZ { get; set; } = 0;
public double EstimatedWorkTime { get; set; } = 0;
public Dictionary<string, double> BOMList { get; set; }= new Dictionary<string, double>();
}
}
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebDoorCreator.Data.DTO
{
/// <summary>
/// Serialized order data
/// </summary>
[Serializable]
public class OrderDetailsDTO
{
/// <summary>
/// Order UID (DB)
/// </summary>
public int OrderId { get; set; }
/// <summary>
/// Customer Info
/// </summary>
public CustomerDTO CustomerInfo { get; set; } = new CustomerDTO();
/// <summary>
/// Order reference / Ext code
/// </summary>
public string OrderExtCode { get; set; } = "";
/// <summary>
/// Order description
/// </summary>
public string OrderDescript { get; set; } = "";
/// <summary>
/// Door list for current order
/// </summary>
public List<DoorCostingDTO> DoorsList { get; set; } = new List<DoorCostingDTO>();
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebDoorCreator.Data.DbModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("Config")]
public partial class ConfigModel
{
[Key]
public string chiave { get; set; } = null!;
public string valore { get; set; } = "";
public string valoreStd { get; set; } = "";
public string note { get; set; } = "";
}
}
@@ -0,0 +1,143 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static WebDoorCreator.Core.Enum;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace WebDoorCreator.Data.DbModels
{
public class PrtRepOrderModel
{
public int OrderId { get; set; }
/// <summary>
/// Company cui è associato l'ordine
/// </summary>
public int CompanyId { get; set; }
/// <summary>
/// Codice esterno x riferimento (es ERP)
/// </summary>
public string OrderExtCode { get; set; } = "";
/// <summary>
/// Data inserimento ordine
/// </summary>
public DateTime DateIns { get; set; } = DateTime.Now;
/// <summary>
/// Codice utente che ha creato
/// </summary>
public string UserIdIns { get; set; } = "";
/// <summary>
/// Data (ultima) modifica ordine
/// </summary>
public DateTime DateMod { get; set; } = DateTime.Now;
/// <summary>
/// Codice utente che ha creato
/// </summary>
public string UserIdMod { get; set; } = "";
/// <summary>
/// Stato globale dell'ordine
/// </summary>
public int Status { get; set; } = 10;
/// <summary>
/// Descrizione
/// </summary>
public string OrderDescript { get; set; } = "";
/// <summary>
/// Codice esterno x riferimento (es ERP)
/// </summary>
public string CompanyExtCode { get; set; } = "";
/// <summary>
/// Nome / ragione Sociale
/// </summary>
public string CompanyName { get; set; } = "";
/// <summary>
/// indirizzo
/// </summary>
public string Address { get; set; } = "";
/// <summary>
/// CAP
/// </summary>
public int ZipCode { get; set; } = 0;
/// <summary>
/// Citta
/// </summary>
public string City { get; set; } = "";
/// <summary>
/// Stato
/// </summary>
public string State { get; set; } = "";
/// <summary>
/// VAT / P.Iva
/// </summary>
public string VAT { get; set; } = "";
public int DoorId { get; set; }
/// <summary>
/// Door's Type
/// </summary>
public int TypeId { get; set; } = 0;
/// <summary>
/// Codice esterno x riferimento (es ERP)
/// </summary>
public string DoorExtCode { get; set; } = "";
/// <summary>
/// Descrizione
/// </summary>
public string DoorDescript { get; set; } = "";
/// <summary>
/// Quantity Ordered
/// </summary>
public int Quantity { get; set; } = 1;
/// <summary>
/// Unit cost for the door
/// </summary>
public decimal UnitCost { get; set; } = 0;
/// <summary>
/// Unità di misura
/// </summary>
public string MeasureUnit { get; set; } = "";
/// <summary>
/// Tipo DoorOP
/// </summary>
public string ObjectType { get; set; } = "";
/// <summary>
/// Chiave DoorOP
/// </summary>
public string ObjectKey { get; set; } = "";
/// <summary>
/// Valore DoorOp
/// </summary>
public string ObjectVal { get; set; } = "";
/// <summary>
/// Quantità DoorOp
/// </summary>
public int ObjectQty { get; set; } = 1;
}
}
+13 -1
View File
@@ -34,10 +34,22 @@ namespace WebDoorCreator.Data.DbModels
/// RoleId from AspNetUserRoles table
/// </summary>
public string RoleId { get; set; } = "";
/// <summary>
/// Name from AspNetRole table
/// </summary>
public string RoleName { get; set; } = "";
/// <summary>
/// ClaimId from AspNetUserRoles table
/// </summary>
public int ClaimId { get; set; } = 0;
/// <summary>
/// ClaimType from AspNetRole table
/// </summary>
public string ClaimType { get; set; } = "";
/// <summary>
/// ClaimValue from AspNetRole table
/// </summary>
public string ClaimValue { get; set; } = "";
}
}
@@ -0,0 +1,891 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WebDoorCreator.Data;
#nullable disable
namespace WebDoorCreator.Data.Migrations.WDCData
{
[DbContext(typeof(WDCDataContext))]
[Migration("20230523081025_ConfigTable")]
partial class ConfigTable
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseCollation("Latin1_General_CI_AS")
.HasAnnotation("ProductVersion", "6.0.14")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetRoles", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations());
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", null, t => t.ExcludeFromMigrations());
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUsers", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations());
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b =>
{
b.Property<int>("CompanyId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("CompanyId"), 1L, 1);
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("City")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("CompanyExtCode")
.IsRequired()
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("CompanyName")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("CompanyToken")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("PrivateNote")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("State")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("VAT")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("ZipCode")
.HasColumnType("int");
b.HasKey("CompanyId");
b.ToTable("Company");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ConfigModel", b =>
{
b.Property<string>("chiave")
.HasColumnType("nvarchar(450)");
b.Property<string>("note")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("valore")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("valoreStd")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("chiave");
b.ToTable("Config");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
{
b.Property<int>("DoorId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorId"), 1L, 1);
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DateLockExpiry")
.HasColumnType("datetime2");
b.Property<DateTime>("DateMod")
.HasColumnType("datetime2");
b.Property<string>("DoorDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DoorExtCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MeasureUnit")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("OrderId")
.HasColumnType("int");
b.Property<int>("Quantity")
.HasColumnType("int");
b.Property<int>("TypeId")
.HasColumnType("int");
b.Property<decimal>("UnitCost")
.HasColumnType("decimal(18,2)");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdLock")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("DoorId");
b.HasIndex("OrderId");
b.HasIndex("TypeId");
b.ToTable("Door");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpModel", b =>
{
b.Property<int>("DoorOpId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorOpId"), 1L, 1);
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DateMod")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("DoorId")
.HasColumnType("int");
b.Property<DateTime?>("DtConfirm")
.HasColumnType("datetime2");
b.Property<string>("JsoncActVal")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("JsoncConfigVal")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ObjectId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("userConfirm")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("DoorOpId");
b.HasIndex("DoorId");
b.ToTable("DoorOp");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpTypeModel", b =>
{
b.Property<int>("DoorOpTypId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorOpTypId"), 1L, 1);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayUrl")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<HierarchyId>("DoorOpIdPathFromPatriarch")
.HasColumnType("hierarchyid");
b.Property<string>("ExtDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtOpCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FPath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("HasHw")
.HasColumnType("bit");
b.Property<string>("HwCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("HwDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsConcrete")
.HasColumnType("bit");
b.Property<bool>("IsDefault")
.HasColumnType("bit");
b.Property<string>("JsoncConfig")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("MaxAllowed")
.HasColumnType("int");
b.Property<string>("OpCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("ParentDoorOpId")
.HasColumnType("int");
b.Property<string>("Rev")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("ValidFrom")
.HasColumnType("datetime2");
b.Property<DateTime>("ValidUntil")
.HasColumnType("datetime2");
b.HasKey("DoorOpTypId");
b.ToTable("DoorOpType");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorTypeModel", b =>
{
b.Property<int>("TypeId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("TypeId"), 1L, 1);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("TypeCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("TypeId");
b.ToTable("DoorType");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.GraphicParamsModel", b =>
{
b.Property<int>("GraphicParamId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("GraphicParamId"), 1L, 1);
b.Property<int>("compoId")
.HasColumnType("int");
b.Property<string>("graphicParamAlias")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamDefaultVal")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamKey")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamsN")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("GraphicParamId");
b.ToTable("GraphicParams");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.HardwareModel", b =>
{
b.Property<int>("HardwareId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("HardwareId"), 1L, 1);
b.Property<string>("compoAlias")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("compoLayerName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("compoName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("compoTemplateIsActive")
.HasColumnType("bit");
b.HasKey("HardwareId");
b.ToTable("Hardware");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.LanguageModel", b =>
{
b.Property<string>("CodLingua")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("DescrizioneLingua")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("CodLingua");
b.ToTable("Languages");
b.HasData(
new
{
CodLingua = "EN",
DescrizioneLingua = "English"
},
new
{
CodLingua = "IT",
DescrizioneLingua = "Italiano"
});
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValuesModel", b =>
{
b.Property<string>("TableName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Value")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DefaultVal")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("InputType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Label")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("Ordinal")
.HasColumnType("int");
b.Property<bool>("isSerializable")
.HasMaxLength(5)
.HasColumnType("bit");
b.HasKey("TableName", "FieldName", "Value");
b.ToTable("ListValues");
b.HasData(
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "LH",
Label = "Left Handed",
Ordinal = 1,
isSerializable = false
},
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "RH",
Label = "Right Handed",
Ordinal = 2,
isSerializable = false
},
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "LHR",
Label = "Left Handed Reverse",
Ordinal = 3,
isSerializable = false
},
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "RHR",
Label = "Right Handed Reverse",
Ordinal = 4,
isSerializable = false
},
new
{
TableName = "Edges",
FieldName = "EdgeType",
Value = "BV",
Label = "Bevel",
Ordinal = 1,
isSerializable = false
},
new
{
TableName = "Edges",
FieldName = "EdgeType",
Value = "SQ",
Label = "Squared",
Ordinal = 2,
isSerializable = false
},
new
{
TableName = "Edges",
FieldName = "EdgeType",
Value = "1B",
Label = "Bull Nose 1",
Ordinal = 3,
isSerializable = false
});
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValuesTempModel", b =>
{
b.Property<string>("TableName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Value")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DefaultVal")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("InputType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Label")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("Ordinal")
.HasColumnType("int");
b.Property<bool>("isSerializable")
.HasMaxLength(5)
.HasColumnType("bit");
b.HasKey("TableName", "FieldName", "Value");
b.ToTable("ListValuesTemp");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
b.Property<int>("CompanyId")
.HasColumnType("int");
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DateMod")
.HasColumnType("datetime2");
b.Property<string>("OrderDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderExtCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("OrderId");
b.HasIndex("CompanyId");
b.ToTable("Order");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderStatusViewModel", b =>
{
b.Property<int>("OrderId")
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
b.Property<int>("CompanyId")
.HasColumnType("int");
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<int>("NumDoors")
.HasColumnType("int");
b.Property<int>("NumType")
.HasColumnType("int");
b.Property<string>("OrderDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderExtCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("OrderStatus")
.HasColumnType("int");
b.Property<decimal>("TotCost")
.HasColumnType("decimal(18,2)");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("OrderId");
b.ToView("OrderStatusViewModel");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.SerializedDoorsModel", b =>
{
b.Property<int>("DoorTmpId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorTmpId"), 1L, 1);
b.Property<string>("DoorSerVal")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Lock")
.HasColumnType("bit");
b.HasKey("DoorTmpId");
b.ToTable("SerializedDoors");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersViewModel", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "RoleId");
b.ToView("UsersViewModel");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.VocabularyModel", b =>
{
b.Property<string>("Lingua")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Lemma")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Traduzione")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.HasKey("Lingua", "Lemma");
b.ToTable("Vocabulary");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.VocabularyTempModel", b =>
{
b.Property<string>("Lingua")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Lemma")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Traduzione")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.HasKey("Lingua", "Lemma");
b.ToTable("VocabularyTemp");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.AspNetRoles", "RolesNav")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebDoorCreator.Data.DbModels.AspNetUsers", "UsersNav")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RolesNav");
b.Navigation("UsersNav");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.OrderModel", "OrderNav")
.WithMany()
.HasForeignKey("OrderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebDoorCreator.Data.DbModels.DoorTypeModel", "TypeNav")
.WithMany()
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("OrderNav");
b.Navigation("TypeNav");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpModel", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.DoorModel", "DoorNav")
.WithMany()
.HasForeignKey("DoorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DoorNav");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.CompanyModel", "CompanyNav")
.WithMany()
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CompanyNav");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,32 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WebDoorCreator.Data.Migrations.WDCData
{
public partial class ConfigTable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Config",
columns: table => new
{
chiave = table.Column<string>(type: "nvarchar(450)", nullable: false),
valore = table.Column<string>(type: "nvarchar(max)", nullable: false),
valoreStd = table.Column<string>(type: "nvarchar(max)", nullable: false),
note = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Config", x => x.chiave);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Config");
}
}
}
@@ -0,0 +1,890 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WebDoorCreator.Data;
#nullable disable
namespace WebDoorCreator.Data.Migrations.WDCData
{
[DbContext(typeof(WDCDataContext))]
[Migration("20230526063309_tryFixSqlErr")]
partial class tryFixSqlErr
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseCollation("Latin1_General_CI_AS")
.HasAnnotation("ProductVersion", "6.0.14")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetRoles", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AspNetRoles", null, t => t.ExcludeFromMigrations());
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", null, t => t.ExcludeFromMigrations());
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUsers", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("AspNetUsers", null, t => t.ExcludeFromMigrations());
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.CompanyModel", b =>
{
b.Property<int>("CompanyId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("CompanyId"), 1L, 1);
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("City")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("CompanyExtCode")
.IsRequired()
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("CompanyName")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("CompanyToken")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("PrivateNote")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("State")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("VAT")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("ZipCode")
.HasColumnType("int");
b.HasKey("CompanyId");
b.ToTable("Company");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ConfigModel", b =>
{
b.Property<string>("chiave")
.HasColumnType("nvarchar(450)");
b.Property<string>("note")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("valore")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("valoreStd")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("chiave");
b.ToTable("Config");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
{
b.Property<int>("DoorId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorId"), 1L, 1);
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DateLockExpiry")
.HasColumnType("datetime2");
b.Property<DateTime>("DateMod")
.HasColumnType("datetime2");
b.Property<string>("DoorDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DoorExtCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MeasureUnit")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("OrderId")
.HasColumnType("int");
b.Property<int>("Quantity")
.HasColumnType("int");
b.Property<int>("TypeId")
.HasColumnType("int");
b.Property<decimal>("UnitCost")
.HasColumnType("decimal(18,2)");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdLock")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("DoorId");
b.HasIndex("OrderId");
b.HasIndex("TypeId");
b.ToTable("Door");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpModel", b =>
{
b.Property<int>("DoorOpId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorOpId"), 1L, 1);
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DateMod")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("DoorId")
.HasColumnType("int");
b.Property<DateTime?>("DtConfirm")
.HasColumnType("datetime2");
b.Property<string>("JsoncActVal")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("JsoncConfigVal")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ObjectId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("userConfirm")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("DoorOpId");
b.HasIndex("DoorId");
b.ToTable("DoorOp");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpTypeModel", b =>
{
b.Property<int>("DoorOpTypId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorOpTypId"), 1L, 1);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DisplayUrl")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<HierarchyId>("DoorOpIdPathFromPatriarch")
.HasColumnType("hierarchyid");
b.Property<string>("ExtDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtOpCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FPath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("HasHw")
.HasColumnType("bit");
b.Property<string>("HwCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("HwDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsConcrete")
.HasColumnType("bit");
b.Property<bool>("IsDefault")
.HasColumnType("bit");
b.Property<string>("JsoncConfig")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("MaxAllowed")
.HasColumnType("int");
b.Property<string>("OpCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("ParentDoorOpId")
.HasColumnType("int");
b.Property<string>("Rev")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("ValidFrom")
.HasColumnType("datetime2");
b.Property<DateTime>("ValidUntil")
.HasColumnType("datetime2");
b.HasKey("DoorOpTypId");
b.ToTable("DoorOpType");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorTypeModel", b =>
{
b.Property<int>("TypeId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("TypeId"), 1L, 1);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("TypeCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("TypeId");
b.ToTable("DoorType");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.GraphicParamsModel", b =>
{
b.Property<int>("GraphicParamId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("GraphicParamId"), 1L, 1);
b.Property<int>("compoId")
.HasColumnType("int");
b.Property<string>("graphicParamAlias")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamDefaultVal")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamKey")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("graphicParamsN")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("GraphicParamId");
b.ToTable("GraphicParams");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.HardwareModel", b =>
{
b.Property<int>("HardwareId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("HardwareId"), 1L, 1);
b.Property<string>("compoAlias")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("compoLayerName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("compoName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("compoTemplateIsActive")
.HasColumnType("bit");
b.HasKey("HardwareId");
b.ToTable("Hardware");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.LanguageModel", b =>
{
b.Property<string>("CodLingua")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("DescrizioneLingua")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("CodLingua");
b.ToTable("Languages");
b.HasData(
new
{
CodLingua = "EN",
DescrizioneLingua = "English"
},
new
{
CodLingua = "IT",
DescrizioneLingua = "Italiano"
});
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValuesModel", b =>
{
b.Property<string>("TableName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Value")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DefaultVal")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("InputType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Label")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("Ordinal")
.HasColumnType("int");
b.Property<bool>("isSerializable")
.HasMaxLength(5)
.HasColumnType("bit");
b.HasKey("TableName", "FieldName", "Value");
b.ToTable("ListValues");
b.HasData(
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "LH",
Label = "Left Handed",
Ordinal = 1,
isSerializable = false
},
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "RH",
Label = "Right Handed",
Ordinal = 2,
isSerializable = false
},
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "LHR",
Label = "Left Handed Reverse",
Ordinal = 3,
isSerializable = false
},
new
{
TableName = "Opening",
FieldName = "Swing",
Value = "RHR",
Label = "Right Handed Reverse",
Ordinal = 4,
isSerializable = false
},
new
{
TableName = "Edges",
FieldName = "EdgeType",
Value = "BV",
Label = "Bevel",
Ordinal = 1,
isSerializable = false
},
new
{
TableName = "Edges",
FieldName = "EdgeType",
Value = "SQ",
Label = "Squared",
Ordinal = 2,
isSerializable = false
},
new
{
TableName = "Edges",
FieldName = "EdgeType",
Value = "1B",
Label = "Bull Nose 1",
Ordinal = 3,
isSerializable = false
});
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ListValuesTempModel", b =>
{
b.Property<string>("TableName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Value")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DefaultVal")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("InputType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Label")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("Ordinal")
.HasColumnType("int");
b.Property<bool>("isSerializable")
.HasMaxLength(5)
.HasColumnType("bit");
b.HasKey("TableName", "FieldName", "Value");
b.ToTable("ListValuesTemp");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
b.Property<int>("CompanyId")
.HasColumnType("int");
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DateMod")
.HasColumnType("datetime2");
b.Property<string>("OrderDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderExtCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("OrderId");
b.HasIndex("CompanyId");
b.ToTable("Order");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderStatusViewModel", b =>
{
b.Property<int>("OrderId")
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"), 1L, 1);
b.Property<int>("CompanyId")
.HasColumnType("int");
b.Property<DateTime>("DateIns")
.HasColumnType("datetime2");
b.Property<int>("NumDoors")
.HasColumnType("int");
b.Property<int>("NumType")
.HasColumnType("int");
b.Property<string>("OrderDescript")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OrderExtCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("OrderStatus")
.HasColumnType("int");
b.Property<decimal>("TotCost")
.HasColumnType("decimal(18,2)");
b.Property<string>("UserIdIns")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserIdMod")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("OrderId");
b.ToView("OrderStatusViewModel");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.SerializedDoorsModel", b =>
{
b.Property<int>("DoorTmpId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("DoorTmpId"), 1L, 1);
b.Property<string>("DoorSerVal")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Lock")
.HasColumnType("bit");
b.HasKey("DoorTmpId");
b.ToTable("SerializedDoors");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.UsersViewModel", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "RoleId");
b.ToView("UsersViewModel");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.VocabularyModel", b =>
{
b.Property<string>("Lingua")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Lemma")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Traduzione")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.HasKey("Lingua", "Lemma");
b.ToTable("Vocabulary");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.VocabularyTempModel", b =>
{
b.Property<string>("Lingua")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("Lemma")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Traduzione")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.HasKey("Lingua", "Lemma");
b.ToTable("VocabularyTemp");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.AspNetUserRoles", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.AspNetRoles", "RolesNav")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebDoorCreator.Data.DbModels.AspNetUsers", "UsersNav")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RolesNav");
b.Navigation("UsersNav");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.OrderModel", "OrderNav")
.WithMany()
.HasForeignKey("OrderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WebDoorCreator.Data.DbModels.DoorTypeModel", "TypeNav")
.WithMany()
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("OrderNav");
b.Navigation("TypeNav");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorOpModel", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.DoorModel", "DoorNav")
.WithMany()
.HasForeignKey("DoorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DoorNav");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
{
b.HasOne("WebDoorCreator.Data.DbModels.CompanyModel", "CompanyNav")
.WithMany()
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CompanyNav");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WebDoorCreator.Data.Migrations.WDCData
{
public partial class tryFixSqlErr : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
@@ -177,6 +177,28 @@ namespace WebDoorCreator.Data.Migrations.WDCData
b.ToTable("Company");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.ConfigModel", b =>
{
b.Property<string>("chiave")
.HasColumnType("nvarchar(450)");
b.Property<string>("note")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("valore")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("valoreStd")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("chiave");
b.ToTable("Config");
});
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
{
b.Property<int>("DoorId")
@@ -754,7 +776,6 @@ namespace WebDoorCreator.Data.Migrations.WDCData
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "RoleId");
@@ -13,6 +13,7 @@ namespace WebDoorCreator.Data.Services
{
#region Public Constructors
private int vetoRemoveProcSec { get; set; } = 10;
/// <summary>
/// Init classe
/// </summary>
@@ -38,6 +39,8 @@ namespace WebDoorCreator.Data.Services
// setup canali pub/sub
CalcReqPipe = new MessagePipe(redisConn, Constants.CALC_REQ_QUEUE);
CalcDonePipe = new MessagePipe(redisConn, Constants.CALC_DONE_QUEUE);
// leggo conf speciali
vetoRemoveProcSec = _configuration.GetValue<int>("RumtimeOpt:VetoRemoveProcessing");
}
#endregion Public Constructors
@@ -171,6 +174,16 @@ namespace WebDoorCreator.Data.Services
answ = $"{rawData}";
}
}
// se non trovata --> missing!
if (string.IsNullOrEmpty(answ))
{
// leggo missing standard...
string missingFilePath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
if (File.Exists(missingFilePath))
{
answ = File.ReadAllText(missingFilePath);
}
}
return answ;
}
@@ -585,16 +598,78 @@ namespace WebDoorCreator.Data.Services
}
/// <summary>
/// Upsert for single hash record
/// Upsert for single hash record in processing
/// </summary>
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
public async Task<long> RequestProcessingUpsert(string doorId, string vers)
{
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
long numReq = await RedHashUpsert(currKey, doorId, vers);
// aggiungo cache veto rimozione da coda processing
RedisKey currVetoKey = new RedisKey($"{Constants.CALC_REQ_PROC}:{doorId}");
await redisDb.StringSetAsync(currVetoKey, vers, TimeSpan.FromSeconds(vetoRemoveProcSec));
return numReq;
}
/// <summary>
/// Reset to queue request for specified DoorIdList
/// </summary>
/// <returns>Dictionary of DoorId, saveVersNumb</returns>
public async Task<List<string>> ResetQueueByDoorList(List<string> DoorIdList)
{
int num2proc = DoorIdList.Count;
List<string> listDone = new List<string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
// cerco le richieste processing
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
var rawData = await redisDb.HashGetAllAsync(currKey);
foreach (var item in rawData)
{
// se è nell'elenco...
if (DoorIdList.Contains($"{item.Name}"))
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestProcessingRemove(item.Name!);
listDone.Add($"{item.Name}");
}
}
// cerco le richieste con errori
currKey = new RedisKey(Constants.CALC_REQ_ERRS);
rawData = await redisDb.HashGetAllAsync(currKey);
foreach (var item in rawData)
{
// se è nell'elenco...
if (DoorIdList.Contains($"{item.Name}"))
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestErrRemove(item.Name!);
listDone.Add($"{item.Name}");
}
}
// cerco le richieste processed
currKey = new RedisKey(Constants.CALC_REQ_DONE);
rawData = await redisDb.HashGetAllAsync(currKey);
foreach (var item in rawData)
{
// se è nell'elenco...
if (DoorIdList.Contains($"{item.Name}"))
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestDoneRemove(item.Name!);
listDone.Add($"{item.Name}");
}
}
// calcolo eventuali porte NON ancora richieste...
foreach (var item in listDone)
{
DoorIdList.Remove(item);
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ResetQueueByDoorList | doors #: {num2proc} --> {DoorIdList.Count} | EXEC in: {ts.TotalMilliseconds} ms");
return DoorIdList;
}
/// <summary>
/// Reset to queue request all processing/processed data
/// </summary>
@@ -634,7 +709,38 @@ namespace WebDoorCreator.Data.Services
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ResetQueue | REDIS in: {ts.TotalMilliseconds} ms");
Log.Debug($"ResetQueue | REDIS EXEC in: {ts.TotalMilliseconds} ms");
return fatto;
}
/// <summary>
/// Reset to queue request all processing stuck data (veto check)
/// </summary>
/// <returns>Boolean, executed</returns>
public async Task<bool> ResetQueueProcessing()
{
bool fatto = false;
await Task.Delay(1);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
// cerco le richieste processing
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
RedisKey currVetoKey = new RedisKey($"{Constants.CALC_REQ_PROC}:0");
var rawData = await redisDb.HashGetAllAsync(currKey);
foreach (var item in rawData)
{
// verifico SE siano senza veto rimozione...
currVetoKey = new RedisKey($"{Constants.CALC_REQ_PROC}:{item.Name}");
var redisVal = await redisDb.StringGetAsync(currVetoKey);
if (!redisVal.HasValue)
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestProcessingRemove(item.Name!);
fatto = true;
}
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ResetQueueProcessing | REDIS EXEC in: {ts.TotalMilliseconds} ms");
return fatto;
}
@@ -707,7 +813,7 @@ namespace WebDoorCreator.Data.Services
// salvo nell'archivio REDIS delle porte il DDF corrente (key=doorId.versNumb), potrebbe
// venire buono anche x eventuale UNDO...
RedisKey currDdfKey = new RedisKey($"{Constants.CALC_REQ_DDF_CACHE}:{sDoorId}:{sCurrVers}");
await redisDb.StringSetAsync(currDdfKey, FullDDF, DayLongCache);
await redisDb.StringSetAsync(currDdfKey, FullDDF, WeekLongCache);
// invio sul canale dei messaggi il numero di items in coda attuali x chiedere esecuzione...
long numPending = await NumRequestPending();
@@ -1023,6 +1129,13 @@ namespace WebDoorCreator.Data.Services
{
get => TimeSpan.FromHours(24 * 7);
}
/// <summary>
/// Durata cache di 24h
/// </summary>
private TimeSpan MonthLongCache
{
get => TimeSpan.FromDays(30);
}
#endregion Private Properties
@@ -1,41 +1,46 @@
/****** Object: View [dbo].[v_UserRolesClaims] Script Date: 17/03/2023 08:48:50 ******/
SET ANSI_NULLS ON
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[v_UserRolesClaims]
AS
/*
Mod: 2023.05.26 agg. campi Claims
*/
SELECT
dbo.AspNetUsers.Id AS UserId
,dbo.AspNetUsers.UserName
,dbo.AspNetUsers.Email
,ISNULL(dbo.AspNetUserRoles.RoleId, '') as RoleId
,ISNULL(dbo.AspNetRoles.Name, '') as RoleName
--,dbo.AspNetRoles.Id
--,dbo.AspNetRoles.NormalizedName
--,dbo.AspNetRoles.ConcurrencyStamp
--,dbo.AspNetUserRoles.UserId
--,dbo.AspNetUsers.NormalizedUserName
--,dbo.AspNetUsers.NormalizedEmail
--,dbo.AspNetUsers.EmailConfirmed
--,dbo.AspNetUsers.PasswordHash
--,dbo.AspNetUsers.SecurityStamp
--,dbo.AspNetUsers.ConcurrencyStamp AS Expr2
--,dbo.AspNetUsers.PhoneNumber
--,dbo.AspNetUsers.PhoneNumberConfirmed
--,dbo.AspNetUsers.TwoFactorEnabled
--,dbo.AspNetUsers.LockoutEnd
--,dbo.AspNetUsers.LockoutEnabled
--,dbo.AspNetUsers.AccessFailedCount
--,dbo.AspNetUserClaims.Id AS Expr3
--,dbo.AspNetUserClaims.UserId AS Expr4
--,dbo.AspNetUserClaims.ClaimType
--,dbo.AspNetUserClaims.ClaimValue
FROM dbo.AspNetRoles
INNER JOIN dbo.AspNetUserRoles ON dbo.AspNetRoles.Id = dbo.AspNetUserRoles.RoleId
RIGHT OUTER JOIN dbo.AspNetUsers ON dbo.AspNetUserRoles.UserId = dbo.AspNetUsers.Id
--LEFT OUTER JOIN dbo.AspNetUserClaims ON dbo.AspNetUsers.Id = dbo.AspNetUserClaims.UserId
NU.Id AS UserId
,NU.UserName
,NU.Email
,ISNULL(UR.RoleId, '') AS RoleId
,ISNULL(ANR.Name, '') AS RoleName
,UC.Id AS ClaimId
,UC.UserId AS ClaimUserId
,UC.ClaimType
,UC.ClaimValue
--,ANR.Id
--,ANR.NormalizedName
--,ANR.ConcurrencyStamp
--,UR.UserId
--,NU.NormalizedUserName
--,NU.NormalizedEmail
--,NU.EmailConfirmed
--,NU.PasswordHash
--,NU.SecurityStamp
--,NU.ConcurrencyStamp AS Expr2
--,NU.PhoneNumber
--,NU.PhoneNumberConfirmed
--,NU.TwoFactorEnabled
--,NU.LockoutEnd
--,NU.LockoutEnabled
--,NU.AccessFailedCount
FROM dbo.AspNetRoles ANR
INNER JOIN dbo.AspNetUserRoles UR ON ANR.Id = UR.RoleId
RIGHT OUTER JOIN dbo.AspNetUsers NU ON UR.UserId = NU.Id
LEFT OUTER JOIN dbo.AspNetUserClaims UC ON NU.Id = UC.UserId
GO
+13 -5
View File
@@ -76,6 +76,8 @@ namespace WebDoorCreator.Data
public virtual DbSet<VocabularyTempModel> DbSetVocabularyTemp { get; set; } = null!;
public virtual DbSet<LanguageModel> DbSetLanguages { get; set; } = null!;
public virtual DbSet<SerializedDoorsModel> DbSetSerializedDoors { get; set; } = null!;
public virtual DbSet<ConfigModel> DbSetConfig { get; set; } = null!;
public virtual DbSet<PrtRepOrderModel> DbSetPrtRepOrder { get; set; } = null!;
#endregion Public Properties
@@ -130,13 +132,14 @@ namespace WebDoorCreator.Data
modelBuilder.Entity<AspNetUserRoles>().ToTable(nameof(AspNetUserRoles), t => t.ExcludeFromMigrations());
//Creazione viste migrate
modelBuilder.Entity<UsersViewModel>().ToView(nameof(UsersViewModel));
modelBuilder.Entity<OrderStatusViewModel>().ToView(nameof(OrderStatusViewModel));
// Creazione viste migrate
modelBuilder.Entity<UsersViewModel>().ToView("v_UserRolesClaims");
modelBuilder.Entity<OrderStatusViewModel>().ToView("v_OrderStatus");
//modelBuilder.Entity<OrderStatusViewModel>().ToView(nameof(OrderStatusViewModel));
modelBuilder.Entity<AspNetUserRoles>().HasKey(c => new { c.UserId, c.RoleId });
modelBuilder.Entity<UsersViewModel>().HasKey(c => new { c.UserId, c.RoleId });
modelBuilder.Entity<UsersViewModel>().HasKey(c => new { c.UserId, c.RoleId, c.ClaimId });
modelBuilder.Entity<ListValuesModel>().HasKey(c => new { c.TableName, c.FieldName, c.Value });
modelBuilder.Entity<ListValuesTempModel>().HasKey(c => new { c.TableName, c.FieldName, c.Value });
modelBuilder.Entity<VocabularyModel>().HasKey(c => new { c.Lingua, c.Lemma });
@@ -160,8 +163,13 @@ namespace WebDoorCreator.Data
{
modelBuilder.ApplyConfiguration(new ListValuesConfiguration());
modelBuilder.ApplyConfiguration(new LanguageConfiguration());
}
// modello dati x report ordini
modelBuilder.Entity<PrtRepOrderModel>().HasKey(c => new { c.OrderId, c.DoorId, c.ObjectKey});
//modelBuilder.Seed();
OnModelCreatingPartial(modelBuilder);
@@ -13,6 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2305.1916" />
<PackageReference Include="EntityFrameworkCore.SqlServer.HierarchyId" Version="3.0.1" />
<PackageReference Include="MailKit" Version="3.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.11" />
+32 -1
View File
@@ -87,6 +87,27 @@ namespace WebDoorCreator.SDK
return answ;
}
}
/// <summary>
/// Effettua test ping all'indirizzo del server
/// </summary>
public bool testPingOk
{
get
{
bool answ = false;
try
{
Ping myPing = new Ping();
// timeout a 1 sec!
var testPing= myPing.Send(_baseIp, 1000);
answ = testPing.Status == IPStatus.Success;
}
catch
{ }
// rendo!
return answ;
}
}
#endregion Public Properties
@@ -134,7 +155,7 @@ namespace WebDoorCreator.SDK
}
/// <summary>
/// Reset delel code di processing
/// Reset di tutte le code a REQUEST
/// </summary>
/// <returns></returns>
public string ResetQueue()
@@ -146,6 +167,15 @@ namespace WebDoorCreator.SDK
var rawData = callUrlPost(urlResetQueue, "", parList);
return rawData;
}
/// <summary>
/// Reset delle code di processing a REQUEST
/// </summary>
/// <returns></returns>
public string ResetQueueProcessing()
{
var rawData = callUrlPost(urlResetQueueProc, "");
return rawData;
}
/// <summary>
/// Restitusice l'elenco degli esiti di processing
@@ -167,6 +197,7 @@ namespace WebDoorCreator.SDK
protected const string urlActLenght = "api/Queue/ActLenght";
protected const string urlAlive = "/api/Alive";
protected const string urlResetQueue = "api/Queue/ResetQueue";
protected const string urlResetQueueProc = "api/Queue/ResetQueueProcessing";
protected const string urlSaveProcRes = "api/Queue/SaveProcResult";
protected const string urlStatusList = "api/Queue/StatusList";
protected const string urlTakeNextItems = "api/Queue/TakeNextItems";
@@ -20,7 +20,7 @@
</div>
<div class="d-flex justify-content-center fw-bold fs-2 mb-5">Powered BY</div>
<div class="d-flex justify-content-center">
<img src="~/images/LOGO_EGALWARE_jpg-01.jpg" style="height: 10rem; width: 10rem;" />
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
</div>
</div>
</div>
@@ -20,7 +20,7 @@
</div>
<div class="d-flex justify-content-center fw-bold fs-2 mb-5">Powered BY</div>
<div class="d-flex justify-content-center">
<img src="~/images/LOGO_EGALWARE_jpg-01.jpg" style="height: 10rem; width: 10rem;" />
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
</div>
</div>
</div>
@@ -111,7 +111,7 @@ namespace WebDoorCreator.UI.Areas.Identity.Pages.Account
private async Task CheckSuperAdmin()
{
//se non ci fosse --> creo samuele come superadmin
string superUser = "samuele@steamware.net";
string superUser = "zaccaria.majid01@egalware.com";
string superPwd = "viaDante16!";
string ADMIN_ROLE = "SuperAdmin";
var user = await _userManager.FindByEmailAsync(superUser);
@@ -21,7 +21,7 @@
</div>
<div class="d-flex justify-content-center fw-bold fs-2 mb-5">Powered BY</div>
<div class="d-flex justify-content-center">
<img src="~/images/LOGO_EGALWARE_jpg-01.jpg" style="height: 10rem; width: 10rem;" />
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
</div>
</div>
</div>
@@ -21,7 +21,7 @@
</div>
<div class="d-flex justify-content-center fw-bold fs-2 mb-5">Powered BY</div>
<div class="d-flex justify-content-center">
<img src="~/images/LOGO_EGALWARE_jpg-01.jpg" style="height: 10rem; width: 10rem;" />
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
</div>
</div>
</div>
@@ -1,8 +0,0 @@
@if (isAdd)
{
<button class="btn btn-sm btn-success" @onclick="()=>addOrRemoveOneDoorNumber()"><i class="fa-solid fa-plus"></i> <i class="fa-solid fa-1"></i></button>
}
else
{
<button class="btn btn-sm btn-danger" @onclick="()=>addOrRemoveOneDoorNumber()"><i class="fa-solid fa-minus"></i> <i class="fa-solid fa-1"></i></button>
}
@@ -1,44 +0,0 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Identity;
using Microsoft.JSInterop;
using WebDoorCreator.UI.Data;
namespace WebDoorCreator.UI.Components.Buttons
{
public partial class ButtonAddRemDoor
{
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Parameter]
public int DoorId { get; set; } = 0;
[Parameter]
public int OrderId { get; set; } = 0;
[Parameter]
public bool isAdd { get; set; }
[Parameter]
public EventCallback<bool> E_isChange { get; set; }
protected bool doorChange { get; set; } = false;
protected async Task addOrRemoveOneDoorNumber()
{
//var door = new DoorModel();
doorChange = false;
var done = await WDService.DoorModQty(OrderId, DoorId, isAdd);
if (done)
{
doorChange = true;
await E_isChange.InvokeAsync(doorChange);
}
}
}
}
@@ -1,7 +1,8 @@
<div>
@if (B_doorOpUpd || true)
{
<button class="btn btn-success" @onclick="() => doSave()"><i class="fa-solid fa-floppy-disk"></i></button>
@*<button class="btn btn-success" @onclick="() => doSave()"><i class="fa-solid fa-rotate-right"></i></button>
<button class="btn btn-info" @onclick="() => doRecalcAll()"><i class="fa-solid fa-window-restore"></i></button>*@
<a class="btn btn-warning" href="https://iis01.egalware.com/Test3D/Doors041122/EXB_0267100040/EXB_0267100040.html" target="_blank"><i class="fa-solid fa-cube"></i></a>
@if (IsErr)
{
@@ -10,15 +11,34 @@
}
else
{
<button class="btn btn-secondary"><i class="fa-solid fa-floppy-disk"></i></button>
<button class="btn btn-secondary"><i class="fa-solid fa-rotate-right"></i></button>
<button class="btn btn-secondary"><i class="fa-solid fa-cube"></i></button>
}
@*<button class="btn btn-success" @onclick="() => toOrderPage()">Return to Order <b>@idOrd</b></button>*@
</div>
<div class="modal" id="errListModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="errListModalLabel">Current error</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" style="max-height: 80vh">
<div class="w-100 text-start">
@ErrCode
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal Order -->
<div class="modal fade" id="errListModal" tabindex="-1" aria-labelledby="errListModalLabel" aria-hidden="true">
@*<div class="modal" id="errListModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog" style=" overflow-y: initial ">
<div class="modal-content">
<div class="modal-header d-flex justify-content-between">
@@ -35,24 +55,4 @@
</div>
</div>
</div>
</div>
<!-- Modal Order -->
<div class="modal fade" id="errListModal" tabindex="-1" aria-labelledby="errListModalLabel" aria-hidden="true">
<div class="modal-dialog" style=" overflow-y: initial ">
<div class="modal-content">
<div class="modal-header d-flex justify-content-between">
<h1 class="modal-title fs-5" id="errListModalLabel">Current error</h1>
<i class="fa-solid fa-triangle-exclamation text-danger fs-5"></i>
</div>
<div class="modal-body" style="max-height: 80vh; overflow-y: auto;">
<div class="w-100 text-start">
@ErrCode
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>*@
@@ -1,7 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using Newtonsoft.Json;
using System.Configuration;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.DTO;
using WebDoorCreator.Data.Services;
@@ -11,11 +9,14 @@ namespace WebDoorCreator.UI.Components.Buttons
{
public partial class ButtonsDoorDef
{
#region Public Properties
[CascadingParameter]
public bool B_doorOpUpd { get; set; }
[CascadingParameter]
public string ErrCode { get; set; } = "ERROREEEEE";
[CascadingParameter]
public int idDoor { get; set; } = 0;
@@ -24,6 +25,11 @@ namespace WebDoorCreator.UI.Components.Buttons
[CascadingParameter]
public bool IsErr { get; set; } = false;
#endregion Public Properties
#region Protected Properties
protected Dictionary<string, string> a { get; set; } = new Dictionary<string, string>();
protected bool change
@@ -62,20 +68,13 @@ namespace WebDoorCreator.UI.Components.Buttons
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
[Inject]
protected WDCUserService WDCUService { get; set; } = null!;
public async Task SaveYaml(string ddfContent)
{
await Task.Delay(1);
string fileName = Path.Combine("temp", $"Conf.yaml");
if (File.Exists(fileName))
{
File.Delete(fileName);
}
// scrivo!
File.WriteAllText(fileName, ddfContent);
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Effettua Richiesta visione porta 3D
@@ -99,7 +98,6 @@ namespace WebDoorCreator.UI.Components.Buttons
if (listOp != null)
{
// chiamo metodo x avewre DDF serializzato
//var list2Ord = ;
var CurrentCompoOrder = await WDCService.ListValuesGetAll("*", "Hardware");
if (CurrentCompoOrder != null)
{
@@ -112,12 +110,10 @@ namespace WebDoorCreator.UI.Components.Buttons
listOp = listOp.OrderBy(d => ordListVal.IndexOf(d.ObjectId)).ToList();
string currDdf = currDdfConv.GetSerialized(listOp);
// FIXME TODO: si potrebbe eliminare in futuro che va su REDIS
//await SaveYaml(currDdf);
// versione corrente del DDF generato
int currVers = await QDataServ.SendCalcReq(idDoor, currDdf);
if(currVers > 0)
if (currVers > 0)
{
IsErr = false;
}
@@ -125,6 +121,14 @@ namespace WebDoorCreator.UI.Components.Buttons
}
}
protected async Task doRecalcAll()
{
await Task.Delay(1);
await QDataServ.ResetQueue();
await doSave();
}
protected override void OnInitialized()
{
base.OnInitialized();
@@ -142,14 +146,10 @@ namespace WebDoorCreator.UI.Components.Buttons
//change = paramsChanged;
}
protected async Task toOrderPage()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Do you really want to return to the order page without saving current work?"))
return;
#endregion Protected Methods
#region Private Methods
await Task.Delay(1);
NavManager.NavigateTo($"OrderDetails?idOrd={idOrd}");
}
private async void WDCRService_EA_UpdDoorOp()
{
await InvokeAsync(() =>
@@ -157,5 +157,7 @@ namespace WebDoorCreator.UI.Components.Buttons
StateHasChanged();
});
}
#endregion Private Methods
}
}
@@ -8,7 +8,6 @@ else
<thead>
<tr class="bg-dark text-light">
<th>
@*<button class="btn btn-success btn-sm" @onclick="() => toggleAddNew()"><i class="fas fa-plus"></i></button>*@
</th>
<th>Company</th>
<th>VAT</th>
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.UI.Data;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.UI.Components.CompMan
{
@@ -8,12 +8,12 @@ namespace WebDoorCreator.UI.Components.CompMan
{
#region Protected Properties
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
[Parameter]
public EventCallback<CompanyModel> E_currCompany { get; set; }
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
@@ -33,6 +33,11 @@ namespace WebDoorCreator.UI.Components.CompMan
#region Private Methods
private async Task editRec(CompanyModel currComp)
{
await E_currCompany.InvokeAsync(currComp);
}
private async Task ReloadData()
{
ListRecords = null;
@@ -42,11 +47,6 @@ namespace WebDoorCreator.UI.Components.CompMan
await InvokeAsync(StateHasChanged);
}
private async Task editRec(CompanyModel currComp)
{
await E_currCompany.InvokeAsync(currComp);
}
#endregion Private Methods
}
}
@@ -4,7 +4,8 @@
}
else
{
<div class="row">
<div class="row me-2">
<div class="row mb-1">
<div class="col-4">
@if (DoorOp2Save != null)
@@ -12,7 +13,9 @@ else
<div>Pending changes: <b>@DoorOp2Save.Count()</b></div>
}
</div>
<div class="col-4"></div>
<div class="col-4">
@*<ButtonsDoorDef></ButtonsDoorDef>*@
</div>
@if (paramsChanged)
{
@@ -41,20 +44,22 @@ else
</div>
}
</div>
@foreach (var item in CurrBaseDoorOp)
{
@if (item.ObjectId == "Size" || item.ObjectId == "Swing" || item.ObjectId == "Finishing" || item.ObjectId == "Properties")
<div class="d-flex justify-content-between flex-wrap">
@foreach (var item in CurrBaseDoorOp)
{
<div class="col-6 border">
<DoorDataBlock E_doorOp2Save="doSetDoorOp2Save" BlockDoorOp="@item"></DoorDataBlock>
</div>
@if (item.ObjectId == "Size" || item.ObjectId == "Swing" || item.ObjectId == "Finishing" || item.ObjectId == "Properties")
{
<div class="col-2 m-2 small p-2 mt-2" style="border: 2px solid black; border-radius: 15px;">
<DoorDataBlock paramsChanged=@paramsChanged E_doorOp2Save="doSetDoorOp2Save" BlockDoorOp="@item"></DoorDataBlock>
</div>
}
else
{
<div class="col-12 small p-2 mt-2 text-start" style="border: 2px solid black; border-radius: 15px;">
<DoorDataBlock paramsChanged=@paramsChanged E_doorOp2Save="doSetDoorOp2Save" BlockDoorOp="@item"></DoorDataBlock>
</div>
}
}
else
{
<div class="col-12 border">
<DoorDataBlock E_doorOp2Save="doSetDoorOp2Save" BlockDoorOp="@item"></DoorDataBlock>
</div>
}
}
</div>
</div>
}
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.UI.Data;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.UI.Components.DoorDef
{
@@ -17,6 +17,9 @@ namespace WebDoorCreator.UI.Components.DoorDef
[Parameter]
public EventCallback<bool> E_DoorOpReqRel { get; set; }
[Parameter]
public int doorId { get; set; } = 0;
#endregion Public Properties
#region Protected Properties
@@ -32,11 +35,14 @@ namespace WebDoorCreator.UI.Components.DoorDef
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
[Inject]
protected QueueDataService QDataServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task doSaveDoorOp()
{
if (DoorOp2Save != null)
@@ -44,6 +50,9 @@ namespace WebDoorCreator.UI.Components.DoorDef
var done = await WDService.DoorOpUpdate(DoorOp2Save);
if (done)
{
string currDdf = await WDService.DoorOpGetDDF(doorId) ?? "";
int currVers = await QDataServ.SendCalcReq(doorId, currDdf);
DoorOp2Save = new List<DoorOpModel>();
paramsChanged = false;
await Task.Delay(50);
@@ -34,7 +34,6 @@
}
}
</div>
@*<hr />*@
</div>
</div>
}
@@ -51,6 +51,9 @@ namespace WebDoorCreator.UI.Components.DoorDef
#region Protected Properties
[Parameter]
public bool paramsChanged { get; set; } = false;
/// <summary>
/// Lista delle conf assocaite alle BlockDoorOp
/// </summary>
@@ -60,19 +63,17 @@ namespace WebDoorCreator.UI.Components.DoorDef
/// Lista delle BlockDoorOp da passare
/// </summary>
protected Dictionary<string, Dictionary<string, string>> bdoList { get; set; } = new Dictionary<string, Dictionary<string, string>>();
[Parameter]
public bool paramsChanged { get; set; } = false;
protected string userLang { get; set; } = "EN";
#endregion Protected Properties
#region Protected Methods
protected bool showCirc { get; set; } = false;
[Inject]
protected WDCRefreshService WDCRService { get; set; } = null!;
protected async Task doSaveBlock(Dictionary<string, Dictionary<string, string>> updSet)
{
await Task.Delay(1);
@@ -101,9 +102,6 @@ namespace WebDoorCreator.UI.Components.DoorDef
}
}
}
protected bool showCirc { get; set; } = false;
protected Dictionary<string, List<string>> getParamsConfig(string paramName)
{
Dictionary<string, List<string>> answ = new Dictionary<string, List<string>>();
@@ -2,23 +2,26 @@
{
<div class="d-flex justify-content-between px-2 py-2" style="background-color: @bgColor">
<div class="d-flex justify-content-between">
@*<div class="badge rounded-pilll bg-dark text-light">Insert Date</div>*@
<button class="btn btn-success" @onclick="() => toOrderPage()">Return to Order <b>@currOrderStatus.OrderId</b></button>
</div>
<div class="d-flex justify-content-between">
<button class="btn btn-danger" @onclick="() => deleteRecord()">Delete Door <i class="fa-solid fa-trash"></i></button>
</div>
<div class="d-flex justify-content-between">
<div>Insert Date: <b>@currOrderStatus.DateIns</b></div>
</div>
<div class="d-flex justify-content-between">
@*<div class="badge rounded-pilll bg-dark text-light">Order External Code</div>*@
<div>Order External Code: <b>@currOrderStatus.OrderExtCode</b></div>
</div>
<div class="d-flex justify-content-between">
@*<div class="badge rounded-pilll bg-dark text-light">Models Number</div>*@
<div class="text-center">Models Number: <b>@currOrderStatus.NumType</b></div>
</div>
<div class="d-flex justify-content-between">
@*<div class="badge rounded-pilll bg-dark text-light">Doors Number</div>*@
<div class="text-center">Doors Number: <b>@currOrderStatus.NumDoors</b></div>
</div>
<div style="background: #AFCFD1; text-align: end">
<ButtonsDoorDef></ButtonsDoorDef>
<ButtonsDoorDef idOrd="@currOrderStatus.OrderId"></ButtonsDoorDef>
</div>
</div>
}
@@ -1,15 +1,74 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.UI.Components.DoorDef
{
public partial class DoorDefOrderTopRow
{
[Parameter]
public OrderStatusViewModel? currOrderStatus { get; set; } = null;
#region Public Properties
[Parameter]
public string bgColor { get; set; } = "";
[Parameter]
public OrderStatusViewModel? currOrderStatus { get; set; } = null;
[CascadingParameter]
public int idDoor { get; set; } = 0;
#endregion Public Properties
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Elimina porta se richiesto
/// </summary>
/// <returns></returns>
protected async Task deleteRecord()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Do you really want to delete this door?"))
return;
await Task.Delay(1);
if (idDoor > 0 && currOrderStatus != null)
{
var ordDoors = await WDCService.DoorGetByOrderId(currOrderStatus.OrderId);
if (ordDoors != null)
{
var CurrDoor = ordDoors.Where(x => x.DoorId == idDoor).FirstOrDefault();
if (CurrDoor != null)
{
await WDCService.DoorDelete(CurrDoor);
if (currOrderStatus != null)
{
NavManager.NavigateTo($"OrderDetails?idOrd={currOrderStatus.OrderId}&orderStat={currOrderStatus.OrderStatus}");
}
}
}
}
}
#endregion Protected Methods
protected async Task toOrderPage()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Do you really want to return to the order page without saving current work?"))
return;
await Task.Delay(1);
NavManager.NavigateTo($"OrdersHomePage?idOrd={currOrderStatus.OrderId}");
}
}
}
@@ -7,10 +7,12 @@ else
<div class="d-flex justify-content-between small">
<div style="width: 90%">
<div style="width: 90%;">
<div class="row my-1">
<b>@HwCode</b>
<div class="row my-1 @doCheckVal()">
@if (HwCode == "lockedge" || HwCode == "hingeedge" || HwCode == "top" || HwCode == "bottom")
{
<b>@HwCode</b>
}
</div>
@doCheckVal()
@foreach (var item in currVal)
{
@if (isCombo(item.Key))
@@ -41,7 +41,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
#region Protected Properties
Dictionary<string, string> _currVal = new Dictionary<string, string>();
private Dictionary<string, string> _currVal = new Dictionary<string, string>();
/// <summary>
/// Array dati effettivo x gestione modifiche
@@ -109,8 +109,6 @@ namespace WebDoorCreator.UI.Components.DoorDef
return answ;
}
protected async Task doSave()
{
await Task.Delay(1);
@@ -1,25 +1,29 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.UI.Data;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.UI.Components.DoorDef
{
public partial class DoorDefStepList
{
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
[Parameter]
public int CurrDoorDefStatus { get; set; } = 10;
[Parameter]
public EventCallback<int> E_CurrStep { get; set; }
protected override async Task OnParametersSetAsync()
protected string currColor { get; set; } = "";
protected List<ListValuesModel>? currListDoorDefStatus { get; set; } = null;
protected List<string> listBord01 { get; set; } = new();
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
protected async Task changeStep(int step)
{
await Task.Delay(1);
await E_CurrStep.InvokeAsync(step);
StateHasChanged();
}
protected async Task doChangeStep(string actDoorDefStep)
@@ -29,9 +33,6 @@ namespace WebDoorCreator.UI.Components.DoorDef
//await E_StepChanged.InvokeAsync(actDoorDefStep);
}
protected List<ListValuesModel>? currListDoorDefStatus { get; set; } = null;
protected string currColor { get; set; } = "";
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
@@ -43,7 +44,6 @@ namespace WebDoorCreator.UI.Components.DoorDef
if (stat2Display != null)
{
currColor = stat2Display.DefaultVal;
}
}
@@ -54,13 +54,9 @@ namespace WebDoorCreator.UI.Components.DoorDef
listBord01.Add("White");
}
protected List<string> listBord01 { get; set; } = new();
protected async Task changeStep(int step)
protected override async Task OnParametersSetAsync()
{
await E_CurrStep.InvokeAsync(step);
StateHasChanged();
await Task.Delay(1);
}
}
}
@@ -0,0 +1,46 @@
<div class="row">
<div class="col-12 px-0">
</div>
<div class="col-8 pe-0">
<div class="mb-3 ps-1 pe-0">
<DoorDefStepList CurrDoorDefStatus="currDefStep" E_CurrStep="setStep"></DoorDefStepList>
</div>
<div class="px-2">
<CascadingValue Value="@WDCUService.userId">
<CascadingValue Value="@idDoor">
<CascadingValue Value="B_doorOpUpd">
@if (orderStatus != null)
{
}
@if (currDefStep == 10)
{
@if (ListBaseDoorOp != null)
{
<BaseParamList doorId=@idDoor CurrBaseDoorOp="@ListBaseDoorOp" E_DoorOpReqRel="doReload"></BaseParamList>
}
}
else if (currDefStep == 20)
{
<HardwareList isHwStep="@setHwToNull" DoorId="@idDoor" Lingua="@userLang"></HardwareList>
}
else if (currDefStep == 30)
{
<ReportList doorId="@idDoor" Lingua="@userLang"></ReportList>
}
</CascadingValue>
</CascadingValue>
</CascadingValue>
</div>
</div>
<div class="col-4 p-0">
<CascadingValue Value="@idDoor">
<CascadingValue Value="IsErr">
<CascadingValue Value="ErrCode">
<DoorPreview doorW="50%" SvgContent="@DoorSvgContent"></DoorPreview>
</CascadingValue>
</CascadingValue>
</CascadingValue>
</div>
</div>
@@ -6,9 +6,8 @@ using WebDoorCreator.Data;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Data;
using static WebDoorCreator.UI.Data.WDCRefreshService;
namespace WebDoorCreator.UI.Pages
namespace WebDoorCreator.UI.Components.DoorDef
{
public partial class DoorDefinition : IDisposable
{
@@ -30,10 +29,12 @@ namespace WebDoorCreator.UI.Pages
protected string DoorSvgContent { get; set; } = "";
protected string ErrCode { get; set; } = "ERRORE";
protected int idDoor { get; set; } = 0;
protected int idOrd { get; set; } = 0;
[Parameter]
public int idDoor { get; set; } = 0;
[Parameter]
public int idOrd { get; set; } = 0;
protected bool isDoorOpConf { get; set; } = false;
protected bool IsErr { get; set; } = false;
[Inject]
@@ -50,7 +51,6 @@ namespace WebDoorCreator.UI.Pages
protected QueueDataService QDataServ { get; set; } = null!;
protected string userLang { get; set; } = "EN";
protected bool isDoorOpConf { get; set; } = false;
[Inject]
protected WDCRefreshService WDCRService { get; set; } = null!;
@@ -75,7 +75,6 @@ namespace WebDoorCreator.UI.Pages
});
}
/// <summary>
/// gestione rilettura info
/// </summary>
@@ -93,22 +92,15 @@ namespace WebDoorCreator.UI.Pages
{
await Task.Delay(1);
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOrd", out var _idOrd) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idDoor", out var _idDoor))
{
idOrd = int.Parse(_idOrd);
idDoor = int.Parse(_idDoor);
await ReloadData();
}
userLang = WDCUService.currLanguage ?? "EN";
#if false
isDoorOpConf = WDCRService.isDoorOpConf;
#endif
//if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOrd", out var _idOrd) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idDoor", out var _idDoor))
//{
// idOrd = int.Parse(_idOrd);
// idDoor = int.Parse(_idDoor);
//}
await ReloadData();
WDCUService.EA_CurrLanguage += WDUService_EA_CurrLanguage;
QDataServ.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
WDCRService.EA_UpdDoorOp += WDService_EA_DoorOpUpdated;
#if false
WDCRService.EA_ConfDoorOp += WDService_EA_DoorOpConfirmed;
#endif
}
protected async Task ReloadData()
@@ -215,8 +207,6 @@ namespace WebDoorCreator.UI.Pages
//if (string.IsNullOrEmpty(DoorSvgContent))
//{
//}
await Task.Run(async () => await InvokeAsync(StateHasChanged));
}
@@ -235,14 +225,6 @@ namespace WebDoorCreator.UI.Pages
StateHasChanged();
}
#if false
private void WDService_EA_DoorOpConfirmed()
{
isDoorOpConf = WDCRService.isDoorOpConf;
StateHasChanged();
}
#endif
#endregion Private Methods
}
}
@@ -1,12 +1,11 @@
<div class="" style="height:100%; width:100%; position:sticky; background: linear-gradient(#AFCFD1, #92B2C4);min-height: 55rem;max-height: 55rem;">
@*@if (IsErr)
{
@*<div class="alert alert-warning text-center fs-2">@ErrCode</div>
}*@
<div class="" style="height:100%; width:100%; background: linear-gradient(#AFCFD1, #92B2C4);min-height: 50rem;">
<ButtonsDoorDef></ButtonsDoorDef>
@if (!string.IsNullOrEmpty(@SvgContent))
{
<div style="height: 0;width: 15rem;align-items: center;display: flex;flex-wrap: wrap;justify-content: center;">
@svgPreview
<div style="align-items: center;display: flex;flex-wrap: wrap;justify-content: center;">
<div style="width: @doorW; max-height: 30rem;">
@svgPreview
</div>
</div>
}
</div>
@@ -7,6 +7,11 @@ namespace WebDoorCreator.UI.Components.DoorDef
{
#region Public Properties
private static Logger Log = LogManager.GetCurrentClassLogger();
[Parameter]
public string doorW { get; set; } = "";
[Parameter]
public string SvgContent
{
@@ -15,11 +20,9 @@ namespace WebDoorCreator.UI.Components.DoorDef
{
_svgContent = value;
}
}
private static Logger Log = LogManager.GetCurrentClassLogger();
}
protected string _svgContent { get; set; } = "";
#endregion Public Properties
#region Protected Properties
@@ -1,38 +0,0 @@
@*<div class="row bg-secondary text-light">
<div class="col-4 p-0 fs-3 d-flex justify-content-between" @onclick="()=>doChangeStep(Core.Enum.DoorDefStep.Door)">
@if (DoorDefStep == Core.Enum.DoorDefStep.Door)
{
<div class="tail-left"></div>
<div class="@doorCSS flex-fill text-center">Door</div>
<div class="arrow-right"></div>
}
else
{
<div class="@doorCSS flex-fill text-center">Door</div>
}
</div>
<div class="col-4 p-0 fs-3 d-flex justify-content-between" @onclick="()=>doChangeStep(Core.Enum.DoorDefStep.Hardware)">
@if (DoorDefStep == Core.Enum.DoorDefStep.Hardware)
{
<div class="tail-left"></div>
<div class="@hwCSS flex-fill text-center">Hardware</div>
<div class="arrow-right"></div>
}
else
{
<div class="@hwCSS flex-fill text-center">Hardware</div>
}
</div>
<div class="col-4 p-0 fs-3 d-flex justify-content-between" @onclick="()=>doChangeStep(Core.Enum.DoorDefStep.Report)">
@if (DoorDefStep == Core.Enum.DoorDefStep.Report)
{
<div class="tail-left"></div>
<div class=" @reportCSS flex-fill text-center">Report</div>
<div class="arrow-right"></div>
}
else
{
<div class=" @reportCSS flex-fill text-center">Report</div>
}
</div>
</div>*@
@@ -1,41 +0,0 @@
using Microsoft.AspNetCore.Components;
namespace WebDoorCreator.UI.Components.DoorDef
{
public partial class StepsList
{
[Parameter]
public Core.Enum.DoorDefStep DoorDefStep { get; set; } = Core.Enum.DoorDefStep.Door;
[Parameter]
public EventCallback<Core.Enum.DoorDefStep> E_StepChanged { get; set; }
//protected string doorCSS
//{
// get => DoorDefStep == Core.Enum.DoorDefStep.Door ? "bg-success" : "bg-secondary";
//}
//protected string hwCSS
//{
// get => DoorDefStep == Core.Enum.DoorDefStep.Hardware ? "bg-success" : "bg-secondary";
//}
//protected string reportCSS
//{
// get => DoorDefStep == Core.Enum.DoorDefStep.Report ? "bg-success" : "bg-secondary";
//}
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
}
protected async Task doChangeStep(Core.Enum.DoorDefStep actDoorDefStep)
{
await Task.Delay(1);
await E_StepChanged.InvokeAsync(actDoorDefStep);
}
}
}
@@ -1,17 +0,0 @@
/*.arrowItem {
transform: skewX(20deg);
}*/
.arrow-right {
width: 0;
height: 0;
border-top: 25px solid transparent;
border-left: 30px solid #198754;
border-bottom: 25px solid transparent;
}
.tail-left {
width: 0;
height: 0;
border-top: 25px solid #198754;
border-left: 30px solid transparent;
border-bottom: 25px solid #198754;
}
@@ -1,21 +0,0 @@
@bordL: 25px;
@bordH: 30px;
@itemColor: #198754;
/*.arrowItem {
transform: skewX(20deg);
}*/
.arrow-right {
width: 0;
height: 0;
border-top: @bordL solid transparent;
border-left: @bordH solid @itemColor;
border-bottom: @bordL solid transparent;
}
.tail-left {
width: 0;
height: 0;
border-top: @bordL solid @itemColor;
border-left: @bordH solid transparent;
border-bottom: @bordL solid @itemColor;
}
@@ -1 +0,0 @@
.arrow-right{width:0;height:0;border-top:25px solid transparent;border-left:30px solid #198754;border-bottom:25px solid transparent;}.tail-left{width:0;height:0;border-top:25px solid #198754;border-left:30px solid transparent;border-bottom:25px solid #198754;}
@@ -2,23 +2,36 @@
{
@if (orderStatus == 10)
{
<div class="row">
<div class="col-4 py-1">
<DoorSvgObj LineColor="rgb(39, 174, 96)" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> createDoor(""))" ObjId="-1" TextData="@AddDoorDict" ImagePath="images/LogoEgwBlack.png"></DoorSvgObj>
@if (isRecalc)
{
<div class="modalOrd">
<div class="modalOrd-content text-center">
<div class="loader">
<span class="loader-text">Loading...</span>
<span class="load"></span>
</div>
</div>
</div>
<div class="col-4 py-1">
<DoorSvgObj LineColor="rgb(39, 174, 96)" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> setCloneDoorMode(""))" ObjId="-2" TextData="@AddFromTemplDict" ImagePath="images/LogoEgwBlue.png"></DoorSvgObj>
}
<div class="d-flex justify-content-between">
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> createDoor(""))" ObjId="-1" ItemName="Add new door" ItemCount="0" ShowPlus="true" ImagePath="images/icons/PlusWhite.svg"></HwSvgObj>
</div>
<div class="col-4 py-1">
<DoorSvgObj LineColor="#8E44AD" LineWidth="8" ObjH="200" ObjW="900" LeftTextClass="col-10 fs-1 fw-bold" RightTextClass="col-2" EC_ExeFunct="@(()=> sendToAbh(currOrderId, orderStatus))" ObjId="-3" TextData="@SendOrderDict" Message1="@currOrderId.ToString()" Message2="@orderStatus.ToString()" ImagePath="images/LogoEgwWhite.png"></DoorSvgObj>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> recalcSVGs(""))" ObjId="-2" ItemName="Recalc all the SVGs" ItemCount="0" ShowPlus="true" ImagePath="images/icons/arrows-rotate-solid.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> reportUrl(currOrderId))" ObjId="-3" ItemName="Get the order estimate" ItemCount="0" ShowPlus="true" ImagePath="images/icons/file-pdf-regular.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" ObjId="-4" ItemName="Calculate total cost" ItemCount="0" ShowPlus="true" ImagePath="images/icons/calculator-solid.svg"></HwSvgObj>
</div>
<div class=" py-1">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="@(()=> sendToCompany(currOrderId, orderStatus))" ObjId="-5" ItemName="Send to DCA" ItemCount="0" ShowPlus="true" ImagePath="images/icons/angles-right-solid.svg"></HwSvgObj>
</div>
</div>
}
<div class="row">
<div class="col-4">
<button @onclick="()=>setAddRemDoor()">ADD REM MODE</button>
</div>
</div>
<div class="row">
@if (DoorsList == null || DoorsList.Count == 0)
{
@@ -27,26 +40,11 @@
else
{
int idxCount = 0;
string imgPath = "";
@foreach (var door in DoorsList)
{
imgPath = $"images/LogoEgw{idxCount % 5:00}.png";
idxCount++;
<div class="col-3 py-1">
@if (isCloneMode)
{
<DoorSvgObj LineColor="#2D3047" LineWidth="8" ObjH="200" ObjW="650" LeftTextClass="col-4" RightTextClass="col-8" EC_ExeClone="@(()=>doClone(@door.DoorId.ToString()))" Message1="@door.DoorId.ToString()" ShowClone="true" ImagePath="@imgPath" ObjId="idxCount" TextData="@textDictSetup(door)"></DoorSvgObj>
}
else if (isAddRemMode)
{
<DoorSvgObj LineColor="#2D3047" LineWidth="8" ObjH="200" ObjW="650" LeftTextClass="col-4" RightTextClass="col-8" ShowPlusMinus="true" Message1="@door.DoorId.ToString()" Message2="@door.OrderId.ToString()" EC_ExePlus="@(()=>addOneDoorNumber("", ""))" EC_ExeMinus="@(()=>removeOneDoorNumber("", ""))" ImagePath="@DoorSvgUrl(door.DoorId)" ObjId="idxCount" TextData="@textDictSetup(door)"></DoorSvgObj>
}
else
{
<DoorSvgObj LineColor="#2D3047" LineWidth="8" ObjH="200" ObjW="650" LeftTextClass="col-4" RightTextClass="col-8" EC_ExeFunct="@(()=> editRec(@door.DoorId.ToString()))" Message1="@door.DoorId.ToString()" ImagePath="@DoorSvgUrl(door.DoorId)" ObjId="idxCount" TextData="@textDictSetup(door)"></DoorSvgObj>
}
<DoorSvgObj ColorLine="#4c0969" LineWidth="8" ObjH="200" ObjW="650" ClassLeftText="col-4" ClassRightText="col-8" EC_ExeFunct="@ExecDoorReq" DoorId="@door.DoorId" ImagePath="@DoorSvgUrl(door.DoorId)" ObjId="idxCount" TextData="@textDictSetup(door)" ShowOptions="true"></DoorSvgObj>
</div>
}
@@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Components.SvgComp;
using WebDoorCreator.UI.Data;
namespace WebDoorCreator.UI.Components.DoorMan
@@ -9,27 +11,50 @@ namespace WebDoorCreator.UI.Components.DoorMan
{
#region Public Properties
[Parameter]
public DoorsSelectFilter actFilter { get; set; } = new DoorsSelectFilter();
[Parameter]
public int currOrderId { get; set; } = 0;
[Parameter]
public EventCallback<DoorModel> E_CurrDoor { get; set; }
[Parameter]
public EventCallback<DoorModel> E_CurrDoorModal { get; set; }
[Parameter]
public EventCallback<bool> E_DoorChanged { get; set; }
[Parameter]
public EventCallback<int> updateRecordCount { get; set; }
[Parameter]
public DoorsSelectFilter actFilter { get; set; } = new DoorsSelectFilter();
public string userId
{
get
{
return WDCUService.userId;
}
}
#endregion Public Properties
#region Protected Fields
protected List<DoorOpModel> doorOps2Add = new List<DoorOpModel>();
#endregion Protected Fields
#region Protected Properties
protected List<DoorModel>? DoorsList { get; set; } = null;
protected Dictionary<string, string> AddDoorDict { get; set; } = new Dictionary<string, string>();
protected Dictionary<string, string> AddFromTemplDict { get; set; } = new Dictionary<string, string>();
protected List<DoorOpModel>? DoorOpsList { get; set; } = null;
protected List<DoorModel>? DoorsList { get; set; } = null;
protected bool isAddRemMode { get; set; }
protected bool IsChanged { get; set; } = false;
protected bool isCloneMode { get; set; }
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
@@ -37,11 +62,14 @@ namespace WebDoorCreator.UI.Components.DoorMan
protected NavigationManager NavManager { get; set; } = null!;
protected int orderStatus { get; set; } = 10;
protected Dictionary<string, string> AddDoorDict { get; set; } = new Dictionary<string, string>();
protected Dictionary<string, string> AddFromTemplDict { get; set; } = new Dictionary<string, string>();
protected Dictionary<string, string> SendOrderDict { get; set; } = new Dictionary<string, string>();
[Inject]
protected WDCUserService WDCUService { get; set; } = null!;
[Inject]
protected QueueDataService QDService { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
@@ -49,6 +77,8 @@ namespace WebDoorCreator.UI.Components.DoorMan
#region Protected Methods
protected DoorModel? currDoor { get; set; } = null;
protected async Task catchDoorChange(bool isChanged)
{
await Task.Delay(1);
@@ -60,6 +90,50 @@ namespace WebDoorCreator.UI.Components.DoorMan
await E_DoorChanged.InvokeAsync(isChanged);
}
protected async void createDoor(string message)
{
int doorId = await WDService.createDoor(currOrderId, userId, "mm");
if (doorId > 0)
{
var door = DoorsList?.Where(x => x.DoorId == doorId).FirstOrDefault();
await InvokeAsync(StateHasChanged);
await E_CurrDoor.InvokeAsync(door);
}
}
protected bool isRecalc { get; set; } = false;
protected async void recalcSVGs(string message)
{
isRecalc = true;
// recupero elenco porte come list interi...
if (DoorsList != null && DoorsList.Count > 0)
{
List<string> doorIdList = DoorsList
.Select(x => $"{x.DoorId}")
.ToList();
// chiamo reset
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
// se ho porte da processare --> chiamo save...
string currDDF = "";
int currDoorId = 0;
int currVers = 0;
foreach (var item in list2Proc)
{
currDoorId = 0;
currVers = 0;
int.TryParse(item, out currDoorId);
if (currDoorId > 0)
{
currDDF = await WDService.DoorOpGetDDF(currDoorId);
// versione corrente del DDF generato
currVers = await QDService.SendCalcReq(currDoorId, currDDF);
}
}
}
isRecalc = false;
await InvokeAsync(StateHasChanged);
}
protected async Task deleteRecord(DoorModel currRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Door Deletion requested: are you sure to remove {currRec.DoorDescript}?"))
@@ -70,144 +144,6 @@ namespace WebDoorCreator.UI.Components.DoorMan
await ReloadData();
}
protected async Task editRec(string doorId)
{
await Task.Delay(1);
NavManager.NavigateTo($"/DoorDefinition?idOrd={currOrderId}&idDoor={int.Parse(doorId)}");
}
protected async Task getBackStatus()
{
await Task.Delay(1);
if (orderStatus > 10 && orderStatus <= 70)
{
await WDService.OrderUpdate(currOrderId, (orderStatus - 10));
}
await ReloadData();
}
protected override async Task OnParametersSetAsync()
{
await ReloadData();
}
protected async Task proceedStatus()
{
await Task.Delay(1);
if (orderStatus >= 10 && orderStatus < 70)
{
await WDService.OrderUpdate(currOrderId, (orderStatus + 10));
}
await ReloadData();
}
protected async Task ReloadData()
{
if (!AddDoorDict.ContainsKey("ADD NEW DOOR"))
{
AddDoorDict.Add("ADD NEW DOOR", "");
}
if (!AddFromTemplDict.ContainsKey("ADD NEW DOOR FROM TEMPLATE"))
{
AddFromTemplDict.Add("ADD NEW DOOR FROM TEMPLATE", "");
}
if (!SendOrderDict.ContainsKey("SEND TO ABH"))
{
SendOrderDict.Add("SEND TO ABH", "");
}
if (currOrderId != -1)
{
var SearchRecords = await WDService.DoorGetByOrderId(currOrderId);
if (SearchRecords != null)
{
totalCount = SearchRecords.Count;
DoorsList = SearchRecords
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
if (DoorsList != null)
{
var currOrder = DoorsList.FirstOrDefault();
if (currOrder?.OrderNav != null)
{
orderStatus = currOrder.OrderNav.Status;
}
}
}
}
}
/// <summary>
/// Prepara il dictionary dei testi da riportare nell'oggetto ordine
/// </summary>
/// <param name="door"></param>
/// <returns></returns>
protected Dictionary<string, string> textDictSetup(DoorModel door)
{
Dictionary<string, string> answ = new Dictionary<string, string>();
answ.Add("Doors N°:", $"{door.Quantity}");
answ.Add("Model N°:", $"{door.TypeNav?.TypeId}");
answ.Add("DoorPrice:", $"{(door.Quantity * door.UnitCost):C2}");
return answ;
}
#endregion Protected Methods
[Inject]
protected WDCUserService WDCUService { get; set; } = null!;
public string userId
{
get
{
return WDCUService.userId;
}
}
protected async void createDoor(string message)
{
int doorId = await WDService.createDoor(currOrderId, userId, "mm");
if (doorId > 0)
{
await InvokeAsync(StateHasChanged);
}
// rimando alla pagina... dettaglio...
NavManager.NavigateTo($"/DoorDefinition?idOrd={currOrderId}&idDoor={doorId}");
}
/// <summary>
/// Path del servizio di recupero SVG delle porte
/// </summary>
/// <param name="doorId"></param>
/// <returns></returns>
protected string DoorSvgUrl(int doorId)
{
return $"api/DoorImage/GetImage.svg?DoorId={doorId}";
}
protected bool isCloneMode { get; set; }
protected bool isAddRemMode { get; set; }
protected async void setCloneDoorMode(string message)
{
await Task.Delay(1);
isCloneMode = !isCloneMode;
isAddRemMode = false;
await InvokeAsync(StateHasChanged);
}
protected async void setAddRemDoor()
{
await Task.Delay(1);
isAddRemMode = !isAddRemMode;
isCloneMode = false;
await InvokeAsync(StateHasChanged);
}
protected List<DoorOpModel> doorOps2Add = new List<DoorOpModel>();
/// <summary>
/// Clona la porta selezionata con annesse door operations
/// </summary>
@@ -245,11 +181,137 @@ namespace WebDoorCreator.UI.Components.DoorMan
}
}
}
protected async void sendToAbh(int ordId, int orderStat)
/// <summary>
/// Path del servizio di recupero SVG delle porte
/// </summary>
/// <param name="doorId"></param>
/// <returns></returns>
protected string DoorSvgUrl(int doorId)
{
return $"api/DoorImage/GetImage.svg?DoorId={doorId}";
}
protected async Task editRec(int doorId)
{
await Task.Delay(1);
if (DoorsList != null)
{
var door = DoorsList.Where(x => x.DoorId == doorId).FirstOrDefault();
if (door != null)
{
//currDoor = door;
await E_CurrDoor.InvokeAsync(door);
}
}
}
protected async Task ExecDoorReq(DoorSvgObj.DoorAct currAct)
{
await Task.Delay(1);
switch (currAct.Action)
{
case DoorSvgObj.ActionReq.Minus:
// TODO
//await removeOneDoorNumber("", "");
break;
case DoorSvgObj.ActionReq.Plus:
// TODO
//await addOneDoorNumber("", "");
break;
case DoorSvgObj.ActionReq.ReqOptions:
// TODO
// aprire la modale di editing...
await setModalShow(currAct.DoorId);
break;
case DoorSvgObj.ActionReq.Select:
await editRec(currAct.DoorId);
break;
default:
break;
}
}
protected async Task getBackStatus()
{
await Task.Delay(1);
if (orderStatus > 10 && orderStatus <= 70)
{
await WDService.OrderUpdate(currOrderId, (orderStatus - 10));
}
await ReloadData();
}
protected override async Task OnParametersSetAsync()
{
await ReloadData();
}
protected async Task proceedStatus()
{
await Task.Delay(1);
if (orderStatus >= 10 && orderStatus < 70)
{
await WDService.OrderUpdate(currOrderId, (orderStatus + 10));
}
await ReloadData();
}
protected async Task ReloadData()
{
// 2023.05.26 - report inserito come servizio nell'app
#if false
var confData = await WDService.ConfigGetKey("prt_ReportServerUrl");
if (confData != null)
{
reportBaseUrl = confData.valore;
}
#endif
if (!AddDoorDict.ContainsKey("ADD NEW DOOR"))
{
AddDoorDict.Add("ADD NEW DOOR", "");
}
if (!AddFromTemplDict.ContainsKey("ADD NEW DOOR FROM TEMPLATE"))
{
AddFromTemplDict.Add("ADD NEW DOOR FROM TEMPLATE", "");
}
if (!SendOrderDict.ContainsKey("SEND TO DCA"))
{
SendOrderDict.Add("SEND TO DCA", "");
}
if (currOrderId != -1)
{
var SearchRecords = await WDService.DoorGetByOrderId(currOrderId);
if (SearchRecords != null)
{
totalCount = SearchRecords.Count;
DoorsList = SearchRecords
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
if (DoorsList != null)
{
var currOrder = DoorsList.FirstOrDefault();
if (currOrder?.OrderNav != null)
{
orderStatus = currOrder.OrderNav.Status;
}
}
}
}
}
protected async void sendToCompany(int ordId, int orderStat)
{
if (orderStat == 10)
{
//int doorId = await WDService.createDoor(currOrderId, userId, "mm");
bool done = await WDService.OrderUpdate(ordId, 20);
if (done)
{
@@ -260,6 +322,40 @@ namespace WebDoorCreator.UI.Components.DoorMan
await ReloadData();
}
protected async Task setModalShow(int doorId)
{
await Task.Delay(1);
if (DoorsList != null)
{
var door = DoorsList.Where(x => x.DoorId == doorId).FirstOrDefault();
if (door != null)
{
//currDoor = door;
await E_CurrDoorModal.InvokeAsync(door);
}
}
}
/// <summary>
/// Prepara il dictionary dei testi da riportare nell'oggetto ordine
/// </summary>
/// <param name="door"></param>
/// <returns></returns>
protected Dictionary<string, string> textDictSetup(DoorModel door)
{
Dictionary<string, string> answ = new Dictionary<string, string>();
answ.Add("Doors #:", $"{door.Quantity}");
answ.Add("Model #:", $"{door.TypeNav?.TypeId}");
answ.Add("Door Price:", $"{(door.Quantity * door.UnitCost):C2}");
return answ;
}
#endregion Protected Methods
#region Private Properties
private int _totalCount { get; set; } = 0;
private int currPage
{
get => actFilter.CurrPage;
@@ -271,13 +367,13 @@ namespace WebDoorCreator.UI.Components.DoorMan
get => actFilter.NumRec;
set => actFilter.NumRec = value;
}
private string searchVal
{
get => actFilter.searchValue;
set => actFilter.searchValue = value;
}
private int _totalCount { get; set; } = 0;
private int totalCount
{
get => _totalCount;
@@ -291,25 +387,29 @@ namespace WebDoorCreator.UI.Components.DoorMan
}
}
protected async Task addOneDoorNumber(string msg1, string msg2)
#endregion Private Properties
#if false
public string reportBaseUrl { get; set; } = "http://w2019-sql-steam/reportserver?/Test/WebDoor/";
protected async Task reportUrl(int orderId)
{
//var door = new DoorModel();
var done = await WDService.DoorModQty(int.Parse(msg1), int.Parse(msg2), true);
if (done)
{
await InvokeAsync(StateHasChanged);
await ReloadData();
}
}
protected async Task removeOneDoorNumber(string msg1, string msg2)
var url = $"{reportBaseUrl}ReportOrder&OrderID={orderId}&rs:Command=Render&rs:format=PDF";
await JSRuntime.InvokeAsync<object>("open", url, "_blank");
}
#endif
/// <summary>
/// Path del servizio di recupero report in PDF
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
protected async Task reportUrl(int orderId)
{
//var door = new DoorModel();
var done = await WDService.DoorModQty(int.Parse(msg1), int.Parse(msg2), false);
if (done)
{
await InvokeAsync(StateHasChanged);
await ReloadData();
}
var url = $"api/Report/GetOrderReport?OrderId={orderId}&Format=PDF";
// chiamo apertura via jscript in target _blank
await JSRuntime.InvokeAsync<object>("open", url, "_blank");
}
}
}
@@ -0,0 +1,118 @@
.modalOrd {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: #000000;
background-color: rgba(0, 0, 0, 0.6);
}
.loader {
width: 80px;
height: 50px;
position: relative;
}
.loader-text {
position: absolute;
top: 0;
padding: 0;
margin: 0;
color: #C8B6FF;
animation: text_713 3.5s ease both infinite;
font-size: 0.8rem;
letter-spacing: 1px;
}
.load {
background-color: #9A79FF;
border-radius: 50px;
display: block;
height: 16px;
width: 16px;
bottom: 0;
position: absolute;
transform: translateX(64px);
animation: loading_713 3.5s ease both infinite;
}
.load::before {
position: absolute;
content: "";
width: 100%;
height: 100%;
background-color: #D1C2FF;
border-radius: inherit;
animation: loading2_713 3.5s ease both infinite;
}
@keyframes text_713 {
0% {
letter-spacing: 1px;
transform: translateX(0px);
}
40% {
letter-spacing: 2px;
transform: translateX(26px);
}
80% {
letter-spacing: 1px;
transform: translateX(32px);
}
90% {
letter-spacing: 2px;
transform: translateX(0px);
}
100% {
letter-spacing: 1px;
transform: translateX(0px);
}
}
@keyframes loading_713 {
0% {
width: 16px;
transform: translateX(0px);
}
40% {
width: 100%;
transform: translateX(0px);
}
80% {
width: 16px;
transform: translateX(64px);
}
90% {
width: 100%;
transform: translateX(0px);
}
100% {
width: 16px;
transform: translateX(0px);
}
}
@keyframes loading2_713 {
0% {
transform: translateX(0px);
width: 16px;
}
40% {
transform: translateX(0%);
width: 80%;
}
80% {
width: 100%;
transform: translateX(0px);
}
90% {
width: 80%;
transform: translateX(15px);
}
100% {
transform: translateX(0px);
width: 16px;
}
}
/* Modal Content/Box */
.modalOrd-content {
margin: 20% auto;
padding-left: 20%;
width: 50%;
}
@@ -0,0 +1,140 @@
.modalOrd {
//display: none;
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.6);
}
.loader {
width: 80px;
height: 50px;
position: relative;
}
.loader-text {
position: absolute;
top: 0;
padding: 0;
margin: 0;
color: #C8B6FF;
animation: text_713 3.5s ease both infinite;
font-size: .8rem;
letter-spacing: 1px;
}
.load {
background-color: #9A79FF;
border-radius: 50px;
display: block;
height: 16px;
width: 16px;
bottom: 0;
position: absolute;
transform: translateX(64px);
animation: loading_713 3.5s ease both infinite;
}
.load::before {
position: absolute;
content: "";
width: 100%;
height: 100%;
background-color: #D1C2FF;
border-radius: inherit;
animation: loading2_713 3.5s ease both infinite;
}
@keyframes text_713 {
0% {
letter-spacing: 1px;
transform: translateX(0px);
}
40% {
letter-spacing: 2px;
transform: translateX(26px);
}
80% {
letter-spacing: 1px;
transform: translateX(32px);
}
90% {
letter-spacing: 2px;
transform: translateX(0px);
}
100% {
letter-spacing: 1px;
transform: translateX(0px);
}
}
@keyframes loading_713 {
0% {
width: 16px;
transform: translateX(0px);
}
40% {
width: 100%;
transform: translateX(0px);
}
80% {
width: 16px;
transform: translateX(64px);
}
90% {
width: 100%;
transform: translateX(0px);
}
100% {
width: 16px;
transform: translateX(0px);
}
}
@keyframes loading2_713 {
0% {
transform: translateX(0px);
width: 16px;
}
40% {
transform: translateX(0%);
width: 80%;
}
80% {
width: 100%;
transform: translateX(0px);
}
90% {
width: 80%;
transform: translateX(15px);
}
100% {
transform: translateX(0px);
width: 16px;
}
}
/* Modal Content/Box */
.modalOrd-content {
margin: 20% auto;
padding-left: 20%;
width: 50%;
}
@@ -0,0 +1 @@
.modalOrd{position:fixed;z-index:9999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.6);}.loader{width:80px;height:50px;position:relative;}.loader-text{position:absolute;top:0;padding:0;margin:0;color:#c8b6ff;animation:text_713 3.5s ease both infinite;font-size:.8rem;letter-spacing:1px;}.load{background-color:#9a79ff;border-radius:50px;display:block;height:16px;width:16px;bottom:0;position:absolute;transform:translateX(64px);animation:loading_713 3.5s ease both infinite;}.load::before{position:absolute;content:"";width:100%;height:100%;background-color:#d1c2ff;border-radius:inherit;animation:loading2_713 3.5s ease both infinite;}@keyframes text_713{0%{letter-spacing:1px;transform:translateX(0);}40%{letter-spacing:2px;transform:translateX(26px);}80%{letter-spacing:1px;transform:translateX(32px);}90%{letter-spacing:2px;transform:translateX(0);}100%{letter-spacing:1px;transform:translateX(0);}}@keyframes loading_713{0%{width:16px;transform:translateX(0);}40%{width:100%;transform:translateX(0);}80%{width:16px;transform:translateX(64px);}90%{width:100%;transform:translateX(0);}100%{width:16px;transform:translateX(0);}}@keyframes loading2_713{0%{transform:translateX(0);width:16px;}40%{transform:translateX(0%);width:80%;}80%{width:100%;transform:translateX(0);}90%{width:80%;transform:translateX(15px);}100%{transform:translateX(0);width:16px;}}.modalOrd-content{margin:20% auto;padding-left:20%;width:50%;}
@@ -0,0 +1,66 @@
<!-- The Modal -->
<div id="myModal" class="modalOrd">
<!-- Modal content -->
<div class="modalOrd-content">
<div class="d-flex justify-content-between">
<h4>@($"Door ID: {CurrDoor.DoorId}")</h4>
<span class="closeOrd mb-3" @onclick="()=>closeModal()">&times;</span>
</div>
<div class="row">
<div class="w-25">
<div class="pb-1">
<div class="d-flex justify-content-between mb-3">
@if (CurrDoorClone.Quantity != CurrDoor.Quantity)
{
<button class="btn btn-outline-danger" type="button" @onclick="()=>ReloadData()">CANCEL</button>
<button class="btn btn-outline-success" type="button" @onclick="()=>ChangeDoorNumber(true)">CONFIRM</button>
}
</div>
<label for="search">Add or Remove door</label>
<div class="input-group mb-3">
@if (CurrDoorClone.Quantity == CurrDoor.Quantity && CurrDoor.Quantity > 1)
{
<button class="btn btn-outline-danger" type="button" @onclick="()=>addOrRemoveOneDoorNumber(false)">-1</button>
}
<input type="number" @bind="@CurrDoor.Quantity" class="form-control text-center">
@if (CurrDoorClone.Quantity == CurrDoor.Quantity)
{
<button class="btn btn-outline-success" type="button" @onclick="()=>addOrRemoveOneDoorNumber(true)">+1</button>
}
</div>
</div>
@if (CurrDoorClone.Quantity == CurrDoor.Quantity)
{
<div class="pb-1">
<div class="input-group mb-3">
<button class="btn btn-primary w-100" type="button" @onclick="()=>doClone()">Clone door</button>
</div>
</div>
<div class="pb-1">
<div class="input-group mb-3">
<button class="btn btn-danger w-100" type="button" @onclick="()=>deleteRecord()">Delete door</button>
</div>
</div>
}
</div>
<div class="w-75">
<div class="doorSvgCont" style="height:100%; width:100%; background: linear-gradient(#AFCFD1, #92B2C4);min-height: 50rem;">
<div style="align-items: center;display: flex;flex-wrap: wrap;justify-content: center;">
<div style="width: 45%; max-height: 30rem;">
<img src="@($"api/DoorImage/GetImage.svg?DoorId={CurrDoorId}")" />
</div>
</div>
</div>
</div>
<div class="pb-1 text-start">
<div class="input-group mb-3">
<button class="btn btn-danger" type="button" @onclick="()=>closeModal()">X CLOSE</button>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,219 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.DTO;
using WebDoorCreator.Data.Services;
namespace WebDoorCreator.UI.Components.DoorMan
{
public partial class DoorModal
{
protected List<DoorOpModel> doorOps2Add = new List<DoorOpModel>();
public DoorModel CurrDoor { get; set; } = new DoorModel();
public DoorModel CurrDoorClone { get; set; } = new DoorModel();
[Parameter]
public int CurrDoorId { get; set; } = 0;
public List<DoorModel> DoorsList { get; set; } = new List<DoorModel>();
[Parameter]
public EventCallback<DoorModel> E_DoorClose { get; set; }
[Parameter]
public EventCallback<bool> E_isChange { get; set; }
[Parameter]
public int OrderId { get; set; } = 0;
[Parameter]
public string userId { get; set; } = "";
[Inject]
protected IConfiguration config { get; set; } = null!;
protected WebDoorCreator.Data.DDF.Converter currDdfConv { get; set; } = null!;
protected DDFDto CurrentConf { get; set; } = new DDFDto();
protected int doorQty
{
get => CurrDoor.Quantity;
set => CurrDoor.Quantity = value;
}
protected string DoorSvgContent { get; set; } = "";
protected bool IsErr { get; set; } = false;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
protected int newDoorId { get; set; } = 0;
protected List<string> ordListVal { get; set; } = new List<string>();
[Inject]
protected QueueDataService QDataServ { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
protected async Task addOrRemoveOneDoorNumber(bool isAdd)
{
//var door = new DoorModel();
var done = await WDService.DoorModQty(0, CurrDoor.OrderId, CurrDoor.DoorId, isAdd);
if (done)
{
//await E_isChange.InvokeAsync(true);
await ReloadData();
}
}
protected async Task ChangeDoorNumber(bool isAdd)
{
var done = await WDService.DoorModQty(doorQty, CurrDoor.OrderId, CurrDoor.DoorId, isAdd);
if (done)
{
await ReloadData();
}
}
protected async Task closeModal()
{
await Task.Delay(1);
var fakeDoor = new DoorModel();
await E_DoorClose.InvokeAsync(fakeDoor);
}
/// <summary>
/// Elimina porta se richiesto
/// </summary>
/// <returns></returns>
protected async Task deleteRecord()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Do you really want to delete this door?"))
return;
await Task.Delay(1);
if (CurrDoor != null)
{
var done = await WDService.DoorDelete(CurrDoor);
if (done)
{
await closeModal();
}
}
}
/// <summary>
/// Clona la porta selezionata con annesse door operations
/// </summary>
/// <returns></returns>
protected async Task doClone()
{
var DoorOpsList = await WDService.DoorOpGetByDoorId(CurrDoorId);
if (DoorOpsList != null)
{
var doorOps2Clone = DoorOpsList?.Where(x => x.DoorId == CurrDoorId).ToList();
var door2Clone = CurrDoor;
if (door2Clone != null)
{
var doorToAdd = door2Clone.ObjClone(userId);
// salvo!
newDoorId = await WDService.DoorInsert(doorToAdd);
if (newDoorId != 0 && doorOps2Clone != null)
{
foreach (var item in doorOps2Clone)
{
var doorOp2Add = item.ObjClone(userId, newDoorId);
doorOps2Add.Add(doorOp2Add);
}
// salvo!
var done = await WDService.DoorOpInsert(newDoorId, doorOps2Add);
if (done)
{
await doSave();
await closeModal();
}
}
}
}
}
/// <summary>
/// Effettua salvataggio record e generazione DDF
/// </summary>
/// <returns></returns>
protected async Task doSave()
{
List<DoorOpModel>? listOpAll = await WDService.DoorOpGetByDoorId(newDoorId);
if (listOpAll != null)
{
List<DoorOpModel> listOp = listOpAll.Where(x => x.userConfirm != "" && x.DtConfirm != null).ToList();
if (listOp != null)
{
// chiamo metodo x avewre DDF serializzato
//var list2Ord = ;
var CurrentCompoOrder = await WDService.ListValuesGetAll("*", "Hardware");
if (CurrentCompoOrder != null)
{
foreach (var item in CurrentCompoOrder.OrderBy(x => x.Ordinal).ToList())
{
ordListVal.Add(item.TableName);
}
}
listOp = listOp.OrderBy(d => ordListVal.IndexOf(d.ObjectId)).ToList();
string currDdf = currDdfConv.GetSerialized(listOp);
// FIXME TODO: si potrebbe eliminare in futuro che va su REDIS
// versione corrente del DDF generato
int currVers = await QDataServ.SendCalcReq(newDoorId, currDdf);
if (currVers > 0)
{
IsErr = false;
}
}
}
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
string vers = config.GetValue<string>("ConfDDF:VersNumber");
bool remDoorOp = config.GetValue<bool>("ConfDDF:RemoveDoorOps");
var headRows = config.GetSection("ConfDDF:Header").Get<List<string>>();
var footRows = config.GetSection("ConfDDF:Footer").Get<List<string>>();
currDdfConv = new WebDoorCreator.Data.DDF.Converter(vers, remDoorOp, headRows, footRows);
}
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
await ReloadData();
}
protected async Task ReloadData()
{
var SearchRecords = await WDService.DoorGetByOrderId(OrderId);
if (SearchRecords != null)
{
DoorsList = SearchRecords;
if (DoorsList != null)
{
var door = DoorsList.Where(x => x.DoorId == CurrDoorId).FirstOrDefault();
if (door != null)
{
CurrDoor = door;
}
}
}
CurrDoorClone = CurrDoor.ObjClone("");
}
}
}
@@ -0,0 +1,45 @@
/* Background scuro del modale */
.modalOrd {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: #000000;
background-color: rgba(0, 0, 0, 0.4);
}
/* Modal Content/Box */
.modalOrd-content {
background-color: #fefefe;
margin: 3% auto;
padding: 20px;
border: 1px solid #888;
width: 50%;
border-radius: 1rem;
animation: slideDown 0.5s;
/* display: flex;
justify-content: space-between;*/
}
/* The Close Button */
.closeOrd {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.closeOrd:hover,
.closeOrd:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
@keyframes slideDown {
0% {
transform: translate(0, -1000px);
}
100% {
transform: translate(0, 0);
}
}
@@ -0,0 +1,52 @@
/* Background scuro del modale */
.modalOrd {
//display: none;
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
/* Modal Content/Box */
.modalOrd-content {
background-color: #fefefe;
margin: 3% auto;
padding: 20px;
border: 1px solid #888;
width: 50%;
border-radius: 1rem;
animation: slideDown .5s;
/* display: flex;
justify-content: space-between;*/
}
/* The Close Button */
.closeOrd {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.closeOrd:hover,
.closeOrd:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
@keyframes slideDown {
0% {
transform: translate(0, -1000px);
}
100% {
transform: translate(0, 0);
}
}
@@ -0,0 +1 @@
.modalOrd{position:fixed;z-index:9999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.4);}.modalOrd-content{background-color:#fefefe;margin:3% auto;padding:20px;border:1px solid #888;width:50%;border-radius:1rem;animation:slideDown .5s;}.closeOrd{color:#aaa;float:right;font-size:28px;font-weight:bold;}.closeOrd:hover,.closeOrd:focus{color:#000;text-decoration:none;cursor:pointer;}@keyframes slideDown{0%{transform:translate(0,-1000px);}100%{transform:translate(0,0);}}
@@ -28,7 +28,6 @@
}
}
</select>
@*<input id="orderStatus" @bind="@orderStatus" class="form-control" />*@
<label for="orderStatus">Order Status</label>
</div>
</div>
@@ -1,45 +1,22 @@
using Microsoft.AspNetCore.Components;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Data;
namespace WebDoorCreator.UI.Components.Filters
{
public partial class OrderFilter
{
[Parameter]
public EventCallback<OrderSelectFilter> FilterUpdated { get; set; }
private List<ListValuesModel>? ListValuesAll = null;
[Parameter]
public OrderSelectFilter actFilter { get; set; } = new OrderSelectFilter();
private List<ListValuesModel>? ListValuesAll = null;
protected override async Task OnParametersSetAsync()
{
ListValuesAll = await WDService.ListValuesGetAll("All", "OrderStep");
}
[Parameter]
public EventCallback<OrderSelectFilter> FilterUpdated { get; set; }
[Inject]
protected WebDoorCreatorService WDService { get; set; } = null!;
private string searchVal
{
get => actFilter.searchValue;
set
{
actFilter.CurrPage = 1;
actFilter.searchValue = value;
StateHasChanged();
ReportChange();
}
}
private int orderStatus
{
get => actFilter.OrderStatus;
set
{
actFilter.CurrPage = 1;
actFilter.OrderStatus = value;
StateHasChanged();
ReportChange();
}
}
private DateTime dateFrom
{
get => actFilter.DateFrom;
@@ -51,6 +28,7 @@ namespace WebDoorCreator.UI.Components.Filters
ReportChange();
}
}
private DateTime dateTo
{
get => actFilter.DateTo;
@@ -63,20 +41,34 @@ namespace WebDoorCreator.UI.Components.Filters
}
}
#if false
private string searchFamily
private int orderStatus
{
get => actFilter.itemFamily;
get => actFilter.OrderStatus;
set
{
actFilter.CurrPage = 1;
actFilter.itemFamily = value;
actFilter.OrderStatus = value;
StateHasChanged();
ReportChange();
}
}
#endif
}
private string searchVal
{
get => actFilter.searchValue;
set
{
actFilter.CurrPage = 1;
actFilter.searchValue = value;
StateHasChanged();
ReportChange();
}
}
protected override async Task OnParametersSetAsync()
{
ListValuesAll = await WDService.ListValuesGetAll("All", "OrderStep");
}
private void ReportChange()
{
FilterUpdated.InvokeAsync(actFilter);
@@ -3,7 +3,7 @@
<b>Web Door Creator @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
</div>
<div class="col-7 ps-0 text-end">
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="~/images/LogoEgw.png" /> Egalware </a>
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
</div>
</div>
@@ -5,7 +5,7 @@
<div class="d-flex justify-content-between w-100 px-4">
<div class="d-flex justify-content-between" style="width: 80%;">
<a class="navbar-brand" href="/">
<img src="/images/DCOlogoCut.png" style="width: 7.5rem;height: 3rem;" />
<img src="images/DCOlogoCut.png" style="width: 7.5rem;height: 3rem;" />
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
@@ -32,12 +32,6 @@
</Authorized>
</AuthorizeView>
</div>
@*<div class="nav-item px-3 d-flex flex-warp align-items-center">
<NavLink class="nav-link" href="DoorDefinition">
<span class="bi bi-door-open-fill pe-3" aria-hidden="true"></span> Door definition page
</NavLink>
</div>*@
</div>
</div>
</div>
@@ -49,7 +43,9 @@
<ul class="dropdown-menu p-2">
<li>
<div class="">
<button href="Identity/Account/Manage" class="btn btn-sm btn-success w-100 fw-bold text-light text-decoration-none text-dark" style="">User options</button>
<NavLink class="nav-link" href="/Identity/Account/Manage">
<button class="btn btn-sm btn-success w-100 fw-bold text-light text-decoration-none text-dark" style="">User options</button>
</NavLink>
</div>
</li>
<li>
@@ -100,41 +96,6 @@
</li>
</ul>
</div>
@*<div class="d-flex justify-content-between small">
<div class="d-flex justify-content-between">
<a href="Identity/Account/Manage" class="text-decoration-none text-dark" style="">@context.User.Identity?.Name</a>
<div class="text-decoration-none text-secondary small" style="">
@if (listCompanies != null)
{
@if (listCompanies.Count > 1)
{
<select @bind="userCurrCompany" class="form-select form-select-sm">
@foreach (var item in listCompanies)
{
<option value="@item.CompanyId">@item.CompanyName</option>
}
</select>
}
else
{
@if (compToShow != null)
{
<div>@compToShow.CompanyName</div>
}
}
}
</div>
<div>
<select @bind="userLang" class="form-select form-select-sm">
<option>EN</option>
<option>IT</option>
</select>
</div>
</div>
<form method="post" action="Identity/Account/LogOut">
<button type="submit" class="btnLogout">Log out</button>
</form>
</div>*@
</div>
</nav>
</Authorized>
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Identity;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Data;
namespace WebDoorCreator.UI.Components.Gen
@@ -4,11 +4,7 @@
@if (HwToShow != null)
{
<div class="row m-0">
<HardwareNewPanel HwInst="getInstNumber(HwToShow.Value)" HwLabel="@HwToShow.Label" E_act2Rel="setRefOnDelete" Lingua="@Lingua" HwCode="@HwToShow.TableName" HwAdded="@hwAdd" DoorId="@DoorId"></HardwareNewPanel>
</div>
<div>
<button class="btn btn-info" @onclick="()=>backToList()">BACK TO LIST</button>
<HardwareNewPanel HwLabel="@HwToShow.Label" E_act2Rel="setRefOnDelete" Lingua="@Lingua" HwCode="@HwToShow.TableName" HwAdded="@hwAdd" DoorId="@DoorId"></HardwareNewPanel>
</div>
}
else
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Data;
namespace WebDoorCreator.UI.Components.Hardware
@@ -21,11 +22,6 @@ namespace WebDoorCreator.UI.Components.Hardware
[CascadingParameter]
public string UserId { get; set; } = "";
#if false
[Parameter]
public bool isDoorOpConf { get; set; }
#endif
#endregion Public Properties
#region Protected Properties
@@ -47,10 +43,19 @@ namespace WebDoorCreator.UI.Components.Hardware
#region Protected Methods
protected async Task backToList()
protected int getInstNumber(string hwCode)
{
await Task.Delay(1);
HwToShow = null;
int answ = 0;
if (DoorOpList != null)
{
answ = DoorOpList
.Where(x => x.ObjectId == hwCode)
.ToList()
.Count();
}
return answ;
}
protected async Task hwToAdd()
@@ -210,6 +215,15 @@ namespace WebDoorCreator.UI.Components.Hardware
return answ;
}
protected async Task setRefOnDelete(bool isDel)
{
if (isDel)
{
HwToShow = null;
await ReloadData();
}
}
//CultureInfo ci = CultureInfo.InstalledUICulture;
protected string translate(string lemma)
{
@@ -246,29 +260,6 @@ namespace WebDoorCreator.UI.Components.Hardware
}
}
protected async Task setRefOnDelete(bool isDel)
{
if (isDel)
{
await ReloadData();
}
}
protected int getInstNumber(string hwCode)
{
int answ = 0;
if (DoorOpList != null)
{
answ = DoorOpList
.Where(x => x.ObjectId == hwCode)
.ToList()
.Count();
}
return answ;
}
#endregion Private Methods
}
}
@@ -6,16 +6,14 @@ else
{
@if (DoorOpList != null)
{
@*<div class="text-center">
<div class="row col-4">
<div class="rectangle">
@(translate(HwLabel))
<div class="circle" @onclick="()=>hwToAdd()"></div>
</div>
<div class="row">
<div class="col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="exeFun" ObjId="RETURN" ItemName="Back to List" ItemCount="0" ShowPlus="false" ImagePath="images/icons/ExitWhite.svg"></HwSvgObj>
</div>
<div class="col-4"></div>
<div class="col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExeFunct="exeFun" ObjId="@HwCode" ItemName="@(translate(HwLabel))" ItemCount="@HwInst" ShowPlus="true" ImagePath="images/icons/PlusWhite.svg"></HwSvgObj>
</div>
</div>*@
<div class="row col-4">
<HwSvgObj LineColor="#CFD8DC" LineWidth="8" ObjH="200" ObjW="700" EC_ExePlus="@(()=> hwToAdd(""))" ObjId="@HwCode" ItemName="@(translate(HwLabel))" ItemCount="@HwInst" ShowPlus="true" ImagePath=""></HwSvgObj>
</div>
<div class="row">
@@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using WebDoorCreator.Data;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.UI.Components.DoorMan;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI.Components.SvgComp;
using WebDoorCreator.UI.Data;
using static WebDoorCreator.UI.Data.WDCRefreshService;
@@ -33,25 +33,95 @@ namespace WebDoorCreator.UI.Components.Hardware
[Parameter]
public string HwLabel { get; set; } = "";
[Parameter]
public int HwInst { get; set; } = 0;
[Parameter]
public string Lingua { get; set; } = "EN";
[CascadingParameter]
public string UserId { get; set; } = "";
protected bool _isDoorOpConf { get; set; } = false;
#endregion Public Properties
#region Public Methods
public void Dispose()
{
WDCRefresh.EA_ConfDoorOp -= WDCRefresh_EA_ConfDoorOp;
}
#endregion Public Methods
#region Protected Properties
protected List<DoorOpModel>? DoorOpList { get; set; } = null!;
protected bool _isDoorOpConf { get; set; } = false;
protected bool B_doorOpUpd
{
get => WDCRService.isDoorOpUpd;
set => WDCRService.isDoorOpUpd = value;
}
protected List<DoorOpModel> DoorOp2ModList { get; set; } = new List<DoorOpModel>();
protected List<DoorOpModel>? DoorOpList { get; set; } = null!;
protected int HwInst
{
get
{
int answ = 0;
if (DoorOpList != null)
{
answ = DoorOpList
.Where(x => x.ObjectId == HwCode)
.ToList()
.Count();
}
return answ;
}
}
//protected int instNum { get; set; } = 1;
protected bool isLoading { get; set; } = false;
protected List<DoorOpModel>? ListRecord { get; set; } = null;
[Inject]
protected WDCRefreshService WDCRefresh { get; set; } = null!;
[Inject]
protected WDCRefreshService WDCRService { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
[Inject]
protected WDCVocabularyService WDVService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task exeFun(HwSvgObj.ActionReq action)
{
await Task.Delay(1);
switch (action)
{
case HwSvgObj.ActionReq.Minus:
// nulla (x ora)
break;
case HwSvgObj.ActionReq.Plus:
await hwToAdd("");
break;
case HwSvgObj.ActionReq.Select:
default:
await E_act2Rel.InvokeAsync(true);
break;
}
}
protected int getDoorOpInstNum(int doorOpId)
{
int answ = 0;
@@ -62,56 +132,6 @@ namespace WebDoorCreator.UI.Components.Hardware
return answ + 1;
}
[Inject]
protected WDCRefreshService WDCRefresh { get; set; } = null!;
[Inject]
protected WebDoorCreatorService WDCService { get; set; } = null!;
[Inject]
protected WDCVocabularyService WDVService { get; set; } = null!;
public void Dispose()
{
WDCRefresh.EA_ConfDoorOp -= WDCRefresh_EA_ConfDoorOp;
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
WDCRefresh.EA_ConfDoorOp += WDCRefresh_EA_ConfDoorOp;
//return base.OnInitializedAsync();
}
protected string translate(string lemma)
{
string answ = "";
answ = WDVService.Traduci(Lingua, lemma);
return answ;
}
private void WDCRefresh_EA_ConfDoorOp(object? sender, EventArgs e)
{
DOPEventArgs currArgs = (DOPEventArgs)e;
// SE sono sula porta indicata + objId corretto --> refresh
if (currArgs.DoorId == DoorId && currArgs.ObjectId == HwCode)
{
var pupd = InvokeAsync(async () => await ReloadData());
}
}
#endregion Protected Properties
#region Protected Methods
protected bool B_doorOpUpd
{
get => WDCRService.isDoorOpUpd;
set => WDCRService.isDoorOpUpd = value;
}
[Inject]
protected WDCRefreshService WDCRService { get; set; } = null!;
protected async Task hwToAdd(string message)
{
await Task.Delay(1);
@@ -236,22 +256,21 @@ namespace WebDoorCreator.UI.Components.Hardware
await Task.Delay(1);
B_doorOpUpd = true;
DoorOp2ModList.Add(currItem);
}
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
WDCRefresh.EA_ConfDoorOp += WDCRefresh_EA_ConfDoorOp;
//return base.OnInitializedAsync();
}
protected override async Task OnParametersSetAsync()
{
await ReloadData();
}
#endregion Protected Methods
#region Private Methods
protected bool isLoading { get; set; } = false;
protected List<DoorOpModel>? ListRecord { get; set; } = null;
protected async Task setRefOnDelete(bool isDel)
{
if (isDel)
@@ -260,6 +279,19 @@ namespace WebDoorCreator.UI.Components.Hardware
}
}
protected string translate(string lemma)
{
string answ = "";
answ = WDVService.Traduci(Lingua, lemma);
return answ;
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
isLoading = true;
@@ -269,17 +301,25 @@ namespace WebDoorCreator.UI.Components.Hardware
DoorOpList = null;
await Task.Delay(1);
ListRecord = await WDCService.DoorOpGetByDoorId(DoorId);
var tempListVal = await WDCService.ListValuesGetAll(HwCode, "Folder");
if (ListRecord != null)
{
DoorOpList = ListRecord.Where(x => (x.DoorId == DoorId) && (x.ObjectId == HwCode)).ToList();
}
isLoading = false;
//await Task.Delay(50);
//await Task.Delay(50);
await InvokeAsync(StateHasChanged);
}
private void WDCRefresh_EA_ConfDoorOp(object? sender, EventArgs e)
{
DOPEventArgs currArgs = (DOPEventArgs)e;
// SE sono sula porta indicata + objId corretto --> refresh
if (currArgs.DoorId == DoorId && currArgs.ObjectId == HwCode)
{
var pupd = InvokeAsync(async () => await ReloadData());
}
}
#endregion Private Methods
}
}

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