95 lines
2.2 KiB
C#
95 lines
2.2 KiB
C#
using global::Microsoft.AspNetCore.Components;
|
|
using MP.Data.DbModels;
|
|
using MP.Data.Services;
|
|
|
|
namespace MP_TAB3.Components
|
|
{
|
|
public partial class MachineSelOdl
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public EventCallback<int> E_OdlSel { get; set; }
|
|
|
|
[Parameter]
|
|
public string IdxMacchina { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public int IdxOdlSel
|
|
{
|
|
get => idxOdlSel;
|
|
set
|
|
{
|
|
if (idxOdlSel != value)
|
|
{
|
|
idxOdlSel = value;
|
|
E_OdlSel.InvokeAsync(value).ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Fields
|
|
|
|
protected bool isProcessing = false;
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Protected Properties
|
|
|
|
|
|
|
|
protected List<vSelOdlModel> ListODL { get; set; } = new();
|
|
|
|
protected int NumRec
|
|
{
|
|
get => numRec;
|
|
set
|
|
{
|
|
if (numRec != value)
|
|
{
|
|
numRec = value;
|
|
var pUpd = Task.Run(async () =>
|
|
{
|
|
await ReloadData();
|
|
});
|
|
pUpd.Wait();
|
|
}
|
|
}
|
|
}
|
|
|
|
[Inject]
|
|
protected TabDataService TabDServ { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
await ReloadData();
|
|
}
|
|
|
|
protected async Task ReloadData()
|
|
{
|
|
isProcessing = true;
|
|
await Task.Delay(1);
|
|
if (!string.IsNullOrEmpty(IdxMacchina))
|
|
{
|
|
ListODL = await TabDServ.VSOdlGetLastByMacc(IdxMacchina, NumRec);
|
|
}
|
|
isProcessing = false;
|
|
await Task.Delay(1);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Properties
|
|
|
|
private int idxOdlSel { get; set; } = 0;
|
|
private int numRec { get; set; } = 10;
|
|
|
|
#endregion Private Properties
|
|
}
|
|
} |