Пример #1
0
        /// <summary>
        /// 处理机器开机
        /// </summary>
        /// <param name="deviceId">设备Id</param>
        /// <param name="deviceOwn">设备所有人</param>
        /// <param name="deviceSetup">设备信息</param>
        private async Task ProcessDeviceSetup(string deviceId, string deviceOwn, DeviceSetup deviceSetup)
        {
            var device = new Entity.Device
            {
                #region
                ComPortNum = deviceSetup.ComPortNum,
                DeviceName = deviceId,
                DeviceType = deviceSetup.DevType,
                InDate     = DateTime.Now,
                DeviceId   = deviceId,
                IsGetway   = deviceSetup.IsGateway,
                IsOnline   = true,
                Gps        = deviceSetup.GPS,
                UserOwn    = deviceOwn,
                Version    = deviceSetup.Version
                             #endregion
            };

            if (await this.deviceService.GetDevice(deviceId) == null)
            {
                await this.deviceService.Insert(device);
            }
            else
            {
                device.IsOnline = true;
                await this.deviceService.Update(device);
            }
        }
Пример #2
0
 public DeviceResponse(Entity.Device phone)
 {
     if (phone != null)
     {
         Id              = phone.Id;
         ManufacturerID  = phone.ManufacturerID;
         Model           = phone.Model;
         Ram             = phone.Ram;
         ScreenSize      = phone.ScreenSize;
         OperatingSystem = phone.OperatingSystem;
     }
 }
Пример #3
0
 public DeviceResponse(Entity.Device phone, string manufacturer) : this(phone)
 {
     Manufacturer = manufacturer;
 }