コード例 #1
0
        private void SubtractFromCount()
        {
            lock (lockObject)
            {
                CurrentCount--;

                if (CurrentCount < 0)
                    CurrentCount = 0;
            }

            try
            {
                var entry = new EntryExit
                {
                    Type = EntryExitEnum.Exit,
                };
                SaveEntryExit(entry);
                SaveCurrentCount(CurrentCount);
            }
            catch (Exception)
            {
                // do nothing
            }
        }
コード例 #2
0
        private void AddToCount()
        {
            lock (lockObject)
            {
                CurrentCount++;
            }

            try
            {
                var entry = new EntryExit
                    {
                        Type = EntryExitEnum.Entry,
                    };
                SaveEntryExit(entry);
                SaveCurrentCount(CurrentCount);
            }
            catch (Exception)
            {
                // do nothing
            }
        }
コード例 #3
0
 private void SaveEntryExit(EntryExit audit)
 {
     _session.Save(audit);
 }