b072312a71
- ok gestione gruppi - update spostamento fasi
55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using GPW.CORE.Data.DbModels;
|
|
using GPW.CORE.Data.DTO;
|
|
using GPW.CORE.Data.Services;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace GPW.CORE.ADM.Components.Compo
|
|
{
|
|
public partial class GruppiEdit
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public AnagGruppiModel? CurrRecord { get; set; } = null;
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_update { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected GpwDataService GDataServ { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected string CodExt
|
|
{
|
|
get => CurrRecord.CodExt ?? "";
|
|
set
|
|
{
|
|
CurrRecord.CodExt = value.Length < 5 ? value : value.Substring(0, 4);
|
|
}
|
|
}
|
|
|
|
protected async Task DoSave()
|
|
{
|
|
bool fatto = false;
|
|
if (CurrRecord != null)
|
|
{
|
|
fatto = await GDataServ.AnagGruppiUpsert(CurrRecord);
|
|
}
|
|
await EC_update.InvokeAsync(fatto);
|
|
}
|
|
|
|
protected async Task DoCancel()
|
|
{
|
|
await EC_update.InvokeAsync(true);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |