示例#1
0
        public List <RewardCondition> GetList(List <Dictionary <string, object> > dictList)
        {
            data.Clear();

            foreach (Dictionary <string, object> dict in dictList)
            {
                foreach (KeyValuePair <string, object> obj in dict)
                {
                    RewardCondition objectValue = (RewardCondition)obj.Value;
                    objectValue.FillFromDictionary(dict);
                    data.Add(objectValue);
                }
            }

            return(data);
        }
示例#2
0
 public virtual bool SetRewardConditionByUuid(RewardCondition obj)
 {
     return act.SetRewardConditionByUuid(DEFAULT_SET_TYPE, obj);
 }
示例#3
0
 public virtual bool SetRewardConditionByUuid(SetType set_type, RewardCondition obj)
 {
     return act.SetRewardConditionByUuid(ConvertSetTypeToString(set_type), obj);
 }
示例#4
0
 //------------------------------------------------------------------------------
 public virtual bool SetRewardConditionByUuid(string set_type, RewardCondition obj)
 {
     return act.SetRewardConditionByUuid(set_type, obj);
 }
示例#5
0
        //------------------------------------------------------------------------------
        public virtual bool SetRewardConditionByUuid(string set_type, RewardCondition 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("@code", obj.code));
            parameters.Add(new SqlParameter("@display_name", obj.display_name));
            parameters.Add(new SqlParameter("@name", obj.name));
            parameters.Add(new SqlParameter("@end_date", obj.end_date));
            parameters.Add(new SqlParameter("@date_modified", obj.date_modified));
            parameters.Add(new SqlParameter("@data", obj.data));
            parameters.Add(new SqlParameter("@org_id", obj.org_id));
            parameters.Add(new SqlParameter("@uuid", obj.uuid));
            parameters.Add(new SqlParameter("@channel_id", obj.channel_id));
            parameters.Add(new SqlParameter("@amount", obj.amount));
            parameters.Add(new SqlParameter("@global_reward", obj.global_reward));
            parameters.Add(new SqlParameter("@condition", obj.condition));
            parameters.Add(new SqlParameter("@active", obj.active));
            parameters.Add(new SqlParameter("@date_created", obj.date_created));
            parameters.Add(new SqlParameter("@type", obj.type));
            parameters.Add(new SqlParameter("@start_date", obj.start_date));
            parameters.Add(new SqlParameter("@reward_id", obj.reward_id));
            parameters.Add(new SqlParameter("@description", obj.description));

            try {
                return (bool)data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_reward_condition_set_by_uuid"
                , parameters
                );
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
示例#6
0
        public virtual RewardCondition FillRewardCondition(DataRow dr)
        {
            RewardCondition obj = new RewardCondition();

            if (dr["status"] != null)
                    obj.status = dataType.FillDataString(dr, "status");
            if (dr["code"] != null)
                    obj.code = dataType.FillDataString(dr, "code");
            if (dr["display_name"] != null)
                    obj.display_name = dataType.FillDataString(dr, "display_name");
            if (dr["name"] != null)
                    obj.name = dataType.FillDataString(dr, "name");
            if (dr["end_date"] != null)
                    obj.end_date = dataType.FillDataDateTime(dr, "end_date");
            if (dr["date_modified"] != null)
                    obj.date_modified = dataType.FillDataDateTime(dr, "date_modified");
            if (dr["data"] != null)
                    obj.data = dataType.FillDataString(dr, "data");
            if (dr["org_id"] != null)
                    obj.org_id = dataType.FillDataString(dr, "org_id");
            if (dr["uuid"] != null)
                    obj.uuid = dataType.FillDataString(dr, "uuid");
            if (dr["channel_id"] != null)
                    obj.channel_id = dataType.FillDataString(dr, "channel_id");
            if (dr["amount"] != null)
                    obj.amount = dataType.FillDataInt(dr, "amount");
            if (dr["global_reward"] != null)
                    obj.global_reward = dataType.FillDataBool(dr, "global_reward");
            if (dr["condition"] != null)
                    obj.condition = dataType.FillDataString(dr, "condition");
            if (dr["active"] != null)
                    obj.active = dataType.FillDataBool(dr, "active");
            if (dr["date_created"] != null)
                    obj.date_created = dataType.FillDataDateTime(dr, "date_created");
            if (dr["type"] != null)
                    obj.type = dataType.FillDataString(dr, "type");
            if (dr["start_date"] != null)
                    obj.start_date = dataType.FillDataDateTime(dr, "start_date");
            if (dr["reward_id"] != null)
                    obj.reward_id = dataType.FillDataString(dr, "reward_id");
            if (dr["description"] != null)
                    obj.description = dataType.FillDataString(dr, "description");

            return obj;
        }
示例#7
0
        //------------------------------------------------------------------------------
        public virtual void SetRewardConditionByUuid()
        {
            ResponseRewardConditionBool wrapper = new ResponseRewardConditionBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "reward-condition/set/by-uuid";

            RewardCondition obj = new RewardCondition();

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

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

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

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

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

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

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

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

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

            string _amount = util.GetParamValue(_context, "amount");
            if(!String.IsNullOrEmpty(_amount))
                obj.amount = Convert.ToInt32(_amount);

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

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

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

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

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

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

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

            util.SerializeTypeJSONToResponse(_context, wrapper);
        }