Exemple #1
0
        double EstimatedRate(Person shipto, ProductCollection cart)
        {
            if (cart.ShipMethod[0] == 'F')
            {
                return(FedEx.FedExEstimatedRate(shipto, cart));
            }

            else if (cart.ShipMethod[0] == 'U')
            {
                return(UPS.UPSEstimatedRate(shipto, cart));
            }

            else
            {
                throw new ArgumentException("Ship method is incorrect");
            }
        }
Exemple #2
0
        double EstimatedRate(Person shipto, ProductCollection cart)
        {
            try
            {
                if (cart.ShipMethod[0] == 'F')
                {
                    return(FedEx.FedExEstimatedRate(shipto, cart));
                }

                else if (cart.ShipMethod[0] == 'U')
                {
                    return(UPS.UPSEstimatedRate(shipto, cart));
                }
            }
            catch (Exception ex)
            {
                return(0.0);
            }
            return(0.0);
        }