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

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