54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using EgwCoreLib.Lux.Data.DbModel.Items;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace Lux.UI.Components.Compo
|
|
{
|
|
public partial class ItemEdit
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public ItemModel? CurrRecord { get; set; } = null;
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_Close { get; set; }
|
|
|
|
[Parameter]
|
|
public EventCallback<ItemModel> EC_Updated { get; set; }
|
|
|
|
[Parameter]
|
|
public List<ItemGroupModel> ListItemGroup { get; set; } = null!;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Private Methods
|
|
|
|
private async Task DoCancel()
|
|
{
|
|
await EC_Close.InvokeAsync(true);
|
|
}
|
|
|
|
private async Task DoSave()
|
|
{
|
|
// richiede di effettuare salvataggio record...
|
|
await EC_Updated.InvokeAsync(CurrRecord);
|
|
}
|
|
|
|
#endregion Private Methods
|
|
|
|
/// <summary>
|
|
/// Wrapper per valore margine in modalità decimal
|
|
/// </summary>
|
|
private decimal MarginDec
|
|
{
|
|
get => CurrRecord != null ? (decimal)CurrRecord.Margin : 0M;
|
|
set
|
|
{
|
|
if (CurrRecord != null)
|
|
{
|
|
CurrRecord.Margin = (double)value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |