Esempio n. 1
0
 public void Start()
 {
     using (NpgsqlConnection connection = _connectionFactory.Create()) {
         _repository.EnsureTable(connection);
         InsertContextUsers(connection);
         _context = null;
     }
 }
Esempio n. 2
0
        public void Run()
        {
            if (_connection == null)
            {
                _connection = _connectionFactory.Create();
            }
            DeleteOldAlarms();
            var time = _timeService.UtcTime;

            _updateAlarmTagsDigitalValues();
            ProcessAlarms(time);
        }
Esempio n. 3
0
 public DateTime Save(LogItem item)
 {
     using (var connection = _connectionFactory.Create())
     {
         DeleteOld(connection);
         if (item.Time == _defaultTime)
         {
             item.Time = _timeService.UtcTime;
             _repository.Insert(connection, item);
         }
         else if (!_repository.Update(connection, item))
         {
             _repository.Insert(connection, item);
         }
         return(item.Time);
     }
 }
Esempio n. 4
0
 public ITrendsRepository Create()
 {
     return(new TrendsRepository(_connectionFactory.Create(), _categoryId, _trendTagIds));
 }