/// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IGuildTable source, DbParameterValues paramValues)
 {
     paramValues["created"] = source.Created;
     paramValues["id"] = (UInt16)source.ID;
     paramValues["name"] = source.Name;
     paramValues["tag"] = source.Tag;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateTable source, DbParameterValues paramValues)
 {
     paramValues["ai_id"]        = (ushort?)source.AIID;
     paramValues["alliance_id"]  = (Byte)source.AllianceID;
     paramValues["body_id"]      = (UInt16)source.BodyID;
     paramValues["chat_dialog"]  = (ushort?)source.ChatDialog;
     paramValues["exp"]          = source.Exp;
     paramValues["give_cash"]    = source.GiveCash;
     paramValues["give_exp"]     = source.GiveExp;
     paramValues["id"]           = (UInt16)source.ID;
     paramValues["level"]        = source.Level;
     paramValues["move_speed"]   = source.MoveSpeed;
     paramValues["name"]         = source.Name;
     paramValues["respawn"]      = source.Respawn;
     paramValues["shop_id"]      = (ushort?)source.ShopID;
     paramValues["statpoints"]   = source.StatPoints;
     paramValues["stat_agi"]     = (Int16)source.GetStat(StatType.Agi);
     paramValues["stat_defence"] = (Int16)source.GetStat(StatType.Defence);
     paramValues["stat_int"]     = (Int16)source.GetStat(StatType.Int);
     paramValues["stat_maxhit"]  = (Int16)source.GetStat(StatType.MaxHit);
     paramValues["stat_maxhp"]   = (Int16)source.GetStat(StatType.MaxHP);
     paramValues["stat_maxmp"]   = (Int16)source.GetStat(StatType.MaxMP);
     paramValues["stat_minhit"]  = (Int16)source.GetStat(StatType.MinHit);
     paramValues["stat_str"]     = (Int16)source.GetStat(StatType.Str);
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IGuildTable source, DbParameterValues paramValues)
 {
     paramValues["created"] = source.Created;
     paramValues["id"]      = (UInt16)source.ID;
     paramValues["name"]    = source.Name;
     paramValues["tag"]     = source.Tag;
 }
Exemple #4
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterQuestStatusTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["completed_on"] = source.CompletedOn;
     paramValues["quest_id"]     = (UInt16)source.QuestID;
     paramValues["started_on"]   = source.StartedOn;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterQuestStatusTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["completed_on"] = source.CompletedOn;
     paramValues["quest_id"] = (UInt16)source.QuestID;
     paramValues["started_on"] = source.StartedOn;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IItemTable source, DbParameterValues paramValues)
 {
     paramValues["action_display_id"] = (ushort?)source.ActionDisplayID;
     paramValues["amount"]            = source.Amount;
     paramValues["description"]       = source.Description;
     paramValues["equipped_body"]     = source.EquippedBody;
     paramValues["graphic"]           = (UInt16)source.Graphic;
     paramValues["height"]            = source.Height;
     paramValues["hp"] = (Int16)source.HP;
     paramValues["id"] = (Int32)source.ID;
     paramValues["item_template_id"] = (ushort?)source.ItemTemplateID;
     paramValues["mp"]           = (Int16)source.MP;
     paramValues["name"]         = source.Name;
     paramValues["range"]        = source.Range;
     paramValues["stat_agi"]     = (Int16)source.GetStat(StatType.Agi);
     paramValues["stat_defence"] = (Int16)source.GetStat(StatType.Defence);
     paramValues["stat_int"]     = (Int16)source.GetStat(StatType.Int);
     paramValues["stat_maxhit"]  = (Int16)source.GetStat(StatType.MaxHit);
     paramValues["stat_maxhp"]   = (Int16)source.GetStat(StatType.MaxHP);
     paramValues["stat_maxmp"]   = (Int16)source.GetStat(StatType.MaxMP);
     paramValues["stat_minhit"]  = (Int16)source.GetStat(StatType.MinHit);
     paramValues["stat_req_agi"] = (Int16)source.GetReqStat(StatType.Agi);
     paramValues["stat_req_int"] = (Int16)source.GetReqStat(StatType.Int);
     paramValues["stat_req_str"] = (Int16)source.GetReqStat(StatType.Str);
     paramValues["stat_str"]     = (Int16)source.GetStat(StatType.Str);
     paramValues["type"]         = (Byte)source.Type;
     paramValues["value"]        = source.Value;
     paramValues["weapon_type"]  = (Byte)source.WeaponType;
     paramValues["width"]        = source.Width;
 }
Exemple #7
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateEquippedTable source, DbParameterValues paramValues)
 {
     paramValues["chance"] = (UInt16)source.Chance;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
 }
 /// <summary>
 /// When overridden in the derived class, sets the database parameters values <paramref name="p"/>
 /// based on the values specified in the given <paramref name="item"/> parameter.
 /// </summary>
 /// <param name="p">Collection of database parameters to set the values for.</param>
 /// <param name="item">The value or object/struct containing the values used to execute the query.</param>
 protected override void SetParameters(DbParameterValues p, QueryArgs item)
 {
     p["accountID"] = (int)item.AccountID;
     p["secs"]      = item.Secs;
     p["reason"]    = item.Reason;
     p["issuedBy"]  = item.IssuedBy;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IViewUserCharacterTable source, DbParameterValues paramValues)
 {
     paramValues["ai_id"]   = (ushort?)source.AIID;
     paramValues["body_id"] = (UInt16)source.BodyID;
     paramValues["cash"]    = source.Cash;
     paramValues["character_template_id"] = (ushort?)source.CharacterTemplateID;
     paramValues["chat_dialog"]           = (ushort?)source.ChatDialog;
     paramValues["exp"]            = source.Exp;
     paramValues["hp"]             = (Int16)source.HP;
     paramValues["id"]             = source.ID;
     paramValues["level"]          = source.Level;
     paramValues["load_map_id"]    = (UInt16)source.LoadMapID;
     paramValues["load_x"]         = source.LoadX;
     paramValues["load_y"]         = source.LoadY;
     paramValues["move_speed"]     = source.MoveSpeed;
     paramValues["mp"]             = (Int16)source.MP;
     paramValues["name"]           = source.Name;
     paramValues["respawn_map_id"] = (ushort?)source.RespawnMapID;
     paramValues["respawn_x"]      = source.RespawnX;
     paramValues["respawn_y"]      = source.RespawnY;
     paramValues["shop_id"]        = (ushort?)source.ShopID;
     paramValues["statpoints"]     = source.StatPoints;
     paramValues["stat_agi"]       = source.StatAgi;
     paramValues["stat_defence"]   = source.StatDefence;
     paramValues["stat_int"]       = source.StatInt;
     paramValues["stat_maxhit"]    = source.StatMaxhit;
     paramValues["stat_maxhp"]     = source.StatMaxhp;
     paramValues["stat_maxmp"]     = source.StatMaxmp;
     paramValues["stat_minhit"]    = source.StatMinhit;
     paramValues["stat_str"]       = source.StatStr;
 }
Exemple #10
0
 /// <summary>
 /// When overridden in the derived class, sets the database parameters values <paramref name="p"/>
 /// based on the values specified in the given <paramref name="item"/> parameter.
 /// </summary>
 /// <param name="p">Collection of database parameters to set the values for.</param>
 /// <param name="item">The value or object/struct containing the values used to execute the query.</param>
 protected override void SetParameters(DbParameterValues p, QueryArgs item)
 {
     p["name"]       = item.Name;
     p["password"]   = item.Password;
     p["email"]      = item.Email;
     p["creator_ip"] = item.IP;
 }
Exemple #11
0
        /// <summary>
        /// Copies the column values into the given DbParameterValues using the database column name
        /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
        /// for the value to be copied over. If any of the keys in the DbParameterValues do not
        /// match one of the column names, or if there is no field for a key, then it will be
        /// ignored. Because of this, it is important to be careful when using this method
        /// since columns or keys can be skipped without any indication.
        /// </summary>
        /// <param name="source">The object to copy the values from.</param>
        /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void TryCopyValues(this ICharacterStatusEffectTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "character_id":
                    paramValues[i] = (Int32)source.CharacterID;
                    break;

                case "id":
                    paramValues[i] = (Int32)source.ID;
                    break;

                case "power":
                    paramValues[i] = source.Power;
                    break;

                case "status_effect_id":
                    paramValues[i] = (Byte)source.StatusEffect;
                    break;

                case "time_left_secs":
                    paramValues[i] = source.TimeLeftSecs;
                    break;
                }
            }
        }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterQuestStatusKillsTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"]          = (Int32)source.CharacterID;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["count"]    = source.Count;
     paramValues["quest_id"] = (UInt16)source.QuestID;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTable source, DbParameterValues paramValues)
 {
     paramValues["ai_id"] = (ushort?)source.AIID;
     paramValues["body_id"] = (UInt16)source.BodyID;
     paramValues["cash"] = source.Cash;
     paramValues["character_template_id"] = (ushort?)source.CharacterTemplateID;
     paramValues["chat_dialog"] = (ushort?)source.ChatDialog;
     paramValues["exp"] = source.Exp;
     paramValues["hp"] = (Int16)source.HP;
     paramValues["id"] = (Int32)source.ID;
     paramValues["level"] = source.Level;
     paramValues["load_map_id"] = (UInt16)source.LoadMapID;
     paramValues["load_x"] = source.LoadX;
     paramValues["load_y"] = source.LoadY;
     paramValues["move_speed"] = source.MoveSpeed;
     paramValues["mp"] = (Int16)source.MP;
     paramValues["name"] = source.Name;
     paramValues["respawn_map_id"] = (ushort?)source.RespawnMapID;
     paramValues["respawn_x"] = source.RespawnX;
     paramValues["respawn_y"] = source.RespawnY;
     paramValues["shop_id"] = (ushort?)source.ShopID;
     paramValues["statpoints"] = source.StatPoints;
     paramValues["stat_agi"] = (Int16)source.GetStat(StatType.Agi);
     paramValues["stat_defence"] = (Int16)source.GetStat(StatType.Defence);
     paramValues["stat_int"] = (Int16)source.GetStat(StatType.Int);
     paramValues["stat_maxhit"] = (Int16)source.GetStat(StatType.MaxHit);
     paramValues["stat_maxhp"] = (Int16)source.GetStat(StatType.MaxHP);
     paramValues["stat_maxmp"] = (Int16)source.GetStat(StatType.MaxMP);
     paramValues["stat_minhit"] = (Int16)source.GetStat(StatType.MinHit);
     paramValues["stat_str"] = (Int16)source.GetStat(StatType.Str);
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IAccountIpsTable source, DbParameterValues paramValues)
 {
     paramValues["account_id"] = (Int32)source.AccountID;
     paramValues["id"] = source.ID;
     paramValues["ip"] = source.Ip;
     paramValues["time"] = source.Time;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateTable source, DbParameterValues paramValues)
 {
     paramValues["ai_id"] = (ushort?)source.AIID;
     paramValues["alliance_id"] = (Byte)source.AllianceID;
     paramValues["body_id"] = (UInt16)source.BodyID;
     paramValues["chat_dialog"] = (ushort?)source.ChatDialog;
     paramValues["exp"] = source.Exp;
     paramValues["give_cash"] = source.GiveCash;
     paramValues["give_exp"] = source.GiveExp;
     paramValues["id"] = (UInt16)source.ID;
     paramValues["level"] = source.Level;
     paramValues["move_speed"] = source.MoveSpeed;
     paramValues["name"] = source.Name;
     paramValues["respawn"] = source.Respawn;
     paramValues["shop_id"] = (ushort?)source.ShopID;
     paramValues["statpoints"] = source.StatPoints;
     paramValues["stat_agi"] = (Int16)source.GetStat(StatType.Agi);
     paramValues["stat_defence"] = (Int16)source.GetStat(StatType.Defence);
     paramValues["stat_int"] = (Int16)source.GetStat(StatType.Int);
     paramValues["stat_maxhit"] = (Int16)source.GetStat(StatType.MaxHit);
     paramValues["stat_maxhp"] = (Int16)source.GetStat(StatType.MaxHP);
     paramValues["stat_maxmp"] = (Int16)source.GetStat(StatType.MaxMP);
     paramValues["stat_minhit"] = (Int16)source.GetStat(StatType.MinHit);
     paramValues["stat_str"] = (Int16)source.GetStat(StatType.Str);
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsGuildUserChangeTable source, DbParameterValues paramValues)
 {
     paramValues["guild_id"] = (ushort?)source.GuildID;
     paramValues["id"] = source.ID;
     paramValues["user_id"] = (Int32)source.UserID;
     paramValues["when"] = source.When;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IItemTemplateTable source, DbParameterValues paramValues)
 {
     paramValues["action_display_id"] = (ushort?)source.ActionDisplayID;
     paramValues["description"] = source.Description;
     paramValues["equipped_body"] = source.EquippedBody;
     paramValues["graphic"] = (UInt16)source.Graphic;
     paramValues["height"] = source.Height;
     paramValues["hp"] = (Int16)source.HP;
     paramValues["id"] = (UInt16)source.ID;
     paramValues["mp"] = (Int16)source.MP;
     paramValues["name"] = source.Name;
     paramValues["range"] = source.Range;
     paramValues["stat_agi"] = (Int16)source.GetStat(StatType.Agi);
     paramValues["stat_defence"] = (Int16)source.GetStat(StatType.Defence);
     paramValues["stat_int"] = (Int16)source.GetStat(StatType.Int);
     paramValues["stat_maxhit"] = (Int16)source.GetStat(StatType.MaxHit);
     paramValues["stat_maxhp"] = (Int16)source.GetStat(StatType.MaxHP);
     paramValues["stat_maxmp"] = (Int16)source.GetStat(StatType.MaxMP);
     paramValues["stat_minhit"] = (Int16)source.GetStat(StatType.MinHit);
     paramValues["stat_req_agi"] = (Int16)source.GetReqStat(StatType.Agi);
     paramValues["stat_req_int"] = (Int16)source.GetReqStat(StatType.Int);
     paramValues["stat_req_str"] = (Int16)source.GetReqStat(StatType.Str);
     paramValues["stat_str"] = (Int16)source.GetStat(StatType.Str);
     paramValues["type"] = (Byte)source.Type;
     paramValues["value"] = source.Value;
     paramValues["weapon_type"] = (Byte)source.WeaponType;
     paramValues["width"] = source.Width;
 }
Exemple #18
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IGuildMemberTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["guild_id"]     = (UInt16)source.GuildID;
     paramValues["joined"]       = source.Joined;
     paramValues["rank"]         = (Byte)source.Rank;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsCountUserKillNpcTable source, DbParameterValues paramValues)
 {
     paramValues["count"] = source.Count;
     paramValues["last_update"] = source.LastUpdate;
     paramValues["npc_template_id"] = (UInt16)source.NPCTemplateID;
     paramValues["user_id"] = (Int32)source.UserID;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IQuestTable source, DbParameterValues paramValues)
 {
     paramValues["id"]          = (UInt16)source.ID;
     paramValues["repeatable"]  = source.Repeatable;
     paramValues["reward_cash"] = source.RewardCash;
     paramValues["reward_exp"]  = source.RewardExp;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterQuestStatusKillsTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["count"] = source.Count;
     paramValues["quest_id"] = (UInt16)source.QuestID;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IGuildMemberTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["guild_id"] = (UInt16)source.GuildID;
     paramValues["joined"] = source.Joined;
     paramValues["rank"] = (Byte)source.Rank;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateEquippedTable source, DbParameterValues paramValues)
 {
     paramValues["chance"] = (UInt16)source.Chance;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IQuestTable source, DbParameterValues paramValues)
 {
     paramValues["id"] = (UInt16)source.ID;
     paramValues["repeatable"] = source.Repeatable;
     paramValues["reward_cash"] = source.RewardCash;
     paramValues["reward_exp"] = source.RewardExp;
 }
Exemple #25
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IAccountIpsTable source, DbParameterValues paramValues)
 {
     paramValues["account_id"] = (Int32)source.AccountID;
     paramValues["id"]         = source.ID;
     paramValues["ip"]         = source.Ip;
     paramValues["time"]       = source.Time;
 }
Exemple #26
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsCountNpcKillUserTable source, DbParameterValues paramValues)
 {
     paramValues["count"]           = source.Count;
     paramValues["last_update"]     = source.LastUpdate;
     paramValues["npc_template_id"] = (UInt16)source.NPCTemplateID;
     paramValues["user_id"]         = (Int32)source.UserID;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsGuildUserChangeTable source, DbParameterValues paramValues)
 {
     paramValues["guild_id"] = (ushort?)source.GuildID;
     paramValues["id"]       = source.ID;
     paramValues["user_id"]  = (Int32)source.UserID;
     paramValues["when"]     = source.When;
 }
        /// <summary>
        /// When overridden in the derived class, sets the database parameters values <paramref name="p"/>
        /// based on the values specified in the given <paramref name="item"/> parameter.
        /// </summary>
        /// <param name="p">Collection of database parameters to set the values for.</param>
        /// <param name="item">The value or object/struct containing the values used to execute the query.</param>
        protected override void SetParameters(DbParameterValues p, IWorldStatsUserConsumeItemTable item)
        {
            item.CopyValues(p);

            // Set the `when` field to null to ensure that the time is assigned by MySQL
            p["when"] = null;
        }
Exemple #29
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterStatusEffectTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"]     = (Int32)source.CharacterID;
     paramValues["id"]               = (Int32)source.ID;
     paramValues["power"]            = source.Power;
     paramValues["status_effect_id"] = (Byte)source.StatusEffect;
     paramValues["time_left_secs"]   = source.TimeLeftSecs;
 }
        /// <summary>
        /// When overridden in the derived class, sets the database parameters based on the specified characterID.
        /// </summary>
        /// <param name="p">Collection of database parameters to set the values for.</param>
        /// <param name="item">Item used to execute the query.</param>
        protected override void SetParameters(DbParameterValues p, QueryArgs item)
        {
            p["character_id"] = (int)item.CharacterID;
            p["slot"]         = (int)item.Slot;

            Debug.Assert(Convert.ToInt32(p["slot"]) == (int)item.Slot);
            Debug.Assert(Convert.ToInt32(p["character_id"]) == (int)item.CharacterID);
        }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterStatusEffectTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["id"] = (Int32)source.ID;
     paramValues["power"] = source.Power;
     paramValues["status_effect_id"] = (Byte)source.StatusEffect;
     paramValues["time_left_secs"] = source.TimeLeftSecs;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateInventoryTable source, DbParameterValues paramValues)
 {
     paramValues["chance"] = (UInt16)source.Chance;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["max"] = source.Max;
     paramValues["min"] = source.Min;
 }
Exemple #33
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateInventoryTable source, DbParameterValues paramValues)
 {
     paramValues["chance"] = (UInt16)source.Chance;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["max"] = source.Max;
     paramValues["min"] = source.Min;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsUserConsumeItemTable source, DbParameterValues paramValues)
 {
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["map_id"] = (ushort?)source.MapID;
     paramValues["user_id"] = (Int32)source.UserID;
     paramValues["when"] = source.When;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
Exemple #35
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IAccountBanTable source, DbParameterValues paramValues)
 {
     paramValues["account_id"] = (Int32)source.AccountID;
     paramValues["end_time"]   = source.EndTime;
     paramValues["expired"]    = source.Expired;
     paramValues["id"]         = source.ID;
     paramValues["issued_by"]  = source.IssuedBy;
     paramValues["reason"]     = source.Reason;
     paramValues["start_time"] = source.StartTime;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsUserLevelTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["id"]           = source.ID;
     paramValues["level"]        = source.Level;
     paramValues["map_id"]       = (ushort?)source.MapID;
     paramValues["when"]         = source.When;
     paramValues["x"]            = source.X;
     paramValues["y"]            = source.Y;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IAccountBanTable source, DbParameterValues paramValues)
 {
     paramValues["account_id"] = (Int32)source.AccountID;
     paramValues["end_time"] = source.EndTime;
     paramValues["expired"] = source.Expired;
     paramValues["id"] = source.ID;
     paramValues["issued_by"] = source.IssuedBy;
     paramValues["reason"] = source.Reason;
     paramValues["start_time"] = source.StartTime;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsQuestCancelTable source, DbParameterValues paramValues)
 {
     paramValues["id"] = source.ID;
     paramValues["map_id"] = (ushort?)source.MapID;
     paramValues["quest_id"] = (UInt16)source.QuestID;
     paramValues["user_id"] = (Int32)source.UserID;
     paramValues["when"] = source.When;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
 /// <summary>
 /// When overridden in the derived class, sets the database parameters values <paramref name="p"/>
 /// based on the values specified in the given <paramref name="item"/> parameter.
 /// </summary>
 /// <param name="p">Collection of database parameters to set the values for.</param>
 /// <param name="item">The value or object/struct containing the values used to execute the query.</param>
 protected override void SetParameters(DbParameterValues p, QueryArgs item)
 {
     p["guild_id"]            = (int)item.GuildID;
     p["character_id"]        = (int)item.CharacterID;
     p["target_character_id"] = (int?)item.TargetID;
     p["event_id"]            = item.EventID;
     p["arg0"] = item.Arg0;
     p["arg1"] = item.Arg1;
     p["arg2"] = item.Arg2;
 }
Exemple #40
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsUserConsumeItemTable source, DbParameterValues paramValues)
 {
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["map_id"]           = (ushort?)source.MapID;
     paramValues["user_id"]          = (Int32)source.UserID;
     paramValues["when"]             = source.When;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsQuestCancelTable source, DbParameterValues paramValues)
 {
     paramValues["id"]       = source.ID;
     paramValues["map_id"]   = (ushort?)source.MapID;
     paramValues["quest_id"] = (UInt16)source.QuestID;
     paramValues["user_id"]  = (Int32)source.UserID;
     paramValues["when"]     = source.When;
     paramValues["x"]        = source.X;
     paramValues["y"]        = source.Y;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsUserLevelTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["id"] = source.ID;
     paramValues["level"] = source.Level;
     paramValues["map_id"] = (ushort?)source.MapID;
     paramValues["when"] = source.When;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IMapSpawnTable source, DbParameterValues paramValues)
 {
     paramValues["amount"] = source.Amount;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["height"] = source.Height;
     paramValues["id"] = (Int32)source.ID;
     paramValues["map_id"] = (UInt16)source.MapID;
     paramValues["width"] = source.Width;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IMapSpawnTable source, DbParameterValues paramValues)
 {
     paramValues["amount"] = source.Amount;
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["height"] = source.Height;
     paramValues["id"]     = (Int32)source.ID;
     paramValues["map_id"] = (UInt16)source.MapID;
     paramValues["width"]  = source.Width;
     paramValues["x"]      = source.X;
     paramValues["y"]      = source.Y;
 }
Exemple #45
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IGuildEventTable source, DbParameterValues paramValues)
 {
     paramValues["arg0"]                = source.Arg0;
     paramValues["arg1"]                = source.Arg1;
     paramValues["arg2"]                = source.Arg2;
     paramValues["character_id"]        = (Int32)source.CharacterID;
     paramValues["created"]             = source.Created;
     paramValues["event_id"]            = source.EventID;
     paramValues["guild_id"]            = (UInt16)source.GuildID;
     paramValues["id"]                  = source.ID;
     paramValues["target_character_id"] = (int?)source.TargetCharacterID;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IGuildEventTable source, DbParameterValues paramValues)
 {
     paramValues["arg0"] = source.Arg0;
     paramValues["arg1"] = source.Arg1;
     paramValues["arg2"] = source.Arg2;
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["created"] = source.Created;
     paramValues["event_id"] = source.EventID;
     paramValues["guild_id"] = (UInt16)source.GuildID;
     paramValues["id"] = source.ID;
     paramValues["target_character_id"] = (int?)source.TargetCharacterID;
 }
Exemple #47
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IAccountTable source, DbParameterValues paramValues)
 {
     paramValues["creator_ip"]      = source.CreatorIp;
     paramValues["current_ip"]      = source.CurrentIp;
     paramValues["email"]           = source.Email;
     paramValues["id"]              = (Int32)source.ID;
     paramValues["name"]            = source.Name;
     paramValues["password"]        = source.Password;
     paramValues["permissions"]     = (Byte)source.Permissions;
     paramValues["time_created"]    = source.TimeCreated;
     paramValues["time_last_login"] = source.TimeLastLogin;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsNetworkTable source, DbParameterValues paramValues)
 {
     paramValues["connections"] = source.Connections;
     paramValues["id"] = source.ID;
     paramValues["recv_bytes"] = source.RecvBytes;
     paramValues["recv_messages"] = source.RecvMessages;
     paramValues["recv_packets"] = source.RecvPackets;
     paramValues["sent_bytes"] = source.SentBytes;
     paramValues["sent_messages"] = source.SentMessages;
     paramValues["sent_packets"] = source.SentPackets;
     paramValues["when"] = source.When;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IAccountTable source, DbParameterValues paramValues)
 {
     paramValues["creator_ip"] = source.CreatorIp;
     paramValues["current_ip"] = source.CurrentIp;
     paramValues["email"] = source.Email;
     paramValues["id"] = (Int32)source.ID;
     paramValues["name"] = source.Name;
     paramValues["password"] = source.Password;
     paramValues["permissions"] = (Byte)source.Permissions;
     paramValues["time_created"] = source.TimeCreated;
     paramValues["time_last_login"] = source.TimeLastLogin;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
 /// for the value to be copied over. If any of the keys in the DbParameterValues do not
 /// match one of the column names, or if there is no field for a key, then it will be
 /// ignored. Because of this, it is important to be careful when using this method
 /// since columns or keys can be skipped without any indication.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void TryCopyValues(this IServerTimeTable source, DbParameterValues paramValues)
 {
     for (var i = 0; i < paramValues.Count; i++)
     {
         switch (paramValues.GetParameterName(i))
         {
             case "server_time":
                 paramValues[i] = source.ServerTime;
                 break;
         }
     }
 }
Exemple #51
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsNetworkTable source, DbParameterValues paramValues)
 {
     paramValues["connections"]   = source.Connections;
     paramValues["id"]            = source.ID;
     paramValues["recv_bytes"]    = source.RecvBytes;
     paramValues["recv_messages"] = source.RecvMessages;
     paramValues["recv_packets"]  = source.RecvPackets;
     paramValues["sent_bytes"]    = source.SentBytes;
     paramValues["sent_messages"] = source.SentMessages;
     paramValues["sent_packets"]  = source.SentPackets;
     paramValues["when"]          = source.When;
 }
Exemple #52
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
 /// for the value to be copied over. If any of the keys in the DbParameterValues do not
 /// match one of the column names, or if there is no field for a key, then it will be
 /// ignored. Because of this, it is important to be careful when using this method
 /// since columns or keys can be skipped without any indication.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void TryCopyValues(this IServerTimeTable source, DbParameterValues paramValues)
 {
     for (var i = 0; i < paramValues.Count; i++)
     {
         switch (paramValues.GetParameterName(i))
         {
         case "server_time":
             paramValues[i] = source.ServerTime;
             break;
         }
     }
 }
        /// <summary>
        /// Copies the column values into the given DbParameterValues using the database column name
        /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
        /// for the value to be copied over. If any of the keys in the DbParameterValues do not
        /// match one of the column names, or if there is no field for a key, then it will be
        /// ignored. Because of this, it is important to be careful when using this method
        /// since columns or keys can be skipped without any indication.
        /// </summary>
        /// <param name="source">The object to copy the values from.</param>
        /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void TryCopyValues(this IWorldStatsUserShoppingTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "amount":
                    paramValues[i] = source.Amount;
                    break;

                case "character_id":
                    paramValues[i] = (Int32)source.CharacterID;
                    break;

                case "cost":
                    paramValues[i] = source.Cost;
                    break;

                case "id":
                    paramValues[i] = source.ID;
                    break;

                case "item_template_id":
                    paramValues[i] = (ushort?)source.ItemTemplateID;
                    break;

                case "map_id":
                    paramValues[i] = (ushort?)source.MapID;
                    break;

                case "sale_type":
                    paramValues[i] = source.SaleType;
                    break;

                case "shop_id":
                    paramValues[i] = (UInt16)source.ShopID;
                    break;

                case "when":
                    paramValues[i] = source.When;
                    break;

                case "x":
                    paramValues[i] = source.X;
                    break;

                case "y":
                    paramValues[i] = source.Y;
                    break;
                }
            }
        }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsUserKillNpcTable source, DbParameterValues paramValues)
 {
     paramValues["id"] = source.ID;
     paramValues["map_id"] = (ushort?)source.MapID;
     paramValues["npc_template_id"] = (ushort?)source.NPCTemplateID;
     paramValues["npc_x"] = source.NpcX;
     paramValues["npc_y"] = source.NpcY;
     paramValues["user_id"] = (Int32)source.UserID;
     paramValues["user_level"] = source.UserLevel;
     paramValues["user_x"] = source.UserX;
     paramValues["user_y"] = source.UserY;
     paramValues["when"] = source.When;
 }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsUserShoppingTable source, DbParameterValues paramValues)
 {
     paramValues["amount"] = source.Amount;
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["cost"] = source.Cost;
     paramValues["id"] = source.ID;
     paramValues["item_template_id"] = (ushort?)source.ItemTemplateID;
     paramValues["map_id"] = (ushort?)source.MapID;
     paramValues["sale_type"] = source.SaleType;
     paramValues["shop_id"] = (UInt16)source.ShopID;
     paramValues["when"] = source.When;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
        /// <summary>
        /// Copies the column values into the given DbParameterValues using the database column name
        /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
        /// for the value to be copied over. If any of the keys in the DbParameterValues do not
        /// match one of the column names, or if there is no field for a key, then it will be
        /// ignored. Because of this, it is important to be careful when using this method
        /// since columns or keys can be skipped without any indication.
        /// </summary>
        /// <param name="source">The object to copy the values from.</param>
        /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void TryCopyValues(this ICharacterTemplateSkillTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                    case "character_template_id":
                        paramValues[i] = (UInt16)source.CharacterTemplateID;
                        break;

                    case "skill_id":
                        paramValues[i] = (Byte)source.SkillID;
                        break;
                }
            }
        }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this ICharacterTemplateSkillTable source, DbParameterValues paramValues)
 {
     paramValues["character_template_id"] = (UInt16)source.CharacterTemplateID;
     paramValues["skill_id"] = (Byte)source.SkillID;
 }
        /// <summary>
        /// Copies the column values into the given DbParameterValues using the database column name
        /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
        /// for the value to be copied over. If any of the keys in the DbParameterValues do not
        /// match one of the column names, or if there is no field for a key, then it will be
        /// ignored. Because of this, it is important to be careful when using this method
        /// since columns or keys can be skipped without any indication.
        /// </summary>
        /// <param name="source">The object to copy the values from.</param>
        /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void TryCopyValues(this IEventCountersQuestTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                    case "counter":
                        paramValues[i] = source.Counter;
                        break;

                    case "quest_event_counter_id":
                        paramValues[i] = source.QuestEventCounterId;
                        break;

                    case "quest_id":
                        paramValues[i] = (UInt16)source.QuestID;
                        break;
                }
            }
        }
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IEventCountersQuestTable source, DbParameterValues paramValues)
 {
     paramValues["counter"] = source.Counter;
     paramValues["quest_event_counter_id"] = source.QuestEventCounterId;
     paramValues["quest_id"] = (UInt16)source.QuestID;
 }
        /// <summary>
        /// Copies the column values into the given DbParameterValues using the database column name
        /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
        /// for the value to be copied over. If any of the keys in the DbParameterValues do not
        /// match one of the column names, or if there is no field for a key, then it will be
        /// ignored. Because of this, it is important to be careful when using this method
        /// since columns or keys can be skipped without any indication.
        /// </summary>
        /// <param name="source">The object to copy the values from.</param>
        /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void TryCopyValues(this ICharacterEquippedTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                    case "character_id":
                        paramValues[i] = (Int32)source.CharacterID;
                        break;

                    case "item_id":
                        paramValues[i] = (Int32)source.ItemID;
                        break;

                    case "slot":
                        paramValues[i] = (Byte)source.Slot;
                        break;
                }
            }
        }