public HomeSecureServerInputsListener()
 {
     using (ServerDataAccess conf = new ServerDataAccess("HomeSecureData"))
     {
         bool dbCreated = conf.Database.CreateIfNotExists();
     }
 }
 public void AddMotionSecurityEvent(MotionDetectionEvent motionEvent)
 {
     Logger.Debug("Security event detected");
     using (ServerDataAccess conf = new ServerDataAccess("HomeSecureData"))
     {
         conf.AddMotionDetectionEvent(motionEvent);
     }
 }
        public List<MotionDetectionEvent> GetMotionSecurityEvents(int pageSize, int pageNumber, out int total)
        {
            List<MotionDetectionEvent> result;

            using (ServerDataAccess conf = new ServerDataAccess("HomeSecureData"))
            {
                result = conf.GetMotionDetectionEvents(pageSize,pageNumber,out total);
            }

            return result;
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Logger.Init("Log.config", "DataAccessTestLogger");

            MotionDetectionEvent mde = new MotionDetectionEvent()
            {
                CameraDevice = new CameraDevice()
                {
                    ID = "123",
                    Name = "Name"
                },
                ID = 1,
                NumberOfPixelsDetected = 100,
                SecurityEventTime = DateTime.Now
            };

            ServerDataAccess conf = new ServerDataAccess("HomeSecureData");
            conf.AddMotionDetectionEvent(mde);

            int total = 0;
            List<MotionDetectionEvent> motionDetectionEvents = conf.GetMotionDetectionEvents(2, 1, out total);
        }