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

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

            return(data);
        }
Beispiel #2
0
 public virtual bool SetGameContentByUuid(GameContent obj)
 {
     return act.SetGameContentByUuid(DEFAULT_SET_TYPE, obj);
 }
Beispiel #3
0
 public virtual bool SetGameContentByUuid(SetType set_type, GameContent obj)
 {
     return act.SetGameContentByUuid(ConvertSetTypeToString(set_type), obj);
 }
Beispiel #4
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameContentByUuid(string set_type, GameContent obj)
 {
     return act.SetGameContentByUuid(set_type, obj);
 }
Beispiel #5
0
 public virtual bool SetGameContentByGameIdByPathByVersionByPlatformByIncrement(GameContent obj)
 {
     return act.SetGameContentByGameIdByPathByVersionByPlatformByIncrement(DEFAULT_SET_TYPE, obj);
 }
Beispiel #6
0
 public virtual bool SetGameContentByGameIdByPathByVersionByPlatformByIncrement(SetType set_type, GameContent obj)
 {
     return act.SetGameContentByGameIdByPathByVersionByPlatformByIncrement(ConvertSetTypeToString(set_type), obj);
 }
Beispiel #7
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameContentByGameIdByPathByVersionByPlatformByIncrement(string set_type, GameContent obj)
 {
     return act.SetGameContentByGameIdByPathByVersionByPlatformByIncrement(set_type, obj);
 }
Beispiel #8
0
 public virtual bool SetGameContentByGameIdByPathByVersion(GameContent obj)
 {
     return act.SetGameContentByGameIdByPathByVersion(DEFAULT_SET_TYPE, obj);
 }
Beispiel #9
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameContentByGameIdByPathByVersion(string set_type, GameContent obj)
 {
     return act.SetGameContentByGameIdByPathByVersion(set_type, obj);
 }
Beispiel #10
0
        //------------------------------------------------------------------------------
        public virtual bool SetGameContentByUuid(string set_type, GameContent 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("@extension", obj.extension));
            parameters.Add(new SqlParameter("@date_modified", obj.date_modified));
            parameters.Add(new SqlParameter("@data", obj.data));
            parameters.Add(new SqlParameter("@game_id", obj.game_id));
            parameters.Add(new SqlParameter("@uuid", obj.uuid));
            parameters.Add(new SqlParameter("@filename", obj.filename));
            parameters.Add(new SqlParameter("@source", obj.source));
            parameters.Add(new SqlParameter("@version", obj.version));
            parameters.Add(new SqlParameter("@platform", obj.platform));
            parameters.Add(new SqlParameter("@content_type", obj.content_type));
            parameters.Add(new SqlParameter("@path", obj.path));
            parameters.Add(new SqlParameter("@active", obj.active));
            parameters.Add(new SqlParameter("@date_created", obj.date_created));
            parameters.Add(new SqlParameter("@increment", obj.increment));
            parameters.Add(new SqlParameter("@type", obj.type));
            parameters.Add(new SqlParameter("@hash", obj.hash));
            parameters.Add(new SqlParameter("@description", obj.description));

            try {
                return (bool)data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_content_set_by_uuid"
                , parameters
                );
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
Beispiel #11
0
        //------------------------------------------------------------------------------
        public virtual bool SetGameContentByUuid(string set_type, GameContent 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_code", obj.code));
            parameters.Add(new NpgsqlParameter("in_display_name", obj.display_name));
            parameters.Add(new NpgsqlParameter("in_name", obj.name));
            parameters.Add(new NpgsqlParameter("in_extension", obj.extension));
            parameters.Add(new NpgsqlParameter("in_date_modified", obj.date_modified));
            parameters.Add(new NpgsqlParameter("in_data", obj.data));
            parameters.Add(new NpgsqlParameter("in_game_id", obj.game_id));
            parameters.Add(new NpgsqlParameter("in_uuid", obj.uuid));
            parameters.Add(new NpgsqlParameter("in_filename", obj.filename));
            parameters.Add(new NpgsqlParameter("in_source", obj.source));
            parameters.Add(new NpgsqlParameter("in_version", obj.version));
            parameters.Add(new NpgsqlParameter("in_platform", obj.platform));
            parameters.Add(new NpgsqlParameter("in_content_type", obj.content_type));
            parameters.Add(new NpgsqlParameter("in_path", obj.path));
            parameters.Add(new NpgsqlParameter("in_active", obj.active));
            parameters.Add(new NpgsqlParameter("in_date_created", obj.date_created));
            parameters.Add(new NpgsqlParameter("in_increment", obj.increment));
            parameters.Add(new NpgsqlParameter("in_type", obj.type));
            parameters.Add(new NpgsqlParameter("in_hash", obj.hash));
            parameters.Add(new NpgsqlParameter("in_description", obj.description));

            try {
                return Convert.ToBoolean(data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_content_set_uuid"
                , parameters
                ));
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
Beispiel #12
0
        public virtual GameContent FillGameContent(DataRow dr)
        {
            GameContent obj = new GameContent();

            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["extension"] != null)
                    obj.extension = dataType.FillDataString(dr, "extension");
            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["game_id"] != null)
                    obj.game_id = dataType.FillDataString(dr, "game_id");
            if (dr["uuid"] != null)
                    obj.uuid = dataType.FillDataString(dr, "uuid");
            if (dr["filename"] != null)
                    obj.filename = dataType.FillDataString(dr, "filename");
            if (dr["source"] != null)
                    obj.source = dataType.FillDataString(dr, "source");
            if (dr["version"] != null)
                    obj.version = dataType.FillDataString(dr, "version");
            if (dr["platform"] != null)
                    obj.platform = dataType.FillDataString(dr, "platform");
            if (dr["content_type"] != null)
                    obj.content_type = dataType.FillDataString(dr, "content_type");
            if (dr["path"] != null)
                    obj.path = dataType.FillDataString(dr, "path");
            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["increment"] != null)
                    obj.increment = dataType.FillDataInt(dr, "increment");
            if (dr["type"] != null)
                    obj.type = dataType.FillDataString(dr, "type");
            if (dr["hash"] != null)
                    obj.hash = dataType.FillDataString(dr, "hash");
            if (dr["description"] != null)
                    obj.description = dataType.FillDataString(dr, "description");

            return obj;
        }
Beispiel #13
0
 public virtual bool SetGameContentByGameIdByPath(string set_type, GameContent obj)
 {
     return data.SetGameContentByGameIdByPath(set_type, obj);
 }
Beispiel #14
0
        //------------------------------------------------------------------------------
        public virtual void SetGameContentByUuid()
        {
            ResponseGameContentBool wrapper = new ResponseGameContentBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "game-content/set/by-uuid";

            GameContent obj = new GameContent();

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

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

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

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

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

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

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

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

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

            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 _increment = util.GetParamValue(_context, "increment");
            if(!String.IsNullOrEmpty(_increment))
                obj.increment = Convert.ToInt32(_increment);

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

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

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

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

            util.SerializeTypeJSONToResponse(_context, wrapper);
        }