예제 #1
0
 public virtual bool SetMessageByUuid(Message obj)
 {
     return act.SetMessageByUuid(DEFAULT_SET_TYPE, obj);
 }
예제 #2
0
 public virtual bool SetMessageByUuid(SetType set_type, Message obj)
 {
     return act.SetMessageByUuid(ConvertSetTypeToString(set_type), obj);
 }
예제 #3
0
 //------------------------------------------------------------------------------
 public virtual bool SetMessageByUuid(string set_type, Message obj)
 {
     return act.SetMessageByUuid(set_type, obj);
 }
예제 #4
0
        //------------------------------------------------------------------------------
        public virtual bool SetMessageByUuid(string set_type, Message obj)
        {
            List<SqlParameter> parameters
                = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@set_type", set_type));
            parameters.Add(new SqlParameter("@status", obj.status));
            parameters.Add(new SqlParameter("@profile_from_name", obj.profile_from_name));
            parameters.Add(new SqlParameter("@read", obj.read));
            parameters.Add(new SqlParameter("@profile_from_id", obj.profile_from_id));
            parameters.Add(new SqlParameter("@profile_to_token", obj.profile_to_token));
            parameters.Add(new SqlParameter("@app_id", obj.app_id));
            parameters.Add(new SqlParameter("@active", obj.active));
            parameters.Add(new SqlParameter("@data", obj.data));
            parameters.Add(new SqlParameter("@subject", obj.subject));
            parameters.Add(new SqlParameter("@uuid", obj.uuid));
            parameters.Add(new SqlParameter("@date_modified", obj.date_modified));
            parameters.Add(new SqlParameter("@profile_to_id", obj.profile_to_id));
            parameters.Add(new SqlParameter("@date_created", obj.date_created));
            parameters.Add(new SqlParameter("@profile_to_name", obj.profile_to_name));
            parameters.Add(new SqlParameter("@type", obj.type));
            parameters.Add(new SqlParameter("@sent", obj.sent));

            try {
                return (bool)data.ExecuteScalar(
                BasePlatformData.connectionString
                , CommandType.StoredProcedure
                , "usp_message_set_by_uuid"
                , parameters
                );
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
예제 #5
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);
        }
예제 #6
0
        public virtual Message FillMessage(DataRow dr)
        {
            Message obj = new Message();

            if (dr["status"] != null)
                    obj.status = dataType.FillDataString(dr, "status");
            if (dr["profile_from_name"] != null)
                    obj.profile_from_name = dataType.FillDataString(dr, "profile_from_name");
            if (dr["read"] != null)
                    obj.read = dataType.FillDataBool(dr, "read");
            if (dr["profile_from_id"] != null)
                    obj.profile_from_id = dataType.FillDataString(dr, "profile_from_id");
            if (dr["profile_to_token"] != null)
                    obj.profile_to_token = dataType.FillDataString(dr, "profile_to_token");
            if (dr["app_id"] != null)
                    obj.app_id = dataType.FillDataString(dr, "app_id");
            if (dr["active"] != null)
                    obj.active = dataType.FillDataBool(dr, "active");
            if (dr["data"] != null)
                    obj.data = dataType.FillDataString(dr, "data");
            if (dr["subject"] != null)
                    obj.subject = dataType.FillDataString(dr, "subject");
            if (dr["uuid"] != null)
                    obj.uuid = dataType.FillDataString(dr, "uuid");
            if (dr["date_modified"] != null)
                    obj.date_modified = dataType.FillDataDateTime(dr, "date_modified");
            if (dr["profile_to_id"] != null)
                    obj.profile_to_id = dataType.FillDataString(dr, "profile_to_id");
            if (dr["date_created"] != null)
                    obj.date_created = dataType.FillDataDateTime(dr, "date_created");
            if (dr["profile_to_name"] != null)
                    obj.profile_to_name = dataType.FillDataString(dr, "profile_to_name");
            if (dr["type"] != null)
                    obj.type = dataType.FillDataString(dr, "type");
            if (dr["sent"] != null)
                    obj.sent = dataType.FillDataBool(dr, "sent");

            return obj;
        }