Ejemplo n.º 1
0
        public List <CounterInfo> GetCounters()
        {
            List <CounterInfo> counters = new List <CounterInfo>();

            try
            {
                using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
                {
                    CountersDataSet.CountersDataTable table = countersDataAccess.GetCounters();
                    foreach (CountersDataSet.CountersRow r in table)
                    {
                        CounterInfo counter = new CounterInfo();
                        counter.Id           = r.id;
                        counter.CounterValue = r.value;
                        counters.Add(counter);
                    }
                }
            }
            catch (InvalidOperationException ex)
            {
                throw new FaultException(ex.Message);
            }

            return(counters);
        }
Ejemplo n.º 2
0
        public List <CounterInfo> GetCounters()
        {
            List <CounterInfo> counters = new List <CounterInfo>();

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                CountersDataSet.CountersDataTable table = countersDataAccess.GetCounters();
                foreach (CountersDataSet.CountersRow r in table)
                {
                    CounterInfo counter = new CounterInfo();
                    counter.Id           = r.id;
                    counter.CounterValue = r.value;
                    counters.Add(counter);
                }
            }

            return(counters);
        }