99 lines
2.5 KiB
C#
99 lines
2.5 KiB
C#
using global::Microsoft.AspNetCore.Components;
|
|
using MP.Data.DatabaseModels;
|
|
using MP.Data.DTO;
|
|
using MP.Data.Services;
|
|
|
|
namespace MP_TAB_SERV.Components
|
|
{
|
|
public partial class NotesMan
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public MappaStatoExpl? RecMSE { get; set; } = null;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
protected int NumComm
|
|
{
|
|
get => numComm;
|
|
set
|
|
{
|
|
if (numComm != value)
|
|
{
|
|
numComm = value;
|
|
ReloadComments().ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|
|
protected int NumGiorni
|
|
{
|
|
get => _numGiorni;
|
|
set
|
|
{
|
|
if (_numGiorni != value)
|
|
{
|
|
_numGiorni = value;
|
|
ReloadFnq().ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|
|
protected int DurataMin
|
|
{
|
|
get => _durataMin;
|
|
set
|
|
{
|
|
if (_durataMin != value)
|
|
{
|
|
_durataMin = value;
|
|
ReloadFnq().ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|
|
private int numComm { get; set; } = 10;
|
|
private int _numGiorni { get; set; } = 3;
|
|
private int _durataMin { get; set; } = 30;
|
|
|
|
protected List<CommentiModel> RecordListComments { get; set; } = new List<CommentiModel>();
|
|
protected List<FermiNonQualModel> RecordListFnq { get; set; } = new List<FermiNonQualModel>();
|
|
|
|
[Inject]
|
|
protected TabDataService TabServ { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
await ReloadComments();
|
|
await ReloadFnq();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Methods
|
|
|
|
private async Task ReloadComments()
|
|
{
|
|
RecordListComments = await TabServ.CommentiGetLastByMacc(RecMSE?.IdxMacchina, NumComm);
|
|
}
|
|
private async Task ReloadFnq()
|
|
{
|
|
RecordListFnq = await TabServ.FermiNonQualificatiFilt(RecMSE?.IdxMacchina, NumGiorni, DurataMin);
|
|
}
|
|
|
|
private async Task DoUpdate(bool forceReload)
|
|
{
|
|
if (forceReload)
|
|
{
|
|
await ReloadComments();
|
|
}
|
|
}
|
|
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |