diff --git a/Docs/ActualToDo.md b/Docs/ActualToDo.md index 0986f66..0f72171 100644 --- a/Docs/ActualToDo.md +++ b/Docs/ActualToDo.md @@ -2,7 +2,7 @@ ## Framework -Traduzione OVUNQUE x ogni termine/etichetta/button +Traduzione OVUNQUE x ogni termine/etichetta/button.. ## Pagine @@ -17,52 +17,58 @@ Traduzione OVUNQUE x ogni termine/etichetta/button ### Orders Home page Per completare -- aggiunta paginatore -- aggiunta stato ordine -- aggiunta filtri ricerca +- [x] aggiunta paginatore +- [x] aggiunta stato ordine +- [x] aggiunta filtri ricerca - periodo da-a - search generico - stato ordine -- ordinamento +- [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: -- aggiunta button x il cambio stato da end-user -- sistemare con paginatore max 3 righe x 4 porte -- fix button verde add-new + +- [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 -- conteggio num modifiche da salvare -- armonizzare il cancel/save nella pagina -- revisione testata fino al btn del salva generale -- 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) +- [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: -- da implementare davvero lettura pdf (da cartella pdf di esempi) -- fix cancel/save: globale x Hardware oppure x ognuno con icona? -- verificare perché NON si aggiorna al salvataggio pagina dei 18 hw -- mancano il totale componenti x ogni hw attivato +- [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 -Va inserita una lista dei componenti + elenco quote. -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 -- btn effettivi -- dinamico da user-role? -- fix responsive \ No newline at end of file +- [x] btn effettivi +- [x] dinamico da user-role? +- [x] fix responsive \ No newline at end of file diff --git a/Docs/ActualToDo.pdf b/Docs/ActualToDo.pdf index 8eeedec..d82b8a7 100644 Binary files a/Docs/ActualToDo.pdf and b/Docs/ActualToDo.pdf differ diff --git a/WebDoorCreator.Core/Constants.cs b/WebDoorCreator.Core/Constants.cs index 643e707..242f592 100644 --- a/WebDoorCreator.Core/Constants.cs +++ b/WebDoorCreator.Core/Constants.cs @@ -42,6 +42,7 @@ namespace WebDoorCreator.Core 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 rKeyOrderDetail = $"{redisBaseAddr}:Cache:OrderDetail"; public const string rKeyOrderStatus = $"{redisBaseAddr}:Cache:OrderStatus"; public const string rKeyRoles = $"{redisBaseAddr}:Cache:Roles"; diff --git a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs index 1adc767..f95a773 100644 --- a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs +++ b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs @@ -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; @@ -254,6 +252,66 @@ namespace WebDoorCreator.Data.Controllers return fatto; } + /// + /// Delete doorOp instance + /// + /// Record to delete + /// + public async Task 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; + } + + /// + /// Delete doorOp list + /// + /// Record to delete + /// + public async Task DoorOpDeleteRange(List 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; + } + /// /// Retrieving current data from door /// @@ -278,6 +336,7 @@ namespace WebDoorCreator.Data.Controllers } return dbResult; } + /// /// Retrieving current door operations by id /// @@ -295,7 +354,7 @@ namespace WebDoorCreator.Data.Controllers .Where(x => x.DoorOpId == doorOpId) .FirstOrDefault(); - if(temp != null) + if (temp != null) { dbResult = temp; } @@ -333,106 +392,6 @@ namespace WebDoorCreator.Data.Controllers } return fatto; } - /// - /// Update door's OP - /// - /// Records to add - /// - public async Task DoorOpUpdate(List 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; - } - - /// - /// Delete doorOp instance - /// - /// Record to delete - /// - public async Task 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; - } - - /// - /// Delete doorOp list - /// - /// Record to delete - /// - public async Task DoorOpDeleteRange(List 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; - } /// /// Adding a new DoorOpType @@ -534,7 +493,45 @@ namespace WebDoorCreator.Data.Controllers } /// - /// Getting door data by orderId + /// Update door's OP + /// + /// Records to add + /// + public async Task DoorOpUpdate(List 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; + } + + /// + /// Getting door data by numRec /// /// public List DoorsGetByOrderId(int orderId) @@ -563,6 +560,36 @@ namespace WebDoorCreator.Data.Controllers return dbResult; } + /// + /// Getting door list (last numRec) + /// + /// + public List DoorsGetLast(int numRec) + { + List dbResult = new List(); + // 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; + } + /// /// Modifying or adding a new door /// @@ -626,6 +653,47 @@ namespace WebDoorCreator.Data.Controllers return dbResult; } + /// + /// Adding a new list value + /// + /// Record to add + /// + public async Task ListValuesAdd(List 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; + } + /// /// ListValues list (All) /// @@ -640,7 +708,6 @@ namespace WebDoorCreator.Data.Controllers { if (tableName != "*" && fieldName != "*") { - // extracting entire set dbResult = localDbCtx .DbSetValues @@ -673,49 +740,6 @@ namespace WebDoorCreator.Data.Controllers return dbResult; } - /// - /// Adding a new list value - /// - /// Record to add - /// - public async Task ListValuesAdd(List 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; - } - /// /// Adding a new order /// @@ -742,40 +766,6 @@ namespace WebDoorCreator.Data.Controllers return fatto; } - /// - /// Updating an order status - /// - /// - /// - /// - public async Task 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; - } - /// /// Remove order /// @@ -841,6 +831,40 @@ namespace WebDoorCreator.Data.Controllers return dbResult; } + /// + /// Updating an order status + /// + /// + /// + /// + public async Task 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; + } + /// /// Adding a new graphic param /// @@ -1051,6 +1075,7 @@ namespace WebDoorCreator.Data.Controllers } return dbResult; } + public Dictionary> VocLemmaGetAll() { Dictionary> DTOResult = new Dictionary>(); diff --git a/WebDoorCreator.Data/Services/QueueDataService.cs b/WebDoorCreator.Data/Services/QueueDataService.cs index 55cca09..4af7007 100644 --- a/WebDoorCreator.Data/Services/QueueDataService.cs +++ b/WebDoorCreator.Data/Services/QueueDataService.cs @@ -171,6 +171,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; } diff --git a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs index e3f32d9..f1fc27a 100644 --- a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs +++ b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs @@ -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,28 @@ namespace WebDoorCreator.UI.Components.Buttons [CascadingParameter] public bool IsErr { get; set; } = false; + + #endregion Public Properties + + #region Public Methods + + 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 Public Methods + + #region Protected Properties + protected Dictionary a { get; set; } = new Dictionary(); protected bool change @@ -62,20 +85,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 /// /// Effettua Richiesta visione porta 3D @@ -117,7 +133,7 @@ namespace WebDoorCreator.UI.Components.Buttons // versione corrente del DDF generato int currVers = await QDataServ.SendCalcReq(idDoor, currDdf); - if(currVers > 0) + if (currVers > 0) { IsErr = false; } @@ -150,6 +166,11 @@ namespace WebDoorCreator.UI.Components.Buttons await Task.Delay(1); NavManager.NavigateTo($"OrderDetails?idOrd={idOrd}"); } + + #endregion Protected Methods + + #region Private Methods + private async void WDCRService_EA_UpdDoorOp() { await InvokeAsync(() => @@ -157,5 +178,7 @@ namespace WebDoorCreator.UI.Components.Buttons StateHasChanged(); }); } + + #endregion Private Methods } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor b/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor index 32d0c15..95dbb6c 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor @@ -2,6 +2,9 @@ {
+ +
+
@*
Insert Date
*@
Insert Date: @currOrderStatus.DateIns
diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor.cs b/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor.cs index f7ec723..56356c8 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor.cs +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor.cs @@ -1,15 +1,66 @@ using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; using WebDoorCreator.Data.DbModels; +using WebDoorCreator.UI.Data; 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; } = ""; + [CascadingParameter] + public int idDoor { get; set; } = 0; + + [Parameter] + public OrderStatusViewModel? currOrderStatus { get; set; } = null; + + #endregion Public Properties + + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + + [Inject] + protected WebDoorCreatorService WDCService { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Elimina porta se richiesto + /// + /// + protected async Task deleteRecord() + { + if (!await JSRuntime.InvokeAsync("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 } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor b/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor index 44fe0d6..58c8a4d 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor +++ b/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor @@ -1,12 +1,12 @@ -
- @*@if (IsErr) - { - @*
@ErrCode
- }*@ +@*
*@ +
@if (!string.IsNullOrEmpty(@SvgContent)) { -
- @svgPreview + @*
*@ +
+
+ @svgPreview +
}
\ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor index d3ea635..8bfc991 100644 --- a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor +++ b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor @@ -10,7 +10,7 @@
- +
} diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs index 29ef427..6087222 100644 --- a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs +++ b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs @@ -73,7 +73,7 @@ namespace WebDoorCreator.UI.Components.DoorMan protected async Task editRec(string doorId) { await Task.Delay(1); - NavManager.NavigateTo($"/DoorDefinition?idOrd={currOrderId}&idDoor={int.Parse(doorId)}"); + NavManager.NavigateTo($"DoorDefinition?idOrd={currOrderId}&idDoor={int.Parse(doorId)}"); } protected async Task getBackStatus() @@ -111,9 +111,9 @@ namespace WebDoorCreator.UI.Components.DoorMan { AddFromTemplDict.Add("ADD NEW DOOR FROM TEMPLATE", ""); } - if (!SendOrderDict.ContainsKey("SEND TO ABH")) + if (!SendOrderDict.ContainsKey("SEND TO DCA")) { - SendOrderDict.Add("SEND TO ABH", ""); + SendOrderDict.Add("SEND TO DCA", ""); } if (currOrderId != -1) { @@ -147,8 +147,8 @@ namespace WebDoorCreator.UI.Components.DoorMan protected Dictionary textDictSetup(DoorModel door) { Dictionary answ = new Dictionary(); - answ.Add("Doors N°:", $"{door.Quantity}"); - answ.Add("Model N°:", $"{door.TypeNav?.TypeId}"); + answ.Add("Doors N�:", $"{door.Quantity}"); + answ.Add("Model N�:", $"{door.TypeNav?.TypeId}"); answ.Add("DoorPrice:", $"{(door.Quantity * door.UnitCost):C2}"); return answ; } @@ -176,7 +176,7 @@ namespace WebDoorCreator.UI.Components.DoorMan } // rimando alla pagina... dettaglio... - NavManager.NavigateTo($"/DoorDefinition?idOrd={currOrderId}&idDoor={doorId}"); + NavManager.NavigateTo($"DoorDefinition?idOrd={currOrderId}&idDoor={doorId}"); } /// /// Path del servizio di recupero SVG delle porte @@ -245,7 +245,7 @@ namespace WebDoorCreator.UI.Components.DoorMan } } } - protected async void sendToAbh(int ordId, int orderStat) + protected async void sendToCompany(int ordId, int orderStat) { if (orderStat == 10) { diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor index 4634d75..7a44d62 100644 --- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor +++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor @@ -5,7 +5,7 @@
- + +
} else diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs index afa1bf9..ec055cf 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs @@ -47,12 +47,6 @@ namespace WebDoorCreator.UI.Components.Hardware #region Protected Methods - protected async Task backToList() - { - await Task.Delay(1); - HwToShow = null; - } - protected async Task hwToAdd() { await Task.Delay(1); @@ -250,6 +244,7 @@ namespace WebDoorCreator.UI.Components.Hardware { if (isDel) { + HwToShow = null; await ReloadData(); } } diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor index 432ff66..313dd5a 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor +++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor @@ -6,16 +6,14 @@ else { @if (DoorOpList != null) { - @*
-
-
- @(translate(HwLabel)) -
-
+
+
+ +
+
+
+
-
*@ -
-
diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs index d145ebd..8fcc296 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs @@ -1,8 +1,7 @@ using Microsoft.AspNetCore.Components; using Newtonsoft.Json; -using WebDoorCreator.Data; using WebDoorCreator.Data.DbModels; -using WebDoorCreator.UI.Components.DoorMan; +using WebDoorCreator.UI.Components.SvgComp; using WebDoorCreator.UI.Data; using static WebDoorCreator.UI.Data.WDCRefreshService; @@ -33,25 +32,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? DoorOpList { get; set; } = null!; + protected bool _isDoorOpConf { get; set; } = false; + + protected bool B_doorOpUpd + { + get => WDCRService.isDoorOpUpd; + set => WDCRService.isDoorOpUpd = value; + } + protected List DoorOp2ModList { get; set; } = new List(); + protected List? 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? 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 +131,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 +255,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? ListRecord { get; set; } = null; - protected async Task setRefOnDelete(bool isDel) { if (isDel) @@ -260,6 +278,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 +300,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 - - } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor index bcdd3f8..38ebac5 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor +++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor @@ -1,7 +1,7 @@  -
+
@ItemName
@@ -29,16 +29,16 @@ @if (ShowPlus) { - + } @if (ShowPlus) { - + } else { - + } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs index 40ad5ef..f974d42 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs +++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs @@ -1,47 +1,39 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using WebDoorCreator.UI; -using WebDoorCreator.UI.Components; -using WebDoorCreator.UI.Components.Buttons; -using WebDoorCreator.UI.Components.CompMan; -using WebDoorCreator.UI.Components.DoorMan; -using WebDoorCreator.UI.Components.DoorDef; -using WebDoorCreator.UI.Components.Gen; -using WebDoorCreator.UI.Components.Order; -using WebDoorCreator.UI.Components.Users; -using WebDoorCreator.UI.Components.Hardware; -using WebDoorCreator.UI.Components.SvgComp; -using WebDoorCreator.UI.Components.Filters; -using WebDoorCreator.UI.Components.Report; -using WebDoorCreator.UI.Shared; -using WebDoorCreator.Data.DbModels; -using EgwCoreLib.Razor; namespace WebDoorCreator.UI.Components.SvgComp { public partial class HwSvgObj { + #region Public Enums + + /// + /// Enum delle azioni associate al controllo + /// + public enum ActionReq + { + Minus, + Plus, + Select + } + + #endregion Public Enums + #region Public Properties [Parameter] - public EventCallback EC_ExeFunct { get; set; } + public EventCallback EC_ExeFunct { get; set; } + + /// + /// Path img da mostrare + /// + [Parameter] + public string ImagePath { get; set; } = ""; [Parameter] - public EventCallback EC_ExePlus { get; set; } + public int ItemCount { get; set; } = 0; [Parameter] - public string ImagePath { get; set; } = "images/LogoEgw.png"; + public string ItemName { get; set; } = ""; [Parameter] public string LineColor { get; set; } = "#00838F"; @@ -49,16 +41,6 @@ namespace WebDoorCreator.UI.Components.SvgComp [Parameter] public int LineWidth { get; set; } = 8; - [Parameter] - public string ItemName { get; set; } = ""; - - [Parameter] - public int ItemCount { get; set; } = 0; - - - [Parameter] - public string PlusColor { get; set; } = "green"; - [Parameter] public int ObjH { get; set; } = 204; @@ -68,6 +50,9 @@ namespace WebDoorCreator.UI.Components.SvgComp [Parameter] public int ObjW { get; set; } = 450; + [Parameter] + public string PlusColor { get; set; } = "#69FF69"; + [Parameter] public bool ShowPlus { get; set; } = false; @@ -78,6 +63,10 @@ namespace WebDoorCreator.UI.Components.SvgComp #region Protected Properties + protected string cardClass + { + get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark"; + } protected CircleData CircleImg { get; set; } = null!; @@ -95,11 +84,6 @@ namespace WebDoorCreator.UI.Components.SvgComp get => ObjW - (ObjH * 90 / 100); } - protected string cardClass - { - get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark"; - } - #endregion Protected Properties #region Protected Methods @@ -107,20 +91,19 @@ namespace WebDoorCreator.UI.Components.SvgComp /// /// Invia evento principale /// - /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo... - protected void execFunc(bool forceSend) + /// Azione richiesta + /// + /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo... + /// + protected void doExecFunc(ActionReq action, bool forceSend) { + // invia la chiamata richiesta secondo configurazione... if (forceSend || !ShowPlus) { - EC_ExeFunct.InvokeAsync(true); + EC_ExeFunct.InvokeAsync(action); } } - protected void execPlus() - { - EC_ExePlus.InvokeAsync(true); - } - protected override void OnParametersSet() { setupGraphParams(); diff --git a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs index 5fa7afb..54f14e1 100644 --- a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs +++ b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs @@ -212,7 +212,7 @@ namespace WebDoorCreator.UI.Data TableName = "All", FieldName = "OrderStep", Value = "20", - Label = "Sent to ABH", + Label = "Sent to DCA", Ordinal = 20, DefaultVal = "#FBC02D", InputType = "" @@ -597,7 +597,47 @@ namespace WebDoorCreator.UI.Data } /// - /// Doors list by orderId + /// Doors list, last in desc order + /// + public async Task?> DoorGetLast(int numRec) + { + string source = "DB"; + List? dbResult = new List(); + // cerco da cache + string currKey = $"{Constants.rKeyDoorLast}:{numRec}"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string? rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbController.DoorsGetLast(numRec); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, FastCache); + } + if (dbResult == null) + { + dbResult = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"DoorGetLast | {source} in: {ts.TotalMilliseconds} ms"); + return dbResult; + } + /// + /// Doors list by numRec /// public async Task?> DoorGetByOrderId(int orderId) { @@ -720,7 +760,7 @@ namespace WebDoorCreator.UI.Data } /// - /// Doors list by orderId + /// Doors list by numRec /// public async Task> DoorOpGetByDoorId(int doorId) { @@ -760,7 +800,7 @@ namespace WebDoorCreator.UI.Data return dbResult; } /// - /// Doors list by orderId + /// Doors list by numRec /// public async Task DoorOpGetById(int doorOpId) { @@ -906,7 +946,7 @@ namespace WebDoorCreator.UI.Data { // cerco il setup del template selezionato var listRecordTmp = await ListValuesGetAll(currDoorOp.ObjectId, "template"); - if (listRecordTmp != null && actDict.ContainsKey("Folder") && (actDict.ContainsKey("template") || actDict.ContainsKey("shape")) ) + if (listRecordTmp != null && actDict.ContainsKey("Folder") && (actDict.ContainsKey("template") || actDict.ContainsKey("shape"))) { string actKey = actDict["template"];// Path.Combine(actDict["Folder"], actDict["template"]); var firstTemplate = listRecordTmp.Where(x => x.Value == actKey).FirstOrDefault(); @@ -962,7 +1002,7 @@ namespace WebDoorCreator.UI.Data } /// - /// Doors list by orderId + /// Doors list by numRec /// public async Task?> DoorOpTypeGetAll() { @@ -1365,7 +1405,9 @@ namespace WebDoorCreator.UI.Data } else { - dbResult = dbController.OrderStatusGetAll(companyId, orderStatus, dataFrom, dataTo); + var rawResult = dbController.OrderStatusGetAll(companyId, orderStatus, dataFrom, dataTo); + // ordino desc in ram... + dbResult = rawResult.OrderByDescending(x => x.OrderId).ToList(); rawData = JsonConvert.SerializeObject(dbResult, JSSettings); await redisDb.StringSetAsync(currKey, rawData, UltraLongCache); } diff --git a/WebDoorCreator.UI/Pages/ApprovedByAbh.razor b/WebDoorCreator.UI/Pages/ApprovedByAbh.razor deleted file mode 100644 index 178a40e..0000000 --- a/WebDoorCreator.UI/Pages/ApprovedByAbh.razor +++ /dev/null @@ -1,9 +0,0 @@ -@page "/abhapprove" - -

Approved by ABH

- - - -@code { - -} diff --git a/WebDoorCreator.UI/Pages/ApprovedByCompany.razor b/WebDoorCreator.UI/Pages/ApprovedByCompany.razor new file mode 100644 index 0000000..025c5ea --- /dev/null +++ b/WebDoorCreator.UI/Pages/ApprovedByCompany.razor @@ -0,0 +1,9 @@ +@page "/ApprovedByCompany" + +

Approved by DCA

+ + + +@code { + +} diff --git a/WebDoorCreator.UI/Pages/Definingdoorsstage.razor b/WebDoorCreator.UI/Pages/Definingdoorsstage.razor deleted file mode 100644 index ada5ab0..0000000 --- a/WebDoorCreator.UI/Pages/Definingdoorsstage.razor +++ /dev/null @@ -1,9 +0,0 @@ -@page "/senttoabh" - -

Sent to ABH

- - - -@code { - -} diff --git a/WebDoorCreator.UI/Pages/Senttoabh.razor b/WebDoorCreator.UI/Pages/DefinitionDoorStage.razor similarity index 74% rename from WebDoorCreator.UI/Pages/Senttoabh.razor rename to WebDoorCreator.UI/Pages/DefinitionDoorStage.razor index 8b58806..c991bd0 100644 --- a/WebDoorCreator.UI/Pages/Senttoabh.razor +++ b/WebDoorCreator.UI/Pages/DefinitionDoorStage.razor @@ -1,4 +1,4 @@ -@page "/definingdoorsstage" +@page "/DefinitionDoorStage"

Order definition stage

diff --git a/WebDoorCreator.UI/Pages/DoorDefinition.razor b/WebDoorCreator.UI/Pages/DoorDefinition.razor index ea8fbe5..c914932 100644 --- a/WebDoorCreator.UI/Pages/DoorDefinition.razor +++ b/WebDoorCreator.UI/Pages/DoorDefinition.razor @@ -18,11 +18,11 @@
-
+
-
+
@if (currDefStep == 10) { @@ -44,7 +44,7 @@
-
+
diff --git a/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs b/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs index 2850271..49157bd 100644 --- a/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs +++ b/WebDoorCreator.UI/Pages/DoorDefinition.razor.cs @@ -6,7 +6,6 @@ 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 { @@ -34,6 +33,7 @@ namespace WebDoorCreator.UI.Pages protected int idOrd { get; set; } = 0; + protected bool isDoorOpConf { get; set; } = false; protected bool IsErr { get; set; } = false; [Inject] @@ -50,7 +50,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 +74,6 @@ namespace WebDoorCreator.UI.Pages }); } - /// /// gestione rilettura info /// @@ -101,13 +99,13 @@ namespace WebDoorCreator.UI.Pages } userLang = WDCUService.currLanguage ?? "EN"; #if false - isDoorOpConf = WDCRService.isDoorOpConf; + isDoorOpConf = WDCRService.isDoorOpConf; #endif 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; + WDCRService.EA_ConfDoorOp += WDService_EA_DoorOpConfirmed; #endif } @@ -215,8 +213,6 @@ namespace WebDoorCreator.UI.Pages //if (string.IsNullOrEmpty(DoorSvgContent)) //{ - - //} await Task.Run(async () => await InvokeAsync(StateHasChanged)); } @@ -235,14 +231,14 @@ namespace WebDoorCreator.UI.Pages StateHasChanged(); } + #endregion Private Methods + #if false private void WDService_EA_DoorOpConfirmed() { isDoorOpConf = WDCRService.isDoorOpConf; StateHasChanged(); - } + } #endif - - #endregion Private Methods } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrderDetails.razor.cs b/WebDoorCreator.UI/Pages/OrderDetails.razor.cs index ed56961..98dc1db 100644 --- a/WebDoorCreator.UI/Pages/OrderDetails.razor.cs +++ b/WebDoorCreator.UI/Pages/OrderDetails.razor.cs @@ -31,7 +31,7 @@ namespace WebDoorCreator.UI.Pages protected OrderStatusViewModel? orderView { get; set; } = null; /// - /// Unità di misura selezionata + /// Unit� di misura selezionata /// protected string currMeaUnit { get; set; } = "mm"; @@ -67,7 +67,7 @@ namespace WebDoorCreator.UI.Pages } // rimando alla pagina... dettaglio... - NavManager.NavigateTo($"/DoorDefinition?idOrd={idOrd}&idDoor={doorId}"); + NavManager.NavigateTo($"DoorDefinition?idOrd={idOrd}&idDoor={doorId}"); } diff --git a/WebDoorCreator.UI/Pages/OrderDetails.razor.css b/WebDoorCreator.UI/Pages/OrderDetails.razor.css index 0860454..df99745 100644 --- a/WebDoorCreator.UI/Pages/OrderDetails.razor.css +++ b/WebDoorCreator.UI/Pages/OrderDetails.razor.css @@ -5,12 +5,19 @@ padding: 1rem 4rem 4.5rem 4rem; } .cardDoors { + /*width: 100%; + //transform: translate(0, -53px); + border-radius: 60px 60px 0 0; + transform: translate(0, -120px); + background-color: #FFF; + padding: 0; + box-shadow: rgba(0, 0, 0, 0.45) 0px -24px 27px -20px;*/ width: 100%; - border-radius: 60px 60px 0 0; + border-radius: 60px; transform: translate(0, -120px); - background-color: #FFF; padding: 0; - box-shadow: rgba(0, 0, 0, 0.45) 0px -24px 27px -20px; + background-color: #FFF; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px -2px; } .testataOrder { border: 3px solid var(--bgStepColor); diff --git a/WebDoorCreator.UI/Pages/OrderDetails.razor.less b/WebDoorCreator.UI/Pages/OrderDetails.razor.less index 5285602..c797eb9 100644 --- a/WebDoorCreator.UI/Pages/OrderDetails.razor.less +++ b/WebDoorCreator.UI/Pages/OrderDetails.razor.less @@ -6,13 +6,21 @@ } .cardDoors { - width: 100%; + /*width: 100%; //transform: translate(0, -53px); border-radius: 60px 60px 0 0; transform: translate(0, -120px); background-color: #FFF; padding: 0; - box-shadow: rgba(0, 0, 0, 0.45) 0px -24px 27px -20px; + box-shadow: rgba(0, 0, 0, 0.45) 0px -24px 27px -20px;*/ + + + width: 100%; + border-radius: 60px; + transform: translate(0, -120px); + padding: 0; + background-color: #FFF; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px -2px; } .testataOrder { diff --git a/WebDoorCreator.UI/Pages/OrderDetails.razor.min.css b/WebDoorCreator.UI/Pages/OrderDetails.razor.min.css index e27cb9d..cdbd292 100644 --- a/WebDoorCreator.UI/Pages/OrderDetails.razor.min.css +++ b/WebDoorCreator.UI/Pages/OrderDetails.razor.min.css @@ -1 +1 @@ -.cardStatus{border-radius:60px;background-color:var(--bgStepColor);transform:translate(0,-65px);padding:1rem 4rem 4.5rem 4rem;}.cardDoors{width:100%;border-radius:60px 60px 0 0;transform:translate(0,-120px);background-color:#fff;padding:0;box-shadow:rgba(0,0,0,.45) 0 -24px 27px -20px;}.testataOrder{border:3px solid var(--bgStepColor);padding:1rem 1rem 4.5rem 1rem;border-radius:60px 60px 20px 20px;transform:translate(63px,0);width:93%;z-index:-99999;position:relative;font-size:17px;background-color:#031926;} \ No newline at end of file +.cardStatus{border-radius:60px;background-color:var(--bgStepColor);transform:translate(0,-65px);padding:1rem 4rem 4.5rem 4rem;}.cardDoors{width:100%;border-radius:60px;transform:translate(0,-120px);padding:0;background-color:#fff;box-shadow:rgba(0,0,0,.45) 0 20px 22px -2px;}.testataOrder{border:3px solid var(--bgStepColor);padding:1rem 1rem 4.5rem 1rem;border-radius:60px 60px 20px 20px;transform:translate(63px,0);width:93%;z-index:-99999;position:relative;font-size:17px;background-color:#031926;} \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor b/WebDoorCreator.UI/Pages/OrdersHomePage.razor index c5b3b93..be6aaea 100644 --- a/WebDoorCreator.UI/Pages/OrdersHomePage.razor +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor @@ -3,7 +3,7 @@ -
+
WEB DOOR CREATOR diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.cs b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.cs index 6174ee7..362c884 100644 --- a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.cs +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.cs @@ -178,7 +178,7 @@ namespace WebDoorCreator.UI.Pages await Task.Delay(1); currOrderId = orderId; await ReloadData(); - goToDefPage = $"/DoorDefinition?idOrd={orderId}"; + goToDefPage = $"DoorDefinition?idOrd={orderId}"; } protected async Task catchDoorChange(bool isChanged) diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css new file mode 100644 index 0000000..06db017 --- /dev/null +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.css @@ -0,0 +1,9 @@ +.cardOrders { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + /*box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px -9px;*/ + margin-top: 0.5rem; + margin-bottom: 1rem; +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less new file mode 100644 index 0000000..e2da35d --- /dev/null +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.less @@ -0,0 +1,9 @@ +.cardOrders { + width: 100%; + border-radius: 18px; + padding: 1rem 4rem 0.5rem 4rem; + box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px 3px; + /*box-shadow: rgba(0, 0, 0, 0.45) 0px 20px 22px -9px;*/ + margin-top: 0.5rem; + margin-bottom: 1rem; +} diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor.min.css b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.min.css new file mode 100644 index 0000000..ab146ca --- /dev/null +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor.min.css @@ -0,0 +1 @@ +.cardOrders{width:100%;border-radius:18px;padding:1rem 4rem .5rem 4rem;box-shadow:rgba(0,0,0,.45) 0 20px 22px 3px;margin-top:.5rem;margin-bottom:1rem;} \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/SentToCompany.razor b/WebDoorCreator.UI/Pages/SentToCompany.razor new file mode 100644 index 0000000..10396e3 --- /dev/null +++ b/WebDoorCreator.UI/Pages/SentToCompany.razor @@ -0,0 +1,9 @@ +@page "/SentToCompany" + +

Sent to DCA

+ + + +@code { + +} diff --git a/WebDoorCreator.UI/Pages/TestPage.razor b/WebDoorCreator.UI/Pages/TestPage.razor index e2fcaca..963a443 100644 --- a/WebDoorCreator.UI/Pages/TestPage.razor +++ b/WebDoorCreator.UI/Pages/TestPage.razor @@ -1,6 +1,9 @@ @using WebDoorCreator.UI.Components.SvgComp +@using WebDoorCreator.UI.Data @page "/TestPage" +@inject WebDoorCreatorService WDCService +

TestPage

@@ -18,34 +21,49 @@
- +
- +
-
- +
+
-
+
+
-
- +
+ +
+
+
- @for (int i = 183; i < 205; i++) + @if (DoorsList == null) { -
- @i
- -
+ + } + else + { + foreach (var door in DoorsList) + { + + @*} + for (int i = 183; i < 220; i++) + {*@ +
+ @door.DoorId
+ +
+ } }
@@ -80,15 +98,22 @@ protected Dictionary msgList = new Dictionary(); - protected override void OnInitialized() + protected override async Task OnInitializedAsync() { msgList = new Dictionary(); msgList.Add("T1", "Titolo"); msgList.Add("M1", "Messaggio 1"); msgList.Add("M2", "MEssaggio 2"); + DoorsList = await WDCService.DoorGetLast(100); } - protected async Task exeFun() + protected List? DoorsList { get; set; } = null; + + protected async Task exeDoor() + { + await Task.Delay(1); + } + protected async Task exeFun(HwSvgObj.ActionReq action) { await Task.Delay(1); } diff --git a/WebDoorCreator.UI/Program.cs b/WebDoorCreator.UI/Program.cs index b4141ca..1d47488 100644 --- a/WebDoorCreator.UI/Program.cs +++ b/WebDoorCreator.UI/Program.cs @@ -62,6 +62,10 @@ builder.Services.AddBlazoredLocalStorage(); builder.Services.AddBlazoredSessionStorage(); var app = builder.Build(); +// aggiunt base URL x routing corretto +//app.UsePathBase("/WDC/UI"); +app.UsePathBase(configuration["RumtimeOpt:BaseUrl"]); + // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { diff --git a/WebDoorCreator.UI/Properties/launchSettings.json b/WebDoorCreator.UI/Properties/launchSettings.json index 8a3d8d8..544b3f4 100644 --- a/WebDoorCreator.UI/Properties/launchSettings.json +++ b/WebDoorCreator.UI/Properties/launchSettings.json @@ -1,28 +1,30 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:38024", - "sslPort": 44365 - } - }, - "profiles": { - "WebDoorCreator.UI": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "https://localhost:7196;http://localhost:5013", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:38024", + "launchUrl": "https://localhost:38024", + "sslPort": 44365 + } }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "profiles": { + "WebDoorCreator.UI": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7196;http://localhost:5013", + "launchUrl": "https://localhost:7196", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } } - } -} +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Shared/LoginDisplay.razor b/WebDoorCreator.UI/Shared/LoginDisplay.razor index 9bf38dd..1b3b244 100644 --- a/WebDoorCreator.UI/Shared/LoginDisplay.razor +++ b/WebDoorCreator.UI/Shared/LoginDisplay.razor @@ -1,96 +1,95 @@ - -@* +@* *@ -
- @if (NavManager.Uri.Contains("DoorDefinition")) - { - - - - - - - } - else if (NavManager.Uri.Contains("OrdersHomePage")) - { - - - - - - - - - } + +@* *@ - @if (!NavManager.Uri.Contains("Register") || !NavManager.Uri.Contains("Login")) - { - Register - Log in - } - @* +@if (!NavManager.Uri.Contains("Register") || !NavManager.Uri.Contains("Login")) +{ + Register + Log in +} +@* *@ diff --git a/WebDoorCreator.UI/appsettings.Production.json b/WebDoorCreator.UI/appsettings.Production.json new file mode 100644 index 0000000..5e4b2ce --- /dev/null +++ b/WebDoorCreator.UI/appsettings.Production.json @@ -0,0 +1,13 @@ +{ + "DetailedErrors": true, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "RumtimeOpt": { + "MaxDayCalcCache": 7, + "BaseUrl": "/WDC/UI" + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/appsettings.Staging.json b/WebDoorCreator.UI/appsettings.Staging.json new file mode 100644 index 0000000..5e4b2ce --- /dev/null +++ b/WebDoorCreator.UI/appsettings.Staging.json @@ -0,0 +1,13 @@ +{ + "DetailedErrors": true, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "RumtimeOpt": { + "MaxDayCalcCache": 7, + "BaseUrl": "/WDC/UI" + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/appsettings.json b/WebDoorCreator.UI/appsettings.json index f3b6956..5355d74 100644 --- a/WebDoorCreator.UI/appsettings.json +++ b/WebDoorCreator.UI/appsettings.json @@ -1,47 +1,48 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "Identity.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;", + "Redis": "nkcredis.steamware.net:6379, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG", + "WDC.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;" + }, + "ExternalProviders": { + "MailKit": { + "SMTP": { + "Address": "smtp-mail.outlook.com", + "Port": "587", + "Account": "steamwarebot@outlook.it", + "Password": "siamoInViaNazionale93", + "SenderEmail": "steamwarebot@outlook.it", + "SenderName": "Steamware Email BOT" + } + } + }, + "SetupOpt": { + "DisableIdentMigrate": true, + "DisableWDCMigrate": true + }, + "RumtimeOpt": { + "MaxDayCalcCache": 7, + "BaseUrl": "/WDC/UI" + }, + "ConfDDF": { + "Header": [ + "#WEBDOORCREATOR", + "#Config: EgtCompoBase", + "#Door1", + "" + ], + "Footer": [ + "", + "---" + ], + "VersNumber": "2", + "RemoveDoorOps": true } - }, - "AllowedHosts": "*", - "ConnectionStrings": { - "Identity.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;", - "Redis": "nkcredis.steamware.net:6379, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, password=BtN9Py1wtLfLRvmzWnOPJ7RytDM+CLiVsJ/16zduNTlV8IOPGNrtzJSXPUnImA5PqmUMhKaUqo9NdHIG", - "WDC.DB": "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.UI;" - }, - "ExternalProviders": { - "MailKit": { - "SMTP": { - "Address": "smtp-mail.outlook.com", - "Port": "587", - "Account": "steamwarebot@outlook.it", - "Password": "siamoInViaNazionale93", - "SenderEmail": "steamwarebot@outlook.it", - "SenderName": "Steamware Email BOT" - } - } - }, - "SetupOpt": { - "DisableIdentMigrate": true, - "DisableWDCMigrate": true - }, - "RumtimeOpt": { - "MaxDayCalcCache": 7 - }, - "ConfDDF": { - "Header": [ - "#WEBDOORCREATOR", - "#Config: EgtCompoBase", - "#Door1", - "" - ], - "Footer": [ - "", - "---" - ], - "VersNumber": "2", - "RemoveDoorOps": true - } } \ No newline at end of file diff --git a/WebDoorCreator.UI/compilerconfig.json b/WebDoorCreator.UI/compilerconfig.json index b299ce6..80aced5 100644 --- a/WebDoorCreator.UI/compilerconfig.json +++ b/WebDoorCreator.UI/compilerconfig.json @@ -78,5 +78,9 @@ { "outputFile": "Components/SvgComp/HwSvgObj.razor.css", "inputFile": "Components/SvgComp/HwSvgObj.razor.less" + }, + { + "outputFile": "Pages/OrdersHomePage.razor.css", + "inputFile": "Pages/OrdersHomePage.razor.less" } ] \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/Approved_by_ABH.png b/WebDoorCreator.UI/wwwroot/images/Approved_by_DCA.png similarity index 100% rename from WebDoorCreator.UI/wwwroot/images/Approved_by_ABH.png rename to WebDoorCreator.UI/wwwroot/images/Approved_by_DCA.png diff --git a/WebDoorCreator.UI/wwwroot/images/MissingGray.svg b/WebDoorCreator.UI/wwwroot/images/MissingGray.svg new file mode 100644 index 0000000..830e2f2 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/MissingGray.svg @@ -0,0 +1,59 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/WebDoorCreator.UI/wwwroot/images/MissingOrange.svg b/WebDoorCreator.UI/wwwroot/images/MissingOrange.svg new file mode 100644 index 0000000..88cdfd4 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/MissingOrange.svg @@ -0,0 +1,59 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/WebDoorCreator.UI/wwwroot/images/Sent_to_ABH.png b/WebDoorCreator.UI/wwwroot/images/Sent_to_DCA.png similarity index 100% rename from WebDoorCreator.UI/wwwroot/images/Sent_to_ABH.png rename to WebDoorCreator.UI/wwwroot/images/Sent_to_DCA.png diff --git a/WebDoorCreator.UI/wwwroot/images/icons/Exit.svg b/WebDoorCreator.UI/wwwroot/images/icons/Exit.svg new file mode 100644 index 0000000..229ea09 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/Exit.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/icons/ExitWhite.svg b/WebDoorCreator.UI/wwwroot/images/icons/ExitWhite.svg new file mode 100644 index 0000000..00771c0 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/ExitWhite.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/icons/Plus.svg b/WebDoorCreator.UI/wwwroot/images/icons/Plus.svg new file mode 100644 index 0000000..958c8c1 --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/Plus.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WebDoorCreator.UI/wwwroot/images/icons/PlusWhite.svg b/WebDoorCreator.UI/wwwroot/images/icons/PlusWhite.svg new file mode 100644 index 0000000..add741d --- /dev/null +++ b/WebDoorCreator.UI/wwwroot/images/icons/PlusWhite.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file