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

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

                case "last_update":
                    paramValues[i] = source.LastUpdate;
                    break;
                }
            }
        }
/// <summary>
/// Checks if this <see cref="IWorldStatsCountItemBuyTable"/> contains the same values as another <see cref="IWorldStatsCountItemBuyTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IWorldStatsCountItemBuyTable"/>.</param>
/// <param name="otherItem">The <see cref="IWorldStatsCountItemBuyTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IWorldStatsCountItemBuyTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
public static System.Boolean HasSameValues(this IWorldStatsCountItemBuyTable source, IWorldStatsCountItemBuyTable otherItem)
{
return Equals(source.Count, otherItem.Count) && 
Equals(source.ItemTemplateID, otherItem.ItemTemplateID) && 
Equals(source.LastUpdate, otherItem.LastUpdate);
}
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsCountItemBuyTable.
/// </summary>
/// <param name="source">The IWorldStatsCountItemBuyTable to copy the values from.</param>
        public void CopyValuesFrom(IWorldStatsCountItemBuyTable source)
        {
            this.Count          = (System.Int32)source.Count;
            this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            this.LastUpdate     = (System.DateTime)source.LastUpdate;
        }
/// <summary>
/// Copies the column values into the given Dictionary using the database column name
/// with a prefixed @ as the key. The keys must already exist in the Dictionary;
/// this method will not create them if they are missing.
/// </summary>
/// <param name="source">The object to copy the values from.</param>
/// <param name="dic">The Dictionary to copy the values into.</param>
        public static void CopyValues(IWorldStatsCountItemBuyTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["count"]            = (System.Int32)source.Count;
            dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            dic["last_update"]      = (System.DateTime)source.LastUpdate;
        }
/// <summary>
/// Initializes a new instance of the <see cref="WorldStatsCountItemBuyTable"/> class.
/// </summary>
/// <param name="source">IWorldStatsCountItemBuyTable to copy the initial values from.</param>
        public WorldStatsCountItemBuyTable(IWorldStatsCountItemBuyTable source)
        {
            CopyValuesFrom(source);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsCountItemBuyTable"/> class.
 /// </summary>
 /// <param name="source">IWorldStatsCountItemBuyTable to copy the initial values from.</param>
 public WorldStatsCountItemBuyTable(IWorldStatsCountItemBuyTable source)
 {
     CopyValuesFrom(source);
 }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsCountItemBuyTable.
 /// </summary>
 /// <param name="source">The IWorldStatsCountItemBuyTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsCountItemBuyTable source)
 {
     Count = source.Count;
     ItemTemplateID = source.ItemTemplateID;
     LastUpdate = source.LastUpdate;
 }
 /// <summary>
 /// Copies the column values into the given Dictionary using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the Dictionary;
 /// this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="dic">The Dictionary to copy the values into.</param>
 public static void CopyValues(IWorldStatsCountItemBuyTable source, IDictionary<String, Object> dic)
 {
     dic["count"] = source.Count;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["last_update"] = source.LastUpdate;
 }
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsCountItemBuyTable.
/// </summary>
/// <param name="source">The IWorldStatsCountItemBuyTable to copy the values from.</param>
public void CopyValuesFrom(IWorldStatsCountItemBuyTable source)
{
this.Count = (System.Int32)source.Count;
this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
this.LastUpdate = (System.DateTime)source.LastUpdate;
}
Esempio n. 10
0
/// <summary>
/// Copies the column values into the given Dictionary using the database column name
/// with a prefixed @ as the key. The keys must already exist in the Dictionary;
/// this method will not create them if they are missing.
/// </summary>
/// <param name="source">The object to copy the values from.</param>
/// <param name="dic">The Dictionary to copy the values into.</param>
public static void CopyValues(IWorldStatsCountItemBuyTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["count"] = (System.Int32)source.Count;
dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
dic["last_update"] = (System.DateTime)source.LastUpdate;
}
Esempio n. 11
0
 /// <summary>
 /// Checks if this <see cref="IWorldStatsCountItemBuyTable"/> contains the same values as another <see cref="IWorldStatsCountItemBuyTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IWorldStatsCountItemBuyTable"/>.</param>
 /// <param name="otherItem">The <see cref="IWorldStatsCountItemBuyTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IWorldStatsCountItemBuyTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IWorldStatsCountItemBuyTable source, IWorldStatsCountItemBuyTable otherItem)
 {
     return(Equals(source.Count, otherItem.Count) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) &&
            Equals(source.LastUpdate, otherItem.LastUpdate));
 }
Esempio n. 12
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IWorldStatsCountItemBuyTable source, DbParameterValues paramValues)
 {
     paramValues["count"]            = source.Count;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["last_update"]      = source.LastUpdate;
 }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsCountItemBuyTable.
 /// </summary>
 /// <param name="source">The IWorldStatsCountItemBuyTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsCountItemBuyTable source)
 {
     Count          = source.Count;
     ItemTemplateID = source.ItemTemplateID;
     LastUpdate     = source.LastUpdate;
 }
 /// <summary>
 /// Copies the column values into the given Dictionary using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the Dictionary;
 /// this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="dic">The Dictionary to copy the values into.</param>
 public static void CopyValues(IWorldStatsCountItemBuyTable source, IDictionary <String, Object> dic)
 {
     dic["count"]            = source.Count;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["last_update"]      = source.LastUpdate;
 }
/// <summary>
/// Copies the column values into the given DbParameterValues using the database column name
/// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
///  this method will not create them if they are missing.
/// </summary>
/// <param name="source">The object to copy the values from.</param>
/// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void CopyValues(this IWorldStatsCountItemBuyTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["count"]            = (System.Int32)source.Count;
            paramValues["item_template_id"] = (System.UInt16)source.ItemTemplateID;
            paramValues["last_update"]      = (System.DateTime)source.LastUpdate;
        }