Beispiel #1
0
        //Just messing around
        public static DataSet ViewDeliveryZips()
        {
            //
            DataSet zips = new DataSet();
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                zips.Merge(client.ViewDeliveryZips());
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(zips);
        }
Beispiel #2
0
        public static DataModule[] GetAvailableTariffs()
        {
            //
            DataModule[]           tariffs = null;
            RateQuoteServiceClient client  = new RateQuoteServiceClient();

            try {
                tariffs = client.GetAvailableTariffs();
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(tariffs);
        }
Beispiel #3
0
        public static Decimal GetMileage(string originPostalCode, string destinationPostalCode)
        {
            //
            Decimal miles = 0;
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                miles = (Decimal)client.GetMileage(originPostalCode, destinationPostalCode);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(miles);
        }
Beispiel #4
0
        public static LTLPointListResponse GetLTLPointList(LTLPointListRequest request)
        {
            //
            LTLPointListResponse   response = null;
            RateQuoteServiceClient client   = new RateQuoteServiceClient();

            try {
                response = client.GetLTLPointList(request);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(response);
        }
Beispiel #5
0
        public static LTLRateShipmentResponse[] CalculateLTLRates(LTLRateShipmentRequest[] requests)
        {
            //
            LTLRateShipmentResponse[] response = null;
            RateQuoteServiceClient    client   = new RateQuoteServiceClient();

            try {
                response = client.CalculateLTLRates(requests);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(response);
        }
Beispiel #6
0
        public static Rates CalculateRates(RateQuoteRequest request)
        {
            //
            Rates rates = null;
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                rates = client.CalculateRates(request.Tariff, request.OriginPostalCode, request.ClassCode, request.MCDiscount, request.UserMinimumChargeFloor, request.DestinationPostalCodes);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(rates);
        }
Beispiel #7
0
        public static RateQuoteDataset GetClassCodes()
        {
            //
            RateQuoteDataset       classes = new RateQuoteDataset();
            RateQuoteServiceClient client  = new RateQuoteServiceClient();

            try {
                classes.Merge(client.GetClassCodes());
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RateQuoteFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(classes);
        }