private CalendricUrlRangeModel(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     this.startDate = info.GetDateTime("startDate");
     this.endDate = info.GetDateTime("endDate");
     this.format = info.GetString("format");
 }
/// <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 WorldStatsQuestAcceptTable 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 WorldStatsUserConsumeItemTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("id");

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

i = dataRecord.GetOrdinal("item_template_id");

source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID)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("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);
}
Exemplo n.º 4
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 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 ServerTimeTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("server_time");

source.ServerTime = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
}
Exemplo n.º 6
0
 public override DTOBase PopulateDTO(System.Data.IDataReader reader)
 {
     var credential = base.PopulateId(reader, new Credential());
     if (!reader.IsDBNull(_ordinals.EmailAddress)) { credential.EmailAddress = reader.GetString(_ordinals.EmailAddress); }
     if (!reader.IsDBNull(_ordinals.Salt)) { credential.Salt = reader.GetString(_ordinals.Salt); }
     if (!reader.IsDBNull(_ordinals.PasswordHash)) { credential.PasswordHash = reader.GetString(_ordinals.PasswordHash); }
     if (!reader.IsDBNull(_ordinals.CreateDateTimeUtc)) { credential.CreateDateTimeUtc = reader.GetDateTime(_ordinals.CreateDateTimeUtc); }
     credential.IsNew = false;
     return credential;
 }
Exemplo n.º 7
0
        private ContainerInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        {
            this._id = info.GetInt32("id");
            this._title = info.GetString("title");
            this._touched = info.GetDateTime("touched");

            // setup events
            this.SetupEvents();
        }
Exemplo n.º 8
0
 private SiteInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     this._id = info.GetInt32("id");
     this._domain = info.GetString("domain");
     this._subDomain = info.GetString("subDomain");
     this._touched = info.GetDateTime("touched");
     this._section_id = info.GetInt32("section_id");
     this._originalTheme = info.GetString("originalTheme");
     this._originalStyle = info.GetString("originalStyle");
 }
/// <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 CharacterQuestStatusTable 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("completed_on");

source.CompletedOn = (System.Nullable<System.DateTime>)(System.Nullable<System.DateTime>)(dataRecord.IsDBNull(i) ? (System.Nullable<System.DateTime>)null : dataRecord.GetDateTime(i));

i = dataRecord.GetOrdinal("quest_id");

source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID)dataRecord.GetUInt16(i);

i = dataRecord.GetOrdinal("started_on");

source.StartedOn = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
}
Exemplo n.º 10
0
        private CommunityInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        {
            this._id = info.GetInt32("id");
            this._universalID = new Guid(info.GetString("universalID"));
            this._title = info.GetString("title");
            this._touched = info.GetDateTime("touched");

            // setup events
            this.SetupEvents();
        }
Exemplo n.º 11
0
 public DateTime PreencheAtributo(System.Data.IDataReader lDataReader, int NumeroColuna, System.DateTime Atributo)
 {
     if ((lDataReader.IsDBNull(NumeroColuna) == true))
     {
         return DateTime.MinValue;
     }
     else
     {
         return lDataReader.GetDateTime(NumeroColuna);
     }
 }
/// <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="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this ServerTimeTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "server_time":
source.ServerTime = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
break;


}

}
}
/// <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 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 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 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);
}
Exemplo n.º 18
0
 public static DateTime? GetDateTime(System.Data.SqlClient.SqlDataReader rd, string field)
 {
     var index = rd.GetOrdinal(field);
     if (index < 0)
     {
         return null;
     }
     else
     {
         if (rd.IsDBNull(index))
         {
             return null;
         }
         else
         {
             return rd.GetDateTime(index);
         }
     }
 }
/// <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);
}
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this AppliedPatchesTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "date_applied":
source.DateApplied = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
break;


case "file_name":
source.FileName = (System.String)(System.String)dataRecord.GetString(i);
break;


}

}
}
Exemplo n.º 21
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 GuildTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("created");

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

i = dataRecord.GetOrdinal("id");

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

i = dataRecord.GetOrdinal("name");

source.Name = (System.String)(System.String)dataRecord.GetString(i);

i = dataRecord.GetOrdinal("tag");

source.Tag = (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 WorldStatsCountUserKillNpcTable 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);
}
/// <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 WorldStatsGuildUserChangeTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("guild_id");

source.GuildID = (System.Nullable<NetGore.Features.Guilds.GuildID>)(System.Nullable<NetGore.Features.Guilds.GuildID>)(dataRecord.IsDBNull(i) ? (System.Nullable<System.UInt16>)null : dataRecord.GetUInt16(i));

i = dataRecord.GetOrdinal("id");

source.ID = (System.UInt32)(System.UInt32)dataRecord.GetUInt32(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);
}
/// <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 AccountIpsTable 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("id");

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

i = dataRecord.GetOrdinal("ip");

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

i = dataRecord.GetOrdinal("time");

source.Time = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
}
Exemplo n.º 25
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 GuildEventTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("arg0");

source.Arg0 = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));

i = dataRecord.GetOrdinal("arg1");

source.Arg1 = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));

i = dataRecord.GetOrdinal("arg2");

source.Arg2 = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));

i = dataRecord.GetOrdinal("character_id");

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

i = dataRecord.GetOrdinal("created");

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

i = dataRecord.GetOrdinal("event_id");

source.EventID = (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);

i = dataRecord.GetOrdinal("id");

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

i = dataRecord.GetOrdinal("target_character_id");

source.TargetCharacterID = (System.Nullable<DemoGame.CharacterID>)(System.Nullable<DemoGame.CharacterID>)(dataRecord.IsDBNull(i) ? (System.Nullable<System.Int32>)null : dataRecord.GetInt32(i));
}
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this GuildMemberTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "character_id":
source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID)dataRecord.GetInt32(i);
break;


case "guild_id":
source.GuildID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID)dataRecord.GetUInt16(i);
break;


case "joined":
source.Joined = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
break;


case "rank":
source.Rank = (NetGore.Features.Guilds.GuildRank)(NetGore.Features.Guilds.GuildRank)dataRecord.GetByte(i);
break;


}

}
}
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this WorldStatsCountItemBuyTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "count":
source.Count = (System.Int32)(System.Int32)dataRecord.GetInt32(i);
break;


case "item_template_id":
source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID)dataRecord.GetUInt16(i);
break;


case "last_update":
source.LastUpdate = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
break;


}

}
}
Exemplo n.º 28
0
        public void fill(System.Data.IDataReader dr)
        {
            this.Deposito = new Valor();
            this.Deposito.Importe = dr.GetDecimal(dr.GetOrdinal("MontoDeposito"));
            this.Deposito.Moneda = new GI.BR.Monedas.Moneda();
            this.Deposito.Moneda = Monedas.MonedasFlyweigthFactory.GetInstancia.GetMoneda(dr.GetInt32(dr.GetOrdinal("IdMonedaDeposito")));
            this.DiaCobro = dr.GetByte(dr.GetOrdinal("DiaVencimientoCuota"));

            if (dr.IsDBNull(dr.GetOrdinal("FechaCancelacion")))
                this.FechaCancelacion = null;
            else
                this.FechaCancelacion = dr.GetDateTime(dr.GetOrdinal("FechaCancelacion"));

            this.FechaInicio = dr.GetDateTime(dr.GetOrdinal("FechaInicio"));
            this.FechaVencimiento = dr.GetDateTime(dr.GetOrdinal("FechaVencimiento"));

            if (!dr.IsDBNull(dr.GetOrdinal("IdInquilino")))
            {
                this.Inquilino = new GI.BR.Clientes.Inquilino();
                this.Inquilino.IdCliente = dr.GetInt32(dr.GetOrdinal("IdInquilino"));
            }

            this.Observaciones = dr.GetString(dr.GetOrdinal("Observaciones"));
            this.IdContrato = dr.GetInt32(dr.GetOrdinal("IdContrato"));
            this.vigente = dr.GetBoolean(dr.GetOrdinal("Vigente"));
        }
Exemplo n.º 29
0
 public override Record build(System.Data.SqlClient.SqlDataReader reader)
 {
     return new PedidoTDA(Int16.Parse(reader.GetString(0)), reader.GetDateTime(1), reader.GetInt16(2),
         reader.GetString(3), reader.GetInt16(4), reader.GetString(5), reader.GetString(6));
 }
Exemplo n.º 30
0
        internal static Addressee getAddresseeFromReader(System.Data.IDataReader rdr, Dictionary<string, bool> columnTable)
        {
            Addressee addr = new Addressee();

            if (columnTable["ADDRESSEE_ID"])
            {
                int idIndex = rdr.GetOrdinal("ADDRESSEE_ID");
                if (!rdr.IsDBNull(idIndex))
                {
                    addr.Id = Convert.ToInt32(rdr.GetDecimal(idIndex));
                }
            }
            if (columnTable["ADDRESSEE_ROLE"])
            {
                int roleIndex = rdr.GetOrdinal("ADDRESSEE_ROLE");
                if (!rdr.IsDBNull(roleIndex))
                {
                    addr.Role = (AddresseeRoleEnum)Convert.ToInt32(rdr.GetDecimal(roleIndex));
                }
            }
            if (columnTable["SECURE_MESSAGE_ID"])
            {
                int smIdIndex = rdr.GetOrdinal("SECURE_MESSAGE_ID");
                if (!rdr.IsDBNull(smIdIndex))
                {
                    addr.Message = new Message() { Id = Convert.ToInt32(rdr.GetDecimal(smIdIndex)) };
                }
            }
            if (columnTable["USER_ID"])
            {
                int userIdIndex = rdr.GetOrdinal("USER_ID");
                if (!rdr.IsDBNull(userIdIndex))
                {
                    addr.Owner = new User() { Id = Convert.ToInt32(rdr.GetDecimal(userIdIndex)) };
                }
            }
            if (columnTable["ADDROPLOCK"])
            {
                int oplockIndex = rdr.GetOrdinal("ADDROPLOCK");
                if (!rdr.IsDBNull(oplockIndex))
                {
                    addr.Oplock = Convert.ToInt32(rdr.GetDecimal(oplockIndex));
                }
            }
            if (columnTable["FOLDER_ID"])
            {
                int folderIdIndex = rdr.GetOrdinal("FOLDER_ID");
                if (!rdr.IsDBNull(folderIdIndex))
                {
                    addr.FolderId = Convert.ToInt32(rdr.GetDecimal(folderIdIndex));
                }
                addr.Folder = Folder.getFolderFromReader(rdr);
            }
            if (columnTable["READ_DATE"])
            {
                int readDateIndex = rdr.GetOrdinal("READ_DATE");
                if (!rdr.IsDBNull(readDateIndex))
                {
                    addr.ReadDate = rdr.GetDateTime(readDateIndex);
                }
            }
            if (columnTable["REMINDER_DATE"])
            {
                int reminderDateIndex = rdr.GetOrdinal("REMINDER_DATE");
                if (!rdr.IsDBNull(reminderDateIndex))
                {
                    addr.ReminderDate = rdr.GetDateTime(reminderDateIndex);
                }
            }

            return addr;
        }