diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 3ed6c5d6..38194411 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 0.9.2509.1812 + 0.9.2509.1813 diff --git a/Lux.UI/Components/Compo/GenClassMan.razor b/Lux.UI/Components/Compo/GenClassMan.razor new file mode 100644 index 00000000..589a5c07 --- /dev/null +++ b/Lux.UI/Components/Compo/GenClassMan.razor @@ -0,0 +1,40 @@ + + + + + + + + + + + @foreach (var item in ListRecords) + { + + + + + + + + } + + + + + + +
+ + CodDescrizione
+ + @* + *@ + @item.ClassCod@item.Description + @* *@ +
+ @if (totalCount >= numRecord) + { + + } +
\ No newline at end of file diff --git a/Lux.UI/Components/Compo/GenClassMan.razor.cs b/Lux.UI/Components/Compo/GenClassMan.razor.cs new file mode 100644 index 00000000..02d63d9f --- /dev/null +++ b/Lux.UI/Components/Compo/GenClassMan.razor.cs @@ -0,0 +1,205 @@ +using EgwCoreLib.Lux.Data.DbModel; +using EgwCoreLib.Lux.Data.Services; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using NLog.LayoutRenderers; + +namespace Lux.UI.Components.Compo +{ + public partial class GenClassMan + { + + [Parameter] + public List ListGenClass { get; set; } = null!; + + [Parameter] + public string SearchVal { get; set; } = ""; + + [Parameter] + public EventCallback EC_Selected { get; set; } + + #region Protected Fields + + protected List AllRecords = new List(); + protected List ListRecords = new List(); + + #endregion Protected Fields + + #region Protected Properties + + [Inject] + protected DataLayerServices DLService { get; set; } = null!; + + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Clona record + /// + /// + protected void DoClone(GenClassModel curRec) + { +#if false + editRecord = new ItemModel() + { + ItemIDParent = curRec.ItemType == Enums.ItemClassType.Bom ? curRec.ItemID : curRec.ItemIDParent, + CodGroup = curRec.CodGroup, + ItemType = curRec.ItemType == Enums.ItemClassType.Bom ? Enums.ItemClassType.BomAlt : curRec.ItemType, + IsService = curRec.IsService, + ItemCode = curRec.ItemCode, + ExtItemCode = $"{curRec.ExtItemCode} - COPY", + SupplCode = curRec.ItemType == Enums.ItemClassType.Bom ? $"{curRec.SupplCode} ALT" : curRec.SupplCode, + Description = $"{curRec.Description} - COPY", + Cost = curRec.Cost, + Margin = curRec.Margin, + QtyMin = curRec.QtyMin, + QtyMax = curRec.QtyMax, + UM = curRec.UM + }; +#endif + } + + /// + /// impossta record x eliminazione + /// + /// + protected async Task DoDelete(GenClassModel selRec) + { + 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(); + } + + /// + /// Edit articolo selezionato + /// + /// + protected void DoEdit(GenClassModel curRec) + { + editRecord = curRec; + } + + /// + /// Reset selezione + /// + protected async void DoReset() + { + editRecord = null; + await EC_Selected.InvokeAsync(""); + } + + /// + /// Selezione articolo x display info + /// + /// + protected async void DoSelect(GenClassModel curRec) + { + selRecord = curRec; + await EC_Selected.InvokeAsync(curRec.ClassCod); + } + + protected override void OnParametersSet() + { + ReloadData(); + UpdateTable(); + } + + protected void SaveNumRec(int newNum) + { + numRecord = newNum; + UpdateTable(); + } + + protected void SavePage(int newNum) + { + currPage = newNum; + UpdateTable(); + } + + #endregion Protected Methods + + #region Private Fields + + + private int currPage = 1; + + private GenClassModel? editRecord = null; + + private bool isLoading = false; + + private int numRecord = 10; + + private GenClassModel? selRecord = null; + + private int totalCount = 0; + + #endregion Private Fields + + #region Private Methods + + private void DoCancel() + { + ResetEdit(); + UpdateTable(); + } + + private async Task DoSave(GenClassModel currRec) + { + // salvo + await Task.Delay(10); +#if false + await DLService.ItemUpsertAsync(currRec); +#endif + ResetEdit(); + UpdateTable(); + } + + private void ReloadData() + { + isLoading = true; + AllRecords = ListGenClass; + // se ho ricerca testuale faccio filtro ulteriore... + if (!string.IsNullOrEmpty(SearchVal)) + { + AllRecords = AllRecords + .Where(x => + x.ClassCod.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase) || + x.Description.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase)) + .ToList(); + } + totalCount = AllRecords.Count; + } + + private void ResetEdit() + { + // reset edit + editRecord = null; + ReloadData(); + } + + /// + /// Filtro e paginazione + /// + private void UpdateTable() + { + // fix paginazione + ListRecords = AllRecords + .Skip(numRecord * (currPage - 1)) + .Take(numRecord) + .ToList(); + isLoading = false; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/Lux.UI/Components/Pages/GenList.razor b/Lux.UI/Components/Pages/GenList.razor index 9f717a5a..569e1bcb 100644 --- a/Lux.UI/Components/Pages/GenList.razor +++ b/Lux.UI/Components/Pages/GenList.razor @@ -37,6 +37,13 @@
- +
+
+ +
+
+ +
+
\ 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 83181e56..9cd9cdd0 100644 --- a/Lux.UI/Components/Pages/GenList.razor.cs +++ b/Lux.UI/Components/Pages/GenList.razor.cs @@ -54,7 +54,7 @@ namespace Lux.UI.Components.Pages editRecord = new ItemModel() { #if false - CodGroup = ListGenClass.FirstOrDefault()?.CodGroup ?? "", + CodGroup = ListGenClass.FirstOrDefault()?.CodGroup ?? "", #endif ItemType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND, IsService = false, @@ -101,6 +101,11 @@ namespace Lux.UI.Components.Pages ListGenClass = await DLService.GenClassGetAllAsync(); } + private void SaveSel(string codGroup) + { + SelCodGroup = codGroup; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index 3b8c9558..a0fcec6b 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.1812 + 0.9.2509.1813 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 2d5516c2..53d02dee 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 0.9.2509.1812

+

Versione: 0.9.2509.1813


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index f3b6368d..9f8d908b 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -0.9.2509.1812 +0.9.2509.1813 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 16784692..2499a925 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 0.9.2509.1812 + 0.9.2509.1813 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false