/// <summary> /// This method fetches a 'List<Member>' object. /// This method uses the 'Members_FetchAll' procedure. /// </summary> /// <returns>A 'List<Member>'</returns> /// </summary> public List <Member> FetchAllMembers(FetchAllMembersStoredProcedure fetchAllMembersProc, DataConnector databaseConnector) { // Initial Value List <Member> memberCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allMembersDataSet = this.DataHelper.LoadDataSet(fetchAllMembersProc, databaseConnector); // Verify DataSet Exists if (allMembersDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allMembersDataSet); // if table exists if (table != null) { // Load Collection memberCollection = MemberReader.LoadCollection(table); } } } // return value return(memberCollection); }
/// <summary> /// This method finds a 'Member' object. /// This method uses the 'Member_Find' procedure. /// </summary> /// <returns>A 'Member' object.</returns> /// </summary> public Member FindMember(FindMemberStoredProcedure findMemberProc, DataConnector databaseConnector) { // Initial Value Member member = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet memberDataSet = this.DataHelper.LoadDataSet(findMemberProc, databaseConnector); // Verify DataSet Exists if (memberDataSet != null) { // Get DataTable From DataSet DataRow row = this.DataHelper.ReturnFirstRow(memberDataSet); // if row exists if (row != null) { // Load Member member = MemberReader.Load(row); } } } // return value return(member); }