Exemple #1
0
 //Interface
 static TLViewerProxy()
 {
     //
     _Client  = new TLViewerServiceClient();
     _state   = true;
     _address = _Client.Endpoint.Address.Uri.AbsoluteUri;
 }
Exemple #2
0
        public Terminals GetTerminals(int terminalID)
        {
            //Returns a list of terminals
            Terminals             terminals = null;
            TLViewerServiceClient _Client   = null;

            try {
                terminals = new Terminals();
                _Client   = new TLViewerServiceClient();
                Terminals ts = _Client.GetTerminals();
                for (int i = 0; i < ts.Count; i++)
                {
                    Terminal t = ts[i];
                    if (terminalID == 0 || t.TerminalID == terminalID)
                    {
                        terminals.Add(t);
                    }
                }
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminals() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminals() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminals() communication error.", ce); }
            return(terminals);
        }
Exemple #3
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);
        }
Exemple #4
0
        //Interface
        static FreightGateway()
        {
            //
            TLViewerServiceClient client = new TLViewerServiceClient();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Exemple #5
0
 public static void WriteLogEntry(TraceMessage m)
 {
     //Get the operating enterprise terminal
     try {
         _Client = new TLViewerServiceClient();
         _Client.WriteLogEntry(m);
         _Client.Close();
     }
     catch (FaultException fe) { throw new ApplicationException("WriteLogEntry() service error.", fe); }
     catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("WriteLogEntry() timeout error.", te); }
     catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("WriteLogEntry() communication error.", ce); }
 }
Exemple #6
0
        public static void WriteLogEntry(TraceMessage m)
        {
            //Get the operating enterprise terminal
            TLViewerServiceClient client = null;

            try {
                client = new TLViewerServiceClient();
                client.WriteLogEntry(m);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
        }
Exemple #7
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new TLViewerServiceClient();
                terminal = _Client.GetTerminalInfo();
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTerminalInfo() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTerminalInfo() communication error.", ce); }
            return(terminal);
        }
Exemple #8
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration config = null;

            try {
                _Client = new TLViewerServiceClient();
                config  = _Client.GetUserConfiguration(application, usernames);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetUserConfiguration() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetUserConfiguration() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetUserConfiguration() communication error.", ce); }
            return(config);
        }
Exemple #9
0
        public static TLs GetAgentSummary(int terminalID)
        {
            //Get an agent summary view for the specified terminal
            TLs tls = null;

            try {
                _Client = new TLViewerServiceClient();
                tls     = _Client.GetAgentSummary(terminalID);
                _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);
        }
Exemple #10
0
        public static TLs GetTLDetail(int terminalID, string tlNumber)
        {
            //Get TL detail for the specified TL#
            TLs tls = null;

            try {
                _Client = new TLViewerServiceClient();
                tls     = _Client.GetTLDetail(terminalID, tlNumber);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetTLDetail() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetTLDetail() timed out.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetTLDetail() had a communication issue.", ce); }
            return(tls);
        }
Exemple #11
0
        public static ServiceInfo GetServiceInfo()
        {
            //Get the operating enterprise terminal
            ServiceInfo           terminal = null;
            TLViewerServiceClient client   = null;

            try {
                client   = new TLViewerServiceClient();
                terminal = client.GetServiceInfo();
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(terminal);
        }
Exemple #12
0
        public static UserConfiguration GetUserConfiguration(string application, string[] usernames)
        {
            //Get the operating enterprise terminal
            UserConfiguration     config = null;
            TLViewerServiceClient client = null;

            try {
                client = new TLViewerServiceClient();
                config = client.GetUserConfiguration(application, usernames);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(config);
        }
Exemple #13
0
        public static TLs GetTLView(int terminalID)
        {
            //Get a view of TLs for the specified terminal
            TLs tls = null;

            try {
                _Client = new TLViewerServiceClient();
                tls     = _Client.GetTLView(terminalID);
                for (int i = 0; i < tls.Count; i++)
                {
                    tls[i].TerminalID = terminalID;
                }
                _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);
        }
Exemple #14
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);
        }
Exemple #15
0
        public void WriteLogEntry(LogLevel level, string username, Exception ex)
        {
            //Write an entry into the Argix log
            TLViewerServiceClient client = new TLViewerServiceClient();

            try {
                TraceMessage tm = new TraceMessage();
                tm.Name     = LOG_NAME;
                tm.LogLevel = level;
                tm.Date     = DateTime.Now;
                tm.Source   = LOG_SOURCE;
                tm.Category = tm.Event = "";
                tm.User     = username;
                tm.Computer = "";
                tm.Keyword1 = tm.Keyword2 = tm.Keyword3 = "";
                tm.Message  = ex.ToString();
                client.WriteLogEntry(tm);
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <ConfigurationFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
        }