public TLs GetAgentSummary(int terminalID, string sortBy) { //Get an agent summary view for the specified terminal TLs tls = null; TLViewerServiceClient _Client = null; try { _Client = new TLViewerServiceClient(); tls = _Client.GetAgentSummary(terminalID); if (sortBy.Trim().Length == 0) { sortBy = "AgentNumber"; } TLComparer comparer = new TLComparer(sortBy); tls.Sort(comparer); _Client.Close(); } catch (FaultException fe) { throw new ApplicationException("GetAgentSummary() service error.", fe); } catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetAgentSummary() timed out.", te); } catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetAgentSummary() had a communication issue.", ce); } return(tls); }