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