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