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