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