protected ValuePerWeight(ValuePerWeightUnits units, decimal amount, bool canHaveNegativeAmount = false)
 {
     this.canHaveNegativeAmount = canHaveNegativeAmount;
     CheckIsValid(units, amount);
     Units = units;
     Amount = amount;
 }
Beispiel #2
0
 protected ValuePerWeight(ValuePerWeightUnits units, decimal amount, bool canHaveNegativeAmount = false)
 {
     this.canHaveNegativeAmount = canHaveNegativeAmount;
     CheckIsValid(units, amount);
     Units  = units;
     Amount = amount;
 }
Beispiel #3
0
 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;
        }
Beispiel #5
0
        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;
     }
 }
Beispiel #7
0
        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");
            }
        }
Beispiel #9
0
        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");
            }
        }
Beispiel #10
0
        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 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;
            }
        }
Beispiel #12
0
 public DisposalCost(ValuePerWeightUnits units, decimal amount)
     : base(units, amount)
 {
 }
Beispiel #13
0
 public DisposalCostViewModel(Guid id, ValuePerWeightUnits shipmentInfoUnits)
 {
     NotificationId = id;
     ShipmentInfoUnits = shipmentInfoUnits;
     Units = shipmentInfoUnits;
 }
 public ValuePerWeightData(decimal amount, ValuePerWeightUnits unit)
 {
     Unit = unit;
     Amount = amount;
 }
Beispiel #15
0
 public EstimatedValue(ValuePerWeightUnits units, decimal amount)
     : base(units, amount, canHaveNegativeAmount: true)
 {
 }
Beispiel #16
0
 public ValuePerWeightData(decimal amount, ValuePerWeightUnits unit)
 {
     Unit   = unit;
     Amount = amount;
 }
Beispiel #17
0
 public RecoveryCost(ValuePerWeightUnits units, decimal amount)
     : base(units, amount)
 {
 }