Files
lux/Lux.UI/Components/Compo/JobTask/ResourceDetail.razor.cs
T
2026-03-25 09:05:06 +01:00

63 lines
1.4 KiB
C#

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);
}
}
}