From 184d536bb0ba2f933a6442f00a77a4d630662fea Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 18 Sep 2025 16:53:22 +0200 Subject: [PATCH] OK edit classe liste --- .../Controllers/LuxController.cs | 137 +++++++++++++----- EgwCoreLib.Lux.Data/DbModel/GenClassModel.cs | 14 +- .../Services/DataLayerServices.cs | 114 +++++++++------ Lux.UI/Components/Compo/EditBom.razor | 2 +- Lux.UI/Components/Compo/GenClassMan.razor | 100 +++++++++++-- Lux.UI/Components/Compo/GenClassMan.razor.cs | 124 ++++++++++++---- Lux.UI/Components/Pages/GenList.razor | 37 ++--- Lux.UI/Components/Pages/GenList.razor.cs | 33 +---- Lux.UI/Lux.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 12 files changed, 390 insertions(+), 179 deletions(-) diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs index d7d5ce11..b26a9320 100644 --- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs +++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs @@ -4,28 +4,21 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using NLog; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static EgwCoreLib.Lux.Core.Enums; -using static System.Runtime.InteropServices.JavaScript.JSType; namespace EgwCoreLib.Lux.Data.Controllers { - public class LuxController + internal class LuxController { // manca costruttore parametrico contoller... - #region Public Methods + #region Internal Methods /// /// Elenco completo Customers da DB /// /// - public List CustomersGetAll() + internal List CustomersGetAll() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -49,7 +42,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// Elenco completo Dealers da DB /// /// - public List DealersGetAll() + internal List DealersGetAll() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -69,11 +62,47 @@ namespace EgwCoreLib.Lux.Data.Controllers return dbResult; } + /// + /// Esegue eliminazione + refresh cache + /// + /// + /// + internal async Task GenClassDeleteAsync(GenClassModel upsRec) + { + bool answ = false; + //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + var dbResult = dbCtx + .DbSetGenClass + .Where(x => x.ClassCod == upsRec.ClassCod) + .FirstOrDefault(); + + var numChild = dbCtx + .DbSetGenVal + .Count(x => x.ClassCod == upsRec.ClassCod); + // se trovato e NON HA record child --> elimino + if (dbResult != null && numChild == 0) + { + dbCtx.DbSetGenClass.Remove(dbResult); + await dbCtx.SaveChangesAsync(); + } + } + catch (Exception exc) + { + Log.Error($"Eccezione durante GenClassDeleteAsync{Environment.NewLine}{exc}"); + } + } + return answ; + } + /// /// Elenco completo GenClass /// /// - public async Task> GenClassGetAllAsync() + internal async Task> GenClassGetAllAsync() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -83,6 +112,7 @@ namespace EgwCoreLib.Lux.Data.Controllers { dbResult = await dbCtx .DbSetGenClass + .Include(o => o.GenValNav) .ToListAsync(); } catch (Exception exc) @@ -93,12 +123,51 @@ namespace EgwCoreLib.Lux.Data.Controllers return dbResult; } + /// + /// Upsert record GenClass + /// + /// + /// + internal async Task GenClassUpsertAsync(GenClassModel upsRec) + { + bool answ = false; + //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + var currRec = dbCtx + .DbSetGenClass + .Where(x => x.ClassCod == upsRec.ClassCod) + .FirstOrDefault(); + // se trovato --> aggiorno + if (currRec != null) + { + currRec.Description = upsRec.Description; + dbCtx.Entry(currRec).State = EntityState.Modified; + } + // se mancasse --> aggiungo + else + { + dbCtx.DbSetGenClass.Add(upsRec); + } + // salvo... + await dbCtx.SaveChangesAsync(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante GenClassUpsertAsync{Environment.NewLine}{exc}"); + } + } + return answ; + } + /// /// Elenco valori x classe richiesta /// /// /// - public async Task> GenValGetFiltAsync(string codClass) + internal async Task> GenValGetFiltAsync(string codClass) { List dbResult = new List(); if (!string.IsNullOrEmpty(codClass)) @@ -127,7 +196,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public async Task ItemDeleteAsync(ItemModel rec2del) + internal async Task ItemDeleteAsync(ItemModel rec2del) { bool result = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -157,7 +226,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// Elenco completo Items /// /// - public List ItemGetAll() + internal List ItemGetAll() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -183,7 +252,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// ID parent (valido quindi >0) /// - public List ItemGetChild(int ItemIdParent) + internal List ItemGetChild(int ItemIdParent) { List dbResult = new List(); if (ItemIdParent > 0) @@ -213,7 +282,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// ID item corrente (valido quindi >0) /// - public List ItemGetAlt(int ItemId) + internal List ItemGetAlt(int ItemId) { List dbResult = new List(); if (ItemId > 0) @@ -264,7 +333,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public List ItemGetFilt(string CodGroup, ItemClassType ItemType) + internal List ItemGetFilt(string CodGroup, ItemClassType ItemType) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -293,7 +362,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public List ItemGetFilt(string CodGroup, ItemClassType ItemType, string SearchVal) + internal List ItemGetFilt(string CodGroup, ItemClassType ItemType, string SearchVal) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -327,7 +396,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public async Task> ItemGetFiltAsync(string CodGroup, ItemClassType ItemType) + internal async Task> ItemGetFiltAsync(string CodGroup, ItemClassType ItemType) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -357,7 +426,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public async Task> ItemGetFiltAsync(string CodGroup, ItemClassType ItemType, string SearchVal) + internal async Task> ItemGetFiltAsync(string CodGroup, ItemClassType ItemType, string SearchVal) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -389,7 +458,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public List ItemGetSearch(string SearchVal) + internal List ItemGetSearch(string SearchVal) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -415,7 +484,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public async Task> ItemGetSearchAsync(string SearchVal) + internal async Task> ItemGetSearchAsync(string SearchVal) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -440,7 +509,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// Elenco completo ItemGroup gestiti /// /// - public List ItemGroupGetAll() + internal List ItemGroupGetAll() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -464,7 +533,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// Elenco completo ItemGroup gestiti async /// /// - public async Task> ItemGroupGetAllAsync() + internal async Task> ItemGroupGetAllAsync() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -484,7 +553,7 @@ namespace EgwCoreLib.Lux.Data.Controllers return dbResult; } - public bool ItemUpsert(ItemModel newRec) + internal bool ItemUpsert(ItemModel newRec) { bool answ = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -529,7 +598,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public async Task ItemUpsertAsync(ItemModel currRec) + internal async Task ItemUpsertAsync(ItemModel currRec) { bool result = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -576,7 +645,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public bool ItemUpsertFromBom(List bomList) + internal bool ItemUpsertFromBom(List bomList) { bool answ = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -634,7 +703,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// Elenco completo offerte da DB /// /// - public async Task> OfferGetAll() + internal async Task> OfferGetAll() { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -662,7 +731,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public List OfferRowGetByOffer(int OfferID) + internal List OfferRowGetByOffer(int OfferID) { List dbResult = new List(); //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -691,7 +760,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// ID riga offerta da aggiornare /// Bom aggiornata da salvare /// - public async Task OffertRowUpdateBom(int OfferRowID, List newBomList) + internal async Task OffertRowUpdateBom(int OfferRowID, List newBomList) { bool answ = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -749,7 +818,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public async Task OffertUpdateCost(int OfferID) + internal async Task OffertUpdateCost(int OfferID) { bool answ = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -864,7 +933,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - public bool OfferUpsertFromBom(string uID, List bomList) + internal bool OfferUpsertFromBom(string uID, List bomList) { bool answ = false; //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) @@ -917,7 +986,7 @@ namespace EgwCoreLib.Lux.Data.Controllers return answ; } - #endregion Public Methods + #endregion Internal Methods #region Private Fields diff --git a/EgwCoreLib.Lux.Data/DbModel/GenClassModel.cs b/EgwCoreLib.Lux.Data/DbModel/GenClassModel.cs index 888c6791..eb97b3f6 100644 --- a/EgwCoreLib.Lux.Data/DbModel/GenClassModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/GenClassModel.cs @@ -20,7 +20,19 @@ namespace EgwCoreLib.Lux.Data.DbModel /// Descrizione /// public string Description { get; set; } = ""; + + /// + /// Numero Item compresi + /// + [NotMapped] + public int NumChild + { + get => GenValNav?.Count ?? 0; + } - + /// + /// Navigazione alle righe dei valori associati + /// + public virtual ICollection GenValNav { get; set; } = new List(); } } diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs index af425d73..ab810e43 100644 --- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs +++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs @@ -32,8 +32,8 @@ namespace EgwCoreLib.Lux.Data.Services } else { - dbController = new LuxController(); //dbController = new Controllers.LuxController(configuration); + dbController = new LuxController(); StringBuilder sb = new StringBuilder(); sb.AppendLine($"DataLayerServices | LuxController OK"); Log.Info(sb.ToString()); @@ -42,12 +42,6 @@ namespace EgwCoreLib.Lux.Data.Services #endregion Public Constructors - #region Public Properties - - public static LuxController dbController { get; set; } = null!; - - #endregion Public Properties - #region Public Methods /// @@ -148,6 +142,19 @@ namespace EgwCoreLib.Lux.Data.Services return answ; } + /// + /// Esegue eliminazione + refresh cache + /// + /// + /// + public async Task GenClassDeleteAsync(GenClassModel selRec) + { + bool result = await dbController.GenClassDeleteAsync(selRec); + await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:GenClass"); + await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:GenVal:*"); + return result; + } + /// /// Elenco completo GenClass /// @@ -182,6 +189,19 @@ namespace EgwCoreLib.Lux.Data.Services return result; } + /// + /// Esegue Upsert del record ricevuto + /// + /// + /// + public async Task GenClassUpsertAsync(GenClassModel upsRec) + { + bool result = await dbController.GenClassUpsertAsync(upsRec); + await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:GenClass"); + await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:GenVal:*"); + return result; + } + /// /// Elenco valori x classe richiesta /// @@ -266,43 +286,6 @@ namespace EgwCoreLib.Lux.Data.Services return result; } -#if false - /// - /// Elenco item Child da ParentId (per sostituzione) async - /// - /// ID corrente di cui cercare parent + fratelli - /// - public List ItemGetChild(int ItemId) - { - string source = "DB"; - Stopwatch sw = new Stopwatch(); - sw.Start(); - List? result = new List(); - // cerco in redis... - string currKey = $"{redisBaseKey}:Item:ListChild:{ItemId}"; - RedisValue rawData = redisDb.StringGet(currKey); - if (rawData.HasValue) - { - result = JsonConvert.DeserializeObject>($"{rawData}"); - source = "REDIS"; - } - else - { - result = dbController.ItemGetChild(ItemId); - // serializzo e salvo con config x evitare loop... - rawData = JsonConvert.SerializeObject(result, JSSettings); - redisDb.StringSet(currKey, rawData, FastCache); - } - if (result == null) - { - result = new List(); - } - sw.Stop(); - Log.Debug($"ItemGetChild | {source} | {sw.Elapsed.TotalMilliseconds}ms"); - return result; - } -#endif - /// /// Elenco item da ricerca completa Async /// @@ -801,5 +784,48 @@ namespace EgwCoreLib.Lux.Data.Services private string redisBaseKey = "Lux:Cache"; #endregion Private Fields + + #region Private Properties + + private static LuxController dbController { get; set; } = null!; + + #endregion Private Properties + +#if false + /// + /// Elenco item Child da ParentId (per sostituzione) async + /// + /// ID corrente di cui cercare parent + fratelli + /// + public List ItemGetChild(int ItemId) + { + string source = "DB"; + Stopwatch sw = new Stopwatch(); + sw.Start(); + List? result = new List(); + // cerco in redis... + string currKey = $"{redisBaseKey}:Item:ListChild:{ItemId}"; + RedisValue rawData = redisDb.StringGet(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + source = "REDIS"; + } + else + { + result = dbController.ItemGetChild(ItemId); + // serializzo e salvo con config x evitare loop... + rawData = JsonConvert.SerializeObject(result, JSSettings); + redisDb.StringSet(currKey, rawData, FastCache); + } + if (result == null) + { + result = new List(); + } + sw.Stop(); + Log.Debug($"ItemGetChild | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + return result; + } +#endif } } \ No newline at end of file diff --git a/Lux.UI/Components/Compo/EditBom.razor b/Lux.UI/Components/Compo/EditBom.razor index b68183c1..7ee0f337 100644 --- a/Lux.UI/Components/Compo/EditBom.razor +++ b/Lux.UI/Components/Compo/EditBom.razor @@ -15,7 +15,7 @@ @foreach (var item in bomDict) { - @if (item.Key == currIdx && EditRecord != null) + @if (EditRecord != null && item.Key == currIdx) { @(item.Key + 1) diff --git a/Lux.UI/Components/Compo/GenClassMan.razor b/Lux.UI/Components/Compo/GenClassMan.razor index 589a5c07..d988515a 100644 --- a/Lux.UI/Components/Compo/GenClassMan.razor +++ b/Lux.UI/Components/Compo/GenClassMan.razor @@ -1,4 +1,50 @@ - +@if (AddVisible) +{ + +} +
- + + @foreach (var item in ListRecords) { - - - - - - + + @if (EditRecord != null && item.ClassCod == EditRecord.ClassCod) + { + + + + + + } + else + { + + + + + + } } diff --git a/Lux.UI/Components/Compo/GenClassMan.razor.cs b/Lux.UI/Components/Compo/GenClassMan.razor.cs index 02d63d9f..2c3a0f62 100644 --- a/Lux.UI/Components/Compo/GenClassMan.razor.cs +++ b/Lux.UI/Components/Compo/GenClassMan.razor.cs @@ -1,13 +1,22 @@ using EgwCoreLib.Lux.Data.DbModel; using EgwCoreLib.Lux.Data.Services; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.DataProtection; using Microsoft.JSInterop; using NLog.LayoutRenderers; +using System.Threading.Tasks; namespace Lux.UI.Components.Compo { public partial class GenClassMan { + #region Public Properties + + [Parameter] + public EventCallback EC_Selected { get; set; } + + [Parameter] + public EventCallback EC_Updated { get; set; } [Parameter] public List ListGenClass { get; set; } = null!; @@ -15,8 +24,7 @@ namespace Lux.UI.Components.Compo [Parameter] public string SearchVal { get; set; } = ""; - [Parameter] - public EventCallback EC_Selected { get; set; } + #endregion Public Properties #region Protected Fields @@ -37,6 +45,50 @@ namespace Lux.UI.Components.Compo #region Protected Methods + protected void ToggleAdd() + { + AddVisible = !AddVisible; + NewRecord = new GenClassModel() + { + ClassCod = "NewClass", + Description = $"Descrizione-{DateTime.Now:yyyy.MM.dd-HH.mm.ss}" + }; + } + private bool AddVisible = false; + private string ErrorMsg = ""; + + /// + /// Genera nuovo record e lo salva + /// + /// + protected async Task DoAdd() + { + if (NewRecord != null) + { + // verifico non sia duplicato... + var recExist = ListRecords.Count(x => x.ClassCod == NewRecord.ClassCod); + if (recExist > 0) + { + ErrorMsg = $"Errore: record già esistente con codice {NewRecord.ClassCod}"; + } + else + { + ErrorMsg = ""; + // faccio upsert record... + await DLService.GenClassUpsertAsync(NewRecord); + // segnalo update x reload + await EC_Updated.InvokeAsync(true); + NewRecord = null; + } + } + } + + protected void DoCancel() + { + ResetEdit(); + UpdateTable(); + } + /// /// Clona record /// @@ -59,34 +111,39 @@ namespace Lux.UI.Components.Compo QtyMin = curRec.QtyMin, QtyMax = curRec.QtyMax, UM = curRec.UM - }; + }; #endif } /// - /// impossta record x eliminazione + /// Eliminazione record /// /// protected async Task DoDelete(GenClassModel selRec) { + // controlo che NON abbia child obj... altrimenti esco + if (selRec.NumChild > 0) + return; + if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il record? Dettagli: {selRec.ClassCod} | {selRec.Description}")) return; - //// esegue eliminazione del record... - //await DLService.ItemDeleteAsync(selRec); - editRecord = null; - selRecord = null; - ReloadData(); - UpdateTable(); + // esegue eliminazione del record... + await DLService.GenClassDeleteAsync(selRec); + + // segnalo update x reload + await EC_Updated.InvokeAsync(true); } /// /// Edit articolo selezionato /// /// - protected void DoEdit(GenClassModel curRec) + protected async void DoEdit(GenClassModel curRec) { - editRecord = curRec; + EditRecord = curRec; + SelRecord = curRec; + await EC_Selected.InvokeAsync(curRec.ClassCod); } /// @@ -94,17 +151,26 @@ namespace Lux.UI.Components.Compo /// protected async void DoReset() { - editRecord = null; + EditRecord = null; + SelRecord = null; await EC_Selected.InvokeAsync(""); } + protected async Task DoSave(GenClassModel currRec) + { + // faccio upsert record... + await DLService.GenClassUpsertAsync(currRec); + // segnalo update x reload + await EC_Updated.InvokeAsync(true); + } + /// /// Selezione articolo x display info /// /// protected async void DoSelect(GenClassModel curRec) { - selRecord = curRec; + SelRecord = curRec; await EC_Selected.InvokeAsync(curRec.ClassCod); } @@ -130,16 +196,16 @@ namespace Lux.UI.Components.Compo #region Private Fields - private int currPage = 1; - private GenClassModel? editRecord = null; + private GenClassModel? EditRecord = null; + private GenClassModel? NewRecord = null; private bool isLoading = false; private int numRecord = 10; - private GenClassModel? selRecord = null; + private GenClassModel? SelRecord = null; private int totalCount = 0; @@ -147,21 +213,14 @@ namespace Lux.UI.Components.Compo #region Private Methods - private void DoCancel() + private string checkSel(GenClassModel curRec) { - ResetEdit(); - UpdateTable(); - } - - private async Task DoSave(GenClassModel currRec) - { - // salvo - await Task.Delay(10); -#if false - await DLService.ItemUpsertAsync(currRec); -#endif - ResetEdit(); - UpdateTable(); + string answ = ""; + if (SelRecord != null) + { + answ = curRec.ClassCod == SelRecord.ClassCod ? "table-info" : ""; + } + return answ; } private void ReloadData() @@ -183,7 +242,7 @@ namespace Lux.UI.Components.Compo private void ResetEdit() { // reset edit - editRecord = null; + EditRecord = null; ReloadData(); } @@ -194,6 +253,7 @@ namespace Lux.UI.Components.Compo { // fix paginazione ListRecords = AllRecords + .OrderBy(x => x.ClassCod) .Skip(numRecord * (currPage - 1)) .Take(numRecord) .ToList(); diff --git a/Lux.UI/Components/Pages/GenList.razor b/Lux.UI/Components/Pages/GenList.razor index 569e1bcb..903e41a0 100644 --- a/Lux.UI/Components/Pages/GenList.razor +++ b/Lux.UI/Components/Pages/GenList.razor @@ -8,24 +8,6 @@ Anagrafiche Generiche
-
- @if (!string.IsNullOrEmpty(SelCodGroup)) - { - - } -
-
-
- Gruppo - -
-
@@ -38,12 +20,19 @@
-
- -
-
- -
+ @if (isLoading) + { + + } + else + { +
+ +
+
+ +
+ }
\ No newline at end of file diff --git a/Lux.UI/Components/Pages/GenList.razor.cs b/Lux.UI/Components/Pages/GenList.razor.cs index 9cd9cdd0..ba25de8d 100644 --- a/Lux.UI/Components/Pages/GenList.razor.cs +++ b/Lux.UI/Components/Pages/GenList.razor.cs @@ -2,6 +2,7 @@ using EgwCoreLib.Lux.Data.DbModel; using EgwCoreLib.Lux.Data.Services; using Lux.UI.Components.Compo; using Microsoft.AspNetCore.Components; +using System.Threading.Tasks; namespace Lux.UI.Components.Pages { @@ -49,35 +50,10 @@ namespace Lux.UI.Components.Pages #region Protected Methods - protected void DoAdd() - { - editRecord = new ItemModel() - { -#if false - CodGroup = ListGenClass.FirstOrDefault()?.CodGroup ?? "", -#endif - ItemType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND, - IsService = false, - ItemCode = 0, - ExtItemCode = "NEW-ITEM", - SupplCode = "", - Description = $"Nuova Offerta {DateTime.Today:ddd yyyy.MM.dd}", - Cost = 0, - Margin = 0, - QtyMin = 0, - QtyMax = 0, - UM = "#" - }; - } - protected override async Task OnInitializedAsync() { isLoading = true; await ReloadBaseData(); -#if false - await ReloadData(); - UpdateTable(); -#endif } protected void ResetSearch() @@ -96,9 +72,16 @@ namespace Lux.UI.Components.Pages #region Private Methods + private async Task ForceReloadAsync() + { + await ReloadBaseData(); + } + private async Task ReloadBaseData() { + isLoading = true; ListGenClass = await DLService.GenClassGetAllAsync(); + isLoading = false; } private void SaveSel(string codGroup) diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index a0fcec6b..328212b0 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 0.9.2509.1813 + 0.9.2509.1816 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 53d02dee..2c553fa7 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 0.9.2509.1813

+

Versione: 0.9.2509.1816


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 9f8d908b..b1f250ea 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -0.9.2509.1813 +0.9.2509.1816 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 2499a925..90bf740f 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 0.9.2509.1813 + 0.9.2509.1816 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false
@@ -6,24 +52,50 @@ Cod Descrizione# Val + +
- - @* - *@ - @item.ClassCod@item.Description - @* *@ -
+ + + @item.ClassCod@item.NumChild + + + + + @* *@ + @item.ClassCod@item.Description@item.NumChild + @if (item.NumChild > 0) + { + + } + else + { + + } +