Пример #1
0
        public static TerminalInfo GetTerminalInfo()
        {
            //Get the operating enterprise terminal
            TerminalInfo terminal = null;

            try {
                _Client  = new InvoicingServiceClient();
                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);
        }
Пример #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 = fillDataset(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 <RateWareFault>(new RateWareFault(new ApplicationException(ex.Message, ex))); }
            return(info);
        }