Пример #1
0
        public static ShipScheduleDataset GetShipSchedules(DateTime scheduleDate)
        {
            //Get a list of ship schedules for the specified date
            ShipScheduleDataset       schedules = new ShipScheduleDataset();
            ShipScheduleServiceClient client    = new ShipScheduleServiceClient();

            try {
                schedules.Merge(client.GetShipSchedules(int.Parse(Program.TerminalCode), scheduleDate));
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ShipScheduleFault> ssf) { client.Abort(); throw new ApplicationException(ssf.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(schedules);
        }