/// <summary>
 /// Volumetric weight calculated based on weight and volume.
 /// </summary>
 /// <typeparam name="S"></typeparam>
 /// <param name="w"></param>
 /// <param name="u"></param>
 /// <returns></returns>
 public RatesArrayFluent <T> DimensionalWeight <S>(decimal w, UnitOfWeight u) where S : IParcelWeight, new()
 {
     _current.DimensionalWeight = new S()
     {
         Weight = w, UnitOfMeasurement = u
     };
     return(this);
 }
Esempio n. 2
0
 /// <summary>
 /// Set parcel weight
 /// </summary>
 /// <param name="d">Weight</param>
 /// <param name="unit">Units - defaults to OZ</param>
 /// <returns></returns>
 public ParcelFluent <T> Weight(decimal d, UnitOfWeight unit = UnitOfWeight.OZ)
 {
     _parcel.Weight = new ParcelWeight()
     {
         Weight = d, UnitOfMeasurement = unit
     };
     return(this);
 }
Esempio n. 3
0
        /// <summary>
        /// Add a pickup count object to the PickupSummary IEnumerable
        /// </summary>
        /// <typeparam name="C">IPickupCountType</typeparam>
        /// <typeparam name="W">IParcelWeight</typeparam>
        /// <param name="s">Service</param>
        /// <param name="c">Count</param>
        /// <param name="w">Total weight</param>
        /// <param name="u">Unit of weight</param>
        /// <returns></returns>
        public PickupFluent <T> AddPickupSummary <C, W>(PickupService s, int c, decimal w, UnitOfWeight u) where C : IPickupCount, new() where W : IParcelWeight, new()
        {
            var ct = new C
            {
                ServiceId   = s,
                TotalWeight = new W {
                    UnitOfMeasurement = u, Weight = w
                },
                Count = c
            };

            _pickup.AddPickupCount(ct);
            return(this);
        }
Esempio n. 4
0
 public JsonParcelWeight(decimal w, UnitOfWeight u = UnitOfWeight.OZ) : base()
 {
     Weight            = w;
     UnitOfMeasurement = u;
 }