Exemplo n.º 1
0
 protected ValuePerWeight(ValuePerWeightUnits units, decimal amount, bool canHaveNegativeAmount = false)
 {
     this.canHaveNegativeAmount = canHaveNegativeAmount;
     CheckIsValid(units, amount);
     Units = units;
     Amount = amount;
 }
Exemplo n.º 2
0
 protected ValuePerWeight(ValuePerWeightUnits units, decimal amount, bool canHaveNegativeAmount = false)
 {
     this.canHaveNegativeAmount = canHaveNegativeAmount;
     CheckIsValid(units, amount);
     Units  = units;
     Amount = amount;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 7
0
        public EstimatedValueViewModel(decimal percentage, ValuePerWeightData estimatedValueData, ValuePerWeightUnits units)
        {
            PercentageRecoverable = percentage;
            ShipmentInfoUnits     = units;

            if (estimatedValueData != null)
            {
                Amount        = estimatedValueData.Amount.ToString();
                SelectedUnits = estimatedValueData.Unit;
            }
        }
Exemplo n.º 8
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");
            }
        }
Exemplo n.º 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");
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 12
0
 public DisposalCost(ValuePerWeightUnits units, decimal amount)
     : base(units, amount)
 {
 }
Exemplo n.º 13
0
 public DisposalCostViewModel(Guid id, ValuePerWeightUnits shipmentInfoUnits)
 {
     NotificationId = id;
     ShipmentInfoUnits = shipmentInfoUnits;
     Units = shipmentInfoUnits;
 }
 public ValuePerWeightData(decimal amount, ValuePerWeightUnits unit)
 {
     Unit = unit;
     Amount = amount;
 }
Exemplo n.º 15
0
 public EstimatedValue(ValuePerWeightUnits units, decimal amount)
     : base(units, amount, canHaveNegativeAmount: true)
 {
 }
Exemplo n.º 16
0
 public ValuePerWeightData(decimal amount, ValuePerWeightUnits unit)
 {
     Unit   = unit;
     Amount = amount;
 }
Exemplo n.º 17
0
 public RecoveryCost(ValuePerWeightUnits units, decimal amount)
     : base(units, amount)
 {
 }