Пример #1
0
        public TLs GetTLView(int terminalID, string sortBy)
        {
            //Get a view of TLs for the specified terminal
            TLs tls = null;
            TLViewerServiceClient _Client = null;

            try {
                _Client = new TLViewerServiceClient();
                tls     = _Client.GetTLView(terminalID);
                for (int i = 0; i < tls.Count; i++)
                {
                    tls[i].TerminalID = terminalID;
                }

                if (sortBy.Trim().Length == 0)
                {
                    sortBy = "TLNumber";
                }
                TLComparer comparer = new TLComparer(sortBy);
                tls.Sort(comparer);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTLView() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTLView() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTLView() communication error.", ce); }
            return(tls);
        }
Пример #2
0
        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);
        }