Пример #1
0
        /// <summary>
        /// Loads a collection of ProductClass2 objects from the database.
        /// </summary>
        /// <returns>A collection containing all of the ProductClass2 objects in the database.</returns>
        public static ProductClass2Collection LoadCollection(string spName, SqlParameter[] parms)
        {
            ProductClass2Collection result = new ProductClass2Collection();

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