Пример #1
0
        private void doDataLiftWork()
        {
            try
            {
                _log.Debug("+doDataLiftWork()");
                this._registry = new LocalRegistryService();
                if (this._registry.isRegistry())
                {
                    if (this.isGreaterThanADay(_registry.getLastRunDateFromRegistry()) || this._registry.getRunNowBooleanFromRegistry())
                    {
                        this._readingDao = new ReadingDao();
                        this._deviceDao  = new DeviceDao();
                        this._run        = new ScheduledRun(this._registry, this._readingDao, this._deviceDao);
                        this._run.getDataAndPostToWebService();

                        //After use, set date to now and run now to false
                        this._registry.setRegistryValueLastRunDateToNow();
                        this._registry.setRegistryValueRunNowBoolean();
                    }
                }
                else
                {
                    this._registry.CreateRegistryPathAndAllValues();
                }
                _log.Debug("-doDataLiftWork()");
            }
            catch (Exception ex)
            {
                _log.Error("-doDataLiftWork() Message: " + ex.Message + " InnerException: " + ex.InnerException);
            }
        }