Exemplo 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);
        }
Exemplo n.º 2
0
 public void SetCounter2(int counterValue)
 {
     using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
     {
         countersDataAccess.SetCounter2(counterValue);
     }
 }
Exemplo n.º 3
0
        public void SetCounter2(int counterValue)
        {
            TraceTransactionInfo("SetCounter2()");

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter2(counterValue);
            }
        }
Exemplo n.º 4
0
        public void SetCounter2(int counterValue)
        {
            Console.WriteLine("About to reset counter 2 to {0} on transaction id {1}", counterValue, Transaction.Current.TransactionInformation.DistributedIdentifier);

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter2(counterValue);
            }
            Console.WriteLine("Reset counter 2 to {0} on transaction id {1}", counterValue, Transaction.Current.TransactionInformation.DistributedIdentifier);
        }
Exemplo n.º 5
0
        public void ResetCounters()
        {
            TraceTransactionInfo("ResetCounters()");

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter1(0);
                countersDataAccess.SetCounter2(0);
            }
        }
Exemplo n.º 6
0
        public void SetCounter2(int counterValue)
        {
            Console.WriteLine("About to reset counter 2 to {0}", counterValue);

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter2(counterValue);
            }
            Console.WriteLine("Reset counter 2 to {0}", counterValue);
        }
Exemplo n.º 7
0
        public void ResetCounters()
        {
            Transaction.Current.TransactionCompleted += new TransactionCompletedEventHandler(Current_TransactionCompleted);

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter1(0);
                Thread.Sleep(5000);
                countersDataAccess.SetCounter2(0);
            }
        }
Exemplo n.º 8
0
 public void SetCounter2(int counterValue)
 {
     try
     {
         using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
         {
             countersDataAccess.SetCounter2(counterValue);
         }
     }
     catch (InvalidOperationException ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Exemplo n.º 9
0
        public void ResetCounters()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                TraceTransactionIds("ResetCounters()");

                using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
                {
                    countersDataAccess.SetCounter1(0);
                    countersDataAccess.SetCounter2(0);
                }

                scope.Complete();
            }
        }
Exemplo n.º 10
0
        public void ResetCounters()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                Console.WriteLine("About to reset counters to {0} on transaction id {1}", 0, Transaction.Current.TransactionInformation.LocalIdentifier);

                using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
                {
                    countersDataAccess.SetCounter1(0);
                    countersDataAccess.SetCounter2(0);
                }

                Console.WriteLine("Reset counters to {0} on transaction id {1}", 0, Transaction.Current.TransactionInformation.LocalIdentifier);

                scope.Complete();
            }
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
0
        public void ResetCounters()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
                {
                    countersDataAccess.SetCounter1(0);
                    countersDataAccess.SetCounter2(0);
                }

                scope.Complete();
            }

            //using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            //{
            //    countersDataAccess.ResetCounters();
            //}
        }
Exemplo n.º 13
0
        public void ResetCounters()
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
                    {
                        countersDataAccess.SetCounter1(0);
                        countersDataAccess.SetCounter2(0);
                    }

                    scope.Complete();
                }
            }
            catch (InvalidOperationException ex)
            {
                throw new FaultException(ex.Message);
            }
        }