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

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