Exemple #1
0
        public LTLQuote CreateQuote(LTLQuote quote)
        {
            //Create a new LTL Quote
            LTLClientServiceClient client = new LTLClientServiceClient();

            try {
                quote = client.CreateQuote(quote);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> 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(quote);
        }
Exemple #2
0
        public int CreateLTLClient(LTLClient ltlClient)
        {
            //Create a new LTL client
            int clientID = 0;
            LTLClientServiceClient client = new LTLClientServiceClient();

            try {
                clientID = client.CreateLTLClient(ltlClient);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> 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(clientID);
        }
Exemple #3
0
        public ServiceLocation ReadPickupLocation(string zipCode)
        {
            //
            ServiceLocation        location = null;
            LTLClientServiceClient client   = new LTLClientServiceClient();

            try {
                location = client.ReadPickupLocation(zipCode);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> 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(location);
        }
Exemple #4
0
        public LTLConsignee ReadLTLConsignee(int consigneeID)
        {
            LTLConsignee           consignee = new LTLConsignee();
            LTLClientServiceClient client    = new LTLClientServiceClient();

            try {
                consignee = client.ReadLTLConsignee(consigneeID);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(consignee);
        }
Exemple #5
0
        public bool UpdateLTLConsignee(LTLConsignee ltlConsignee)
        {
            //Update an existing LTL consignee
            bool updated = false;
            LTLClientServiceClient client = new LTLClientServiceClient();

            try {
                updated = client.UpdateLTLConsignee(ltlConsignee);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> 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(updated);
        }
Exemple #6
0
        public LTLShipper ReadLTLShipper(int shipperID)
        {
            LTLShipper             shipper = new LTLShipper();
            LTLClientServiceClient client  = new LTLClientServiceClient();

            try {
                shipper = client.ReadLTLShipper(shipperID);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(shipper);
        }
Exemple #7
0
        public int CreateLTLShipper(LTLShipper ltlShipper)
        {
            //Create a new LTL shipper
            int shipperID = 0;
            LTLClientServiceClient client = new LTLClientServiceClient();

            try {
                shipperID = client.CreateLTLShipper(ltlShipper);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> 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(shipperID);
        }
Exemple #8
0
        public LTLClient ReadLTLClient(int clientID)
        {
            LTLClient ltlClient           = new LTLClient();
            LTLClientServiceClient client = new LTLClientServiceClient();

            try {
                ltlClient = client.ReadLTLClient(clientID);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(ltlClient);
        }
Exemple #9
0
        public LTLConsigneeDataset ReadLTLConsigneesList(int clientID)
        {
            LTLConsigneeDataset    consignees = new LTLConsigneeDataset();
            LTLClientServiceClient client     = new LTLClientServiceClient();

            try {
                DataSet ds = client.ReadLTLConsigneesList(clientID);
                if (ds != null && ds.Tables["LTLConsigneeTable"].Rows.Count > 0)
                {
                    consignees.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(consignees);
        }
Exemple #10
0
        public LTLShipperDataset ViewLTLShippers(int clientID)
        {
            LTLShipperDataset      shippers = new LTLShipperDataset();
            LTLClientServiceClient client   = new LTLClientServiceClient();

            try {
                DataSet ds = client.ViewLTLShippersForClient(clientID);
                if (ds != null && ds.Tables["LTLShipperTable"].Rows.Count > 0)
                {
                    shippers.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(shippers);
        }