예제 #1
0
        public void SyncTimeByDevice(int deviceId)
        {
            var device = db.Devices.Include(d => d.DeviceType).Where(w => w.DeviceId == deviceId).FirstOrDefault();

            DeviceFactory factory = new DeviceFactory();

            IDevice iDevice = factory.CreateIntance(device);

            iDevice.SyncTime();
        }
예제 #2
0
        public void GetStatus(int id)
        {
            DeviceFactory factory = new DeviceFactory();

            var device = db.Devices.Include(i => i.DeviceType).Where(w => w.DeviceId == id).FirstOrDefault();

            if (device != null)
            {
                IDevice iDevice = factory.CreateIntance(device);
                iDevice.GetStatus();
            }
        }
예제 #3
0
        public void TransferRecordsByDevice(int deviceId)
        {
            var device = db.Devices.Include(d => d.DeviceType).Where(w => w.DeviceId == deviceId).FirstOrDefault();

            DeviceFactory factory = new DeviceFactory();

            IDevice iDevice = factory.CreateIntance(device);

            if (iDevice.TransferRecords())
            {
                iDevice.ClearDevice();
            }
        }
예제 #4
0
        public void SyncTimeAndTransferByDevice(int deviceId)
        {
            MyLogger.GetInstance.Info(string.Format("SyncTimeAndTransferByDevice Device: {0}", deviceId));

            var device = db.Devices.Include(d => d.DeviceType).Where(w => w.DeviceId == deviceId).FirstOrDefault();

            DeviceFactory factory = new DeviceFactory();

            IDevice iDevice = factory.CreateIntance(device);

            if (iDevice.SyncTime())
            {
                if (iDevice.TransferRecords())
                {
                    iDevice.ClearDevice();
                }
            }
        }
예제 #5
0
        public bool TranferRecordsByDevise(int deviceId)
        {
            bool result = false;

            var device = db.Devices.Include(d => d.DeviceType).Where(w => w.DeviceId == deviceId).FirstOrDefault();

            DeviceFactory factory = new DeviceFactory();

            IDevice iDevice = factory.CreateIntance(device);

            if (iDevice.TransferRecords())
            {
                if (iDevice.ClearDevice())
                {
                    result = true;
                }
            }

            return(result);
        }