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 CostDriverList { get; set; } = null!; [Parameter] public EventCallback 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); } } }