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

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

            bool completed = api.DelMessageByUuid(

                _uuid
            );

            // get data
            wrapper.data = completed;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }
Example #2
0
        //------------------------------------------------------------------------------
        public virtual void SetMessageByUuid()
        {
            ResponseMessageBool wrapper = new ResponseMessageBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "message/set/by-uuid";

            Message obj = new Message();

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

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

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

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

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

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

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

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

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

            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_to_id = util.GetParamValue(_context, "profile_to_id");
            if(!String.IsNullOrEmpty(_profile_to_id))
                obj.profile_to_id = (string)_profile_to_id;

            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 _profile_to_name = util.GetParamValue(_context, "profile_to_name");
            if(!String.IsNullOrEmpty(_profile_to_name))
                obj.profile_to_name = (string)_profile_to_name;

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

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

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

            util.SerializeTypeJSONToResponse(_context, wrapper);
        }