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