protected ValuePerWeight(ValuePerWeightUnits units, decimal amount, bool canHaveNegativeAmount = false) { this.canHaveNegativeAmount = canHaveNegativeAmount; CheckIsValid(units, amount); Units = units; Amount = amount; }
public SetWasteDisposal(Guid notificationId, string method, decimal amount, ValuePerWeightUnits unit) { NotificationId = notificationId; Method = method; Amount = amount; Unit = unit; }
public EstimatedValueViewModel(decimal percentage, ValuePerWeightUnits units) { PercentageRecoverable = percentage; ShipmentInfoUnits = units; Amount = string.Empty; SelectedUnits = units; }
public EstimatedValueViewModel(decimal percentage, ValuePerWeightData estimatedValueData, ValuePerWeightUnits units) { PercentageRecoverable = percentage; ShipmentInfoUnits = units; if (estimatedValueData != null) { Amount = estimatedValueData.Amount.ToString(); SelectedUnits = estimatedValueData.Unit; } }
private void CheckIsValid(ValuePerWeightUnits units, decimal amount) { if (!canHaveNegativeAmount && amount < 0) { throw new InvalidOperationException("The amount cannot be negative"); } if (units == default(ValuePerWeightUnits)) { throw new InvalidOperationException("Units cannot be the default value"); } }
public RecoveryCostViewModel(decimal percentage, ValuePerWeightData estimatedValueData, ValuePerWeightData recoveryCostData, ValuePerWeightUnits shipmentInfoUnits) { PercentageRecoverable = percentage; EstimatedValueAmount = estimatedValueData.Amount; EstimatedValueUnit = estimatedValueData.Unit; if (recoveryCostData != null) { Amount = recoveryCostData.Amount.ToString(); SelectedUnits = recoveryCostData.Unit; } else { SelectedUnits = shipmentInfoUnits; } }
public DisposalCost(ValuePerWeightUnits units, decimal amount) : base(units, amount) { }
public DisposalCostViewModel(Guid id, ValuePerWeightUnits shipmentInfoUnits) { NotificationId = id; ShipmentInfoUnits = shipmentInfoUnits; Units = shipmentInfoUnits; }
public ValuePerWeightData(decimal amount, ValuePerWeightUnits unit) { Unit = unit; Amount = amount; }
public EstimatedValue(ValuePerWeightUnits units, decimal amount) : base(units, amount, canHaveNegativeAmount: true) { }
public RecoveryCost(ValuePerWeightUnits units, decimal amount) : base(units, amount) { }