public LTLShipmentDataset SearchLTLShipments(DateTime shipDateStart, DateTime shipDateEnd, string clientNumber, string shipperNumber, int consigneeNumber) { // LTLShipmentDataset shipments = new LTLShipmentDataset(); LTLClientService2Client client = new LTLClientService2Client(); try { if (clientNumber != null && clientNumber.Trim().Length > 0) { LTLSearch2 criteria = new LTLSearch2(); criteria.ShipDateStart = shipDateStart; criteria.ShipDateEnd = shipDateEnd; criteria.ClientNumber = clientNumber; criteria.ShipperNumber = shipperNumber; criteria.ConsigneeNumber = consigneeNumber; DataSet ds = client.SearchLTLShipments(criteria); if (ds != null && ds.Tables["LTLShipmentTable"] != null && ds.Tables["LTLShipmentTable"].Rows.Count > 0) { shipments.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(shipments); }
public LTLShipmentDataset ViewLTLShipments(int clientID) { //View all LTL shipments for the specified client LTLShipmentDataset shipments = new LTLShipmentDataset(); LTLClientServiceClient client = new LTLClientServiceClient(); try { DataSet ds = client.ViewLTLShipments(clientID); if (ds != null && ds.Tables["LTLShipmentTable"].Rows.Count > 0) { shipments.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(shipments); }