Example #1
0
 /// <summary>
 /// Permet de stocker l'ordinal à partir du nom du champ/colonne du reader.
 /// </summary>
 /// <param name="reader">reader contenant les données.</param>
 public override void populateOrdinals(System.Data.SqlClient.SqlDataReader reader)
 {
     ordReponseGuid = reader.GetOrdinal("ID");
     ordReponseIntitule = reader.GetOrdinal("Intitule");
     ordReponseJuste = reader.GetOrdinal("Juste");
     ordReponseQuestionGuid = reader.GetOrdinal("IDQuestion");
 }
        internal static MessageAttachment getAttachmentFromReader(System.Data.IDataReader rdr, Dictionary<string, bool> columnTable)
        {
            MessageAttachment attachment = new MessageAttachment();

            if (columnTable["ATTACHMENT_ID"])
            {
                int idIndex = rdr.GetOrdinal("ATTACHMENT_ID");
                if (!rdr.IsDBNull(idIndex))
                {
                    attachment.Id = Convert.ToInt32(rdr.GetDecimal(idIndex));
                }
            }
            if (columnTable["ATTACHMENT_NAME"])
            {
                int nameIndex = rdr.GetOrdinal("ATTACHMENT_NAME");
                if (!rdr.IsDBNull(nameIndex))
                {
                    attachment.AttachmentName = rdr.GetString(nameIndex);
                }
            }
            if (columnTable["ATTACHMENT"])
            {
                int attIndex = rdr.GetOrdinal("ATTACHMENT");
                if (!rdr.IsDBNull(attIndex))
                {
                    // not crazy about this implementation as it appears to invoke the reader twice but the commented out code
                    // block directly below throws an exception when calling GetOracleBlob for some reason... The good thing about
                    // this solution is it should work for all IDataReader implementations and doesn't need to be cast to an OracleDataReader
                    byte[] blob = new byte[rdr.GetBytes(attIndex, 0, null, 0, Int32.MaxValue)];
                    rdr.GetBytes(attIndex, 0, blob, 0, blob.Length);
                    attachment.SmFile = blob;
                    //if (rdr is Oracle.DataAccess.Client.OracleDataReader)
                    //{
                    //    System.Console.WriteLine(rdr[attIndex].GetType().ToString());
                    //    Oracle.DataAccess.Types.OracleBlob blob = ((Oracle.DataAccess.Client.OracleDataReader)rdr).GetOracleBlob(attIndex);
                    //    byte[] buf = new byte[blob.Length];
                    //    blob.Read(buf, 0, Convert.ToInt32(blob.Length));
                    //    attachment.SmFile = buf;
                    //}
                }
            }
            if (columnTable["MIME_TYPE"])
            {
                int mimeTypeIndex = rdr.GetOrdinal("MIME_TYPE");
                if (!rdr.IsDBNull(mimeTypeIndex))
                {
                    attachment.MimeType = rdr.GetString(mimeTypeIndex);
                }
            }
            if (columnTable["ATTOPLOCK"])
            {
                int oplockIndex = rdr.GetOrdinal("ATTOPLOCK");
                if (!rdr.IsDBNull(oplockIndex))
                {
                    attachment.Oplock = Convert.ToInt32(rdr.GetDecimal(oplockIndex));
                }
            }

            return attachment;
        }
Example #3
0
 /// <summary>
 /// Permet de stocker l'ordinal à partir du nom du champ/colonne du reader.
 /// </summary>
 /// <param name="reader">reader contenant les données.</param>
 public override void populateOrdinals(System.Data.SqlClient.SqlDataReader reader)
 {
     ordMetierGuid = reader.GetOrdinal("ID");
     ordMetierNom = reader.GetOrdinal("Nom");
     ordMetierFiche = reader.GetOrdinal("Fiche");
     ordMetierScoreReseau = reader.GetOrdinal("ScoreReseau");
     ordMetierScoreLogiciel = reader.GetOrdinal("ScoreLogiciel");
 }
Example #4
0
 /// <summary>
 /// Permet de stocker l'ordinal à partir du nom du champ/colonne du reader.
 /// </summary>
 /// <param name="reader">reader contenant les données.</param>
 public override void populateOrdinals(System.Data.SqlClient.SqlDataReader reader)
 {
     // GetOrdinal permet d'obtenir la valeur de chaque ordinal par nom de champ/colonne.
     // On stocke cette valeur dans nos propriétés.
     ordQuestionGuid = reader.GetOrdinal("ID");
     ordQuestionIntitule = reader.GetOrdinal("Intitule");
     ordQuestionReponseGuid = reader.GetOrdinal("IDReponse");
     ordQuestionDifficulteGuid = reader.GetOrdinal("IDDifficulte");
     ordQuestionTypeGuid = reader.GetOrdinal("IDType");
 }
/// <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 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 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 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 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 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 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 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 QuestRequireStartQuestTable 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>
        /// Prepares the DataObjectDiscription instance to read data from <paramref name="reader"/>
        /// use before calling ReadData
        /// </summary>
        /// <param name="reader"></param>
        public void CheckOrdinals(System.Data.IDataReader reader)
        {
            foreach (FieldAttribute field in EntityDescription.Fields)
            {
                field.Ordinal = reader.GetOrdinal(field.NameOrAlias);
            }

            PrimaryKeyFieldAttribute keyField = EntityDescription.Fields.PrimaryKeyField;
            if (keyField != null)
            {
                keyField.Ordinal = reader.GetOrdinal(keyField.NameOrAlias);
            }
        }
/// <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 WorldStatsUserShoppingTable 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_id");

source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID)dataRecord.GetInt32(i);

i = dataRecord.GetOrdinal("cost");

source.Cost = (System.Int32)(System.Int32)dataRecord.GetInt32(i);

i = dataRecord.GetOrdinal("id");

source.ID = (System.UInt32)(System.UInt32)dataRecord.GetUInt32(i);

i = dataRecord.GetOrdinal("item_template_id");

source.ItemTemplateID = (System.Nullable<DemoGame.ItemTemplateID>)(System.Nullable<DemoGame.ItemTemplateID>)(dataRecord.IsDBNull(i) ? (System.Nullable<System.UInt16>)null : dataRecord.GetUInt16(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("sale_type");

source.SaleType = (System.SByte)(System.SByte)dataRecord.GetSByte(i);

i = dataRecord.GetOrdinal("shop_id");

source.ShopID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID)dataRecord.GetUInt16(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);
}
Example #16
0
        public override object NullSafeGet(System.Data.IDataReader rs, string name)
        {
            int index = rs.GetOrdinal(name);

            if( rs.IsDBNull(index) )
            {
                if ( log.IsDebugEnabled )
                {
                    log.Debug("returning null as column: " + name);
                }

                return NullValue; //this value is determined by the subclass.
            }
            else
            {
                object val = null;
                try
                {
                    val = Get(rs, index);
                }
                catch(System.InvalidCastException ice)
                {
                    throw new ADOException(
                        "Could not cast the value in field " + name + " to the Type " + this.GetType().Name +
                        ".  Please check to make sure that the mapping is correct and that your DataProvider supports this Data Type.", ice);
                }

                if ( log.IsDebugEnabled )
                {
                    log.Debug("returning '" + ToString(val) + "' as column: " + name);
                }

                return val;
            }
        }
/// <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 QuestRequireStartItemTable 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 WorldStatsCountItemBuyTable 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 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 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 EventCountersShopTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("counter");

source.Counter = (System.Int64)(System.Int64)dataRecord.GetInt64(i);

i = dataRecord.GetOrdinal("shop_event_counter_id");

source.ShopEventCounterId = (System.Byte)(System.Byte)dataRecord.GetByte(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 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);
}
Example #23
0
/// <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 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 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 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 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 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 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 GuildMemberTable 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("guild_id");

source.GuildID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID)dataRecord.GetUInt16(i);

i = dataRecord.GetOrdinal("joined");

source.Joined = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);

i = dataRecord.GetOrdinal("rank");

source.Rank = (NetGore.Features.Guilds.GuildRank)(NetGore.Features.Guilds.GuildRank)dataRecord.GetByte(i);
}