public AssignmentDataset GetStationAssignments(int terminalID, string freightID) { //Get a list of station-freight assignments for the specified terminal AssignmentDataset assignments = new AssignmentDataset(); FreightAssignServiceClient client = new FreightAssignServiceClient(); try { AssignmentDataset _assignments = new AssignmentDataset(); DataSet ds = client.GetStationAssignments(terminalID); if (ds != null) { _assignments.Merge(ds); } client.Close(); if (freightID != null && freightID.Length > 0) { assignments.Merge(_assignments.StationFreightAssignmentTable.Select("FreightID='" + freightID + "'", "StationNumber ASC")); } else { assignments.Merge(_assignments.StationFreightAssignmentTable.Select("", "StationNumber ASC")); } } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(assignments); }
public static bool StopSort(InboundShipment shipment) { // bool stopped = false; FreightAssignServiceClient client = new FreightAssignServiceClient(); try { stopped = client.StopSort(shipment); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(stopped); }
public static InboundShipment GetInboundShipment(string freightID) { //Return the inbound shipment for the specified terminal and freightID InboundShipment shipment = null; FreightAssignServiceClient client = new FreightAssignServiceClient(); try { shipment = client.GetInboundShipment(int.Parse(Program.TerminalCode), freightID); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(shipment); }
public bool DeleteStationAssignment(StationAssignment assignment) { // bool deleted = false; FreightAssignServiceClient client = new FreightAssignServiceClient(); try { deleted = client.DeleteStationAssignment(assignment); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(deleted); }
public bool CreateStationAssignment(Workstation station, InboundShipment shipment, int sortTypeID) { // bool created = false; FreightAssignServiceClient client = new FreightAssignServiceClient(); try { created = client.CreateStationAssignment(shipment.TerminalID, station.WorkStationID, shipment.FreightID, sortTypeID); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(created); }
public TerminalDataset GetTerminals() { //Get a list of Argix terminals TerminalDataset terminals = new TerminalDataset(); FreightAssignServiceClient client = new FreightAssignServiceClient(); try { DataSet ds = client.GetTerminals(); if (ds != null) { terminals.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(terminals); }
public static TsortDataset GetAssignableSortStations(InboundShipment shipment, int sortTypeID) { // TsortDataset sortStations = new TsortDataset(); FreightAssignServiceClient client = new FreightAssignServiceClient(); try { DataSet ds = client.GetAssignableSortStations(shipment.TerminalID, shipment.FreightID, sortTypeID); if (ds != null) { sortStations.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(sortStations); }
public static TsortDataset GetStationAssignments() { //Get a list of station-freight assignments for the specified terminal TsortDataset assignments = new TsortDataset(); FreightAssignServiceClient client = new FreightAssignServiceClient(); try { DataSet ds = client.GetStationAssignments(int.Parse(Program.TerminalCode)); if (ds != null) { assignments.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(assignments); }
public static void RefreshStationAssignments() { //Refresh the list of freight assignments for the local terminal FreightAssignServiceClient client = new FreightAssignServiceClient(); try { _Assignments.Clear(); _Assignments.Merge(client.GetStationAssignments(int.Parse(Program.TerminalCode))); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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); } finally { if (AssignmentsChanged != null) { AssignmentsChanged(null, EventArgs.Empty); } } }
public static void RefreshFreight() { //Refresh the list of inbound shipments for the specified terminal FreightAssignServiceClient client = new FreightAssignServiceClient(); try { _InboundFreight.Clear(); _InboundFreight.Merge(client.GetInboundFreight(int.Parse(Program.TerminalCode), DateTime.Today.AddDays(-(SortedRange - 1)))); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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); } finally { if (FreightChanged != null) { FreightChanged(null, EventArgs.Empty); } } }
public WorkstationDataset GetAssignableSortStations(int terminalID, string freightID, int sortTypeID) { // WorkstationDataset sortStations = new WorkstationDataset(); FreightAssignServiceClient client = new FreightAssignServiceClient(); try { DataSet ds = client.GetAssignableSortStations(terminalID, freightID, sortTypeID); client.Close(); if (ds != null) { sortStations.Merge(ds); } } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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(sortStations); }
public FreightDataset GetInboundFreight(int terminalID, string freightType) { FreightDataset shipments = new FreightDataset(); FreightAssignServiceClient client = new FreightAssignServiceClient(); try { DataSet ds = client.GetInboundFreight(terminalID, DateTime.Today.AddDays(-this.mSortedDays)); if (ds != null) { FreightDataset _shipments = new FreightDataset(); _shipments.Merge(ds); shipments.Merge(_shipments.InboundFreightTable.Select("FreightType='" + freightType + "'", "TDSNumber ASC")); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <TsortFault> 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); }