Ejemplo n.º 1
0
        public static LoadTender GetLoadTender(int number)
        {
            //Get an existing file attachment from database
            LoadTender loadTender = null;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                loadTender = client.GetLoadTender(number);
                client.Close();
            }
            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(loadTender);
        }
Ejemplo n.º 2
0
        public static bool CancelLoadTenderQuote(int quoteID, DateTime cancelled, string cancelledBy)
        {
            //Cancel an existing LTLLoadTenderQuote
            bool result = false;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                result = client.CancelLoadTenderQuote(quoteID, cancelled, cancelledBy);
                client.Close();
            }
            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(result);
        }
Ejemplo n.º 3
0
        public static bool ChangeOwnerLoadTenderQuote(int quoteID, string owner)
        {
            //Change the owner of an existing LTLLoadTenderQuote
            bool result = false;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                result = client.ChangeOwnerLoadTenderQuote(quoteID, owner);
                client.Close();
            }
            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(result);
        }
Ejemplo n.º 4
0
        public static bool BookLoadTenderQuote(int quoteID, LTLShipment2 shipment)
        {
            //Book an existing LTLLoadTenderQuote
            bool result = false;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                result = client.BookLoadTenderQuote(quoteID, shipment);
                client.Close();
            }
            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(result);
        }
Ejemplo n.º 5
0
        public static bool UpdateLoadTenderQuote(LTLLoadTenderQuote quote)
        {
            //Update an existing LTLLoadTenderQuote
            bool updated = false;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                updated = client.UpdateLoadTenderQuote(quote);
                client.Close();
            }
            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);
        }
Ejemplo n.º 6
0
        public static LTLLoadTenderQuote ReadLoadTenderQuote(int id)
        {
            //
            LTLLoadTenderQuote          quote  = null;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                quote = client.ReadLoadTenderQuote(id);
                client.Close();
            }
            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);
        }
Ejemplo n.º 7
0
        public static int CreateLoadTenderQuote(LTLLoadTenderQuote quote)
        {
            //Create a new LTLLoadTenderQuote
            int id = 0;
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                id = client.CreateLoadTenderQuote(quote);
                client.Close();
            }
            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(id);
        }
Ejemplo n.º 8
0
        public static LoadTenderQuoteDataset ViewLoadTenderQuotes(string owner)
        {
            //
            LoadTenderQuoteDataset      quotes = new LoadTenderQuoteDataset();
            LTLLoadTenderService2Client client = new LTLLoadTenderService2Client();

            try {
                DataSet ds = client.ViewLoadTenderQuotes(owner);
                if (ds != null)
                {
                    quotes.Merge(ds);
                }
                client.Close();
            }
            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(quotes);
        }