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