diff --git a/MP-TAB3/Components/ScrapEditor.razor b/MP-TAB3/Components/ScrapEditor.razor
index c3cbe104..3a89797c 100644
--- a/MP-TAB3/Components/ScrapEditor.razor
+++ b/MP-TAB3/Components/ScrapEditor.razor
@@ -12,7 +12,7 @@
@if(errMsg != "")
{
-
+
@errMsg
}
diff --git a/MP-TAB3/Components/ScrapEditor.razor.cs b/MP-TAB3/Components/ScrapEditor.razor.cs
index 61384da0..e339a29d 100644
--- a/MP-TAB3/Components/ScrapEditor.razor.cs
+++ b/MP-TAB3/Components/ScrapEditor.razor.cs
@@ -31,11 +31,15 @@ namespace MP_TAB3.Components
}
}
+ protected string errMsg { get; set; } = "";
protected List
ListComplete { get; set; } = new List();
[Inject]
protected MessageService MServ { get; set; } = null!;
+ [Inject]
+ protected MessageService MsgServ { get; set; } = null!;
+
protected int NumPz
{
get => numPz;
@@ -70,10 +74,25 @@ namespace MP_TAB3.Components
protected async Task doSave(vSelCauScartoModel currCau)
{
+ bool isMulti = false;
+ // verifico se la macchina sia configurata tra le MSFD...
+ if (SMServ.DictMacchMulti.ContainsKey(IdxMacc))
+ {
+ isMulti = SMServ.DictMacchMulti[IdxMacc] == 1;
+ }
+ string IdxMaccSel = IdxMacc;
+ if (isMulti)
+ {
+ var idxMSel = MsgServ.UserPrefGet(IdxMacc);
+ if (!string.IsNullOrEmpty(idxMSel))
+ {
+ IdxMaccSel = idxMSel;
+ }
+ }
// registro scarto
RegistroScartiModel newRec = new RegistroScartiModel()
{
- IdxMacchina = IdxMacc,
+ IdxMacchina = IdxMaccSel,
DataOra = DateSel,
Causale = currCau.value,
Qta = NumPz,
@@ -87,20 +106,17 @@ namespace MP_TAB3.Components
// reset
DoReset();
errMsg = "";
- //ToggleCtrl();
await E_Updated.InvokeAsync(true);
await ReloadData();
- StateHasChanged();
+ await InvokeAsync(StateHasChanged);
}
else
{
- errMsg = "ODL non attivo o data/ora errato";
+ errMsg = "Insert non possibile: ODL non attivo o data/ora errato";
}
ShowDetail = false;
}
- protected string errMsg { get; set; } = "";
-
protected override async Task OnInitializedAsync()
{
await ReloadData();
@@ -127,6 +143,7 @@ namespace MP_TAB3.Components
if (ShowDetail)
{
DateSel = DateTime.Now;
+ errMsg = "";
}
}