diff --git a/Docs/ActualToDo.md b/Docs/ActualToDo.md index b822ad1..0986f66 100644 --- a/Docs/ActualToDo.md +++ b/Docs/ActualToDo.md @@ -19,40 +19,42 @@ Traduzione OVUNQUE x ogni termine/etichetta/button Per completare - aggiunta paginatore - aggiunta stato ordine -- aggiunta filtri ricerca - - periodo da-a - - search generico - - stato ordine +- aggiunta filtri ricerca + - periodo da-a + - search generico + - stato ordine - ordinamento ### DCA Order Man -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 apgina operativa... +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 -- 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: - - 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) +- aggiunta button x il cambio stato da end-user +- sistemare con paginatore max 3 righe x 4 porte +- fix button verde add-new -### DoorDefinition +### 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: + - 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) + +### DoorDefinition Hardware Sistemare: -- da implementare davvero lettura pdf (da cartella pdf di esempi) -- fix cancel/save: globale x Hardware oppure x ognuno con icona? +- 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 +- mancano il totale componenti x ogni hw attivato #### Report -Va inserita una lista dei componenti + elenco quote +Va inserita una lista dei componenti + elenco quote. Va pensato esportabile in pdf, comprensivo di "check pdf fatto da tizio alle ..." @@ -61,6 +63,6 @@ Va pensato esportabile in pdf, comprensivo di "check pdf fatto da tizio alle ... ### Top Da sistemare -- btn effettivi -- dinamico da user-role? -- fix responsive \ No newline at end of file +- btn effettivi +- dinamico da user-role? +- fix responsive \ No newline at end of file diff --git a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs index 3273630..0ed3090 100644 --- a/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs +++ b/WebDoorCreator.Data/Controllers/WebDoorCreatorController.cs @@ -278,6 +278,35 @@ namespace WebDoorCreator.Data.Controllers } return dbResult; } + /// + /// Retrieving current door operations by id + /// + /// + public DoorOpModel DoorOpGetById(int doorOpId) + { + DoorOpModel dbResult = new DoorOpModel(); + using (WDCDataContext localDbCtx = new WDCDataContext(_configuration)) + { + try + { + // extracting entire set + var temp = localDbCtx + .DbSetDoorOp + .Where(x => x.DoorOpId == doorOpId) + .FirstOrDefault(); + + if(temp != null) + { + dbResult = temp; + } + } + catch (Exception exc) + { + Log.Error($"Error in DoorOpGetById:{Environment.NewLine}{exc}"); + } + } + return dbResult; + } /// /// Adding door's OP diff --git a/WebDoorCreator.Data/DTO/DDFDto.cs b/WebDoorCreator.Data/DTO/DDFDto.cs index d73ded0..7bf14a4 100644 --- a/WebDoorCreator.Data/DTO/DDFDto.cs +++ b/WebDoorCreator.Data/DTO/DDFDto.cs @@ -18,11 +18,11 @@ namespace WebDoorCreator.Data.DTO #region Public Properties public string version { get; set; } = "0"; public bool produce { get; set; } = true; - public string measures { get; set; } = "inch"; + public string measures { get; set; } = "inches"; public string code { get; set; } = "0015943"; public OrderDto order { get; set; } = new OrderDto(); - public DateTime date { get; set; } = DateTime.UtcNow.Date; + public DateTime date { get; set; } = DateTime.Parse(DateTime.Today.ToString("dd/MM/yyyy")); public string piece { get; set; } = "DO_1"; #endregion Public Properties @@ -53,7 +53,7 @@ namespace WebDoorCreator.Data.DTO /// /// /// - public string GetSerialized(List headRows, List footRows, string serialDoorOps, string serialEdges,string serialSize, string serialSwing, string serialProperties, string serialFinishing) + public string GetSerialized(List headRows, List footRows, string serialDoorOps, string serialEdges, string serialSize, string serialSwing, string serialProperties, string serialFinishing) { string fullData = ""; StringBuilder sb = new StringBuilder(); @@ -74,17 +74,19 @@ namespace WebDoorCreator.Data.DTO var currYaml = GetObjYaml(); fullData += currYaml; +#if false + // aggiungo la parte woodType come yaml reale/striped... if (!string.IsNullOrEmpty(serialProperties)) { fullData += serialProperties; } - - // aggiungo la parte woodType come yaml reale/striped... + // aggiungo la parte finishing come yaml reale/striped... if (!string.IsNullOrEmpty(serialFinishing)) { fullData += serialFinishing; - } + } +#endif // aggiungo la parte size come yaml reale/striped... if (!string.IsNullOrEmpty(serialSize)) diff --git a/WebDoorCreator.Data/Services/QueueDataService.cs b/WebDoorCreator.Data/Services/QueueDataService.cs index 9142f3f..bc1c2ed 100644 --- a/WebDoorCreator.Data/Services/QueueDataService.cs +++ b/WebDoorCreator.Data/Services/QueueDataService.cs @@ -275,7 +275,7 @@ namespace WebDoorCreator.Data.Services Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - // per prima cosa controllo se ho GIA' in coda qualcosa come richeiste + // per prima cosa controllo se ho GIA' in coda qualcosa come richieste long numPending = await NumRequestPending(); // se coda non vuota: cerco la DoorId corrente, se c'è sovrascrivo versione altrimenti @@ -309,6 +309,7 @@ namespace WebDoorCreator.Data.Services TimeSpan ts = stopWatch.Elapsed; Log.Debug($"SendCalcReq | DoorId: {DoorId} enqueued in: {ts.TotalMilliseconds} ms"); +#if false // FIXME TODO!!!! levare quando ci sarà il vero sw in esecuzione... // simulazione ritorno dati... @@ -328,7 +329,8 @@ namespace WebDoorCreator.Data.Services await Task.Delay(300); string retMess = $"{sDoorId}:{sCurrVers}"; // invio il FINTO messaggio di ritorno... - CalcDonePipe.saveAndSendMessage(Constants.LAST_CALC_DONE_KEY, retMess); + CalcDonePipe.saveAndSendMessage(Constants.LAST_CALC_DONE_KEY, retMess); +#endif return currVers; } @@ -399,7 +401,7 @@ namespace WebDoorCreator.Data.Services } /// - /// Invio elenco risultati elaborazioni (modalità boolean di esecuzione corretta) + /// Salvo elenco risultati elaborazioni (modalità boolean di esecuzione corretta) /// /// Risultati elaborazioni in formato CalcResultDTO /// @@ -407,6 +409,27 @@ namespace WebDoorCreator.Data.Services { bool answ = true; await Task.Delay(1); + if (calcResults != null && calcResults.Count > 0) + { + string sDoorId = ""; + string sCurrVers = ""; + foreach (var calcTask in calcResults) + { + // solo se risultato valido... + if (calcTask.Validated) + { + // salvo in area REDIS + var doorData = calcTask.DoorIdVers.Split("."); + sDoorId = doorData.Length > 0 ? doorData[0] : ""; + sCurrVers = doorData.Length > 0 ? doorData[0] : ""; + RedisKey currSvgKey = new RedisKey($"{Constants.CALC_REQ_SVG_CACHE}:{sDoorId}:{sCurrVers}"); + await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen, DayLongCache); + // invio il FINTO messaggio di ritorno... + string retMess = $"{sDoorId}:{sCurrVers}"; + CalcDonePipe.saveAndSendMessage(Constants.LAST_CALC_DONE_KEY, retMess); + } + } + } return answ; } diff --git a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor index ba9639d..59a4883 100644 --- a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor +++ b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor @@ -1,12 +1,14 @@ 
@B_doorOpUpd - @if (B_doorOpUpd) + @if (B_doorOpUpd || true) { - + + } else { + } @**@
\ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs index e03e5de..10decd7 100644 --- a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs +++ b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs @@ -28,6 +28,8 @@ namespace WebDoorCreator.UI.Components.Buttons [Inject] protected WebDoorCreatorService WDCService { get; set; } = null!; + [Inject] + protected WDCUserService WDCUService { get; set; } = null!; [Inject] protected QueueDataService QDataServ { get; set; } = null!; @@ -110,6 +112,7 @@ namespace WebDoorCreator.UI.Components.Buttons if (listOp != null) { // chiamo metodo x avewre DDF serializzato + //var list2Ord = ; string currDdf = currDdfConv.GetSerialized(listOp); // FIXME TODO: si potrebbe eliminare in futuro che va su REDIS await SaveYaml(currDdf); @@ -118,6 +121,14 @@ namespace WebDoorCreator.UI.Components.Buttons } } } + /// + /// Effettua Richiesta visione porta 3D + /// + /// + protected async Task doReq3D() + { + await Task.Delay(1); + } protected WebDoorCreator.Data.DDF.Converter currDdfConv { get; set; } = null!; } diff --git a/WebDoorCreator.UI/Components/DoorDef/BaseParamList.razor b/WebDoorCreator.UI/Components/DoorDef/BaseParamList.razor index 7038338..a2c82c2 100644 --- a/WebDoorCreator.UI/Components/DoorDef/BaseParamList.razor +++ b/WebDoorCreator.UI/Components/DoorDef/BaseParamList.razor @@ -6,16 +6,22 @@ else {
-
-
+
+ @if (DoorOp2Save != null) + { +
Pending changes: @DoorOp2Save.Count()
+ } +
+
+ @if (paramsChanged) {
- -
diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor index 687270b..be0c8c2 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor @@ -7,7 +7,14 @@
@BlockDoorOp.ObjectId
- + @if (paramsChanged) + { +
+ } + else + { +
+ }
diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.cs b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.cs index 887db1a..2f01c11 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.cs +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.cs @@ -71,6 +71,7 @@ namespace WebDoorCreator.UI.Components.DoorDef [Inject] protected WDCRefreshService WDCRService { get; set; } = null!; + protected async Task doSaveBlock(Dictionary> updSet) { await Task.Delay(1); @@ -91,6 +92,7 @@ namespace WebDoorCreator.UI.Components.DoorDef await E_doorOp2Save.InvokeAsync(BlockDoorOp); WDCRService.isDoorOpUpd = true; + //showCirc = true; await InvokeAsync(StateHasChanged); } @@ -99,6 +101,8 @@ namespace WebDoorCreator.UI.Components.DoorDef } } + protected bool showCirc { get; set; } = false; + protected Dictionary> getParamsConfig(string paramName) { Dictionary> answ = new Dictionary>(); diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.css b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.css new file mode 100644 index 0000000..d5e29bc --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.css @@ -0,0 +1,28 @@ +body { + height: 100vh; + overflow: hidden; +} +.blue { + background: #3652D9; +} +.grey { + background: #7F8C8D; + opacity: 50%; +} +.circle { + width: 1rem; + height: 1rem; + border-radius: 50%; + box-shadow: 0px 0px 1px 1px #0000001a; +} +.pulse { + animation: pulse-animation 2s infinite; +} +@keyframes pulse-animation { + 0% { + box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2); + } + 100% { + box-shadow: 0 0 0 20px rgba(0, 0, 0, 0); + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.less b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.less new file mode 100644 index 0000000..9c3a099 --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.less @@ -0,0 +1,35 @@ +body { + height: 100vh; + overflow: hidden; +} + + +.blue { + background: #3652D9; +} +.grey { + background: #7F8C8D; + opacity: 50%; +} + + +.circle { + width: 1rem; + height: 1rem; + border-radius: 50%; + box-shadow: 0px 0px 1px 1px #0000001a; +} + +.pulse { + animation: pulse-animation 2s infinite; +} + +@keyframes pulse-animation { + 0% { + box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2); + } + + 100% { + box-shadow: 0 0 0 20px rgba(0, 0, 0, 0); + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.min.css b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.min.css new file mode 100644 index 0000000..ebe223b --- /dev/null +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDataBlock.razor.min.css @@ -0,0 +1 @@ +body{height:100vh;overflow:hidden;}.blue{background:#3652d9;}.grey{background:#7f8c8d;opacity:50%;}.circle{width:1rem;height:1rem;border-radius:50%;box-shadow:0 0 1px 1px #0000001a;}.pulse{animation:pulse-animation 2s infinite;}@keyframes pulse-animation{0%{box-shadow:0 0 0 0 rgba(0,0,0,.2);}100%{box-shadow:0 0 0 20px rgba(0,0,0,0);}} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor b/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor index acb2770..32d0c15 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDefOrderTopRow.razor @@ -1,21 +1,21 @@ @if (currOrderStatus != null) { -
-
-
Insert Date
-
@currOrderStatus.DateIns
+
+
+ @*
Insert Date
*@ +
Insert Date: @currOrderStatus.DateIns
-
-
Order External Code
-
@currOrderStatus.OrderExtCode
+
+ @*
Order External Code
*@ +
Order External Code: @currOrderStatus.OrderExtCode
-
-
Models Number
-
@currOrderStatus.NumType
+
+ @*
Models Number
*@ +
Models Number: @currOrderStatus.NumType
-
-
Doors Number
-
@currOrderStatus.NumDoors
+
+ @*
Doors Number
*@ +
Doors Number: @currOrderStatus.NumDoors
diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor b/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor index 3a3c98f..9e9e137 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor @@ -7,17 +7,17 @@
@if (int.Parse(item.Value) == CurrDoorDefStatus) { - + } else { @if (int.Parse(item.Value) < CurrDoorDefStatus) { - + } else { - + } }
diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor.cs b/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor.cs index c301f5b..ab3495c 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor.cs +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDefStepList.razor.cs @@ -46,8 +46,16 @@ namespace WebDoorCreator.UI.Components.DoorDef } } + + listBord01 = new(); + listBord01.Add("White"); + listBord01.Add("White"); + listBord01.Add("White"); + listBord01.Add("White"); } + protected List listBord01 { get; set; } = new(); + protected async Task changeStep(int step) { await E_CurrStep.InvokeAsync(step); diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor b/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor index 2ea3d2e..73ae96b 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor +++ b/WebDoorCreator.UI/Components/DoorDef/DoorPreview.razor @@ -1,4 +1,4 @@ -
+
@if (!string.IsNullOrEmpty(@SvgContent)) { @svgPreview diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor index 33df5dc..3998f80 100644 --- a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor +++ b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor @@ -1,8 +1,19 @@ @if (DoorsList != null) { -
- -
+ @if (orderStatus == 10) + { +
+
+ +
+
+ +
+
+ +
+
+ }
@if (DoorsList == null || DoorsList.Count == 0) { } @@ -15,7 +26,7 @@ imgPath = $"images/LogoEgw{idxCount % 5:00}.png"; idxCount++;
- +
} diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs index 950d1ed..8a3d739 100644 --- a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs +++ b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs @@ -15,6 +15,13 @@ namespace WebDoorCreator.UI.Components.DoorMan [Parameter] public EventCallback E_DoorChanged { get; set; } + [Parameter] + public EventCallback updateRecordCount { get; set; } + + + [Parameter] + public DoorsSelectFilter actFilter { get; set; } = new DoorsSelectFilter(); + #endregion Public Properties #region Protected Properties @@ -30,7 +37,9 @@ namespace WebDoorCreator.UI.Components.DoorMan protected int orderStatus { get; set; } = 10; - protected Dictionary baseDict { get; set; } = new Dictionary(); + protected Dictionary AddDoorDict { get; set; } = new Dictionary(); + protected Dictionary AddFromTemplDict { get; set; } = new Dictionary(); + protected Dictionary SendOrderDict { get; set; } = new Dictionary(); [Inject] protected WebDoorCreatorService WDService { get; set; } = null!; @@ -93,20 +102,37 @@ namespace WebDoorCreator.UI.Components.DoorMan protected async Task ReloadData() { - if(!baseDict.ContainsKey("ADD NEW DOOR")) + if (!AddDoorDict.ContainsKey("ADD NEW DOOR")) { - baseDict.Add("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) { - DoorsList = await WDService.DoorGetByOrderId(currOrderId); - - if (DoorsList != null) + var SearchRecords = await WDService.DoorGetByOrderId(currOrderId); + if (SearchRecords != null) { - var currOrder = DoorsList.FirstOrDefault(); - if (currOrder?.OrderNav != null) + totalCount = SearchRecords.Count; + + DoorsList = SearchRecords + .Skip(numRecord * (currPage - 1)) + .Take(numRecord) + .ToList(); + + if (DoorsList != null) { - orderStatus = currOrder.OrderNav.Status; + var currOrder = DoorsList.FirstOrDefault(); + if (currOrder?.OrderNav != null) + { + orderStatus = currOrder.OrderNav.Status; + } } } } @@ -151,5 +177,50 @@ namespace WebDoorCreator.UI.Components.DoorMan // rimando alla pagina... dettaglio... NavManager.NavigateTo($"/DoorDefinition?idOrd={currOrderId}&idDoor={doorId}"); } + protected async void sendToAbh(int ordId, int orderStat) + { + if (orderStat == 10) + { + //int doorId = await WDService.createDoor(currOrderId, userId, "mm"); + bool done = await WDService.OrderUpdate(ordId, 20); + if (done) + { + await InvokeAsync(StateHasChanged); + } + } + + await ReloadData(); + } + + private int currPage + { + get => actFilter.CurrPage; + set => actFilter.CurrPage = value; + } + + private int numRecord + { + 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; + set + { + if (_totalCount != value) + { + _totalCount = value; + updateRecordCount.InvokeAsync(value); + } + } + } } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Filters/OrderFilter.razor b/WebDoorCreator.UI/Components/Filters/OrderFilter.razor index 2d033f4..43a0c27 100644 --- a/WebDoorCreator.UI/Components/Filters/OrderFilter.razor +++ b/WebDoorCreator.UI/Components/Filters/OrderFilter.razor @@ -19,7 +19,16 @@
- + + @**@
diff --git a/WebDoorCreator.UI/Components/Filters/OrderFilter.razor.cs b/WebDoorCreator.UI/Components/Filters/OrderFilter.razor.cs index acfd4c6..38b53f2 100644 --- a/WebDoorCreator.UI/Components/Filters/OrderFilter.razor.cs +++ b/WebDoorCreator.UI/Components/Filters/OrderFilter.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using WebDoorCreator.Data.DbModels; using WebDoorCreator.UI.Data; namespace WebDoorCreator.UI.Components.Filters @@ -10,19 +11,13 @@ namespace WebDoorCreator.UI.Components.Filters [Parameter] public OrderSelectFilter actFilter { get; set; } = new OrderSelectFilter(); - -#if false - public List? itemFamList { get; set; } = null; - - [Inject] - protected StockDataService SDService { get; set; } = null!; -#endif - + private List? ListValuesAll = null; protected override async Task OnParametersSetAsync() { - //itemFamList = await SDService.ItemFamilyGetAll(); + ListValuesAll = await WDService.ListValuesGetAll("All", "OrderStep"); } - + [Inject] + protected WebDoorCreatorService WDService { get; set; } = null!; private string searchVal { get => actFilter.searchValue; diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor index 79aa150..4634d75 100644 --- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor +++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor @@ -11,69 +11,130 @@ aria-expanded="false" aria-label="Toggle navigation"> - - - - - - - - - - - -
-
-
- @context.User.Identity?.Name! -
- @if (listCompanies != null) - { - @if (listCompanies.Count > 1) + -
- -
+
+ +
  • +
    +
    + Language +
    + +
    + +
    +
  • +
  • +
    +
    + +
    +
    +
  • +
    + @*
    +
    + @context.User.Identity?.Name +
    + @if (listCompanies != null) + { + @if (listCompanies.Count > 1) + { + + } + else + { + @if (compToShow != null) + { +
    @compToShow.CompanyName
    + } + } + } +
    +
    + +
    +
    +
    + +
    +
    *@
    diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.css b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.css index b18b9b8..ccaa484 100644 --- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.css +++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.css @@ -1,63 +1,52 @@ .navbar-toggler { - background-color: rgba(255, 255, 255, 0.1); + background-color: rgba(255, 255, 255, 0.1); } - .top-row { - height: 3.5rem; - background-color: rgba(0, 0, 0, 0.4); + height: 3.5rem; + background-color: rgba(0, 0, 0, 0.4); } - .oi { - width: 2rem; - font-size: 1.1rem; - vertical-align: text-top; - top: -2px; + width: 2rem; + font-size: 1.1rem; + vertical-align: text-top; + top: -2px; } - .nav-item { - font-size: 0.9rem; - padding-bottom: 0.5rem; + font-size: 0.9rem; + padding-bottom: 0.5rem; } - /*.nav-item:first-of-type { +/*.nav-item:first-of-type { padding-top: 1rem; }*/ - /*.nav-item:last-of-type { +/*.nav-item:last-of-type { padding-bottom: 1rem; }*/ - .nav-item ::deep a { - color: #29b6f6; - border-radius: 4px; - height: 3rem; - display: flex; - align-items: center; - line-height: 3rem; - } - - .nav-item ::deep a.active { - background-color: #2962ff; - color: white; - } - - .nav-item ::deep a:hover { - background-color: #2962ff; - color: white; - } - -@media (min-width: 641px) { - .navbar-toggler { - display: none; - } - - .collapse { - /* Never collapse the sidebar for wide screens */ - display: block; - } +.nav-item ::deep a { + color: #29b6f6; + border-radius: 4px; + height: 3rem; + display: flex; + align-items: center; + line-height: 3rem; +} +.nav-item ::deep a.active { + background-color: #2962ff; + color: white; +} +.nav-item ::deep a:hover { + background-color: #2962ff; + color: white; +} +@media (min-width: 641px) { + .navbar-toggler { + display: none; + } + .collapse { + /* Never collapse the sidebar for wide screens */ + display: block; + } } - .btnLogout { - border: none; - background-color: #29b6f6; - margin-left: 1rem; - padding: 0.2rem; - border-radius: 0.3rem; + border: none; + background-color: transparent; } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.less b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.less index f767d9d..5fcdcc6 100644 --- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.less +++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.less @@ -59,8 +59,5 @@ .btnLogout { border: none; - background-color: rgb(41, 182, 246); - margin-left: 1rem; - padding: 0.2rem; - border-radius: 0.3rem; + background-color: transparent; } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.min.css b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.min.css index c59cdb9..6f0f860 100644 --- a/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.min.css +++ b/WebDoorCreator.UI/Components/Gen/NavMenuHorizontal.razor.min.css @@ -1 +1 @@ -.navbar-toggler{background-color:rgba(255,255,255,.1);}.top-row{height:3.5rem;background-color:rgba(0,0,0,.4);}.oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.nav-item{font-size:.9rem;padding-bottom:.5rem;}.nav-item ::deep a{color:#29b6f6;border-radius:4px;height:3rem;display:flex;align-items:center;line-height:3rem;}.nav-item ::deep a.active{background-color:#2962ff;color:#fff;}.nav-item ::deep a:hover{background-color:#2962ff;color:#fff;}@media(min-width:641px){.navbar-toggler{display:none;}.collapse{display:block;}}.btnLogout{border:0;background-color:#29b6f6;margin-left:1rem;padding:.2rem;border-radius:.3rem;} \ No newline at end of file +.navbar-toggler{background-color:rgba(255,255,255,.1);}.top-row{height:3.5rem;background-color:rgba(0,0,0,.4);}.oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.nav-item{font-size:.9rem;padding-bottom:.5rem;}.nav-item ::deep a{color:#29b6f6;border-radius:4px;height:3rem;display:flex;align-items:center;line-height:3rem;}.nav-item ::deep a.active{background-color:#2962ff;color:#fff;}.nav-item ::deep a:hover{background-color:#2962ff;color:#fff;}@media(min-width:641px){.navbar-toggler{display:none;}.collapse{display:block;}}.btnLogout{border:0;background-color:transparent;} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor index 197be48..ee2b8f8 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor +++ b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor @@ -5,7 +5,7 @@ {
    -
    +
    @(translate(HwToShow.Label))
    @@ -26,8 +26,16 @@ @foreach (var item in HwList) {
    -
    - @(translate(item.Label)) +
    +
    + @(translate(item.Label)) +
    + @if (@getInstNumber(item.Value) > 0) + { +
    + @getInstNumber(item.Value) +
    + }
    diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs index 2a4fa0d..a2c1974 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs @@ -141,7 +141,7 @@ namespace WebDoorCreator.UI.Components.Hardware if (fatto) { hwAdd = fatto; - await InvokeAsync(StateHasChanged); + await InvokeAsync(StateHasChanged); } } } @@ -237,6 +237,21 @@ namespace WebDoorCreator.UI.Components.Hardware } } + 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 } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor index 9a4a876..6259700 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor @@ -5,12 +5,12 @@ else {
    -
    +
    @*
    *@
    -
    +
    @($"{translate(DoorOpInst.ObjectId)} #{instanceN}")
    @@ -121,27 +121,23 @@ else @if (isChangedVal()) {
    -
    - - -
    + +
    } else {
    -
    - - -
    + +
    }
    @@ -163,15 +159,17 @@ else
    -
    - -
    + @*
    + +
    *@
    - + + +
    diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs index 38acc6e..c717362 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs @@ -233,6 +233,12 @@ namespace WebDoorCreator.UI.Components.Hardware return answ; } + private string pathFinder(int id) + { + string answ = $"HwPdfConfirm?idHwInst={id}"; + return answ; + } + #endregion Protected Methods #region Private Methods diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.css b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.css index d99eeb5..5c12066 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.css +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.css @@ -3,20 +3,23 @@ width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; } .btnDelete { border-radius: 50%; width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; background: #B71C1C; - transform: translate(25px, -12px); + transform: translate(25px, -1rem); } .btnClone { border-radius: 50%; width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; background: #FFF; transform: translate(1.6rem, -1rem); } @@ -25,25 +28,46 @@ width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; background: #8E44AD; - transform: translate(25px, 12px); + transform: translate(1rem, 1rem); } .btnPDFPending { border-radius: 50%; width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; background: #F1C40F; - transform: translate(25px, 12px); + transform: translate(16rem, 1rem); } .btnHighlight { border-radius: 50%; width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; background: #03A9F4; transform: translate(1.6rem, 1rem); } +.btnCancel { + border-radius: 50%; + width: 3.5rem; + height: 3.5rem; + border: 5px solid #00838F; + z-index: 99999; + background: var(--colorCode); + transform: translate(-2rem, 1rem); +} +.btnSave { + border-radius: 50%; + width: 3.5rem; + height: 3.5rem; + border: 5px solid #00838F; + z-index: 99999; + background: var(--colorCode); + transform: translate(-2.6rem, 1rem); +} .btnHeadTail { width: 100%; padding: 0.8rem 0 0.8rem 0; diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.less b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.less index 3d0b631..55a60f5 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.less +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.less @@ -1,11 +1,12 @@ @xDelta: 25px; -@yDelta: 12px; +@yDelta: 1rem; .btnGen { border-radius: 50%; width: 3.5rem; height: 3.5rem; border: 5px solid #00838F; + z-index: 99999; } .btnDelete { @@ -23,13 +24,13 @@ .btnPDFSuccess { .btnGen; background: #8E44AD; - transform: translate(@xDelta, @yDelta); + transform: translate(1rem, @yDelta); } .btnPDFPending { .btnGen; background: #F1C40F; - transform: translate(@xDelta, @yDelta); + transform: translate(16rem, @yDelta); } .btnHighlight { @@ -37,6 +38,16 @@ background: #03A9F4; transform: translate(1.6rem, 1rem); } +.btnCancel { + .btnGen; + background: var(--colorCode); + transform: translate(-2rem, 1rem); +} +.btnSave { + .btnGen; + background: var(--colorCode); + transform: translate(-2.6rem, 1rem); +} .btnHeadTail { diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.min.css b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.min.css index 59a0540..22bb871 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.min.css +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.min.css @@ -1 +1 @@ -.btnGen{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;}.btnDelete{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#b71c1c;transform:translate(25px,-12px);}.btnClone{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#fff;transform:translate(1.6rem,-1rem);}.btnPDFSuccess{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#8e44ad;transform:translate(25px,12px);}.btnPDFPending{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#f1c40f;transform:translate(25px,12px);}.btnHighlight{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;background:#03a9f4;transform:translate(1.6rem,1rem);}.btnHeadTail{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.btnConfirm{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;border-bottom:3px solid #000;}.btnHead{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.borderTop{border-top:7px solid #00838f;}.borderBottom{border-bottom:7px solid #00838f;width:100%;}.modal-dialog{overflow-y:initial!important;}.modal-body{height:18.75rem;overflow-y:auto;}.testata{width:100%;}select,input{border:0;border-bottom:2px solid #000;background:none;height:2rem;}i{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;font-size:1.1rem;} \ No newline at end of file +.btnGen{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;}.btnDelete{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#b71c1c;transform:translate(25px,-1rem);}.btnClone{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#fff;transform:translate(1.6rem,-1rem);}.btnPDFSuccess{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#8e44ad;transform:translate(1rem,1rem);}.btnPDFPending{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#f1c40f;transform:translate(16rem,1rem);}.btnHighlight{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:#03a9f4;transform:translate(1.6rem,1rem);}.btnCancel{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:var(--colorCode);transform:translate(-2rem,1rem);}.btnSave{border-radius:50%;width:3.5rem;height:3.5rem;border:5px solid #00838f;z-index:99999;background:var(--colorCode);transform:translate(-2.6rem,1rem);}.btnHeadTail{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.btnConfirm{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;border-bottom:3px solid #000;}.btnHead{width:100%;padding:.8rem 0 .8rem 0;background:none;border:0;}.borderTop{border-top:7px solid #00838f;}.borderBottom{border-bottom:7px solid #00838f;width:100%;}.modal-dialog{overflow-y:initial!important;}.modal-body{height:18.75rem;overflow-y:auto;}.testata{width:100%;}select,input{border:0;border-bottom:2px solid #000;background:none;height:2rem;}i{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;font-size:1.1rem;} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Order/OrderList.razor b/WebDoorCreator.UI/Components/Order/OrderList.razor index 53f5985..6afc7e5 100644 --- a/WebDoorCreator.UI/Components/Order/OrderList.razor +++ b/WebDoorCreator.UI/Components/Order/OrderList.razor @@ -8,8 +8,8 @@ else - Order Date - Order Number + Order Date + Order Number Order Description Doors Number Model Number @@ -29,7 +29,7 @@ else @item.OrderDescript @item.NumDoors @item.NumType - @item.OrderStatus + @getOrderStatusLabel(item.OrderStatus) @($"{item.TotCost:C2}") @*
    diff --git a/WebDoorCreator.UI/Components/Order/OrderList.razor.cs b/WebDoorCreator.UI/Components/Order/OrderList.razor.cs index ff6e4a2..4368ab5 100644 --- a/WebDoorCreator.UI/Components/Order/OrderList.razor.cs +++ b/WebDoorCreator.UI/Components/Order/OrderList.razor.cs @@ -1,3 +1,4 @@ +using EgwCoreLib.Razor; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.DataProtection; @@ -29,6 +30,17 @@ namespace WebDoorCreator.UI.Components.Order [Inject] protected WebDoorCreatorService WDService { get; set; } = null!; + private bool sortAsc = true; + + private string sortField = ""; + + protected async Task SortRequested(Sorter.SortCallBack e) + { + sortField = e.ParamName; + sortAsc = e.IsAscending; + await ReloadData(); + } + [Parameter] public EventCallback updateRecordCount { get; set; } @@ -89,11 +101,6 @@ namespace WebDoorCreator.UI.Components.Order #region Protected Methods - //protected override async Task OnInitializedAsync() - //{ - // //await SetSelectedData(); - //} - protected override async Task OnParametersSetAsync() { //if (B_doorChaged) @@ -107,6 +114,7 @@ namespace WebDoorCreator.UI.Components.Order #region Private Fields private List? ListOrdersStatus = null; + private List? ListValuesAll = null; #endregion Private Fields @@ -161,37 +169,55 @@ namespace WebDoorCreator.UI.Components.Order var domani = DateTime.Today.AddDays(1); ListOrdersStatus = null; await Task.Delay(1); + + ListValuesAll = await WDService.ListValuesGetAll("All", "OrderStep"); + if (userClaims != null) { var SearchRecords = await WDService.OrderStatusGetFilt(userCurrCompany, orderStatus, dateFrom, dateTo); if (SearchRecords != null) { - if (orderType == Core.Enum.orderTypeEnum.DateAscending) - { - SearchRecords = SearchRecords.OrderBy(x => x.DateIns).ToList(); - } - else if (orderType == Core.Enum.orderTypeEnum.DateDescending) - { - SearchRecords = SearchRecords.OrderByDescending(x => x.OrderExtCode).ToList(); - } - else if (orderType == Core.Enum.orderTypeEnum.CodeAscending) - { - SearchRecords = SearchRecords.OrderBy(x => x.OrderExtCode).ToList(); - } - else if (orderType == Core.Enum.orderTypeEnum.CodeDescending) - { - SearchRecords = SearchRecords.OrderByDescending(x => x.OrderExtCode).ToList(); - } - totalCount = SearchRecords.Count; if (searchVal != "") { - ListOrdersStatus = SearchRecords.Where(x=>x.OrderDescript.Contains(searchVal) || x.OrderExtCode.Contains(searchVal)).Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + ListOrdersStatus = SearchRecords + .Where(x => x.OrderDescript.ToLower().Contains(searchVal.ToLower()) || x.OrderExtCode.ToLower().Contains(searchVal.ToLower())) + .Skip(numRecord * (currPage - 1)) + .Take(numRecord) + .ToList(); } else { ListOrdersStatus = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); } + if (!string.IsNullOrEmpty(sortField)) + { + switch (sortField) + { + case "OrderDate": + if (sortAsc) + { + ListOrdersStatus = SearchRecords.OrderBy(x => x.DateIns).ToList(); + } + else + { + ListOrdersStatus = SearchRecords.OrderByDescending(x => x.DateIns).ToList(); + } + break; + default: + case "OrderNumber": + if (sortAsc) + { + ListOrdersStatus = SearchRecords.OrderBy(x => x.OrderExtCode).ToList(); + } + else + { + ListOrdersStatus = SearchRecords.OrderByDescending(x => x.OrderExtCode).ToList(); + } + break; + } + } + } } await Task.Delay(1); @@ -247,8 +273,24 @@ namespace WebDoorCreator.UI.Components.Order protected Core.Enum.orderTypeEnum orderType = Core.Enum.orderTypeEnum.none; - + #endregion Private Methods + + protected string getOrderStatusLabel(int orderStat) + { + string answ = ""; + + if (ListValuesAll != null) + { + var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault(); + if (currOrdStat != null) + { + answ = currOrdStat.Label; + } + } + + return answ; + } } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Order/OrderStatusStep.razor b/WebDoorCreator.UI/Components/Order/OrderStatusStep.razor index d37b7a7..62d6ef8 100644 --- a/WebDoorCreator.UI/Components/Order/OrderStatusStep.razor +++ b/WebDoorCreator.UI/Components/Order/OrderStatusStep.razor @@ -8,17 +8,17 @@
    @if (int.Parse(item.Value) == CurrOrderStatus) { - + } else { @if (int.Parse(item.Value) < CurrOrderStatus) { - + } else { - + } }
    diff --git a/WebDoorCreator.UI/Components/Report/ReportList.razor b/WebDoorCreator.UI/Components/Report/ReportList.razor new file mode 100644 index 0000000..bbf73c9 --- /dev/null +++ b/WebDoorCreator.UI/Components/Report/ReportList.razor @@ -0,0 +1,27 @@ +@if (DoorOps != null) +{ + @*
    @getTranslatedLabel(@item.ObjectId) @getTemplate(item)
    *@ + + + + + + + + + + + + @foreach (var item in DoorOps) + { + + + + + + + + } + +
    Object NameTemplateApproved By:Approval Date
    @getTranslatedLabel(@item.ObjectId)@getTemplate(item)@item.userConfirm@item.DtConfirm
    +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Report/ReportList.razor.cs b/WebDoorCreator.UI/Components/Report/ReportList.razor.cs new file mode 100644 index 0000000..da3a6be --- /dev/null +++ b/WebDoorCreator.UI/Components/Report/ReportList.razor.cs @@ -0,0 +1,68 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Razor.Language.Extensions; +using Microsoft.Build.Framework; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using WebDoorCreator.Data.DbModels; +using WebDoorCreator.UI.Data; + +namespace WebDoorCreator.UI.Components.Report +{ + public partial class ReportList + { + [Parameter] + public int doorId { get; set; } = 0; + + [Parameter] + public string Lingua { get; set; } = "EN"; + + protected List? DoorOps { get; set; } = null; + + [Inject] + protected WebDoorCreatorService WDService { get; set; } = null!; + [Inject] + protected WDCVocabularyService WDVService { get; set; } = null!; + + protected string getTemplate(DoorOpModel currDoorOp) + { + string answ = ""; + + answ = currDoorOp.CurrVals["template"]; + + return answ; + + } + + protected string getTranslatedLabel(string HwId) + { + string answ = ""; + var listHw = Task.Run(async () => await WDService.ListValuesGetAll(HwId, "Hardware")).Result; + if (listHw != null) + { + var hw2Translate = listHw.FirstOrDefault(); + if (hw2Translate != null) + { + + answ = translate(hw2Translate.Label); + } + } + return answ; + } + + protected async override Task OnParametersSetAsync() + { + var result = await WDService.DoorOpGetByDoorId(doorId); + if (result != null) + { + DoorOps = result.Where(x => x.ObjectId != "Size" && x.ObjectId != "Profiles" && x.ObjectId != "Swing" && x.ObjectId != "Properties" && x.ObjectId != "Finishing").ToList(); + } + } + protected string translate(string lemma) + { + string answ = ""; + + answ = WDVService.Traduci(Lingua, lemma); + + return answ; + } + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Report/ReportList.razor.css b/WebDoorCreator.UI/Components/Report/ReportList.razor.css new file mode 100644 index 0000000..61d5045 --- /dev/null +++ b/WebDoorCreator.UI/Components/Report/ReportList.razor.css @@ -0,0 +1,14 @@ +tr { + padding: 0.5rem; + border-bottom: 1px solid; + font-weight: bold; + background-color: #fff; + color: #000; +} +table { + width: 100%; + height: 100%; +} +td { + padding: 0.5rem; +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/Report/ReportList.razor.less b/WebDoorCreator.UI/Components/Report/ReportList.razor.less new file mode 100644 index 0000000..4e51dfd --- /dev/null +++ b/WebDoorCreator.UI/Components/Report/ReportList.razor.less @@ -0,0 +1,16 @@ +tr { + padding: 0.5rem; + border-bottom: 1px solid; + font-weight: bold; + background-color: #fff; + color: #000; +} + +table { + width: 100%; + height: 100%; +} + +td { + padding: 0.5rem; +} diff --git a/WebDoorCreator.UI/Components/Report/ReportList.razor.min.css b/WebDoorCreator.UI/Components/Report/ReportList.razor.min.css new file mode 100644 index 0000000..4d7b32b --- /dev/null +++ b/WebDoorCreator.UI/Components/Report/ReportList.razor.min.css @@ -0,0 +1 @@ +tr{padding:.5rem;border-bottom:1px solid;font-weight:bold;background-color:#fff;color:#000;}table{width:100%;height:100%;}td{padding:.5rem;} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor b/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor index 825b422..c49079b 100644 --- a/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor +++ b/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor @@ -1,16 +1,17 @@  +
    - @foreach (var item in TextData) - { -
    - @item.Key -
    -
    - @item.Value -
    - } + @foreach (var item in TextData) + { +
    + @item.Key +
    +
    + @item.Value +
    + }
    diff --git a/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor.cs b/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor.cs index 7555d2f..b7ddb01 100644 --- a/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor.cs +++ b/WebDoorCreator.UI/Components/SvgComp/DoorSvgObj.razor.cs @@ -7,7 +7,7 @@ namespace WebDoorCreator.UI.Components.SvgComp #region Public Properties [Parameter] - public EventCallback EC_ExeFunct { get; set; } + public EventCallback EC_ExeFunct { get; set; } [Parameter] public string ImagePath { get; set; } = "images/LogoEgw.png"; @@ -34,7 +34,14 @@ namespace WebDoorCreator.UI.Components.SvgComp public string TextStyle { get; set; } = "font-size: 1.5em; fill: #000;"; [Parameter] - public string Message { get; set; } = ""; + public string Message1 { get; set; } = ""; + [Parameter] + public string Message2 { get; set; } = ""; + + [Parameter] + public string LeftTextClass { get; set; } = ""; + [Parameter] + public string RightTextClass { get; set; } = ""; #endregion Public Properties @@ -64,7 +71,7 @@ namespace WebDoorCreator.UI.Components.SvgComp protected void execFunc() { - EC_ExeFunct.InvokeAsync(Message); + EC_ExeFunct.InvokeAsync(true); } protected override void OnParametersSet() diff --git a/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor b/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor new file mode 100644 index 0000000..4fc943d --- /dev/null +++ b/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor @@ -0,0 +1,27 @@ + + + + + + + + + + + +
    +
    + @TitleText +
    +
    + @BodyText +
    +
    + +
    +
    +
    +
    +
    diff --git a/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs b/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs new file mode 100644 index 0000000..3e07d2e --- /dev/null +++ b/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs @@ -0,0 +1,164 @@ +using Microsoft.AspNetCore.Components; + +namespace WebDoorCreator.UI.Components.SvgComp +{ + public partial class HomeCard + { + #region Public Properties + + [Parameter] + public string BodyStyle { get; set; } = "font-size: 2em;"; + + [Parameter] + public string BodyText { get; set; } = "Body Text"; + + [Parameter] + public string ButtonText { get; set; } = "Button Text"; + + [Parameter] + public EventCallback EC_ExeFunct { get; set; } + + [Parameter] + public string ImagePath { get; set; } = "images/DOORBG.png"; + + [Parameter] + public string LineColor { get; set; } = "#3989CC"; + + [Parameter] + public int LineWidth { get; set; } = 16; + + [Parameter] + public int ObjH { get; set; } = 204; + + [Parameter] + public int ObjId { get; set; } = 0; + + [Parameter] + public int ObjW { get; set; } = 450; + + [Parameter] + public int StartPoint { get; set; } = 220; + + [Parameter] + public string TitleStyle { get; set; } = "font-size: 5.5em;"; + + [Parameter] + public string TitleText { get; set; } = "Title Text"; + + #endregion Public Properties + + #region Protected Properties + + protected List PathClip { get; set; } = null!; + + protected string PathClipData + { + get + { + //string path = $"{PathLineData} L1200,0 L1920,0 L1920,1080 L900,1080 Z"; + string path = PathLineData; + if (pathClipCloseList.Count > 0) + { + for (int i = 0; i < pathClipCloseList.Count; i++) + { + path += $" L{pathClipCloseList[i].px},{pathClipCloseList[i].py}"; + } + } + path += " Z"; + return path; + } + } + + protected List PathLine { get; set; } = null!; + + protected string PathLineData + { + get + { + string path = ""; + if (pathPointList.Count > 0) + { + path = $"M{pathPointList[0].px},{pathPointList[0].py} Q"; + for (int i = 1; i < pathPointList.Count; i++) + { + path += $" {pathPointList[i].px},{pathPointList[i].py}"; + } + } + return path; + } + } + + #endregion Protected Properties + + #region Protected Methods + + protected void execFunc() + { + EC_ExeFunct.InvokeAsync(true); + } + + protected override void OnParametersSet() + { + setupGraphParams(); + } + + protected void setupGraphParams() + { + pathPointList = new List(); + pathClipCloseList = new List(); + // calcolo i dati necessari a disegnare + int deltaX = (ObjW / 2 - StartPoint) / 6; + int deltaY = ObjH / 3; + // inizio aggiungendo punti parametrici + pathPointList.Add(new PointData(StartPoint, ObjH)); + pathPointList.Add(new PointData(StartPoint - deltaX, ObjH - (deltaY / 2))); + pathPointList.Add(new PointData(StartPoint + deltaX, ObjH - deltaY)); + pathPointList.Add(new PointData((ObjW / 2) - deltaX * 3, (ObjH / 2) + deltaY / 8)); + pathPointList.Add(new PointData(ObjW / 2, ObjH / 2)); + pathPointList.Add(new PointData((ObjW / 2) + deltaX * 3, (ObjH / 2) - deltaY / 8)); + pathPointList.Add(new PointData(ObjW - (StartPoint + deltaX), deltaY)); + pathPointList.Add(new PointData(ObjW - (StartPoint - deltaX), (deltaY / 2))); + pathPointList.Add(new PointData(ObjW - StartPoint, 0)); + // ora provvedo x la parte clip + pathClipCloseList.Add(new PointData(ObjW - StartPoint, 0)); + pathClipCloseList.Add(new PointData(ObjW, 0)); + pathClipCloseList.Add(new PointData(ObjW, ObjH)); + pathClipCloseList.Add(new PointData(StartPoint, ObjH)); + + } + + protected List pathPointList = new List(); + protected List pathClipCloseList = new List(); + + #endregion Protected Methods + + #region Protected Classes + + protected class PointData + { + #region Public Constructors + + public PointData(int valx, int valy) + { + px = valx; + py = valy; + } + + #endregion Public Constructors + + #region Public Properties + + public int px { get; set; } = 0; + public int py { get; set; } = 0; + + #endregion Public Properties + } + + protected async Task raiseEvent() + { + await EC_ExeFunct.InvokeAsync(true); + } + + #endregion Protected Classes + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/StepArrow.razor b/WebDoorCreator.UI/Components/SvgComp/StepArrow.razor deleted file mode 100644 index f68580a..0000000 --- a/WebDoorCreator.UI/Components/SvgComp/StepArrow.razor +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - @StepText - \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/StepArrow.razor.cs b/WebDoorCreator.UI/Components/SvgComp/StepArrow.razor.cs deleted file mode 100644 index df760f3..0000000 --- a/WebDoorCreator.UI/Components/SvgComp/StepArrow.razor.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.AspNetCore.Components; - -namespace WebDoorCreator.UI.Components.SvgComp -{ - public partial class StepArrow - { - #region Public Properties - - [Parameter] - public int ObjH { get; set; } = 100; - - [Parameter] - public int ObjId { get; set; } = 0; - - [Parameter] - public int ObjW { get; set; } = 500; - - [Parameter] - public string StepText { get; set; } = "Arrow Stepped"; - - [Parameter] - public string TextStyle { get; set; } = "font-size: 2.5em; font-weight:bold; fill: white;"; - - - [Parameter] - public string BlockStyle { get; set; } = "fill:rgb(0,0,255);stroke-width:0;stroke:rgb(0,0,0);"; - - [Parameter] - public string BlockStyleBorderUp { get; set; } = "stroke-width:5px;stroke:rgb(255,255,255);stroke-dasharray: 650,600;"; - - #endregion Public Properties - - #region Protected Properties - - protected int deltaH - { - get => ObjH / 100; - } - - protected int rectH - { - get => (ObjH / 2); - //* (96 / 100); - } - - protected int rectW - { - get => ObjW - ObjH / 2; - } - - protected int tipSize - { - get => ObjH / 3; - } - - #endregion Protected Properties - } -} \ No newline at end of file diff --git a/WebDoorCreator.UI/Data/DoorsSelectFilter.cs b/WebDoorCreator.UI/Data/DoorsSelectFilter.cs new file mode 100644 index 0000000..27b7d7f --- /dev/null +++ b/WebDoorCreator.UI/Data/DoorsSelectFilter.cs @@ -0,0 +1,78 @@ +namespace WebDoorCreator.UI.Data +{ + public class DoorsSelectFilter + { + #region Public Constructors + + public DoorsSelectFilter() + { } + + #endregion Public Constructors + + #region Public Properties + + public int CurrPage { get; set; } = 1; + + public string Id { get; set; } = "*"; + public string searchValue { get; set; } = ""; + public int MaxRecord { get; set; } = 100; + + public int NumRec { get; set; } = 10; + + public int TotCount { get; set; } = 0; + + #endregion Public Properties + + #region Public Methods + + public DoorsSelectFilter clone() + { + DoorsSelectFilter clonedData = new DoorsSelectFilter() + { + CurrPage = this.CurrPage, + MaxRecord = this.MaxRecord, + NumRec = this.NumRec, + searchValue = this.searchValue, + TotCount = this.TotCount, + Id = this.Id + }; + return clonedData; + } + + public override bool Equals(object? obj) + { + if (obj == null) + return false; + + if (!(obj is OrderSelectFilter item)) + return false; + + if (MaxRecord != item.MaxRecord) + return false; + + if (NumRec != item.NumRec) + return false; + + if (TotCount != item.TotCount) + return false; + + if (searchValue != item.searchValue) + return false; + + if (CurrPage != item.CurrPage) + return false; + + if (Id != item.Id) + return false; + + return true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs index eed0c89..8fe8575 100644 --- a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs +++ b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs @@ -201,7 +201,7 @@ namespace WebDoorCreator.UI.Data TableName = "All", FieldName = "OrderStep", Value = "10", - Label = "DoorDef", + Label = "Door Draft", Ordinal = 10, DefaultVal = "#EF6C00", InputType = "" @@ -212,7 +212,7 @@ namespace WebDoorCreator.UI.Data TableName = "All", FieldName = "OrderStep", Value = "20", - Label = "Sent", + Label = "Sent to ABH", Ordinal = 20, DefaultVal = "#FBC02D", InputType = "" @@ -223,7 +223,7 @@ namespace WebDoorCreator.UI.Data TableName = "All", FieldName = "OrderStep", Value = "30", - Label = "ApprovedByMaker", + Label = "Approved By Maker", Ordinal = 30, DefaultVal = "#2962FF", InputType = "" @@ -234,7 +234,7 @@ namespace WebDoorCreator.UI.Data TableName = "All", FieldName = "OrderStep", Value = "40", - Label = "ApprovedByCustomer", + Label = "Approved By Customer", Ordinal = 40, DefaultVal = "#673AB7", InputType = "" @@ -256,7 +256,7 @@ namespace WebDoorCreator.UI.Data TableName = "All", FieldName = "OrderStep", Value = "60", - Label = "InProduction", + Label = "In Production", Ordinal = 60, DefaultVal = "#43A047", InputType = "" @@ -272,6 +272,7 @@ namespace WebDoorCreator.UI.Data DefaultVal = "#AEEA00", InputType = "" }; + listValues.Add(listValObj); listValObj = new ListValuesTempModel() { @@ -459,6 +460,27 @@ namespace WebDoorCreator.UI.Data isSerializable = true }; listValues.Add(listValObj); + int i = 0; + +#if false + var o = listActiveCompo.ToArray(); + + for (int t = 0; t < dirs.Length; t++) + { + var dirPath = dirs[t]; + var h = dirPath.Split("\\"); + var c = h[h.Length - 1]; + c = o[t]; + StringBuilder sb = new StringBuilder(); + foreach (var item in h) + { + sb.Append($"{item}\\"); + } + sb.Append(c); + dirs[t] = $"{sb}"; + } +#endif + foreach (string dir in dirs) { int numPar = 1; @@ -488,6 +510,10 @@ namespace WebDoorCreator.UI.Data string layerName = fIni.ReadString("Layer", "LayerName", "LAYER"); // lo slash indica l'alias var compoNameSplit = compoName.Split("/"); + + var compoAcArray = listActiveCompo.ToArray(); + var x = Array.FindIndex(compoAcArray, row => row == compoNameSplit[0]); + if (listActiveCompo.Contains(compoNameSplit[0].ToString())) { //creo il componente (padre) @@ -497,7 +523,7 @@ namespace WebDoorCreator.UI.Data FieldName = "Hardware", Value = $"{compoNameSplit[0]}", Label = $"{compoNameSplit[1]}", - Ordinal = 0, + Ordinal = x, DefaultVal = " ", InputType = " " }; @@ -505,6 +531,7 @@ namespace WebDoorCreator.UI.Data //await dbController.CompoAdd(compoConfig); //listCompoS.Add(compoConfig); listValues.Add(listValObj); + i++; //cerco all'interno del file tutte le sezioni che contengono "[Graphic" così da poter prendere il nome della sezione ES: [Graphic parameters1] = Graphic parameters1 var lineToSearch = lines.Where(x => x.Contains("[Graphic")).ToList(); numHead = 1; @@ -695,7 +722,7 @@ namespace WebDoorCreator.UI.Data /// /// Doors list by orderId /// - public async Task?> DoorOpGetByDoorId(int doorId) + public async Task> DoorOpGetByDoorId(int doorId) { string source = "DB"; List? dbResult = new List(); @@ -732,6 +759,26 @@ namespace WebDoorCreator.UI.Data Log.Debug($"DoorOpGetByDoorId | {source} in: {ts.TotalMilliseconds} ms"); return dbResult; } + /// + /// Doors list by orderId + /// + public async Task DoorOpGetById(int doorOpId) + { + await Task.Delay(1); + string source = "DB"; + DoorOpModel? dbResult = new DoorOpModel(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbController.DoorOpGetById(doorOpId); + if (dbResult == null) + { + dbResult = new DoorOpModel(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"DoorOpGetById | {source} in: {ts.TotalMilliseconds} ms"); + return dbResult; + } /// /// lista DoorOpList necessarie all'init diff --git a/WebDoorCreator.UI/Pages/DoorDefinition.razor b/WebDoorCreator.UI/Pages/DoorDefinition.razor index 0dc0891..1534989 100644 --- a/WebDoorCreator.UI/Pages/DoorDefinition.razor +++ b/WebDoorCreator.UI/Pages/DoorDefinition.razor @@ -33,6 +33,10 @@ { } + else if (currDefStep == 30) + { + + }
    diff --git a/WebDoorCreator.UI/Pages/HwPdfConfirm.razor b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor new file mode 100644 index 0000000..0bc13e5 --- /dev/null +++ b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor @@ -0,0 +1,26 @@ +@page "/HwPdfConfirm" + +@if (currDoorOp != null) +{ +
    + @*@if (currDoorOp.DtConfirm != null && currDoorOp.userConfirm != "") + {*@ +
    + Please press + + + + after reading the whole file +
    + @*} + else + { +
    + Template already confirmed by user: @currDoorOp.userConfirm on @currDoorOp.DtConfirm +
    + }*@ + +
    +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.cs b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.cs new file mode 100644 index 0000000..a6eb179 --- /dev/null +++ b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.cs @@ -0,0 +1,80 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.WebUtilities; +using Newtonsoft.Json; +using WebDoorCreator.Data.DbModels; +using WebDoorCreator.UI.Data; + +namespace WebDoorCreator.UI.Pages +{ + public partial class HwPdfConfirm + { + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + [Inject] + protected WDCUserService WDCUService { get; set; } = null!; + + protected int idHwInst { get; set; } = 0; + protected DoorOpModel currDoorOp { get; set; } = new DoorOpModel(); + protected List allDoorOps { get; set; } = new List(); + + protected async override Task OnInitializedAsync() + { + await Task.Delay(1); + var uri = NavManager.ToAbsoluteUri(NavManager.Uri); + if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idHwInst", out var _idHwInst)) + { + idHwInst = int.Parse(_idHwInst); + await ReloadData(); + } + } + + protected async Task ReloadData() + { + currDoorOp = await WDService.DoorOpGetById(idHwInst); + if (currDoorOp != null) + { + allDoorOps = await WDService.DoorOpGetByDoorId(currDoorOp.DoorId); + + } + await Task.Delay(1); + } + [Inject] + protected WebDoorCreatorService WDService { get; set; } = null!; + + protected async Task doConfirm() + { + currDoorOp.userConfirm = WDCUService.userId; + currDoorOp.DtConfirm = DateTime.Now; + + var doorOps2Save = new List() { currDoorOp }; + + await WDService.DoorOpUpdate(doorOps2Save); + } + + protected bool checkIfConf() + { + bool answ = false; + if (allDoorOps != null) + { + var rawObj = JsonConvert.DeserializeObject>>(currDoorOp.JsoncActVal!); + if (rawObj != null) + { + foreach (var op in allDoorOps) + { + var opObj = JsonConvert.DeserializeObject>>(op.JsoncActVal!); + if (opObj != null) + { + + if (rawObj["template"] == opObj["template"] && op.DtConfirm != null && op.userConfirm != "") + { + answ = true; + } + } + } + } + } + return answ; + } + + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.css b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.css new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.css @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.less b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.less new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.less @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.min.css b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.min.css new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/WebDoorCreator.UI/Pages/HwPdfConfirm.razor.min.css @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/Index.razor b/WebDoorCreator.UI/Pages/Index.razor index baa924b..a393302 100644 --- a/WebDoorCreator.UI/Pages/Index.razor +++ b/WebDoorCreator.UI/Pages/Index.razor @@ -2,8 +2,8 @@ Index -
    -
    -
    Web Door Creator
    -
    -
    \ No newline at end of file + +
    + +
    + diff --git a/WebDoorCreator.UI/Pages/Index.razor.cs b/WebDoorCreator.UI/Pages/Index.razor.cs new file mode 100644 index 0000000..5fa1a39 --- /dev/null +++ b/WebDoorCreator.UI/Pages/Index.razor.cs @@ -0,0 +1,42 @@ +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.Shared; +using WebDoorCreator.Data.DbModels; +using EgwCoreLib.Razor; + +namespace WebDoorCreator.UI.Pages +{ + public partial class Index + { + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + protected async Task changePage(bool newPage) + { + await Task.Delay(1); + NavManager.NavigateTo("OrdersHomePage"); + } + } +} \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrderDetails.razor b/WebDoorCreator.UI/Pages/OrderDetails.razor index 5f1be2d..6ec3e55 100644 --- a/WebDoorCreator.UI/Pages/OrderDetails.razor +++ b/WebDoorCreator.UI/Pages/OrderDetails.razor @@ -25,14 +25,14 @@
     
    @orderView.NumDoors
    -@* -
    - - -
    *@ + @* +
    + + +
    *@
    } @@ -42,5 +42,8 @@
    - + +
    + +
    diff --git a/WebDoorCreator.UI/Pages/OrderDetails.razor.cs b/WebDoorCreator.UI/Pages/OrderDetails.razor.cs index 45d009c..ed56961 100644 --- a/WebDoorCreator.UI/Pages/OrderDetails.razor.cs +++ b/WebDoorCreator.UI/Pages/OrderDetails.razor.cs @@ -1,3 +1,4 @@ +using EgwCoreLib.Razor; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.WebUtilities; using Newtonsoft.Json; @@ -11,6 +12,8 @@ namespace WebDoorCreator.UI.Pages { #region Public Properties + protected DataPager? pagerDoors = null!; + public string userId { get @@ -106,8 +109,56 @@ namespace WebDoorCreator.UI.Pages #region Private Fields - private List? ListOrdersStatus = null; #endregion Private Fields + + protected DoorsSelectFilter currFilter { get; set; } = new DoorsSelectFilter(); + + private int currPage + { + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get => currFilter.NumRec; + set => currFilter.NumRec = value; + } + private string searchValue + { + get => currFilter.searchValue; + set => currFilter.searchValue = value; + } + + protected int totalCount { get; set; } + + protected void ForceReload(int newNum) + { + numRecord = newNum; + } + + protected void ForceReloadPage(int newNum) + { + currPage = newNum; + } + protected void UpdateTotCount(int newTotCount) + { + totalCount = newTotCount; + } + + private async Task updateFilter(DoorsSelectFilter newParams) + { + isLoading = true; + await Task.Delay(1); + currPage = 1; + searchValue = newParams.searchValue; + await Task.Delay(1); + await InvokeAsync(() => StateHasChanged()); + currFilter = newParams; + isLoading = false; + } } } \ No newline at end of file diff --git a/WebDoorCreator.UI/Pages/OrdersHomePage.razor b/WebDoorCreator.UI/Pages/OrdersHomePage.razor index 57fe87f..94d1b3a 100644 --- a/WebDoorCreator.UI/Pages/OrdersHomePage.razor +++ b/WebDoorCreator.UI/Pages/OrdersHomePage.razor @@ -19,26 +19,34 @@
    *@ -
    - @*
    +
    +
    + @*
    -
    *@ -
    - WEB DOOR CREATOR -
    -
    - -
    - @*
    +
    *@ +
    + WEB DOOR CREATOR +
    +
    + + +
    + @*
    -
    *@ -
    -
    - +
    *@ +
    +
    + +
    + +
    + +
    - - +