Esempio n. 1
0
        private void OnTimedEvent(Object source, ElapsedEventArgs e)
        {
            List <Inspection> inspections = DatabaseConnector.get_inspections();

            foreach (Inspection inspection in inspections)
            {
                DateTime now = DateTime.Parse(DateTime.Now.ToString());
                now = now.Subtract(new TimeSpan(0, 0, now.Second));
                bool isShouldInspect = now.ToString().Equals(inspection.time.ToString());
                if (isShouldInspect)
                {
                    Thread inspectThread = new Thread(new ThreadStart(
                                                          () => this.inspection(inspection)
                                                          ));
                    inspectThread.Start();
                }
            }
        }
Esempio n. 2
0
 public List <Inspection> get_inspections()
 {
     return(DatabaseConnector.get_inspections());
 }