Click or drag to resize

DataExportServiceGetAllPersons2 Method

Gets all person information. (v2)

Namespace:  (Default Namespace)
Assembly:  SeniorSystemsWS (in SeniorSystemsWS.dll) Version: 937.0.0.0 (937.0.0.33)
Syntax
public Person2[] GetAllPersons2(
	string authKey,
	int numberOfRecords,
	int lastEntityNumber,
	DateTime lastUpdateDate,
	List<WSMethodParam> parameters
)

Parameters

authKey
Type: SystemString
Authentication Key obtained from the loginExt method in UserManagementService for a current administrator connection.
numberOfRecords
Type: SystemInt32
The number of records to return with this call.
lastEntityNumber
Type: SystemInt32
The last entity number. The next page of records will begin with persons with a higher entity number.
lastUpdateDate
Type: SystemDateTime
The last update date. The next page of records will only contain persons who have had changes made since this date.
parameters
Type: System.Collections.GenericListWSMethodParam
The options to use to limit the records selected.

Return Value

Type: Person2
A list of Person2 objects.
Exceptions
ExceptionCondition
ApplicationExceptionInvalid authorization key
ApplicationExceptionInsufficient privileges
ExceptionInternal Parameter Parse Error
Remarks
Typically, this call is made in a loop for performance reasons. The first call, will have lastEntityNo = 0. The next call would contain the entity number of the last record.

The authorization key provided must be linked to an administrator role.

See the WSMethodParam[].Parameter property for valid parameters values and a description of what each parameter does.

Examples
The following gets all students in the Student and Graduate groups, all constituents (all constituencies) and all faculty members.
DataExportServiceSoapClient des = new DataExportServiceSoapClient();

int pageSize = 100;

int lastEntityNo = 0;
DateTime lastUpdate = new DateTime(1900, 1, 1);

//set the parameters for the service call
List<WSMethodParam> wsParameters = new List<WSMethodParam>();

//Include students in the returned data
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.IncludeStudents,
    Value = "true"
});

//only return students with a student group of Students or Graduated
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.StudentsGroup,
    Value = "Students,Graduated"
});

//Include parents in the returned data
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.IncludeParents,
    Value = "true"
});

//Include constituents in the returned data
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.IncludeConstituents,
    Value = "true"
});

//only return constituent: Alums
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.Constituencies,
    Value = "Alums"
});

//Include students for a parent
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.IncludePersonStudents,
    Value = "true"
});

//Only return persons that have a web account
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.ReturnOnlyWebUsers,
    Value = "false"
});

//Include the spouse info in the person record
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.IncludePersonSpouseInfo,
    Value = "true"
});

//Include faculty in the returned data
wsParameters.Add(new WSMethodParam()
{
    Parameter = Parameter.IncludeFaculty,
    Value = "true"
});


Person2[] ret = des.GetAllPersons2(authKey, pageSize, lastEntityNo, lastUpdate, wsParameters.ToArray());

while (ret.Count() == pageSize)
{
    lastEntityNo = ret[ret.Count() - 1].EntityNo;
    ret = des.GetAllPersons2(authKey, pageSize, lastEntityNo, lastUpdate, wsParameters.ToArray());
}
See Also