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