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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }