54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
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 MaterialEdit
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public MaterialModel? CurrRecord { get; set; } = null;
|
|
|
|
[Parameter]
|
|
public int KeyNum { get; set; } = 0;
|
|
[Parameter]
|
|
public EventCallback<bool> EC_update { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected TenantService TService { 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 TService.MaterialUpdate(KeyNum, CurrRecord);
|
|
}
|
|
if (fatto)
|
|
{
|
|
await EC_update.InvokeAsync(true);
|
|
}
|
|
}
|
|
protected async Task DoCancel()
|
|
{
|
|
await EC_update.InvokeAsync(true);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |