Files
lux/Lux.UI/Components/Compo/JobTask/ResourceDetail.razor.cs
T
2025-10-31 11:21:01 +01:00

67 lines
1.5 KiB
C#

using EgwCoreLib.Lux.Data.DbModel.Cost;
using Microsoft.AspNetCore.Components;
using System.Transactions;
namespace Lux.UI.Components.Compo.JobTask
{
public partial class ResourceDetail
{
[Parameter]
public ResourceModel CurrRecord { get; set; } = null!;
[Parameter]
public List<CostDriverModel> CostDriverList { get; set; } = null!;
[Parameter]
public EventCallback<ResourceModel> EC_Updated { get; set; }
protected decimal DriverQty
{
get => Math.Round(driverQty, 3);
set
{
driverQty = Math.Round(value, 3);
}
}
protected decimal DriverBudget
{
get => Math.Round(CurrRecord.CostDriverBudget, 3);
set
{
CurrRecord.CostDriverBudget = Math.Round(value, 3);
}
}
protected decimal CostCalc
{
get => DriverQty * CurrRecord.BaseRockBottomCost;
}
protected decimal PriceCalc
{
get => DriverQty * CurrRecord.BasePrice;
}
private decimal driverQty = 1;
private bool isEditing = false;
protected void DoEdit()
{
isEditing = !isEditing;
}
protected async Task DoCancel()
{
isEditing = false;
await EC_Updated.InvokeAsync(null);
}
protected async Task DoSave()
{
isEditing = false;
await EC_Updated.InvokeAsync(CurrRecord);
}
}
}