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