Files
gpw_next/GPW.CORE.SMART/Components/ProjectsList.razor.cs
T
2023-01-23 10:40:07 +01:00

98 lines
2.4 KiB
C#

using GPW.CORE.Data.DbModels;
using GPW.CORE.Smart.Data;
using Microsoft.AspNetCore.Components;
namespace GPW.CORE.Smart.Components
{
public partial class ProjectsList : IDisposable
{
#region Public Properties
[Parameter]
public EventCallback<RegAttivitaModel> ActionPaste { get; set; }
[Parameter]
public bool EnableAdmin { get; set; } = false;
[Parameter]
public bool EnableEdit { get; set; } = false;
[Parameter]
public EventCallback<RegAttivitaModel> ItemCloned { get; set; }
[Parameter]
public EventCallback<RegAttivitaModel> ItemDeleted { get; set; }
[Parameter]
public EventCallback<RegAttivitaModel> ItemSelected { get; set; }
[Parameter]
public List<RegAttivitaModel>? ListRA { get; set; } = null!;
[Parameter]
public EventCallback<bool> ReqUpdate { get; set; }
#endregion Public Properties
#region Public Methods
public void Dispose()
{
ListRA = null;
GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected bool hasClonedRa
{
get => MService.clonedRA != null;
}
[Inject]
protected MessageService MService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Gestione evento cloning
/// </summary>
/// <param name="currRecord"></param>
protected async void DoClone(RegAttivitaModel currRecord)
{
if (currRecord != null)
{
await ItemCloned.InvokeAsync(currRecord);
}
}
/// <summary>
/// Gestione evento incolla
/// </summary>
/// <param name="currRecord"></param>
protected async void DoPaste(RegAttivitaModel currRecord)
{
if (currRecord != null)
{
await ActionPaste.InvokeAsync(currRecord);
}
}
/// <summary>
/// Gestione evento selezione x editing
/// </summary>
protected async void DoSel(RegAttivitaModel currRecord)
{
if (currRecord != null)
{
await ItemSelected.InvokeAsync(currRecord);
}
}
#endregion Protected Methods
}
}