Beispiel #1
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Write an entry into the Argix log
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                //client.WriteLogEntry(m);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Beispiel #2
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the application configuration for the specified user
            UserConfiguration      config = null;
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                config = new UserConfiguration();   // client.GetUserConfiguration(application, usernames);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(config);
        }
Beispiel #3
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 #4
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 #5
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            RateQuoteServiceClient client = new RateQuoteServiceClient();

            try {
                ServiceInfo info = new ServiceInfo();
                info.TerminalID  = 0;
                info.Description = "";
                return(info);   // client.GetServiceInfo();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }
Beispiel #6
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 #7
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 #8
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 #9
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 #10
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);
        }