Ejemplo n.º 1
0
        public StationAssignments GetStationAssignments(string freightID)
        {
            //Get the operating enterprise terminal
            StationAssignments   assignments = null;
            FreightServiceClient _Client     = null;

            try {
                _Client = new FreightServiceClient();
                StationAssignments _assignments = _Client.GetStationAssignments();
                if (freightID != null && freightID.Length > 0)
                {
                    assignments = new StationAssignments();
                    for (int i = 0; i < _assignments.Count; i++)
                    {
                        if (_assignments[i].InboundFreight.FreightID == freightID)
                        {
                            assignments.Add(_assignments[i]);
                        }
                    }
                }
                else
                {
                    assignments = _assignments;
                }
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetStationAssignments() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetStationAssignments() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetStationAssignments() communication error.", ce); }
            return(assignments);
        }
Ejemplo n.º 2
0
        public InboundFreight GetInboundFreight(int terminalID, string freightType)
        {
            //Get the operating enterprise terminal
            InboundFreight       shipments = null;
            FreightServiceClient _Client   = null;

            try {
                _Client = new FreightServiceClient();
                InboundFreight _shipments = _Client.GetInboundFreight(terminalID, 0);
                if (freightType != null && freightType.Length > 0)
                {
                    shipments = new InboundFreight();
                    for (int i = 0; i < _shipments.Count; i++)
                    {
                        if (_shipments[i].FreightType.Trim().ToLower() == freightType.ToLower())
                        {
                            shipments.Add(_shipments[i]);
                        }
                    }
                }
                else
                {
                    shipments = _shipments;
                }
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetInboundFreight() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetInboundFreight() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetInboundFreight() communication error.", ce); }
            return(shipments);
        }
Ejemplo n.º 3
0
        public void WriteLogEntry(TraceMessage m)
        {
            //Get the operating enterprise terminal
            FreightServiceClient _Client = null;

            try {
                _Client = new FreightServiceClient();
                _Client.WriteLogEntry(m);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("WriteLogEntry() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("WriteLogEntry() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("WriteLogEntry() communication error.", ce); }
        }
Ejemplo n.º 4
0
        public Terminals GetTerminals()
        {
            //Get a list of Argix terminals
            Terminals            terminals = null;
            FreightServiceClient _Client   = null;

            try {
                _Client   = new FreightServiceClient();
                terminals = _Client.GetTerminals();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminals() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminals() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminals() communication error.", ce); }
            return(terminals);
        }
Ejemplo n.º 5
0
        public TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo         terminal = null;
            FreightServiceClient _Client  = null;

            try {
                _Client  = new FreightServiceClient();
                terminal = _Client.GetTerminalInfo();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminalInfo() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() communication error.", ce); }
            return(terminal);
        }
Ejemplo n.º 6
0
        public UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration    config  = null;
            FreightServiceClient _Client = null;

            try {
                _Client = new FreightServiceClient();
                config  = _Client.GetUserConfiguration(application, usernames);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetUserConfiguration() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetUserConfiguration() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetUserConfiguration() communication error.", ce); }
            return(config);
        }
Ejemplo n.º 7
0
        public InboundShipment GetInboundShipment(string freightID)
        {
            //Get the operating enterprise terminal
            InboundShipment      shipment = null;
            FreightServiceClient _Client  = null;

            try {
                _Client  = new FreightServiceClient();
                shipment = _Client.GetInboundShipment(freightID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetInboundShipment() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetInboundShipment() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetInboundShipment() communication error.", ce); }
            return(shipment);
        }