Esempio n. 1
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);
        }
Esempio n. 2
0
        public TerminalInfo GetTerminalInfo()
        {
            //Get information about the local terminal for this service
            TerminalInfo info = null;

            try {
                info            = new TerminalInfo();
                info.Connection = DatabaseFactory.CreateDatabase(SQL_CONNID).ConnectionStringWithoutCredentials;
                DataSet ds = new DataService().FillDataset(SQL_CONNID, USP_LOCALTERMINAL, TBL_LOCALTERMINAL, new object[] { });
                if (ds != null && ds.Tables[TBL_LOCALTERMINAL].Rows.Count > 0)
                {
                    info.TerminalID  = Convert.ToInt32(ds.Tables[TBL_LOCALTERMINAL].Rows[0]["TerminalID"]);
                    info.Number      = ds.Tables[TBL_LOCALTERMINAL].Rows[0]["Number"].ToString().Trim();
                    info.Description = ds.Tables[TBL_LOCALTERMINAL].Rows[0]["Description"].ToString().Trim();
                }
            }
            catch (Exception ex) { throw new FaultException <EnterpriseFault>(new EnterpriseFault(new ApplicationException("Unexpected error while reading terminal info.", ex))); }
            return(info);
        }