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