public double ComputeValueByType(ValueComputationType valueComputationType, double value)
        {
            double result = 0;

            switch (valueComputationType)
            {
            case ValueComputationType.Absolute:
                result = value;
                break;

            case ValueComputationType.PriceRelative:
                var percentage = value.CastPercentage();
                result = percentage * Product.Price;
                break;

            default: break;
            }
            return(Math.Round(result, 4));
        }
 public void AssignCapAmount(ValueComputationType valueComputationType, double value)
 => Cap = ComputeValueByType(valueComputationType, value);
Exemplo n.º 3
0
 public void AssignAdditionalCost(ValueComputationType valueComputationType, String key, double value)
 => AdditionalCosts[key] = ComputeValueByType(valueComputationType, value);