/// <summary> /// Loads a collection of ProductClass6 objects from the database. /// </summary> /// <returns>A collection containing all of the ProductClass6 objects in the database.</returns> public static ProductClass6Collection LoadCollection(string spName, SqlParameter[] parms) { ProductClass6Collection result = new ProductClass6Collection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { ProductClass6 tmp = new ProductClass6(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }
/// <summary> /// Loads a ProductClass6 object from the database using the given where clause /// </summary> /// <param name="whereClause">The filter expression for the query</param> /// <returns>A ProductClass6 object</returns> public static ProductClass6 LoadWhere(string whereClause) { SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@WhereClause", whereClause) }; using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spProductClass6_SelAll", parameterValues)) { if (reader.Read()) { ProductClass6 result = new ProductClass6(); result.LoadFromReader(reader); return(result); } else { return(null); } } }
/// <summary> /// Loads a ProductClass6 object from the database using the given Class6Id /// </summary> /// <param name="class6Id">The primary key value</param> /// <returns>A ProductClass6 object</returns> public static ProductClass6 Load(Guid class6Id) { SqlParameter[] parameterValues = new SqlParameter[] { new SqlParameter("@Class6Id", class6Id) }; using (SqlDataReader reader = SqlHelper.Default.ExecuteReader("spProductClass6_SelRec", parameterValues)) { if (reader.Read()) { ProductClass6 result = new ProductClass6(); result.LoadFromReader(reader); return(result); } else { return(null); } } }