using GPW.CORE.Data.DbModels; using Microsoft.AspNetCore.Components; namespace GPW.CORE.Smart8.Components.Compo { public partial class SingleRaDisplay { #region Public Properties [Parameter] public RegAttivitaModel CurrItem { get; set; } = null!; [Parameter] public bool EnableAction { get; set; } = false; [Parameter] public EventCallback ItemCloned { get; set; } [Parameter] public EventCallback ItemSelected { get; set; } #endregion Public Properties #region Protected Methods /// /// Gestione evento cloning /// /// protected async void DoClone(RegAttivitaModel currRecord) { if (EnableAction) { if (currRecord != null) { var newData = currRecord.Clone(); newData.IdxRa = 0; await ItemCloned.InvokeAsync(newData); } } } /// /// Gestione evento selezione x editing /// protected async void DoSel(RegAttivitaModel currRecord) { if (EnableAction) { if (currRecord != null) { await ItemSelected.InvokeAsync(currRecord); } } } #endregion Protected Methods } }