Files
magman/MagMan.UI/Components/AliasEdit.razor.cs
T
Samuele Locatelli 8959cb0751 Update gestione Alias
2024-02-22 16:20:51 +01:00

55 lines
1.2 KiB
C#

using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
using MagMan.Data.Tenant.DbModels;
using MagMan.Data.Tenant.Services;
using Microsoft.AspNetCore.Components;
namespace MagMan.UI.Components
{
public partial class AliasEdit
{
#region Public Properties
[Parameter]
public AliasModel? CurrRecord { get; set; } = null;
[Parameter]
public EventCallback<bool> EC_update { get; set; }
[Parameter]
public int KeyNum { get; set; } = 0;
#endregion Public Properties
#region Protected Properties
[Inject]
protected TenantService TService { 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 TService.AliasUpsert(KeyNum, CurrRecord);
}
if (fatto)
{
await EC_update.InvokeAsync(true);
}
}
#endregion Protected Methods
}
}