Beispiel #1
0
        public UpdateDeviceInfoResponse Process(UpdateDeviceInfoRequest request)
        {
            try
            {
                var dao = new DeviceInfoDao();

                var data = dao.GetDeviceData();

                DeviceInfoMapper.UpdateDeviceData(ref data, request.DeviceInfo);

                dao.UpdateDevice(data);

                return(new UpdateDeviceInfoResponse()
                {
                    Token = request.Token, ResultType = ResultType.OK
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                return(new UpdateDeviceInfoResponse()
                {
                    Token = request.Token, ResultType = ResultType.Error
                });
            }
        }
Beispiel #2
0
        public GetDeviceInfoResponse Process(GetDeviceInfoRequest request)
        {
            try
            {
                var deviceDao   = new DeviceInfoDao();
                var deviceData  = deviceDao.GetDeviceData();
                var serviceData = DeviceInfoMapper.ToModel(deviceData);

                return(new GetDeviceInfoResponse()
                {
                    Token = request.Token, ResultType = ResultType.OK, Service = serviceData
                });
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                return(new GetDeviceInfoResponse()
                {
                    Token = request.Token, ResultType = ResultType.Error
                });
            }
        }