- @if (!ShowItemsBuy && (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND))
+ @if (AddEnabled())
{
}
diff --git a/Lux.UI/Components/Compo/Item/DataFilter.razor.cs b/Lux.UI/Components/Compo/Item/DataFilter.razor.cs
index 0c91d8be..cc6df0f2 100644
--- a/Lux.UI/Components/Compo/Item/DataFilter.razor.cs
+++ b/Lux.UI/Components/Compo/Item/DataFilter.razor.cs
@@ -38,6 +38,20 @@ namespace Lux.UI.Components.Compo.Item
#endregion Protected Methods
+ private bool AddEnabled()
+ {
+ bool answ = false;
+ if (ShowItemsBuy)
+ {
+ answ = (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND);
+ }
+ else
+ {
+ answ = (SelEnvir != EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.NULL);
+ }
+ return answ;
+ }
+
#region Private Properties
[Inject]
diff --git a/Lux.UI/Components/Compo/Item/ItemEdit.razor b/Lux.UI/Components/Compo/Item/ItemEdit.razor
index 2add8884..5455bc18 100644
--- a/Lux.UI/Components/Compo/Item/ItemEdit.razor
+++ b/Lux.UI/Components/Compo/Item/ItemEdit.razor
@@ -1,5 +1,4 @@

-
@if (CurrRecord != null)
{
# @(CurrRecord?.ItemID) | Codice @CurrRecord.ItemCode
diff --git a/Lux.UI/Components/Compo/Item/ItemEdit.razor.cs b/Lux.UI/Components/Compo/Item/ItemEdit.razor.cs
index 318599dc..caf6c19e 100644
--- a/Lux.UI/Components/Compo/Item/ItemEdit.razor.cs
+++ b/Lux.UI/Components/Compo/Item/ItemEdit.razor.cs
@@ -21,20 +21,7 @@ namespace Lux.UI.Components.Compo.Item
#endregion Public Properties
- #region Private Methods
-
- private async Task DoCancel()
- {
- await EC_Close.InvokeAsync(true);
- }
-
- private async Task DoSave()
- {
- // richiede di effettuare salvataggio record...
- await EC_Updated.InvokeAsync(CurrRecord);
- }
-
- #endregion Private Methods
+ #region Private Properties
///
/// Wrapper per valore margine in modalità decimal
@@ -50,5 +37,22 @@ namespace Lux.UI.Components.Compo.Item
}
}
}
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ private Task DoCancel()
+ {
+ return EC_Close.InvokeAsync(true);
+ }
+
+ private Task DoSave()
+ {
+ // richiede di effettuare salvataggio record...
+ return EC_Updated.InvokeAsync(CurrRecord);
+ }
+
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/Lux.UI/Components/Compo/Item/ItemMan.razor b/Lux.UI/Components/Compo/Item/ItemMan.razor
index b26d13d2..4d8a4fd9 100644
--- a/Lux.UI/Components/Compo/Item/ItemMan.razor
+++ b/Lux.UI/Components/Compo/Item/ItemMan.razor
@@ -8,10 +8,6 @@ else if (totalCount == 0)
}
else
{
- if (editRecord != null)
- {
-
- }
diff --git a/Lux.UI/Components/Compo/Item/ItemMan.razor.cs b/Lux.UI/Components/Compo/Item/ItemMan.razor.cs
index 3e14b86b..b50a4b9f 100644
--- a/Lux.UI/Components/Compo/Item/ItemMan.razor.cs
+++ b/Lux.UI/Components/Compo/Item/ItemMan.razor.cs
@@ -10,6 +10,9 @@ namespace Lux.UI.Components.Compo.Item
{
#region Public Properties
+ [Parameter]
+ public EventCallback EC_EditReq { get; set; }
+
[Parameter]
public List ListItemGroup { get; set; } = null!;
@@ -18,34 +21,62 @@ namespace Lux.UI.Components.Compo.Item
#endregion Public Properties
- #region Public Classes
-
- #endregion Public Classes
-
- #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
+ protected override async Task OnParametersSetAsync()
+ {
+ if (!SelFilt.Equals(actFilt) || true)
+ {
+ actFilt = SelFilt;
+ await ReloadData();
+ UpdateTable();
+ }
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private FiltSelect actFilt = new FiltSelect();
+ private List AllRecords = new List();
+ private int currPage = 1;
+ private ItemModel? editRecord = null;
+ private bool isLoading = false;
+ private List ListRecords = new List();
+
+ private int numRecord = 10;
+
+ private ItemModel? selRecord = null;
+
+ private int totalCount = 0;
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ [Inject]
+ private DataLayerServices DLService { get; set; } = null!;
+
+ [Inject]
+ private IJSRuntime JSRuntime { get; set; } = null!;
+
+ #endregion Private Properties
+
+#if false
+ private async Task DoCancel()
+ {
+ await ResetEdit();
+ UpdateTable();
+ }
+#endif
+
+ #region Private Methods
+
///
/// Clona articolo
///
///
- protected void DoClone(ItemModel curRec)
+ private void DoClone(ItemModel curRec)
{
editRecord = new ItemModel()
{
@@ -65,11 +96,16 @@ namespace Lux.UI.Components.Compo.Item
};
}
+ private string doCloneCss(ItemModel item)
+ {
+ return item.ItemType == Enums.ItemClassType.Bom ? "btn-warning" : "btn-success";
+ }
+
///
/// impossta record x eliminazione
///
///
- protected async Task DoDelete(ItemModel selRec)
+ private async Task DoDelete(ItemModel selRec)
{
if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il record? Dettagli: {selRec.ItemID} | {selRec.CodGroup} | {selRec.ItemType} | {selRec.ExtItemCode}"))
return;
@@ -86,83 +122,22 @@ namespace Lux.UI.Components.Compo.Item
/// Edit articolo selezionato
///
///
- protected void DoEdit(ItemModel curRec)
+ private Task DoEdit(ItemModel curRec)
{
editRecord = curRec;
+ return EC_EditReq.InvokeAsync(editRecord);
}
///
/// Reset selezione
///
- protected void DoReset()
+ private Task DoReset()
{
editRecord = null;
+ return EC_EditReq.InvokeAsync(editRecord);
}
- ///
- /// Selezione articolo x display info
- ///
- ///
- protected void DoSelect(ItemModel curRec)
- {
- selRecord = curRec;
- }
-
- protected override async Task OnParametersSetAsync()
- {
- if (!SelFilt.Equals(actFilt) || true)
- {
- actFilt = SelFilt;
- await 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 FiltSelect actFilt = new FiltSelect();
-
- private int currPage = 1;
-
- private ItemModel? editRecord = null;
-
- private bool isLoading = false;
-
- private int numRecord = 10;
-
- private ItemModel? selRecord = null;
-
- private int totalCount = 0;
-
- #endregion Private Fields
-
- #region Private Methods
-
- private async Task DoCancel()
- {
- await ResetEdit();
- UpdateTable();
- }
-
- private string doCloneCss(ItemModel item)
- {
- return item.ItemType == Enums.ItemClassType.Bom ? "btn-warning" : "btn-success";
- }
-
+#if false
private async Task DoSave(ItemModel currRec)
{
// salvo
@@ -170,6 +145,16 @@ namespace Lux.UI.Components.Compo.Item
await ResetEdit();
UpdateTable();
}
+#endif
+
+ ///
+ /// Selezione articolo x display info
+ ///
+ ///
+ private void DoSelect(ItemModel curRec)
+ {
+ selRecord = curRec;
+ }
private async Task ReloadData()
{
@@ -193,6 +178,19 @@ namespace Lux.UI.Components.Compo.Item
// reset edit
editRecord = null;
await ReloadData();
+ await EC_EditReq.InvokeAsync(editRecord);
+ }
+
+ private void SaveNumRec(int newNum)
+ {
+ numRecord = newNum;
+ UpdateTable();
+ }
+
+ private void SavePage(int newNum)
+ {
+ currPage = newNum;
+ UpdateTable();
}
///
diff --git a/Lux.UI/Components/Compo/Item/SellingItemEdit.razor b/Lux.UI/Components/Compo/Item/SellingItemEdit.razor
new file mode 100644
index 00000000..54b2c9dd
--- /dev/null
+++ b/Lux.UI/Components/Compo/Item/SellingItemEdit.razor
@@ -0,0 +1,103 @@
+
+ @if (CurrRecord != null)
+ {
+
# @(CurrRecord?.SellingItemID) | Codice @CurrRecord.ItemCode
+
+
+
+
+
+
+
+
+ @*
+
+
+
*@
+
+
+
+
+
+
+
+
+ @* *@
+
+
+
+
+ @*
+
*@
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+
diff --git a/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs b/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs
new file mode 100644
index 00000000..9fc36e0c
--- /dev/null
+++ b/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs
@@ -0,0 +1,58 @@
+using EgwCoreLib.Lux.Data.DbModel.Items;
+using Microsoft.AspNetCore.Components;
+
+namespace Lux.UI.Components.Compo.Item
+{
+ public partial class SellingItemEdit
+ {
+ #region Public Properties
+
+ [Parameter]
+ public SellingItemModel? CurrRecord { get; set; } = null;
+
+ [Parameter]
+ public EventCallback EC_Close { get; set; }
+
+ [Parameter]
+ public EventCallback EC_Updated { get; set; }
+
+ [Parameter]
+ public List ListItemGroup { get; set; } = null!;
+
+ #endregion Public Properties
+
+ #region Private Properties
+
+ ///
+ /// Wrapper per valore margine in modalità decimal
+ ///
+ private decimal MarginDec
+ {
+ get => CurrRecord != null ? (decimal)CurrRecord.Margin : 0M;
+ set
+ {
+ if (CurrRecord != null)
+ {
+ CurrRecord.Margin = (double)value;
+ }
+ }
+ }
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ private Task DoCancel()
+ {
+ return EC_Close.InvokeAsync(true);
+ }
+
+ private Task DoSave()
+ {
+ // richiede di effettuare salvataggio record...
+ return EC_Updated.InvokeAsync(CurrRecord);
+ }
+
+ #endregion Private Methods
+ }
+}
\ No newline at end of file
diff --git a/Lux.UI/Components/Compo/Templates/TemplateRowList.razor.cs b/Lux.UI/Components/Compo/Templates/TemplateRowList.razor.cs
index 8fe812bb..fd7aeb7f 100644
--- a/Lux.UI/Components/Compo/Templates/TemplateRowList.razor.cs
+++ b/Lux.UI/Components/Compo/Templates/TemplateRowList.razor.cs
@@ -407,8 +407,10 @@ namespace Lux.UI.Components.Compo.Templates
await DLService.TemplateRowUpdateSerStructAsync(EditRecord.TemplateRowID, prevJwd);
// salvo nel record corrente!
EditRecord.SerStruct = prevJwd;
+#if false
// temporaneamenteo NON ricalcolo la BOM (NON mi serve)
- //updateBom = true;
+ //updateBom = true;
+#endif
}
else
// altrimenti ricalcolo valore salvato
@@ -416,10 +418,12 @@ namespace Lux.UI.Components.Compo.Templates
prevJwd = EditRecord.SerStruct;
CurrData.CurrJwd = EditRecord.SerStruct;
}
+#if false
if (updateBom)
{
await reqBomUpdate(EditRecord);
- }
+ }
+#endif
// aggiorno nel dizionari
if (reqDict.ContainsKey("SerializedData"))
{
@@ -454,10 +458,26 @@ namespace Lux.UI.Components.Compo.Templates
private async Task CloseEditJwd(DataSave infoSave)
{
prevJwd = infoSave.currJwd;
+#if false
+ // rileggo dati...
+ int trID = EditRecord?.TemplateRowID ?? 0;
+#endif
// reset preview
await CloseEdit(infoSave.ForceSave);
- //await InvokeAsync(StateHasChanged);
- await Task.Delay(50);
+#if false
+ await ReloadData();
+ // x il corrente chiamo refresh...
+ if (trID > 0 && AllRecords.Count > 0)
+ {
+ EditRecord = AllRecords.FirstOrDefault(x => x.TemplateRowID == trID);
+ if (EditRecord != null)
+ {
+ // chiamo comunque update IMG
+ await reqImgUpdate(EditRecord);
+ }
+ }
+#endif
+ await Task.Delay(200);
CurrData.SvgPreview = "";
}
@@ -1179,6 +1199,10 @@ namespace Lux.UI.Components.Compo.Templates
{
case EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW:
DictExec.Add(serKey, currRec.SerStruct);
+ if (DictExec.ContainsKey(serKey))
+ {
+ rawData = DictExec[serKey];
+ }
break;
case EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.BEAM:
diff --git a/Lux.UI/Components/Pages/Items.razor b/Lux.UI/Components/Pages/Items.razor
index 1ebd7491..fd9bf78d 100644
--- a/Lux.UI/Components/Pages/Items.razor
+++ b/Lux.UI/Components/Pages/Items.razor
@@ -24,10 +24,18 @@
@if (showItemsBuy)
{
-
+ if (editRecItem != null)
+ {
+
+ }
+
}
else
{
+ if (editRecSellItem != null)
+ {
+
+ }
}
diff --git a/Lux.UI/Components/Pages/Items.razor.cs b/Lux.UI/Components/Pages/Items.razor.cs
index 9d0973d0..bac20812 100644
--- a/Lux.UI/Components/Pages/Items.razor.cs
+++ b/Lux.UI/Components/Pages/Items.razor.cs
@@ -9,44 +9,22 @@ namespace Lux.UI.Components.Pages
{
#region Protected Methods
- protected void DoAdd()
- {
- editRecord = new ItemModel()
- {
- CodGroup = ListItemGroup.FirstOrDefault()?.CodGroup ?? "",
- ItemType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND,
- IsService = false,
- ItemCode = 0,
- ExtItemCode = "NEW-ITEM",
- SupplCode = "",
- Description = $"Nuovo ITEM {DateTime.Today:ddd yyyy.MM.dd}",
- Cost = 0,
- Margin = 0,
- QtyMin = 0,
- QtyMax = 0,
- UM = "#"
- };
- }
-
protected override Task OnInitializedAsync()
{
isLoading = true;
return ReloadBaseData();
}
- protected void UpdateFilt(FiltSelect newFilt)
- {
- isLoading = true;
- CurrFilt = newFilt;
- isLoading = false;
- }
-
#endregion Protected Methods
#region Private Fields
- private ItemModel? editRecord = null;
+ private ItemModel? editRecItem = null;
+
+ private SellingItemModel? editRecSellItem = null;
+
private bool isLoading = false;
+
private List ListItemGroup = new List();
///
@@ -75,11 +53,85 @@ namespace Lux.UI.Components.Pages
#region Private Methods
+ private void DoAdd()
+ {
+ if (showItemsBuy)
+ {
+ editRecItem = new ItemModel()
+ {
+ CodGroup = ListItemGroup.FirstOrDefault()?.CodGroup ?? "",
+ ItemType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND,
+ IsService = false,
+ ItemCode = 0,
+ ExtItemCode = "NEW-ITEM",
+ SupplCode = "",
+ Description = $"Nuovo ITEM {DateTime.Today:ddd yyyy.MM.dd}",
+ Cost = 0,
+ Margin = 0,
+ QtyMin = 0,
+ QtyMax = 0,
+ UM = "#"
+ };
+ }
+ else
+ {
+ editRecSellItem = new SellingItemModel()
+ {
+ Cost = 0,
+ Description = $"Nuovo PRODOTTO {DateTime.Today:ddd yyyy.MM.dd}",
+ ExtItemCode = "NEW-PROD",
+ Envir = CurrFilt.Envir,
+ IsService = false,
+ ItemCode = 0,
+ Margin = 0,
+ SupplCode = "",
+ UM = "#"
+ };
+ }
+ }
+
+ private void DoCancel()
+ {
+ editRecItem = null;
+ editRecSellItem = null;
+ }
+
+ private async Task DoSaveItem(ItemModel currRec)
+ {
+ // salvo
+ await DLService.ItemUpsertAsync(currRec);
+ editRecItem = null;
+ }
+
+ private async Task DoSaveSelItem(SellingItemModel currRec)
+ {
+ // salvo
+ await DLService.SellingItemUpsertAsync(currRec);
+ editRecItem = null;
+ }
+
+ private void EditItem(ItemModel editRec)
+ {
+ editRecItem = editRec;
+ }
+
+ private void EditSellItem(SellingItemModel editRec)
+ {
+ editRecSellItem = editRec;
+ }
+
private async Task ReloadBaseData()
{
ListItemGroup = await DLService.ItemGroupGetAllAsync();
}
+ private void UpdateFilt(FiltSelect newFilt)
+ {
+ isLoading = true;
+ CurrFilt = newFilt;
+ isLoading = false;
+ }
+
#endregion Private Methods
}
}
\ No newline at end of file
diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj
index 23839f06..c6621148 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
- 1.1.2603.0914
+ 1.1.2603.0916
diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index a9887265..c8730881 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
LUX - Web Windows MES
- Versione: 1.1.2603.0914
+ Versione: 1.1.2603.0916
Note di rilascio:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index c7f8a457..220b4a65 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-1.1.2603.0914
+1.1.2603.0916
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index c8f11057..2e23012d 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 1.1.2603.0914
+ 1.1.2603.0916
http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip
http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html
false