Files
gpw_next/GPW.CORE.ADM/Components/Compo/ProgettiEdit.razor.cs
T
2024-09-11 17:06:15 +02:00

57 lines
1.4 KiB
C#

using GPW.CORE.Data.DbModels;
using GPW.CORE.Data.Services;
using Microsoft.AspNetCore.Components;
namespace GPW.CORE.ADM.Components.Compo
{
public partial class ProgettiEdit
{
#region Public Properties
[Parameter]
public AnagProgettiModel? CurrRecord { get; set; } = null;
[Parameter]
public EventCallback<bool> EC_update { get; set; }
[Parameter]
public List<AnagClientiModel> ListClienti { get; set; } = null!;
[Parameter]
public List<AnagGruppiModel> ListGruppi { get; set; } = null!;
#endregion Public Properties
#region Protected Properties
[Inject]
protected GpwDataService GDataServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task DoCancel()
{
await EC_update.InvokeAsync(true);
}
protected async Task DoSave()
{
bool fatto = false;
await Task.Delay(1);
if (CurrRecord != null)
{
fatto = await GDataServ.AnagProjUpsert(CurrRecord);
// se fatto ricalcolo...
if (fatto)
{
await GDataServ.AnagProjForceUpdate();
}
}
await EC_update.InvokeAsync(fatto);
}
#endregion Protected Methods
}
}