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 EC_update { get; set; } [Parameter] public List ListClienti { get; set; } = null!; [Parameter] public List 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 } }