Ejemplo n.º 1
0
        public static DateTime FindEarlierTripOnPriorSchedule(DateTime scheduleDate, string tripID, string freightID)
        {
            //Return an earlier trip from a schedule prior to the one specified
            DateTime tripDate = DateTime.MinValue;
            ZoneClosingServiceClient client = new ZoneClosingServiceClient();

            try {
                tripDate = client.FindEarlierTripOnPriorSchedule(int.Parse(Program.TerminalCode), scheduleDate, tripID, freightID);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ShipScheduleFault> 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(tripDate);
        }