Example #1
0
        /// <summary>
        /// Loads a collection of ProductPrice objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the ProductPrice objects in the database.</returns>
        public static ProductPriceCollection LoadCollection(string spName, SqlParameter[] parms)
        {
            ProductPriceCollection result = new ProductPriceCollection();

            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms))
            {
                while (reader.Read())
                {
                    ProductPrice tmp = new ProductPrice();
                    tmp.LoadFromReader(reader);
                    result.Add(tmp);
                }
            }
            return(result);
        }
Example #2
0
 /// <summary>
 /// Loads a ProductPrice object from the database using the given where clause
 /// </summary>
 /// <param name="whereClause">The filter expression for the query</param>
 /// <returns>A ProductPrice object</returns>
 public static ProductPrice LoadWhere(string whereClause)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spProductPrice_SelAll", parameterValues))
     {
         if (reader.Read())
         {
             ProductPrice result = new ProductPrice();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }
Example #3
0
 /// <summary>
 /// Loads a ProductPrice object from the database using the given ProductPriceId
 /// </summary>
 /// <param name="productPriceId">The primary key value</param>
 /// <returns>A ProductPrice object</returns>
 public static ProductPrice Load(Guid productPriceId)
 {
     SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@ProductPriceId", productPriceId) };
     using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spProductPrice_SelRec", parameterValues))
     {
         if (reader.Read())
         {
             ProductPrice result = new ProductPrice();
             result.LoadFromReader(reader);
             return(result);
         }
         else
         {
             return(null);
         }
     }
 }