Example #1
0
        public DataView GetAgentSummary(int terminalID, string sortBy)
        {
            //Get an agent summary view for the specified terminal
            TLDataset tls  = new TLDataset();
            DataView  view = tls.TLTable.DefaultView;
            TLViewerService2Client client = new TLViewerService2Client();

            try {
                DataSet ds = client.GetAgentSummary2(terminalID);
                if (ds != null)
                {
                    tls.Merge(ds);
                    if (sortBy.Trim().Length == 0)
                    {
                        sortBy = "AgentNumber";
                    }
                    view.Sort = sortBy;
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TLViewerFault> tle) { client.Abort(); throw new ApplicationException(tle.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(view);
        }
Example #2
0
        public static FreightDataset GetAgentSummary(int terminalID)
        {
            //Get an agent summary view for the specified terminal
            FreightDataset         tls    = new FreightDataset();
            TLViewerService2Client client = new TLViewerService2Client();

            try {
                DataSet ds = client.GetAgentSummary2(terminalID);
                if (ds != null && ds.Tables["TLTable"] != null && ds.Tables["TLTable"].Rows.Count > 0)
                {
                    tls.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TLViewerFault> tle) { client.Abort(); throw new ApplicationException(tle.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(tls);
        }