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