Пример #1
0
        public List <GameProfileStatistic> GetList(List <Dictionary <string, object> > dictList)
        {
            data.Clear();

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

            return(data);
        }
Пример #2
0
 public virtual bool SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(DEFAULT_SET_TYPE, obj);
 }
Пример #3
0
 public virtual bool SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(SetType set_type, GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(ConvertSetTypeToString(set_type), obj);
 }
Пример #4
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(string set_type, GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(set_type, obj);
 }
Пример #5
0
 public virtual bool SetGameProfileStatisticByUuid(GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByUuid(DEFAULT_SET_TYPE, obj);
 }
Пример #6
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameProfileStatisticByUuid(string set_type, GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByUuid(set_type, obj);
 }
Пример #7
0
 public virtual bool SetGameProfileStatisticByProfileIdByCode(GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByProfileIdByCode(DEFAULT_SET_TYPE, obj);
 }
Пример #8
0
 public virtual bool SetGameProfileStatisticByProfileIdByCode(SetType set_type, GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByProfileIdByCode(ConvertSetTypeToString(set_type), obj);
 }
Пример #9
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameProfileStatisticByCodeByProfileIdByGameId(string set_type, GameProfileStatistic obj)
 {
     return act.SetGameProfileStatisticByCodeByProfileIdByGameId(set_type, obj);
 }
Пример #10
0
        //------------------------------------------------------------------------------
        public virtual bool SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp(string set_type, GameProfileStatistic 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("@username", obj.username));
            parameters.Add(new SqlParameter("@code", obj.code));
            parameters.Add(new SqlParameter("@stat_value_formatted", obj.stat_value_formatted));
            parameters.Add(new SqlParameter("@profile_id", obj.profile_id));
            parameters.Add(new SqlParameter("@active", obj.active));
            parameters.Add(new SqlParameter("@game_id", obj.game_id));
            parameters.Add(new SqlParameter("@data", obj.data));
            parameters.Add(new SqlParameter("@stat_value", obj.stat_value));
            parameters.Add(new SqlParameter("@uuid", obj.uuid));
            parameters.Add(new SqlParameter("@date_modified", obj.date_modified));
            parameters.Add(new SqlParameter("@level", obj.level));
            parameters.Add(new SqlParameter("@points", obj.points));
            parameters.Add(new SqlParameter("@timestamp", obj.timestamp));
            parameters.Add(new SqlParameter("@date_created", obj.date_created));
            parameters.Add(new SqlParameter("@type", obj.type));

            try {
                return (bool)data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_profile_statistic_set_by_uuid_by_profile_id_by_game_id_by_timestamp"
                , parameters
                );
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
Пример #11
0
        //------------------------------------------------------------------------------
        public virtual bool SetGameProfileStatisticByUuid(string set_type, GameProfileStatistic obj)
        {
            List<NpgsqlParameter> parameters
                = new List<NpgsqlParameter>();
            parameters.Add(new NpgsqlParameter("in_set_type", set_type));
            parameters.Add(new NpgsqlParameter("in_status", obj.status));
            parameters.Add(new NpgsqlParameter("in_username", obj.username));
            parameters.Add(new NpgsqlParameter("in_code", obj.code));
            parameters.Add(new NpgsqlParameter("in_stat_value_formatted", obj.stat_value_formatted));
            parameters.Add(new NpgsqlParameter("in_profile_id", obj.profile_id));
            parameters.Add(new NpgsqlParameter("in_active", obj.active));
            parameters.Add(new NpgsqlParameter("in_game_id", obj.game_id));
            parameters.Add(new NpgsqlParameter("in_data", obj.data));
            parameters.Add(new NpgsqlParameter("in_stat_value", obj.stat_value));
            parameters.Add(new NpgsqlParameter("in_uuid", obj.uuid));
            parameters.Add(new NpgsqlParameter("in_date_modified", obj.date_modified));
            parameters.Add(new NpgsqlParameter("in_level", obj.level));
            parameters.Add(new NpgsqlParameter("in_points", obj.points));
            parameters.Add(new NpgsqlParameter("in_timestamp", obj.timestamp));
            parameters.Add(new NpgsqlParameter("in_date_created", obj.date_created));
            parameters.Add(new NpgsqlParameter("in_type", obj.type));

            try {
                return Convert.ToBoolean(data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_profile_statistic_set_uuid"
                , parameters
                ));
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
Пример #12
0
        public virtual GameProfileStatistic FillGameProfileStatistic(DataRow dr)
        {
            GameProfileStatistic obj = new GameProfileStatistic();

            if (dr["status"] != null)
                    obj.status = dataType.FillDataString(dr, "status");
            if (dr["username"] != null)
                    obj.username = dataType.FillDataString(dr, "username");
            if (dr["code"] != null)
                    obj.code = dataType.FillDataString(dr, "code");
            if (dr["stat_value_formatted"] != null)
                    obj.stat_value_formatted = dataType.FillDataString(dr, "stat_value_formatted");
            if (dr["profile_id"] != null)
                    obj.profile_id = dataType.FillDataString(dr, "profile_id");
            if (dr["active"] != null)
                    obj.active = dataType.FillDataBool(dr, "active");
            if (dr["game_id"] != null)
                    obj.game_id = dataType.FillDataString(dr, "game_id");
            if (dr["data"] != null)
                    obj.data = dataType.FillDataString(dr, "data");
            if (dr["stat_value"] != null)
                    obj.stat_value = dataType.FillDataFloat(dr, "stat_value");
            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["level"] != null)
                    obj.level = dataType.FillDataString(dr, "level");
            if (dr["points"] != null)
                    obj.points = dataType.FillDataFloat(dr, "points");
            if (dr["timestamp"] != null)
                    obj.timestamp = dataType.FillDataFloat(dr, "timestamp");
            if (dr["date_created"] != null)
                    obj.date_created = dataType.FillDataDateTime(dr, "date_created");
            if (dr["type"] != null)
                    obj.type = dataType.FillDataString(dr, "type");

            return obj;
        }
Пример #13
0
 public virtual bool SetGameProfileStatisticByProfileIdByCodeByTimestamp(string set_type, GameProfileStatistic obj)
 {
     return data.SetGameProfileStatisticByProfileIdByCodeByTimestamp(set_type, obj);
 }
Пример #14
0
        //------------------------------------------------------------------------------
        public virtual void SetGameProfileStatisticByUuidByProfileIdByGameIdByTimestamp()
        {
            ResponseGameProfileStatisticBool wrapper = new ResponseGameProfileStatisticBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "game-profile-statistic/set/by-uuid/by-profile-id/by-game-id/by-timestamp";

            GameProfileStatistic obj = new GameProfileStatistic();

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

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

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

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

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

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

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

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

            string _stat_value = util.GetParamValue(_context, "stat_value");
            if(!String.IsNullOrEmpty(_stat_value))
                obj.stat_value = float.Parse(_stat_value);

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

            string _points = util.GetParamValue(_context, "points");
            if(!String.IsNullOrEmpty(_points))
                obj.points = float.Parse(_points);

            string _timestamp = util.GetParamValue(_context, "timestamp");
            if(!String.IsNullOrEmpty(_timestamp))
                obj.timestamp = float.Parse(_timestamp);

            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;

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

            util.SerializeTypeJSONToResponse(_context, wrapper);
        }