da4613bf8c
- OK editing - ok add
99 lines
2.2 KiB
C#
99 lines
2.2 KiB
C#
using DnsClient.Protocol;
|
|
using Microsoft.AspNetCore.Components;
|
|
using MP.Core.DTO;
|
|
using MP.Data.DbModels;
|
|
using MP.SPEC.Data;
|
|
|
|
namespace MP.SPEC.Pages
|
|
{
|
|
public partial class GroupMacOprMan
|
|
{
|
|
#region Protected Fields
|
|
|
|
protected List<Macchine>? ListMacchine = null;
|
|
protected List<AnagOperatoriModel>? ListOperatori = null;
|
|
protected List<RepartiDTO>? ListReparti = null;
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected MpDataService MDService { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
ReloadData();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private string CodGruppo = "";
|
|
|
|
private bool isLoading = false;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private string CssMain
|
|
{
|
|
get => ShowDetail ? "col-3" : "col-12";
|
|
}
|
|
|
|
private bool ShowDetail
|
|
{
|
|
get => !string.IsNullOrEmpty(CodGruppo);
|
|
}
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void ForceReload(bool doForce)
|
|
{
|
|
if (doForce)
|
|
{
|
|
CodGruppo = "";
|
|
}
|
|
ReloadData();
|
|
}
|
|
|
|
private void ReloadData()
|
|
{
|
|
isLoading = true;
|
|
ListMacchine?.Clear();
|
|
ListReparti = MDService.ElencoRepartiDTO();
|
|
if (!string.IsNullOrEmpty(CodGruppo))
|
|
{
|
|
ReloadDetail();
|
|
}
|
|
isLoading = false;
|
|
}
|
|
|
|
private void ReloadDetail()
|
|
{
|
|
if (!string.IsNullOrEmpty(CodGruppo))
|
|
{
|
|
ListMacchine = MDService.MacchineGetFilt(CodGruppo);
|
|
ListOperatori = MDService.OperatoriGetFilt(CodGruppo);
|
|
}
|
|
}
|
|
|
|
private void SetCodGruppo(string CodGruppoSel)
|
|
{
|
|
isLoading = true;
|
|
CodGruppo = CodGruppoSel;
|
|
ReloadDetail();
|
|
isLoading = false;
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |