private static decimal GetTax(decimal materialCost, decimal laborCost, Taxes taxes) { decimal tax = (materialCost + laborCost) * (taxes.TaxRate / 100); string rounder = $"{tax:C}"; tax = decimal.Parse(rounder.Remove(0, 1)); return(tax); }
public void CalculateOrderValues(string name, decimal area, Product product, Taxes taxes) { Product = product; Taxes = taxes; CustomerName = name; Area = area; ProductType = product.ProductType; CostPerSquareFoot = product.CostPerSquareFoot; LaborCostPerSquareFoot = product.LaborCostPerSquareFoot; State = taxes.StateAbbreviation; TaxRate = taxes.TaxRate; MaterialCost = GetMaterialCost(area, product); LaborCost = GetLaborCost(area, product); Tax = GetTax(MaterialCost, LaborCost, taxes); Total = GetTotal(MaterialCost, LaborCost, Tax); }