cbd4a90d01
- Correzione MSE i MSEModel x naming - fix e test vari su app CORE (IOC/SPEC/TAB3/MON)
109 lines
2.9 KiB
C#
109 lines
2.9 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.JSInterop;
|
|
using MP.Data.DbModels;
|
|
using MP.Data.Services;
|
|
|
|
namespace MP_TAB3.Components
|
|
{
|
|
public partial class TechSheetMan
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public MappaStatoExplModel? RecMSE { get; set; } = null;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected IJSRuntime JSRuntime { get; set; } = null!;
|
|
|
|
protected List<ST_AnagGruppi> ListGruppi { get; set; } = new List<ST_AnagGruppi>();
|
|
|
|
[Inject]
|
|
protected TabDataService TabDServ { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected async Task ClearOdl()
|
|
{
|
|
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Sicuro di voler resettare?"))
|
|
return;
|
|
if (IdxOdl > 0)
|
|
{
|
|
await TabDServ.ST_CheckCleanByOdl(IdxOdl);
|
|
}
|
|
checkReset();
|
|
}
|
|
|
|
protected async Task ForceRefresh()
|
|
{
|
|
isProcessing = true;
|
|
await InvokeAsync(StateHasChanged);
|
|
await ReloadData();
|
|
isProcessing = false;
|
|
}
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
if (RecMSE != null && !RecMSE.MostlyEquals(lastRecMSE))
|
|
{
|
|
CodArticolo = RecMSE.CodArticolo;
|
|
IdxMaccSel = RecMSE.IdxMacchina;
|
|
IdxOdl = RecMSE.IdxOdl ?? 0;
|
|
lastRecMSE = RecMSE;
|
|
await ReloadData();
|
|
checkReset();
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private string CodArticolo = "";
|
|
private bool inAttr = false;
|
|
private bool isProcessing = false;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private string IdxMaccSel { get; set; } = "";
|
|
private int IdxOdl { get; set; } = 0;
|
|
private MappaStatoExplModel? lastRecMSE { get; set; } = null;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
/// <summary>
|
|
/// Verifica visibilit� reset
|
|
/// </summary>
|
|
private void checkReset()
|
|
{
|
|
// condizioni booleane
|
|
inAttr = false;
|
|
// SOLO SE ho articolo senn� niente reset...
|
|
if (!string.IsNullOrEmpty(CodArticolo))
|
|
{
|
|
// controllo se la macchina sia in attrezzaggio...
|
|
var rigaStato = TabDServ.StatoMacchina(IdxMaccSel);
|
|
if (rigaStato != null)
|
|
{
|
|
inAttr = (rigaStato.IdxStato == 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
private async Task ReloadData()
|
|
{
|
|
ListGruppi = await TabDServ.ST_AnagGruppiList();
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |