private static hierarchy2b ORM_CreateProxy(System.Data.IDataReader result, System.Collections.Generic.IDictionary<string, int> ordinals)
 {
     return new hierarchy2b()
     {
         pid = result.IsDBNull(ordinals["pid"]) ? 0 : result.GetInt64(ordinals["pid"]),
         fid = result.IsDBNull(ordinals["fid"]) ? 0 : result.GetInt64(ordinals["fid"]),
         textfield = result.IsDBNull(ordinals["textfield"]) ? null : result.GetString(ordinals["textfield"])
     };
 }
 public RemoteVolume(System.Data.IDataReader rd)
 {
     this.ID = rd.GetInt64(0);
     this.Name = rd.GetString(1);
     this.Size = rd.ConvertValueToInt64(2);
     this.Hash = rd.ConvertValueToString(3);
     this.VerificationCount = rd.ConvertValueToInt64(4);
 }
Exemple #3
0
 public long PreencheAtributo(System.Data.IDataReader lDataReader, int NumeroColuna, long Atributo)
 {
     if ((lDataReader.IsDBNull(NumeroColuna) == true))
     {
         return Int64.MinValue;
     }
     else
     {
         return lDataReader.GetInt64(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 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);
}
/// <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>
		/// Serialize the datasource.
		/// </summary>
		protected void Serialize(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			m_TargetID = info.GetUInt64("ID");
			this.Action = info.GetInt64("Action");
			try
			{
				if (m_TargetID != 0)
				{
					this.UseUIValue = info.GetBoolean("UseUIValue");
				}
				else
				{
					this.UseUIValue = true;
				}
			}
			catch
			{
				this.UseUIValue = true;
			}
		}
/// <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 EventCountersShopTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "counter":
source.Counter = (System.Int64)(System.Int64)dataRecord.GetInt64(i);
break;


case "shop_event_counter_id":
source.ShopEventCounterId = (System.Byte)(System.Byte)dataRecord.GetByte(i);
break;


case "shop_id":
source.ShopID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID)dataRecord.GetUInt16(i);
break;


}

}
}
 public BlockWithSources(System.Data.IDataReader rd)
     : base(rd.GetString(0), rd.GetInt64(1))
 {
     m_rd = rd;
     Done = !m_rd.Read();
 }
 private Model.hierarchy3a GetInstance(System.Data.IDataReader result, System.Collections.Generic.IDictionary<string, int> ordinals)
 {
     var obj = new Model.hierarchy3a()
     {
         pid = result.IsDBNull(ordinals["pid"]) ? new Guid() : result.GetGuid(ordinals["pid"]),
         fid = result.IsDBNull(ordinals["fid"]) ? 0 : result.GetInt64(ordinals["fid"]),
         uid = result.IsDBNull(ordinals["uid"]) ? new Guid() : result.GetGuid(ordinals["uid"]),
         numfield1 = result.IsDBNull(ordinals["numfield1"]) ? 0 : result.GetInt32(ordinals["numfield1"]),
         numfield2 = result.IsDBNull(ordinals["numfield2"]) ? 0 : result.GetInt32(ordinals["numfield2"]),
         numfield3 = result.IsDBNull(ordinals["numfield3"]) ? 0 : result.GetInt32(ordinals["numfield3"]),
         textfield1 = result.IsDBNull(ordinals["textfield1"]) ? null : result.GetString(ordinals["textfield1"]),
         textfield2 = result.IsDBNull(ordinals["textfield2"]) ? null : result.GetString(ordinals["textfield2"]),
         textfield3 = result.IsDBNull(ordinals["textfield3"]) ? null : result.GetString(ordinals["textfield3"])
     };
     return obj;
 }
/// <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 EventCountersItemTemplateTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "counter":
source.Counter = (System.Int64)(System.Int64)dataRecord.GetInt64(i);
break;


case "item_template_event_counter_id":
source.ItemTemplateEventCounterId = (System.Byte)(System.Byte)dataRecord.GetByte(i);
break;


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


}

}
}
 private static hierarchy3a ORM_CreateProxy(System.Data.IDataReader result, System.Collections.Generic.IDictionary<string, int> ordinals)
 {
     return new hierarchy3a()
     {
         pid = result.IsDBNull(ordinals["pid"]) ? new Guid() : result.GetGuid(ordinals["pid"]),
         fid = result.IsDBNull(ordinals["fid"]) ? 0 : result.GetInt64(ordinals["fid"]),
         uid = result.IsDBNull(ordinals["uid"]) ? new Guid() : result.GetGuid(ordinals["uid"]),
         numfield1 = result.IsDBNull(ordinals["numfield1"]) ? 0 : result.GetInt32(ordinals["numfield1"]),
         numfield2 = result.IsDBNull(ordinals["numfield2"]) ? 0 : result.GetInt32(ordinals["numfield2"]),
         numfield3 = result.IsDBNull(ordinals["numfield3"]) ? 0 : result.GetInt32(ordinals["numfield3"]),
         textfield1 = result.IsDBNull(ordinals["textfield1"]) ? null : result.GetString(ordinals["textfield1"]),
         textfield2 = result.IsDBNull(ordinals["textfield2"]) ? null : result.GetString(ordinals["textfield2"]),
         textfield3 = result.IsDBNull(ordinals["textfield3"]) ? null : result.GetString(ordinals["textfield3"])
     };
     //var obj = new hierarchy3a();
     //obj.pid = result.IsDBNull(ordinals["pid"]) ? new Guid() : result.GetGuid(ordinals["pid"]),
     //obj.fid = result.IsDBNull(ordinals["fid"]) ? 0 : result.GetInt64(ordinals["fid"]),
     //obj.uid = result.IsDBNull(ordinals["uid"]) ? new Guid() : result.GetGuid(ordinals["uid"]),
     //obj.numfield1 = result.IsDBNull(ordinals["numfield1"]) ? 0 : result.GetInt32(ordinals["numfield1"]),
     //obj.numfield2 = result.IsDBNull(ordinals["numfield2"]) ? 0 : result.GetInt32(ordinals["numfield2"]),
     //obj.numfield3 = result.IsDBNull(ordinals["numfield3"]) ? 0 : result.GetInt32(ordinals["numfield3"]),
     //obj.textfield1 = result.IsDBNull(ordinals["textfield1"]) ? null : result.GetString(ordinals["textfield1"]),
     //obj.textfield2 = result.IsDBNull(ordinals["textfield2"]) ? null : result.GetString(ordinals["textfield2"]),
     //obj.textfield3 = result.IsDBNull(ordinals["textfield3"]) ? null : result.GetString(ordinals["textfield3"])
     //return obj;
 }
 /// <summary>
 /// Constructs a new instance of the HttpWebRequestResponseData class with serialized data.
 /// </summary>
 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data.</param>
 /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
 /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
 protected HttpWebRequestResponseData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     if (info != null)
     {
         this._headerNames = (string[])info.GetValue("_headerNames", typeof(string[]));
         this._headerNamesSet = (HashSet<string>)info.GetValue("_headerNamesSet", typeof(HashSet<string>));
         this._headers = (Dictionary<string, string>)info.GetValue("_headers", typeof(Dictionary<string, string>));
         this.StatusCode = (HttpStatusCode)info.GetValue("StatusCode", typeof(HttpStatusCode));
         this.IsSuccessStatusCode = info.GetBoolean("IsSuccessStatusCode");
         this.ContentType = info.GetString("ContentType");
         this.ContentLength = info.GetInt64("ContentLength");
     }
 }
 public static UInt32 GetDBBigInt(String sqlFieldName, System.Data.SqlClient.SqlDataReader reader)
 {
     return reader[sqlFieldName].Equals(DBNull.Value) ? UInt32.MaxValue : (UInt32)reader.GetInt64(reader.GetOrdinal(sqlFieldName));
 }
/// <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 EventCountersUserTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "counter":
source.Counter = (System.Int64)(System.Int64)dataRecord.GetInt64(i);
break;


case "user_event_counter_id":
source.UserEventCounterId = (System.Byte)(System.Byte)dataRecord.GetByte(i);
break;


case "user_id":
source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID)dataRecord.GetInt32(i);
break;


}

}
}
 /// <summary>
 /// Constructs a new instance of the AmazonServiceException class with serialized data.
 /// </summary>
 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
 /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
 /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
 protected StreamSizeMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     if (info != null)
     {
         this.ExpectedSize = info.GetInt64("ExpectedSize");
         this.ActualSize = info.GetInt64("ActualSize");
     }
 }
		protected Transaction(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.TransactionID = info.GetInt64("TransactionID");
			this.Amount = info.GetDecimal("Amount");
			this.TransactionTypeID = info.GetInt32("TransactionTypeID");
			this.PublicNotes = info.GetString("PublicNotes");
			this.PrivateNotes = info.GetString("PrivateNotes");
			this.Date = (DateTime)info.GetValue("Date", typeof(DateTime));
			this.PlayerID = info.GetInt32("PlayerID");
			this.Active = info.GetBoolean("Active");
			this.CreateDt = (DateTime)info.GetValue("CreateDt", typeof(DateTime));
			this.CreateUserID = info.GetInt32("CreateUserID");
			this.ModifyDt = (DateTime?)info.GetValue("ModifyDt", typeof(DateTime?));
			this.ModifyUserID = (int?)info.GetValue("ModifyUserID", typeof(int?));
			CustomizeDeserializationProcess(info, context);
		}