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

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter2(counterValue);
            }
        }
示例#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);
        }
示例#5
0
        public void ResetCounters()
        {
            TraceTransactionInfo("ResetCounters()");

            using (Counters.Dalc.CountersDataAccess countersDataAccess = new Counters.Dalc.CountersDataAccess())
            {
                countersDataAccess.SetCounter1(0);
                countersDataAccess.SetCounter2(0);
            }
        }
示例#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);
        }
示例#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);
            }
        }
示例#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);
     }
 }
示例#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();
            }
        }
示例#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();
            }
        }
示例#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);
        }
示例#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();
            //}
        }
示例#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);
            }
        }