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