Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
                      }
            }
        }
Ejemplo n.º 10
0
        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);
                      }
            }
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }