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