Exemple #1
0
        //------------------------------------------------------------------------------
        public virtual void DelProfileDeviceByUuid()
        {
            string _uuid = (string)util.GetParamValue(_context, "uuid");

            ResponseProfileDeviceBool wrapper = new ResponseProfileDeviceBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "profile-device/del/by-uuid";

            bool completed = api.DelProfileDeviceByUuid(

                _uuid
            );

            // get data
            wrapper.data = completed;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }
Exemple #2
0
        //------------------------------------------------------------------------------
        public virtual void SetProfileDeviceByUuid()
        {
            ResponseProfileDeviceBool wrapper = new ResponseProfileDeviceBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "profile-device/set/by-uuid";

            ProfileDevice obj = new ProfileDevice();

            string _status = util.GetParamValue(_context, "status");
            if(!String.IsNullOrEmpty(_status))
                obj.status = (string)_status;

            string _uuid = util.GetParamValue(_context, "uuid");
            if(!String.IsNullOrEmpty(_uuid))
                obj.uuid = (string)_uuid;

            string _date_modified = util.GetParamValue(_context, "date_modified");
            if(!String.IsNullOrEmpty(_date_modified))
                obj.date_modified = Convert.ToDateTime(_date_modified);
            else
                obj.date_modified = DateTime.Now;

            string _profile_id = util.GetParamValue(_context, "profile_id");
            if(!String.IsNullOrEmpty(_profile_id))
                obj.profile_id = (string)_profile_id;

            string _token = util.GetParamValue(_context, "token");
            if(!String.IsNullOrEmpty(_token))
                obj.token = (string)_token;

            string _secret = util.GetParamValue(_context, "secret");
            if(!String.IsNullOrEmpty(_secret))
                obj.secret = (string)_secret;

            string _device_version = util.GetParamValue(_context, "device_version");
            if(!String.IsNullOrEmpty(_device_version))
                obj.device_version = (string)_device_version;

            string _device_type = util.GetParamValue(_context, "device_type");
            if(!String.IsNullOrEmpty(_device_type))
                obj.device_type = (string)_device_type;

            string _active = util.GetParamValue(_context, "active");
            if(!String.IsNullOrEmpty(_active))
                obj.active = Convert.ToBoolean(_active);

            string _date_created = util.GetParamValue(_context, "date_created");
            if(!String.IsNullOrEmpty(_date_created))
                obj.date_created = Convert.ToDateTime(_date_created);
            else
                obj.date_created = DateTime.Now;

            string _device_os = util.GetParamValue(_context, "device_os");
            if(!String.IsNullOrEmpty(_device_os))
                obj.device_os = (string)_device_os;

            string _device_id = util.GetParamValue(_context, "device_id");
            if(!String.IsNullOrEmpty(_device_id))
                obj.device_id = (string)_device_id;

            string _device_platform = util.GetParamValue(_context, "device_platform");
            if(!String.IsNullOrEmpty(_device_platform))
                obj.device_platform = (string)_device_platform;

            // get data
            wrapper.data = api.SetProfileDeviceByUuid(obj);

            util.SerializeTypeJSONToResponse(_context, wrapper);
        }
Exemple #3
0
        //------------------------------------------------------------------------------
        public virtual void DelProfileDeviceByProfileIdByToken()
        {
            string _profile_id = (string)util.GetParamValue(_context, "profile_id");
            string _token = (string)util.GetParamValue(_context, "token");

            ResponseProfileDeviceBool wrapper = new ResponseProfileDeviceBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "profile-device/del/by-profile-id/by-token";

            bool completed = api.DelProfileDeviceByProfileIdByToken(

                _profile_id
                , _token
            );

            // get data
            wrapper.data = completed;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }