GetLastPage() public method

Max page value for specified service path object
public GetLastPage ( int navigationPageSize, ServicePath p ) : int
navigationPageSize int
p ServicePath
return int
        static void Main(string[] args)
        {
            Authenticator auth = new Authenticator(authUrl, clientId, clientSecret); //Pass auth url, username, and password to authenticate to auth server

            foreach (Endpoint e in auth.GetEndpoints(providerId)) //For the provided endpoint
            {
                XPress xPress = new XPress(e.href); //Pass endpoint info to data API (token, href)

                foreach (XLeaType l in xPress.GetXLeas().Data) //Iterate through each xLea
                {
                    for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXRostersByXLea, l.refId); i++ ) //Get max page size for rosters by lea
                    {
                        foreach (XRosterType r in xPress.GetXRostersByXLea(l.refId, i, navigationPageSize).Data) //Get each roster for each lea refId w/ paging
                        {
                            Console.WriteLine("courseTitle: " + r.courseTitle);
                            foreach (XPersonReferenceType p in r.students.studentReference) //Students for each course
                            {
                                Console.WriteLine("refId: " + p.refId);
                                Console.WriteLine("localId: " + p.localId);
                                Console.WriteLine("givenName: " + p.givenName);
                                Console.WriteLine("familyName: " + p.familyName);
                            }
                        }
                        Console.WriteLine("######## PAGE " + i + " ########");
                    }

                }
            }

            Console.Read();
        }
 //RETURN CALENDARS BY SCHOOL
 public static void XCalendars_GetXCalendarsByXSchoolLastPage(XPress xPress)
 {
     for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXCalendarsByXSchool, refId); i++)
     {
         foreach (XCalendarType calendar in xPress.GetXCalendarsByXSchool(refId, i, navigationPageSize).Data)
         {
             Console.WriteLine("refId: " + calendar.refId);
             Console.WriteLine("schoolRefId: " + calendar.schoolRefId);
             Console.WriteLine("schoolYear: " + calendar.schoolYear);
             Console.WriteLine("##### BEGIN SESSIONLIST #####");
             foreach (XSessionType sl in calendar.sessions.sessionList)
             {
                 Console.WriteLine("sessionType: " + sl.sessionType);
                 Console.WriteLine("sessionCode: " + sl.sessionCode);
                 Console.WriteLine("description: " + sl.description);
                 Console.WriteLine("markingTerm: " + sl.markingTerm);
                 Console.WriteLine("schedulingTerm: " + sl.schedulingTerm);
                 Console.WriteLine("linkedSessionCode: " + sl.linkedSessionCode);
                 Console.WriteLine("startDate: " + sl.startDate);
                 Console.WriteLine("endDate: " + sl.endDate);
             }
             Console.WriteLine("##### END SESSIONLIST #####");
             Console.WriteLine("========================================");
         }
         Console.WriteLine("######## PAGE " + i + " ########");
     }
 }
        //RETURN ROSTERS BY LEA
        public static void XRosters_GetXRostersByXLeaLastPage(XPress xPress)
        {
            for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXRostersByXLea, refId); i++)
            {
                foreach (XRosterType r in xPress.GetXRostersByXLea(refId, i, navigationPageSize).Data)
                {
                    Console.WriteLine("refId: " + r.refId);
                    Console.WriteLine("courseRefId: " + r.courseRefId);
                    Console.WriteLine("courseTitle: " + r.courseTitle);
                    Console.WriteLine("sectionRefId: " + r.sectionRefId);
                    Console.WriteLine("subject: " + r.subject);
                    Console.WriteLine("schoolRefId: " + r.schoolRefId);
                    Console.WriteLine("schoolSectionId: " + r.schoolSectionId);
                    Console.WriteLine("schoolYear: " + r.schoolYear);
                    Console.WriteLine("sessionCode: " + r.sessionCode);
                    Console.WriteLine("schoolCalendarRefId: " + r.schoolCalendarRefId);

                    Console.WriteLine("##### BEGIN MEETING TIMES #####");
                    foreach (XMeetingTimeType mt in r.meetingTimes.meetingTime)
                    {
                        Console.WriteLine("timeTableDay: " + mt.timeTableDay);

                        Console.WriteLine("bellScheduleDay: " + mt.classMeetingDays.bellScheduleDay);
                        Console.WriteLine("timeTablePeriod: " + mt.timeTablePeriod);
                        Console.WriteLine("roomNumber: " + mt.roomNumber);
                        Console.WriteLine("classBeginningTime: " + mt.classBeginningTime);
                        Console.WriteLine("classEndingTime: " + mt.classEndingTime);
                    }
                    Console.WriteLine("##### END MEETING TIMES #####");

                    Console.WriteLine("##### BEGIN STUDENTS #####");
                    foreach (XPersonReferenceType student in r.students.studentReference)
                    {
                        Console.WriteLine("refId: " + student.refId);
                        Console.WriteLine("localId: " + student.localId);
                        Console.WriteLine("givenName: " + student.givenName);
                        Console.WriteLine("familyName: " + student.familyName);
                    }
                    Console.WriteLine("##### END STUDENTS #####");

                    Console.WriteLine("##### BEGIN PRIMARY STAFF #####");
                    Console.WriteLine("refId: " + r.primaryStaff.staffPersonReference.refId);
                    Console.WriteLine("localId: " + r.primaryStaff.staffPersonReference.localId);
                    Console.WriteLine("givenName: " + r.primaryStaff.staffPersonReference.givenName);
                    Console.WriteLine("familyName: " + r.primaryStaff.staffPersonReference.familyName);
                    Console.WriteLine("teacherOfRecord: " + r.primaryStaff.teacherOfRecord);
                    Console.WriteLine("percentResponsible: " + r.primaryStaff.percentResponsible);
                    Console.WriteLine("##### END PRIMARY STAFF #####");

                    Console.WriteLine("##### BEGIN OTHER STAFF #####");
                    foreach (XStaffReferenceType staff in r.otherStaffs.otherStaff)
                    {
                        Console.WriteLine("refId: " + staff.staffPersonReference.refId);
                        Console.WriteLine("localId: " + staff.staffPersonReference.localId);
                        Console.WriteLine("givenName: " + staff.staffPersonReference.givenName);
                        Console.WriteLine("familyName: " + staff.staffPersonReference.familyName);
                        Console.WriteLine("teacherOfRecord: " + staff.teacherOfRecord);
                        Console.WriteLine("percentResponsible: " + staff.percentResponsible);
                    }
                    Console.WriteLine("##### END OTHER STAFF #####");
                    Console.WriteLine("========================================");
                }
                Console.WriteLine("######## PAGE " + i + " ########");
            }
        }
        //RETURN ALL LEAS
        public static void XLeas_GetXLeasLastPage(XPress xPress)
        {
            for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXLeas); i++)
            {
                foreach (XLeaType lea in xPress.GetXLeas(i, navigationPageSize).Data)
                {
                    Console.WriteLine("refId: " + lea.refId);
                    Console.WriteLine("leaName: " + lea.leaName);
                    Console.WriteLine("leaRefId: " + lea.leaRefId);
                    Console.WriteLine("localId: " + lea.localId);
                    Console.WriteLine("ncesId: " + lea.ncesId);
                    Console.WriteLine("stateProvinceId: " + lea.stateProvinceId);

                    Console.WriteLine("##### BEGIN ADDRESS #####");
                    Console.WriteLine("addressType: " + lea.address.addressType);
                    Console.WriteLine("city: " + lea.address.city);
                    Console.WriteLine("line1: " + lea.address.line1);
                    Console.WriteLine("line2: " + lea.address.line2);
                    Console.WriteLine("countryCode: " + lea.address.countryCode);
                    Console.WriteLine("postalCode: " + lea.address.postalCode);
                    Console.WriteLine("stateProvince: " + lea.address.stateProvince);
                    Console.WriteLine("##### END ADDRESS #####");
                    Console.WriteLine("##### BEGIN PHONENUMBER #####");
                    Console.WriteLine("number: " + lea.phoneNumber.number);
                    Console.WriteLine("phoneNumberType: " + lea.phoneNumber.phoneNumberType);
                    Console.WriteLine("primaryIndicator: " + lea.phoneNumber.primaryIndicator);
                    Console.WriteLine("##### END PHONENUMBER #####");
                    Console.WriteLine("##### BEGIN OTHERPHONENUMBER #####");
                    foreach (XTelephoneType p in lea.otherPhoneNumbers.phoneNumber)
                    {
                        Console.WriteLine("number: " + p.number);
                        Console.WriteLine("phoneNumberType: " + p.phoneNumberType);
                        Console.WriteLine("primaryIndicator: " + p.primaryIndicator);
                    }
                    Console.WriteLine("##### END OTHERPHONENUMBER #####");
                    Console.WriteLine("========================================");
                }
                Console.WriteLine("######## PAGE " + i + " ########");
            }
        }
        //RETURN ALL COURSES
        public static void XCourses_GetXCoursesLastPage(XPress xPress)
        {
            for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXCourses); i++)
            {
                foreach (XCourseType course in xPress.GetXCourses(i, navigationPageSize).Data)
                {
                    Console.WriteLine("refId: " + course.refId);
                    Console.WriteLine("schoolRefId: " + course.schoolRefId);
                    Console.WriteLine("schoolCourseId: " + course.schoolCourseId);
                    Console.WriteLine("leaCourseId: " + course.leaCourseId);
                    Console.WriteLine("##### BEGIN OTHERIDS #####");
                    foreach (XOtherCourseIdType id in course.otherIds.otherId)
                    {
                        Console.WriteLine("otherId id" + id.id);
                        Console.WriteLine("type: " + id.type);
                    }
                    Console.WriteLine("##### END OTHERIDS #####");
                    Console.WriteLine("courseTitle: " + course.courseTitle);
                    Console.WriteLine("description: " + course.description);
                    Console.WriteLine("subject: " + course.subject);
                    Console.WriteLine("##### BEGIN APPLICABLEEDUCATIONLEVELS #####");
                    foreach (String ael in course.applicableEducationLevels.applicableEducationLevel)
                    {
                        Console.WriteLine("applicableEducationLevel: " + ael);
                    }
                    Console.WriteLine("##### END APPLICABLEEDUCATIONLEVELS #####");
                    Console.WriteLine("scedCourseCode: " + course.scedCourseCode);
                    Console.WriteLine("scedCourseLevelCode: " + course.scedCourseLevelCode);
                    Console.WriteLine("scedCourseSubjectAreaCode: " + course.scedCourseSubjectAreaCode);

                    Console.WriteLine("========================================");
                }
                Console.WriteLine("######## PAGE " + i + " ########");
            }
        }
        //RETURN ALL CONTACTS
        public static void XContacts_GetXContactsLastPage(XPress xPress)
        {
            for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXContacts); i++)
            {
                foreach (XContactType c in xPress.GetXContacts(i, navigationPageSize).Data)
                {
                    Console.WriteLine("refId: " + c.refId);
                    Console.WriteLine("##### BEGIN NAME #####");
                    Console.WriteLine("type: " + c.name.type);
                    Console.WriteLine("prefix: " + c.name.prefix);
                    Console.WriteLine("familyName: " + c.name.familyName);
                    Console.WriteLine("givenName: " + c.name.givenName);
                    Console.WriteLine("middleName: " + c.name.middleName);
                    Console.WriteLine("suffix: " + c.name.suffix);
                    Console.WriteLine("##### END NAME #####");
                    Console.WriteLine("##### BEGIN OTHERNAME #####");
                    foreach (XPersonNameType n in c.otherNames.name)
                    {
                        Console.WriteLine("type: " + n.type);
                        Console.WriteLine("prefix: " + n.prefix);
                        Console.WriteLine("familyName: " + n.familyName);
                        Console.WriteLine("givenName: " + n.givenName);
                        Console.WriteLine("middleName: " + n.middleName);
                        Console.WriteLine("suffix: " + n.suffix);
                    }
                    Console.WriteLine("##### END OTHERNAME #####");

                    Console.WriteLine("localId: " + c.localId);

                    Console.WriteLine("##### BEGIN OTHERIDS #####");
                    foreach (XOtherPersonIdType id in c.otherIds.otherId)
                    {
                        Console.WriteLine("id: " + id.id);
                        Console.WriteLine("type: " + id.type);
                    }
                    Console.WriteLine("##### END OTHERIDS #####");
                    Console.WriteLine("##### BEGIN ADDRESS #####");
                    Console.WriteLine("addressType: " + c.address.addressType);
                    Console.WriteLine("city: " + c.address.city);
                    Console.WriteLine("line1: " + c.address.line1);
                    Console.WriteLine("line2: " + c.address.line2);
                    Console.WriteLine("countryCode: " + c.address.countryCode);
                    Console.WriteLine("postalCode: " + c.address.postalCode);
                    Console.WriteLine("stateProvince: " + c.address.stateProvince);
                    Console.WriteLine("number: " + c.phoneNumber.number);
                    Console.WriteLine("phoneNumberType: " + c.phoneNumber.phoneNumberType);
                    Console.WriteLine("primaryIndicator: " + c.phoneNumber.primaryIndicator);
                    Console.WriteLine("##### END ADDRESS #####");
                    Console.WriteLine("##### BEGIN PHONENUMBERS #####");
                    Console.WriteLine("number: " + c.phoneNumber.number);
                    Console.WriteLine("phoneNumberType: " + c.phoneNumber.phoneNumberType);
                    Console.WriteLine("primaryIndicator: " + c.phoneNumber.primaryIndicator);
                    Console.WriteLine("##### END PHONENUMBERS #####");
                    Console.WriteLine("##### BEGIN OTHERPHONENUMBERS #####");
                    foreach (XTelephoneType p in c.otherPhoneNumbers.phoneNumber)
                    {
                        Console.WriteLine("otherPhoneNumbers number: " + p.number);
                        Console.WriteLine("phoneNumberType: " + p.phoneNumberType);
                        Console.WriteLine("primaryIndicator: " + p.primaryIndicator);
                    }
                    Console.WriteLine("##### END OTHERPHONENUMBERS #####");
                    Console.WriteLine("##### BEGIN EMAIL #####");
                    Console.WriteLine("emailType: " + c.email.emailType);
                    Console.WriteLine("emailAddress: " + c.email.emailAddress);
                    Console.WriteLine("##### END EMAIL #####");
                    Console.WriteLine("##### BEGIN OTHEREMAILS #####");
                    foreach (XEmailType e in c.otherEmails.email)
                    {
                        Console.WriteLine("emailType: " + e.emailType);
                        Console.WriteLine("emailAddress: " + e.emailAddress);
                    }
                    Console.WriteLine("##### END OTHEREMAILS #####");
                    Console.WriteLine("sex: " + c.sex);
                    Console.WriteLine("employerType: " + c.employerType);
                    Console.WriteLine("##### BEGIN CONTACTRELATIONSHIPS #####");
                    foreach (XContactStudentRelationshipType csr in c.relationships.relationship)
                    {
                        Console.WriteLine("studentRefId: " + csr.studentRefId);
                        Console.WriteLine("relationshipCode: " + csr.relationshipCode);
                        Console.WriteLine("restrictions: " + csr.restrictions);
                        Console.WriteLine("livesWith: " + csr.livesWith);
                        Console.WriteLine("primaryContactIndicator: " + csr.primaryContactIndicator);
                        Console.WriteLine("emergencyContactIndicator: " + csr.emergencyContactIndicator);
                        Console.WriteLine("financialResponsibilityIndicator: " + csr.financialResponsibilityIndicator);
                        Console.WriteLine("custodialIndicator: " + csr.custodialIndicator);
                        Console.WriteLine("communicationsIndicator: " + csr.communicationsIndicator);
                        Console.WriteLine("contactSequence: " + csr.contactSequence);
                    }
                    Console.WriteLine("##### END CONTACTRELATIONSHIPS #####");
                    Console.WriteLine("========================================");
                }
                Console.WriteLine("######## PAGE " + i + " ########");
            }
        }
        //RETURN ALL STUDENTS
        public static void XStudents_GetXStudentsLastPage(XPress xPress)
        {
            for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXStudents); i++)
            {
                foreach (XStudentType s in xPress.GetXStudents(i, navigationPageSize).Data)
                {
                    Console.WriteLine("refId: " + s.refId);
                    Console.WriteLine("##### BEGIN NAME #####");
                    Console.WriteLine("type: " + s.name.type);
                    Console.WriteLine("prefix: " + s.name.prefix);
                    Console.WriteLine("familyName: " + s.name.familyName);
                    Console.WriteLine("givenName: " + s.name.givenName);
                    Console.WriteLine("middleName: " + s.name.middleName);
                    Console.WriteLine("suffix: " + s.name.suffix);
                    Console.WriteLine("##### END NAME #####");
                    Console.WriteLine("##### BEGIN OTHERNAME #####");
                    foreach (XPersonNameType n in s.otherNames.name)
                    {
                        Console.WriteLine("type: " + n.type);
                        Console.WriteLine("prefix: " + n.prefix);
                        Console.WriteLine("familyName: " + n.familyName);
                        Console.WriteLine("givenName: " + n.givenName);
                        Console.WriteLine("middleName: " + n.middleName);
                        Console.WriteLine("suffix: " + n.suffix);
                    }
                    Console.WriteLine("##### END OTHERNAME #####");

                    Console.WriteLine("localId: " + s.localId);

                    Console.WriteLine("stateProvinceIdloginId: " + s.stateProvinceId);
                    Console.WriteLine("##### BEGIN OTHERIDS #####");
                    foreach (XOtherPersonIdType id in s.otherIds.otherId)
                    {
                        Console.WriteLine("id: " + id.id);
                        Console.WriteLine("type: " + id.type);
                    }
                    Console.WriteLine("##### END OTHERIDS #####");
                    Console.WriteLine("##### BEGIN ADDRESS #####");
                    Console.WriteLine("addressType: " + s.address.addressType);
                    Console.WriteLine("city: " + s.address.city);
                    Console.WriteLine("line1: " + s.address.line1);
                    Console.WriteLine("line2: " + s.address.line2);
                    Console.WriteLine("countryCode: " + s.address.countryCode);
                    Console.WriteLine("postalCode: " + s.address.postalCode);
                    Console.WriteLine("stateProvince: " + s.address.stateProvince);
                    Console.WriteLine("number: " + s.phoneNumber.number);
                    Console.WriteLine("phoneNumberType: " + s.phoneNumber.phoneNumberType);
                    Console.WriteLine("primaryIndicator: " + s.phoneNumber.primaryIndicator);
                    Console.WriteLine("##### END ADDRESS #####");
                    Console.WriteLine("##### BEGIN PHONENUMBERS #####");
                    Console.WriteLine("number: " + s.phoneNumber.number);
                    Console.WriteLine("phoneNumberType: " + s.phoneNumber.phoneNumberType);
                    Console.WriteLine("primaryIndicator: " + s.phoneNumber.primaryIndicator);
                    Console.WriteLine("##### END PHONENUMBERS #####");
                    Console.WriteLine("##### BEGIN OTHERPHONENUMBERS #####");
                    foreach (XTelephoneType p in s.otherPhoneNumbers.phoneNumber)
                    {
                        Console.WriteLine("otherPhoneNumbers number: " + p.number);
                        Console.WriteLine("phoneNumberType: " + p.phoneNumberType);
                        Console.WriteLine("primaryIndicator: " + p.primaryIndicator);
                    }
                    Console.WriteLine("##### END OTHERPHONENUMBERS #####");
                    Console.WriteLine("##### BEGIN EMAIL #####");
                    Console.WriteLine("emailType: " + s.email.emailType);
                    Console.WriteLine("emailAddress: " + s.email.emailAddress);
                    Console.WriteLine("##### END EMAIL #####");
                    Console.WriteLine("##### BEGIN OTHEREMAILS #####");
                    foreach (XEmailType e in s.otherEmails.email)
                    {
                        Console.WriteLine("emailType: " + e.emailType);
                        Console.WriteLine("emailAddress: " + e.emailAddress);
                    }
                    Console.WriteLine("##### END OTHEREMAILS #####");
                    Console.WriteLine("##### BEGIN DEMOGRAPHICS #####");
                    Console.WriteLine("##### BEGIN RACES #####");
                    foreach (XRaceType r in s.demographics.races.race)
                    {
                        Console.WriteLine("race: " + r.race);
                    }
                    Console.WriteLine("##### END RACES #####");
                    Console.WriteLine("hispanicLatinoEthnicity: " + s.demographics.hispanicLatinoEthnicity);
                    Console.WriteLine("sex: " + s.demographics.sex);
                    Console.WriteLine("birthDate: " + s.demographics.birthDate);
                    Console.WriteLine("countryOfBirth: " + s.demographics.countryOfBirth);
                    Console.WriteLine("usCitizenshipStatus: " + s.demographics.usCitizenshipStatus);
                    Console.WriteLine("##### END DEMOGRAPHICS #####");
                    Console.WriteLine("##### BEGIN ENROLLMENT #####");
                    Console.WriteLine("leaRefId: " + s.enrollment.leaRefId);
                    Console.WriteLine("schoolRefId: " + s.enrollment.schoolRefId);
                    Console.WriteLine("studentSchoolAssociationRefId: " + s.enrollment.studentSchoolAssociationRefId);
                    Console.WriteLine("responsibleSchoolType: " + s.enrollment.responsibleSchoolType);
                    Console.WriteLine("membershipType: " + s.enrollment.membershipType);
                    Console.WriteLine("entryDate: " + s.enrollment.entryDate);
                    Console.WriteLine("exitDate: " + s.enrollment.exitDate);
                    Console.WriteLine("homeRoomNumber: " + s.enrollment.homeRoomNumber);
                    Console.WriteLine("##### BEGIN HOMEROOMTEACHER #####");
                    Console.WriteLine("refId: " + s.enrollment.homeRoomTeacher.refId);
                    Console.WriteLine("localId: " + s.enrollment.homeRoomTeacher.localId);
                    Console.WriteLine("givenName: " + s.enrollment.homeRoomTeacher.givenName);
                    Console.WriteLine("familyName: " + s.enrollment.homeRoomTeacher.familyName);
                    Console.WriteLine("##### END HOMEROOMTEACHER #####");
                    Console.WriteLine("gradeLevel: " + s.enrollment.gradeLevel);
                    Console.WriteLine("projectedGraduationYear: " + s.enrollment.projectedGraduationYear);
                    Console.WriteLine("##### BEGIN COUNSELOR #####");
                    Console.WriteLine("refId: " + s.enrollment.counselor.refId);
                    Console.WriteLine("localId: " + s.enrollment.counselor.localId);
                    Console.WriteLine("givenName: " + s.enrollment.counselor.givenName);
                    Console.WriteLine("familyName: " + s.enrollment.counselor.familyName);
                    Console.WriteLine("##### END COUNSELOR #####");
                    Console.WriteLine("##### END ENROLLMENT #####");
                    Console.WriteLine("##### BEGIN OTHERENROLLMENT #####");
                    foreach (XEnrollmentType e in s.otherEnrollments.enrollment)
                    {
                        Console.WriteLine("leaRefId: " + e.leaRefId);
                        Console.WriteLine("schoolRefId: " + e.schoolRefId);
                        Console.WriteLine("studentSchoolAssociationRefId: " + e.studentSchoolAssociationRefId);
                        Console.WriteLine("responsibleSchoolType: " + e.responsibleSchoolType);
                        Console.WriteLine("membershipType: " + e.membershipType);
                        Console.WriteLine("entryDate: " + e.entryDate);
                        Console.WriteLine("exitDate: " + e.exitDate);
                        Console.WriteLine("homeRoomNumber: " + e.homeRoomNumber);
                        Console.WriteLine("##### BEGIN HOMEROOMTEACHER #####");
                        Console.WriteLine("refId: " + e.homeRoomTeacher.refId);
                        Console.WriteLine("localId: " + e.homeRoomTeacher.localId);
                        Console.WriteLine("givenName: " + e.homeRoomTeacher.givenName);
                        Console.WriteLine("familyName: " + e.homeRoomTeacher.familyName);
                        Console.WriteLine("##### END HOMEROOMTEACHER #####");
                        Console.WriteLine("gradeLevel: " + e.gradeLevel);
                        Console.WriteLine("projectedGraduationYear: " + e.projectedGraduationYear);
                        Console.WriteLine("##### BEGIN COUNSELOR #####");
                        Console.WriteLine("refId: " + e.counselor.refId);
                        Console.WriteLine("localId: " + e.counselor.localId);
                        Console.WriteLine("givenName: " + e.counselor.givenName);
                        Console.WriteLine("familyName: " + e.counselor.familyName);
                        Console.WriteLine("##### END COUNSELOR #####");
                    }
                    Console.WriteLine("##### END OTHERENROLLMENT #####");
                    Console.WriteLine("##### BEGIN ACADEMICSUMMARY #####");
                    Console.WriteLine("cumulativeWeightedGpa: " + s.academicSummary.cumulativeWeightedGpa);
                    Console.WriteLine("termWeightedGpa: " + s.academicSummary.termWeightedGpa);
                    Console.WriteLine("classRank: " + s.academicSummary.classRank);
                    Console.WriteLine("##### END ACADEMICSUMMARY #####");
                    Console.WriteLine("##### BEGIN STUDENTCONTACTS #####");
                    foreach (String contactRefid in s.studentContacts.contactPersonRefId)
                    {
                        Console.WriteLine("contactPersonRefId: " + contactRefid);
                    }
                    foreach (XContactType c in s.studentContacts.xContact)
                    {
                        Console.WriteLine("##### BEGIN NAME #####");
                        Console.WriteLine("type: " + c.name.type);
                        Console.WriteLine("prefix: " + c.name.prefix);
                        Console.WriteLine("familyName: " + c.name.familyName);
                        Console.WriteLine("givenName: " + c.name.givenName);
                        Console.WriteLine("middleName: " + c.name.middleName);
                        Console.WriteLine("suffix: " + c.name.suffix);
                        Console.WriteLine("##### END NAME #####");
                        Console.WriteLine("##### BEGIN OTHERNAME #####");
                        foreach (XPersonNameType n in c.otherNames.name)
                        {
                            Console.WriteLine("type: " + n.type);
                            Console.WriteLine("prefix: " + n.prefix);
                            Console.WriteLine("familyName: " + n.familyName);
                            Console.WriteLine("givenName: " + n.givenName);
                            Console.WriteLine("middleName: " + n.middleName);
                            Console.WriteLine("suffix: " + n.suffix);
                        }
                        Console.WriteLine("##### END OTHERNAME #####");
                        Console.WriteLine(": " + c.localId);

                        Console.WriteLine("##### BEGIN OTHERIDS #####");
                        foreach (XOtherPersonIdType id in c.otherIds.otherId)
                        {
                            Console.WriteLine("id: " + id.id);
                            Console.WriteLine("type: " + id.type);
                        }
                        Console.WriteLine("##### END OTHERIDS #####");
                        Console.WriteLine("##### BEGIN ADDRESS #####");
                        Console.WriteLine("addressType: " + c.address.addressType);
                        Console.WriteLine("city: " + c.address.city);
                        Console.WriteLine("line1: " + c.address.line1);
                        Console.WriteLine("line2: " + c.address.line2);
                        Console.WriteLine("countryCode: " + c.address.countryCode);
                        Console.WriteLine("postalCode: " + c.address.postalCode);
                        Console.WriteLine("stateProvince: " + c.address.stateProvince);
                        Console.WriteLine("number: " + c.phoneNumber.number);
                        Console.WriteLine("phoneNumberType: " + c.phoneNumber.phoneNumberType);
                        Console.WriteLine("primaryIndicator: " + c.phoneNumber.primaryIndicator);
                        Console.WriteLine("##### END ADDRESS #####");
                        Console.WriteLine("##### BEGIN PHONENUMBERS #####");
                        Console.WriteLine("number: " + c.phoneNumber.number);
                        Console.WriteLine("phoneNumberType: " + c.phoneNumber.phoneNumberType);
                        Console.WriteLine("primaryIndicator: " + c.phoneNumber.primaryIndicator);
                        Console.WriteLine("##### END PHONENUMBERS #####");
                        Console.WriteLine("##### BEGIN OTHERPHONENUMBERS #####");
                        foreach (XTelephoneType p in c.otherPhoneNumbers.phoneNumber)
                        {
                            Console.WriteLine("otherPhoneNumbers number: " + p.number);
                            Console.WriteLine("phoneNumberType: " + p.phoneNumberType);
                            Console.WriteLine("primaryIndicator: " + p.primaryIndicator);
                        }
                        Console.WriteLine("##### END OTHERPHONENUMBERS #####");
                        Console.WriteLine("##### BEGIN EMAIL #####");
                        Console.WriteLine("emailType: " + c.email.emailType);
                        Console.WriteLine("emailAddress: " + c.email.emailAddress);
                        Console.WriteLine("##### END EMAIL #####");
                        Console.WriteLine("##### BEGIN OTHEREMAILS #####");
                        foreach (XEmailType e in c.otherEmails.email)
                        {
                            Console.WriteLine("emailType: " + e.emailType);
                            Console.WriteLine("emailAddress: " + e.emailAddress);
                        }
                        Console.WriteLine("##### END OTHEREMAILS #####");
                        Console.WriteLine(": " + c.sex);
                        Console.WriteLine(": " + c.employerType);
                        Console.WriteLine("##### BEGIN CONTACTRELATIONSHIPS #####");
                        foreach (XContactStudentRelationshipType csr in c.relationships.relationship)
                        {
                            Console.WriteLine("studentRefId: " + csr.studentRefId);
                            Console.WriteLine("relationshipCode: " + csr.relationshipCode);
                            Console.WriteLine("restrictions: " + csr.restrictions);
                            Console.WriteLine("livesWith: " + csr.livesWith);
                            Console.WriteLine("primaryContactIndicator: " + csr.primaryContactIndicator);
                            Console.WriteLine("emergencyContactIndicator: " + csr.emergencyContactIndicator);
                            Console.WriteLine("financialResponsibilityIndicator: " + csr.financialResponsibilityIndicator);
                            Console.WriteLine("custodialIndicator: " + csr.custodialIndicator);
                            Console.WriteLine("communicationsIndicator: " + csr.communicationsIndicator);
                            Console.WriteLine("contactSequence: " + csr.contactSequence);
                        }
                        Console.WriteLine("##### END CONTACTRELATIONSHIPS #####");
                    }
                    Console.WriteLine("##### END STUDENTCONTACTS #####");
                    Console.WriteLine("##### BEGIN LANGUAGES #####");
                    foreach (XLanguageType l in s.languages.language)
                    {
                        Console.WriteLine("type: " + l.type);
                        Console.WriteLine("code: " + l.code);
                    }
                    Console.WriteLine("##### END LANGUAGES #####");
                    Console.WriteLine("========================================");
                }
                Console.WriteLine("######## PAGE " + i + " ########");
            }
        }
        //RETURN ALL STAFFS
        public static void XStaffs_GetXStaffsLastPage(XPress xPress)
        {
            for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXStaffs); i++)
            {
                foreach (XStaffType s in xPress.GetXStaffs(i, navigationPageSize).Data)
                {
                    Console.WriteLine("refId: " + s.refId);
                    Console.WriteLine("##### BEGIN NAME #####");
                    Console.WriteLine("type: " + s.name.type);
                    Console.WriteLine("prefix: " + s.name.prefix);
                    Console.WriteLine("familyName: " + s.name.familyName);
                    Console.WriteLine("givenName: " + s.name.givenName);
                    Console.WriteLine("middleName: " + s.name.middleName);
                    Console.WriteLine("suffix: " + s.name.suffix);
                    Console.WriteLine("##### END NAME #####");
                    Console.WriteLine("localId: " + s.localId);

                    Console.WriteLine("stateProvinceId: " + s.stateProvinceId);
                    Console.WriteLine("##### BEGIN OTHERIDS #####");
                    foreach (XOtherPersonIdType id in s.otherIds.otherId)
                    {
                        Console.WriteLine("id: " + id.id);
                        Console.WriteLine("type: " + id.type);
                    }
                    Console.WriteLine("##### END OTHERIDS #####");
                    Console.WriteLine("sex: " + s.sex);
                    Console.WriteLine("##### BEGIN EMAIL #####");
                    Console.WriteLine("emailType: " + s.email.emailType);
                    Console.WriteLine("emailAddress: " + s.email.emailAddress);
                    Console.WriteLine("##### END EMAIL #####");
                    Console.WriteLine("##### BEGIN PRIMARYASSIGNMENT #####");
                    Console.WriteLine("leaRefId: " + s.primaryAssignment.leaRefId);
                    Console.WriteLine("schoolRefId: " + s.primaryAssignment.schoolRefId);
                    Console.WriteLine("jobFunction: " + s.primaryAssignment.jobFunction);
                    Console.WriteLine("##### END PRIMARYASSIGNMENT #####");
                    Console.WriteLine("##### BEGIN OTHERASSIGNMENT #####");
                    foreach (XStaffPersonAssignmentType pa in s.otherAssignments.staffPersonAssignment)
                    {
                        Console.WriteLine("leaRefId: " + pa.leaRefId);
                        Console.WriteLine("schoolRefId: " + pa.schoolRefId);
                        Console.WriteLine("jobFunction: " + pa.jobFunction);
                    }
                    Console.WriteLine("##### END OTHERASSIGNMENT #####");
                    Console.WriteLine("========================================");
                }
                Console.WriteLine("######## PAGE " + i + " ########");
            }
        }
 //RETURN ALL SCHOOLS
 public static void XSchools_GetXSchoolsLastPage(XPress xPress)
 {
     for (int i = 1; i <= xPress.GetLastPage(navigationPageSize, XPress.ServicePath.GetXSchools); i++)
     {
         foreach (XSchoolType school in xPress.GetXSchools(i, navigationPageSize).Data)
         {
             Console.WriteLine("refId: " + school.refId);
             Console.WriteLine("leaRefId: " + school.leaRefId);
             Console.WriteLine("localId: " + school.localId);
             Console.WriteLine("stateProvinceId: " + school.stateProvinceId);
             Console.WriteLine("##### BEGIN OTHERIDS #####");
             foreach (XOtherOrganizationIdType id in school.otherIds.otherId)
             {
                 Console.WriteLine("otherId id" + id.id);
                 Console.WriteLine("type: " + id.type);
             }
             Console.WriteLine("##### END OTHERIDS #####");
             Console.WriteLine("schoolName: " + school.schoolName);
             Console.WriteLine("##### BEGIN GRADELEVELS #####");
             foreach (String gl in school.gradeLevels.gradeLevel)
             {
                 Console.WriteLine("gradeLevel: " + gl);
             }
             Console.WriteLine("##### END GRADELEVELS #####");
             Console.WriteLine("##### BEGIN ADDRESS #####");
             Console.WriteLine("addressType: " + school.address.addressType);
             Console.WriteLine("city: " + school.address.city);
             Console.WriteLine("line1: " + school.address.line1);
             Console.WriteLine("line2: " + school.address.line2);
             Console.WriteLine("countryCode: " + school.address.countryCode);
             Console.WriteLine("postalCode: " + school.address.postalCode);
             Console.WriteLine("stateProvince: " + school.address.stateProvince);
             Console.WriteLine("##### END ADDRESS #####");
             Console.WriteLine("##### BEGIN PHONENUMBER #####");
             Console.WriteLine("number: " + school.phoneNumber.number);
             Console.WriteLine("phoneNumberType: " + school.phoneNumber.phoneNumberType);
             Console.WriteLine("primaryIndicator: " + school.phoneNumber.primaryIndicator);
             Console.WriteLine("##### END PHONENUMBER #####");
             Console.WriteLine("##### BEGIN OTHERPHONENUMBER #####");
             foreach (XTelephoneType p in school.otherPhoneNumbers.phoneNumber)
             {
                 Console.WriteLine("otherPhoneNumbers number: " + p.number);
                 Console.WriteLine("phoneNumberType: " + p.phoneNumberType);
                 Console.WriteLine("primaryIndicator: " + p.primaryIndicator);
             }
             Console.WriteLine("##### END OTHERPHONENUMBER #####");
             Console.WriteLine("========================================");
         }
         Console.WriteLine("######## PAGE " + i + " ########");
     }
 }