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