From 9bb42101eabd22c7a11f5157394b39db08adad92 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 8 Feb 2024 10:23:06 +0100 Subject: [PATCH 1/4] Fix editing materiali --- MagMan.UI/Components/MaterialEdit.razor | 26 +++++++++++++++++----- MagMan.UI/Components/MaterialEdit.razor.cs | 21 ++++++++++------- MagMan.UI/Components/MaterialMan.razor | 2 +- MagMan.UI/MagMan.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 7 files changed, 38 insertions(+), 19 deletions(-) diff --git a/MagMan.UI/Components/MaterialEdit.razor b/MagMan.UI/Components/MaterialEdit.razor index 2bcbad3..c054487 100644 --- a/MagMan.UI/Components/MaterialEdit.razor +++ b/MagMan.UI/Components/MaterialEdit.razor @@ -16,18 +16,32 @@
+ @if (MatType != 2) + { +
+ + +
+ } + else + { +
+ + +
+ }
- - -
-
- +
- +
+ @*
+ + +
*@ @* *@
diff --git a/MagMan.UI/Components/MaterialEdit.razor.cs b/MagMan.UI/Components/MaterialEdit.razor.cs index 4e2f325..22d9e9b 100644 --- a/MagMan.UI/Components/MaterialEdit.razor.cs +++ b/MagMan.UI/Components/MaterialEdit.razor.cs @@ -1,5 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. +// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this +// file to you under the MIT license. using MagMan.Data.Admin.DbModels; using MagMan.Data.Admin.Services; using MagMan.Data.Tenant.DbModels; @@ -15,11 +15,15 @@ namespace MagMan.UI.Components [Parameter] public MaterialModel? CurrRecord { get; set; } = null; - [Parameter] - public int KeyNum { get; set; } = 0; [Parameter] public EventCallback EC_update { get; set; } + [Parameter] + public int MatType { get; set; } = 0; + + [Parameter] + public int KeyNum { get; set; } = 0; + #endregion Public Properties #region Protected Properties @@ -31,6 +35,11 @@ namespace MagMan.UI.Components #region Protected Methods + protected async Task DoCancel() + { + await EC_update.InvokeAsync(true); + } + protected async Task DoSave() { bool fatto = false; @@ -44,10 +53,6 @@ namespace MagMan.UI.Components await EC_update.InvokeAsync(true); } } - protected async Task DoCancel() - { - await EC_update.InvokeAsync(true); - } #endregion Protected Methods } diff --git a/MagMan.UI/Components/MaterialMan.razor b/MagMan.UI/Components/MaterialMan.razor index 179ebb6..bfb1dc4 100644 --- a/MagMan.UI/Components/MaterialMan.razor +++ b/MagMan.UI/Components/MaterialMan.razor @@ -32,7 +32,7 @@ @if (CurrItem != null) {
- + }
diff --git a/MagMan.UI/MagMan.UI.csproj b/MagMan.UI/MagMan.UI.csproj index ca235e7..1255cab 100644 --- a/MagMan.UI/MagMan.UI.csproj +++ b/MagMan.UI/MagMan.UI.csproj @@ -2,7 +2,7 @@ net6.0 - 1.0.2402.0809 + 1.0.2402.0810 enable enable true diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index d5e2737..faa5bce 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MagMan - Wood Warehouse Management System -

Versione: 1.0.2402.0809

+

Versione: 1.0.2402.0810


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index f3b28c1..78484e2 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2402.0809 +1.0.2402.0810 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index be41279..73692cd 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2402.0809 + 1.0.2402.0810 http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html false From f43acfd3ac8b7ebb8e31e32d5558a8930dfa1ff3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 8 Feb 2024 11:24:34 +0100 Subject: [PATCH 2/4] Fix ItemRaw add --- .../Controllers/TenantController.cs | 135 +++++++++--------- MagMan.UI/Components/ItemMan.razor | 2 +- MagMan.UI/Components/ItemMan.razor.cs | 19 ++- MagMan.UI/Components/MaterialEdit.razor | 5 - MagMan.UI/MagMan.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 8 files changed, 88 insertions(+), 81 deletions(-) diff --git a/MagMan.Data.Tenant/Controllers/TenantController.cs b/MagMan.Data.Tenant/Controllers/TenantController.cs index c51e9bb..c8c5cdb 100644 --- a/MagMan.Data.Tenant/Controllers/TenantController.cs +++ b/MagMan.Data.Tenant/Controllers/TenantController.cs @@ -77,6 +77,30 @@ namespace MagMan.Data.Tenant.Controllers return done; } + /// + /// Converte il DTO in ItemModel + /// + /// DTO di partenza + /// Parametro active da impostare + /// + public RawItemModel ItemFromDto(ItemDTO origItem, bool isActive) + { + RawItemModel answ = new RawItemModel() + { + MatId = origItem.MatCloudId, + IsRemn = origItem.IsRemn, + Location = origItem.Location, + QtyAvail = origItem.QtyAvail, + HMm = origItem.HMm, + LMm = origItem.LMm, + WMm = origItem.WMm, + Note = origItem.Note, + IsActive = isActive + }; + + return answ; + } + /// /// Elenco Items gestiti a magazzino (all) /// @@ -146,16 +170,12 @@ namespace MagMan.Data.Tenant.Controllers return dbResult; } - /// - /// Aggiunge/Modifica un item in magazzino - /// - /// Stringa connessione (variabile x cliente) - /// Record da aggiornare - /// quantità da aggiornare (se <0 è consumo) - /// User corrente (SE applicabile) - /// Messaggio registrato x variazione positiva - /// Messaggio registrato x variazione negativa - /// + /// Aggiunge/Modifica un item in magazzino Stringa connessione (variabile x cliente) Record da aggiornare quantità da + /// aggiornare (se <0 è consumo) User corrente (SE + /// applicabile) Messaggio registrato x variazione + /// positiva Messaggio registrato x variazione negativa public bool ItemModQty(string connString, RawItemModel rec2upd, int deltaQty, string userId, string msgAdd, string msgRem) { bool done = false; @@ -206,6 +226,41 @@ namespace MagMan.Data.Tenant.Controllers return done; } + /// + /// Converte lista ItemModel in DTO + /// + /// Elenco ItemModel di partenza + /// + public List ItemsToDto(List origItem) + { + List answ = answ = origItem.Select(x => ItemToDto(x)).ToList(); + return answ; + } + + /// + /// Converte ItemModel in DTO + /// + /// ItemModel di partenza + /// + public ItemDTO ItemToDto(RawItemModel origItem) + { + ItemDTO answ = new ItemDTO() + { + MatCloudId = origItem.MatId, + RawItemCloudId = origItem.RawItemId, + IsRemn = origItem.IsRemn, + Location = origItem.Location, + QtyAvail = origItem.QtyAvail, + HMm = origItem.HMm, + LMm = origItem.LMm, + WMm = origItem.WMm, + Note = origItem.Note, + ItemDtmx = origItem.ItemDtmx + }; + + return answ; + } + /// /// Aggiunge/Modifica un item in magazzino /// @@ -261,6 +316,8 @@ namespace MagMan.Data.Tenant.Controllers } else { + // levo il matNav... + rec2upd.MaterialNav = new MaterialModel(); dbCtx .DbSetItems .Add(rec2upd); @@ -406,64 +463,6 @@ namespace MagMan.Data.Tenant.Controllers return dbResult; } - /// - /// Converte il DTO in ItemModel - /// - /// DTO di partenza - /// Parametro active da impostare - /// - public RawItemModel ItemFromDto(ItemDTO origItem, bool isActive) - { - RawItemModel answ = new RawItemModel() - { - MatId = origItem.MatCloudId, - IsRemn = origItem.IsRemn, - Location = origItem.Location, - QtyAvail = origItem.QtyAvail, - HMm = origItem.HMm, - LMm = origItem.LMm, - WMm = origItem.WMm, - Note = origItem.Note, - IsActive = isActive - }; - - return answ; - } - - /// - /// Converte ItemModel in DTO - /// - /// ItemModel di partenza - /// - public ItemDTO ItemToDto(RawItemModel origItem) - { - ItemDTO answ = new ItemDTO() - { - MatCloudId = origItem.MatId, - RawItemCloudId = origItem.RawItemId, - IsRemn = origItem.IsRemn, - Location = origItem.Location, - QtyAvail = origItem.QtyAvail, - HMm = origItem.HMm, - LMm = origItem.LMm, - WMm = origItem.WMm, - Note = origItem.Note, - ItemDtmx = origItem.ItemDtmx - }; - - return answ; - } - /// - /// Converte lista ItemModel in DTO - /// - /// Elenco ItemModel di partenza - /// - public List ItemsToDto(List origItem) - { - List answ = answ = origItem.Select(x => ItemToDto(x)).ToList(); - return answ; - } - /// /// Elenco Materiali gestiti a magazzino /// diff --git a/MagMan.UI/Components/ItemMan.razor b/MagMan.UI/Components/ItemMan.razor index d5e11cd..666a208 100644 --- a/MagMan.UI/Components/ItemMan.razor +++ b/MagMan.UI/Components/ItemMan.razor @@ -22,7 +22,7 @@ @if (CurrItem != null) {
    - + }
diff --git a/MagMan.UI/Components/ItemMan.razor.cs b/MagMan.UI/Components/ItemMan.razor.cs index 80912fc..c200a7e 100644 --- a/MagMan.UI/Components/ItemMan.razor.cs +++ b/MagMan.UI/Components/ItemMan.razor.cs @@ -54,6 +54,7 @@ namespace MagMan.UI.Components #region Protected Methods + protected string CheckSel(RawItemModel curItem) { string answ = ""; @@ -70,17 +71,29 @@ namespace MagMan.UI.Components protected async Task CreateNew() { + string matNote = $"{MaterialSel.MatCode.Replace("_"," ")}"; + if (MaterialSel.IsBeam) + { + matNote += $" {MaterialSel.WMm:N0}x{MaterialSel.HMm:N0}"; + } + else + { + matNote += $" {MaterialSel.HMm:N0}"; + } CurrItem = new RawItemModel() { MatId = MaterialSel.MatId, Location = "nd", - Note = "...", + Note = matNote, QtyAvail = 0, IsActive = true, IsRemn = false, + MaterialNav = MaterialSel, HMm = MaterialSel.HMm, - LMm = MaterialSel.LMm, - WMm = MaterialSel.WMm + //LMm = MaterialSel.LMm, + //WMm = MaterialSel.WMm + LMm = 100, + WMm = MaterialSel.IsBeam ? MaterialSel.WMm : 100 }; await InvokeAsync(StateHasChanged); } diff --git a/MagMan.UI/Components/MaterialEdit.razor b/MagMan.UI/Components/MaterialEdit.razor index c054487..a38d796 100644 --- a/MagMan.UI/Components/MaterialEdit.razor +++ b/MagMan.UI/Components/MaterialEdit.razor @@ -38,12 +38,7 @@
- @*
- - -
*@ - @* *@
diff --git a/MagMan.UI/MagMan.UI.csproj b/MagMan.UI/MagMan.UI.csproj index 1255cab..9fea62c 100644 --- a/MagMan.UI/MagMan.UI.csproj +++ b/MagMan.UI/MagMan.UI.csproj @@ -2,7 +2,7 @@ net6.0 - 1.0.2402.0810 + 1.0.2402.0811 enable enable true diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index faa5bce..5d376fa 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MagMan - Wood Warehouse Management System -

Versione: 1.0.2402.0810

+

Versione: 1.0.2402.0811


Note di rilascio: