public MockSensorManager(string name, int actionExecutionDelay, Guid environmentId)
     : base(name, actionExecutionDelay, environmentId)
 {
     this.dbHelper = new DbHelper();
     this.environmentActionsClient = new EnvironmentActionsServiceClient();
     this.environmentConditionsServiceClient = new EnvironmentConditionsServiceClient();
 }
 public MockFeedingService(int poolingInterval)
     : base(poolingInterval)
 {
     this.dbHelper = new DbHelper();
     this.environmentActionsServiceClient = new EnvironmentActionsServiceClient();
     this.feedingTimers = new List<Timer>();
     this.environmentFeedingTimes = new Dictionary<Guid, List<FeedingTime>>();
 }
        public void LoadDataFromStorage()
        {
            try
            {
                this.dbHelper = new DbHelper();
                this.timeSlotEntries = this.dbHelper.GetEnvironmentTimeSlots(this.environmentId);
            }
            catch (Exception)
            {

            }
        }
        private void LoadDataFromStorage()
        {
            this.dbHelper = new DbHelper();

            List<Sensor> sensors = this.dbHelper.GetAllSensors();

            foreach (Sensor sensor in sensors)
            {
                SensorManager manager = new MockSensorManager(sensor.Name, int.Parse(ConfigurationManager.AppSettings[ZoosManagementSystemService.MockSensorPoolingTimeConfigurationKey]), sensor.Environment.Id);

                this.sensorManagers.Add(manager);
            }
        }
 public override void Initialize()
 {
     this.dbHelper = new DbHelper();
     this.LoadDataFromStorage();
 }