44 lines
1019 B
C#
44 lines
1019 B
C#
using MagMan.Data.Admin.DbModels;
|
|
using MagMan.Data.Admin.Services;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace MagMan.UI.Components
|
|
{
|
|
public partial class MachineEdit
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public MachineModel? CurrRecord { get; set; } = null;
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_update { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected MTAdminService MTService { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected async Task DoSave()
|
|
{
|
|
bool fatto = false;
|
|
await Task.Delay(1);
|
|
if (CurrRecord != null)
|
|
{
|
|
fatto = await MTService.MachineUpdate(CurrRecord);
|
|
}
|
|
if (fatto)
|
|
{
|
|
await EC_update.InvokeAsync(true);
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |