コード例 #1
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);
                      }
            }
        }
コード例 #2
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);
                      }
            }
        }