Files
gpw_next/GPW.CORE.SMART/Components/SingleRaDisplay.razor.cs
T
2023-01-18 08:45:56 +01:00

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
}
}