/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this AppliedPatchesTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("date_applied"); source.DateApplied = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); i = dataRecord.GetOrdinal("file_name"); source.FileName = (System.String)(System.String) dataRecord.GetString(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this ActiveTradeItemTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("character_id"); source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("item_id"); source.ItemID = (DemoGame.ItemID)(DemoGame.ItemID) dataRecord.GetInt32(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this CharacterTemplateQuestProviderTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("character_template_id"); source.CharacterTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("quest_id"); source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this MapTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("id"); source.ID = (NetGore.World.MapID)(NetGore.World.MapID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("name"); source.Name = (System.String)(System.String) dataRecord.GetString(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this QuestRequireFinishQuestTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("quest_id"); source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("req_quest_id"); source.ReqQuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this CharacterTemplateSkillTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("character_template_id"); source.CharacterTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("skill_id"); source.SkillID = (DemoGame.SkillType)(DemoGame.SkillType) dataRecord.GetByte(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this ShopItemTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("item_template_id"); source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("shop_id"); source.ShopID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this AllianceHostileTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("alliance_id"); source.AllianceID = (DemoGame.AllianceID)(DemoGame.AllianceID) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("hostile_id"); source.HostileID = (DemoGame.AllianceID)(DemoGame.AllianceID) dataRecord.GetByte(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this AllianceTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("id"); source.ID = (DemoGame.AllianceID)(DemoGame.AllianceID) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("name"); source.Name = (System.String)(System.String) dataRecord.GetString(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this EventCountersMapTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("counter"); source.Counter = (System.Int64)(System.Int64) dataRecord.GetInt64(i); i = dataRecord.GetOrdinal("map_event_counter_id"); source.MapEventCounterId = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("map_id"); source.MapID = (NetGore.World.MapID)(NetGore.World.MapID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this AccountCharacterTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("account_id"); source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("character_id"); source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("time_deleted"); source.TimeDeleted = (System.Nullable <System.DateTime>)(System.Nullable <System.DateTime>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.DateTime>)null : dataRecord.GetDateTime(i)); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this QuestRequireKillTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("amount"); source.Amount = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("character_template_id"); source.CharacterTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("quest_id"); source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this QuestRequireFinishItemTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("amount"); source.Amount = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("item_template_id"); source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("quest_id"); source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this WorldStatsCountConsumeItemTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("count"); source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("item_template_id"); source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("last_update"); source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this EventCountersUserTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("counter"); source.Counter = (System.Int64)(System.Int64) dataRecord.GetInt64(i); i = dataRecord.GetOrdinal("user_event_counter_id"); source.UserEventCounterId = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("user_id"); source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this EventCountersItemTemplateTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("counter"); source.Counter = (System.Int64)(System.Int64) dataRecord.GetInt64(i); i = dataRecord.GetOrdinal("item_template_event_counter_id"); source.ItemTemplateEventCounterId = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("item_template_id"); source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this EventCountersNpcTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("counter"); source.Counter = (System.Int64)(System.Int64) dataRecord.GetInt64(i); i = dataRecord.GetOrdinal("npc_event_counter_id"); source.NPCEventCounterID = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("npc_template_id"); source.NPCTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this WorldStatsCountShopBuyTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("count"); source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("last_update"); source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); i = dataRecord.GetOrdinal("shop_id"); source.ShopID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this ShopTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("can_buy"); source.CanBuy = (System.Boolean)(System.Boolean) dataRecord.GetBoolean(i); i = dataRecord.GetOrdinal("id"); source.ID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("name"); source.Name = (System.String)(System.String) dataRecord.GetString(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this EventCountersGuildTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("counter"); source.Counter = (System.Int64)(System.Int64) dataRecord.GetInt64(i); i = dataRecord.GetOrdinal("guild_event_counter_id"); source.GuildEventCounterId = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("guild_id"); source.GuildID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this CharacterSkillTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("character_id"); source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("skill_id"); source.SkillID = (DemoGame.SkillType)(DemoGame.SkillType) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("time_added"); source.TimeAdded = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this CharacterInventoryTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("character_id"); source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("item_id"); source.ItemID = (DemoGame.ItemID)(DemoGame.ItemID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("slot"); source.Slot = (NetGore.InventorySlot)(NetGore.InventorySlot) dataRecord.GetByte(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this ServerTimeTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("server_time"); source.ServerTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this WorldStatsQuestCompleteTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("id"); source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i); i = dataRecord.GetOrdinal("map_id"); source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); i = dataRecord.GetOrdinal("quest_id"); source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("user_id"); source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("when"); source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); i = dataRecord.GetOrdinal("x"); source.X = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("y"); source.Y = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this AccountBanTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("account_id"); source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("end_time"); source.EndTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); i = dataRecord.GetOrdinal("expired"); source.Expired = (System.Boolean)(System.Boolean) dataRecord.GetBoolean(i); i = dataRecord.GetOrdinal("id"); source.ID = (System.Int32)(System.Int32) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("issued_by"); source.IssuedBy = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i)); i = dataRecord.GetOrdinal("reason"); source.Reason = (System.String)(System.String) dataRecord.GetString(i); i = dataRecord.GetOrdinal("start_time"); source.StartTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this WorldStatsNpcKillUserTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("id"); source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i); i = dataRecord.GetOrdinal("map_id"); source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); i = dataRecord.GetOrdinal("npc_template_id"); source.NPCTemplateID = (System.Nullable <DemoGame.CharacterTemplateID>)(System.Nullable <DemoGame.CharacterTemplateID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); i = dataRecord.GetOrdinal("npc_x"); source.NpcX = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("npc_y"); source.NpcY = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("user_id"); source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("user_level"); source.UserLevel = (System.Int16)(System.Int16) dataRecord.GetInt16(i); i = dataRecord.GetOrdinal("user_x"); source.UserX = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("user_y"); source.UserY = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("when"); source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this MapSpawnTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("amount"); source.Amount = (System.Byte)(System.Byte) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("character_template_id"); source.CharacterTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("direction_id"); source.DirectionId = (NetGore.Direction)(NetGore.Direction) dataRecord.GetInt16(i); i = dataRecord.GetOrdinal("height"); source.Height = (System.Nullable <System.UInt16>)(System.Nullable <System.UInt16>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); i = dataRecord.GetOrdinal("id"); source.ID = (DemoGame.MapSpawnValuesID)(DemoGame.MapSpawnValuesID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("map_id"); source.MapID = (NetGore.World.MapID)(NetGore.World.MapID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("respawn"); source.Respawn = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("width"); source.Width = (System.Nullable <System.UInt16>)(System.Nullable <System.UInt16>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); i = dataRecord.GetOrdinal("x"); source.X = (System.Nullable <System.UInt16>)(System.Nullable <System.UInt16>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); i = dataRecord.GetOrdinal("y"); source.Y = (System.Nullable <System.UInt16>)(System.Nullable <System.UInt16>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i)); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this AccountTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("creator_ip"); source.CreatorIp = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i); i = dataRecord.GetOrdinal("current_ip"); source.CurrentIp = (System.Nullable <System.UInt32>)(System.Nullable <System.UInt32>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt32>)null : dataRecord.GetUInt32(i)); i = dataRecord.GetOrdinal("email"); source.Email = (System.String)(System.String) dataRecord.GetString(i); i = dataRecord.GetOrdinal("friends"); source.Friends = (System.String)(System.String) dataRecord.GetString(i); i = dataRecord.GetOrdinal("id"); source.ID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("name"); source.Name = (System.String)(System.String) dataRecord.GetString(i); i = dataRecord.GetOrdinal("password"); source.Password = (System.String)(System.String) dataRecord.GetString(i); i = dataRecord.GetOrdinal("permissions"); source.Permissions = (DemoGame.UserPermissions)(DemoGame.UserPermissions) dataRecord.GetByte(i); i = dataRecord.GetOrdinal("time_created"); source.TimeCreated = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); i = dataRecord.GetOrdinal("time_last_login"); source.TimeLastLogin = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); }
/// <summary> /// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this /// object's properties. The database column's name is used to as the key, so the value /// will not be found if any aliases are used or not all columns were selected. /// </summary> /// <param name="source">The object to add the extension method to.</param> /// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param> public static void ReadValues(this WorldStatsCountNpcKillUserTable source, System.Data.IDataRecord dataRecord) { System.Int32 i; i = dataRecord.GetOrdinal("count"); source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i); i = dataRecord.GetOrdinal("last_update"); source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i); i = dataRecord.GetOrdinal("npc_template_id"); source.NPCTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i); i = dataRecord.GetOrdinal("user_id"); source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i); }
//this method is to check wheater column exists or not in data reader public static bool IsColumnExists(this System.Data.IDataRecord dr, string colName) { try { return(dr.GetOrdinal(colName) >= 0); } catch (Exception) { return(false); } }