/// <summary> /// Load a collection of Prayer Activity for the given person. /// </summary> /// <param name="ac"></param> /// <param name="personID">ID of the person to fetch activity for</param> public static void LoadActivityByPersonID(this ActivityCollection ac, int personID) { SqlDataReader activityByPersonID = new RequestData().GetActivityByPersonID(personID); while (activityByPersonID.Read()) { ac.Add(new Activity(activityByPersonID)); } activityByPersonID.Close(); }
/// <summary> /// Load all approved prayer requests for the given organization. /// </summary> /// <param name="requests"></param> /// <param name="organizationID"></param> /// <returns></returns> public static RequestCollection LoadApprovedRequestsByOrg(this RequestCollection requests, int organizationID) { SqlDataReader approvedRequests = new RequestData().GetApprovedRequests(organizationID); while (approvedRequests.Read()) { Request request = new Request((int)approvedRequests["request_id"]); requests.Add(request); } approvedRequests.Close(); return(requests); }