Example #1
0
        private void MainCycle(object sender, System.Timers.ElapsedEventArgs e)
        {
            lock (mainLock)
            {
                if (Active)
                {
                    Console.WriteLine("Entered to MainCycle");
                    using (var a = new DB_SAPEntities())
                    {
                        using (var b = new DataAnalysisContext())
                        {
                            Executor _do = new Executor(a, b);

                            var _dataSQL = a.ADDD.FirstOrDefault();

                            _do.UpdateSubtances();
                            _do.UpdatePosts();
                            _do.UpdateWeather();
                            _do.UpdateMeasurments();
                            b.SaveChanges();
                        }
                    }
                    Console.WriteLine("Exit from MainCycle");
                }
            }
        }
Example #2
0
        private void DataUpdater(object sender, System.Timers.ElapsedEventArgs e)
        {
            Console.WriteLine("Entered to MainCycle");
            DateTime time = new DateTime(2018, 1, 1);

            using (var a = new DB_SAPEntities())
            {
                using (var b = new DataAnalysisContext())
                {
                    Executor _do = new Executor(a, b);

                    _do.AllWeatherDataCheker(time);
                    b.SaveChanges();
                }
            }
            Console.WriteLine("Exit from MainCycle");
        }
Example #3
0
 public BaseUpdater(DB_SAPEntities _monitoringContext, IDataAnalysisContext _analysisContext)
 {
     this._analysisContext   = _analysisContext;
     this._monitoringContext = _monitoringContext;
 }
Example #4
0
 public Executor(DB_SAPEntities _Monitoring, DataAnalysisContext _Analysis)
 {
     Moniroting = _Monitoring;
     Analysis   = _Analysis;
 }
Example #5
0
 public SubstanceUpdater(DB_SAPEntities _monitoringContext, IDataAnalysisContext _analysisContext) : base(_monitoringContext, _analysisContext)
 {
 }
 public MeasurementUpdater(DB_SAPEntities _monitoringContext, IDataAnalysisContext _analysisContext) : base(_monitoringContext, _analysisContext)
 {
     numOfRows = 5_000;
 }
Example #7
0
 public WeatherUpdater(DB_SAPEntities _monitoringContext, IDataAnalysisContext _analysisContext) : base(_monitoringContext, _analysisContext)
 {
 }
Example #8
0
 public Executor(DB_SAPEntities monitoringContext, IDataAnalysisContext dataAnalysisContext)
 {
     _monitoringContext   = monitoringContext;
     _dataAnalysisContext = dataAnalysisContext;
 }