© 2018 Capita Business Services Ltd. All rights reserved.

Capita Education Software Solutions is a trading name of Capita Business Services Ltd. Our Registered office is 30 Berners Street, London, W1T 3LR and our registered number is 02299747. Further information about Capita plc can be found in our legal statement.

SIMS 7 - TPPersonStudent

TPPersonStudent.GetXmlStudents(System.DateTime)

This will get all the students and its related information from SIMS system valid within the date supplied. The output returned from the interface will be as below.

TPPersonStudent.GetXmlStudents()

It is similar to above method except that it gets information of All Students. It gets additional information in the Student XML like Birth Certificate Seen, Attendance Mode, Former UPN, English Additional Language, Home Language, Ethnic Data Source etc.

TPPersonStudent.GetXmlStudents(int studentId)

This method gets information of a student passed as a parameter. It gets additional information in the Student XML like Birth Certificate Seen, Attendance Mode, Former UPN, English Additional Language, Home Language, Ethnic Data Source etc.

e.g.

TPPersonStudent studentInfo = new TPPersonStudent();
string data = studentInfo.GetXmlStudents(2447);

Sample return (May be added to over time!)

For a recent review, we have had a need to use a serialization technique to get the same data.

            SIMS.Processes.TPPersonStudent tpps = new SIMS.Processes.TPPersonStudent();
            string xml = tpps.GetXmlStudents(EffectiveDate);
            XmlSerializer serializer = new XmlSerializer(typeof(DataClasses.Students));
            DataClasses.Students students = new DataClasses.Students(); 
            using (StringReader reader = new StringReader(xml))
            {
                students = (DataClasses.Students)serializer.Deserialize(reader);
            }
            foreach (DataClasses.Student s in students.Student)
            {
                StudentId = s.PersonID;
                RegistrationGroupID = -1;

Which populates the following class (NB: Has more fields than the sample output which follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace SIMSAttendanceDemo.DataClasses
{
    // using System.Xml.Serialization;
    // XmlSerializer serializer = new XmlSerializer(typeof(Students));
    // using (StringReader reader = new StringReader(xml))
    // {
    //    var test = (Students)serializer.Deserialize(reader);
    // }

    [XmlRoot(ElementName = "Student")]
    public class Student
    {

        [XmlElement(ElementName = "PersonID")]
        public int PersonID { get; set; }

        [XmlElement(ElementName = "Forename")]
        public string Forename { get; set; }

        [XmlElement(ElementName = "Surname")]
        public string Surname { get; set; }

        [XmlElement(ElementName = "ChosenName")]
        public string ChosenName { get; set; }

        [XmlElement(ElementName = "MiddleName")]
        public string MiddleName { get; set; }

        [XmlElement(ElementName = "LegalSurname")]
        public string LegalSurname { get; set; }

        [XmlElement(ElementName = "Gender")]
        public string Gender { get; set; }

        [XmlElement(ElementName = "GenderID")]
        public string GenderID { get; set; }

        [XmlElement(ElementName = "GenderCode")]
        public string GenderCode { get; set; }

        [XmlElement(ElementName = "DOB")]
        public string _DOB { get; set; }
        [XmlIgnore]
        public DateTime? DOB 
        { 
            get
            {
                if (string.IsNullOrEmpty(_DOB) )
                {
                    return null;
                }
                return DateTime.Parse(_DOB);
            }
        }
        [XmlIgnore]
        [XmlElement(ElementName = "Photo")]
        public string Photo { get; set; }

        [XmlElement(ElementName = "ExternalId")]
        public string ExternalId { get; set; }

        [XmlElement(ElementName = "AdmissionNumber")]
        public string AdmissionNumber { get; set; }

        [XmlElement(ElementName = "UPN")]
        public string UPN { get; set; }

        [XmlElement(ElementName = "Religion")]
        public string Religion { get; set; }

        [XmlElement(ElementName = "ReligionID")]
        public string ReligionID { get; set; }

        [XmlElement(ElementName = "Nationality")]
        public string Nationality { get; set; }

        [XmlElement(ElementName = "NationalityID")]
        public string NationalityID { get; set; }

        [XmlElement(ElementName = "RegGroup")]
        public string RegGroup { get; set; }

        [XmlElement(ElementName = "RegGroupID")]
        public string RegGroupID { get; set; }

        [XmlElement(ElementName = "YearGroup")]
        public string YearGroup { get; set; }

        [XmlElement(ElementName = "YearGroupID")]
        public string YearGroupID { get; set; }

        [XmlElement(ElementName = "House")]
        public string House { get; set; }

        [XmlElement(ElementName = "HouseID")]
        public string HouseID { get; set; }

        [XmlElement(ElementName = "RollMode")]
        public string RollMode { get; set; }

        [XmlElement(ElementName = "RollModeID")]
        public string RollModeID { get; set; }

        [XmlElement(ElementName = "OnRollMode")]
        public string OnRollMode { get; set; }

        [XmlElement(ElementName = "AdmissionDate")]
        public string _AdmissionDate { get; set; }
        [XmlIgnore]
        public DateTime? AdmissionDate 
        {
            get
            {
                if (string.IsNullOrEmpty(_AdmissionDate))
                {
                    return null;
                }
                return DateTime.Parse(_AdmissionDate);
            }
        }


        [XmlElement(ElementName = "DateOfLeaving")]
        public string _DOL { get; set; }
        [XmlIgnore]
        public DateTime? DateOfLeaving 
        { 
            get
            {
                if (string.IsNullOrEmpty(_DOL))
                {
                    return null;

                }
                return DateTime.Parse(_DOL);
            }
        }

        [XmlElement(ElementName = "ParentalSalutation")]
        public string ParentalSalutation { get; set; }

        [XmlElement(ElementName = "ReligionCode")]
        public string ReligionCode { get; set; }

        [XmlElement(ElementName = "ReligionCategoryCode")]
        public string ReligionCategoryCode { get; set; }

        [XmlElement(ElementName = "AsylumStatusCode")]
        public string AsylumStatusCode { get; set; }

        [XmlElement(ElementName = "ServiceChildrenCode")]
        public string ServiceChildrenCode { get; set; }

        [XmlElement(ElementName = "FirstLanguageCode")]
        public string FirstLanguageCode { get; set; }
    }

    [XmlRoot(ElementName = "Students")]
    public class Students
    {

        [XmlElement(ElementName = "Student")]
        public List<Student> Student { get; set; }
    }


}

Example of Xml

Output :
<StudentExtendeds>
  <Student>
    <PersonID>2447</PersonID>
    <Forename>Ben</Forename>
    <Surname>Abbot</Surname>
    <ChosenName />
    <MiddleName />
    <LegalSurname>Abbot</LegalSurname>
    <Gender>Male</Gender>
    <GenderID>0</GenderID>
    <DOB>1986-01-17T00:00:00</DOB>
    <BirthCertificateSeen>F</BirthCertificateSeen>
    <AttendanceMode>All Day</AttendanceMode>
    <AttendanceModeID>-1</AttendanceModeID>
    <FormerUPN />
    <UniqueLearnerNumber />
    <YearTaughtIn />
    <YearTaughtInID />
    <EmergencyConsent>F</EmergencyConsent>
    <NHSNumber />
    <BloodGroup />
    <EthnicDataSource>Provided by the parent</EthnicDataSource>
    <EthnicDataSourceID>2019</EthnicDataSourceID>
    <HomeLanguage>English</HomeLanguage>
    <HomeLanguageID>366</HomeLanguageID>
    <FirstLanguage>English</FirstLanguage>
    <FirstLanguageID>2027</FirstLanguageID>
    <EnglishAdditionalLanguage />
    <EnglishAdditionalLanguageID />
    <NationalIdentity />
    <NationalIdentityID />
    <AdmissionNumber>001511</AdmissionNumber>
    <UPN>U820432190122</UPN>
    <Religion>Christian*</Religion>
    <ReligionID>339</ReligionID>
    <RegGroup />
    <RegGroupID />
    <YearGroup />
    <YearGroupID />
    <House />
    <HouseID />
    <RollMode>Single Registration</RollMode>
    <RollModeID>2</RollModeID>
    <AdmissionDate>1997-09-03T00:00:00</AdmissionDate>
    <DateOfLeaving>2004-07-23T23:59:00</DateOfLeaving>
    <ParentalSalutation>Mr F and Mrs R Abbot</ParentalSalutation>
  </Student>
<StudentExtendeds>

TPPersonStudent.GetXmlStudentsNationalities(System.DateTime)

This will get all the nationality description related to all students from SIMS system valid within date supplied. The output returned from the interface will be as below

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<StudentNationalities>
  <StudentNationality>
    <PersonID>6034</PersonID>
    <Nationality>Somalia</Nationality>
  </StudentNationality>
</StudentNationalities

 

TPPersonStudent.GetXmlChangedStudents(DateTime referenceDate)

1) Calling the interface on referenceDate 04/01/2010 will get all the students from SIMS system as shown below:

TPPersonStudent studInfo = new TPPersonStudent();
string changeddata = studInfo.GetXmlChangedStudents(DateTime.Parse("04/01/2010"));

2) Calling this interface after modifying/deleting/adding students [with appropriate date] returns only the changed student information. Sample code and out for each is shown below:

a) Modifying an existing Student. Add middle name to Student with personId 5253 [Ben Abbot]

TPPersonStudent studInfo = new TPPersonStudent();
string changeddata = studInfo.GetXmlChangedStudents(System.DateTime.Now);

Output:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<StudentExtendeds>
  <Student>
    <PersonID>5253</PersonID>
    <Forename>Benja</Forename>
    <Surname>Abbot</Surname>
    <ChosenName>Ben</ChosenName>
    <MiddleName>Michael</MiddleName>
    <LegalSurname>Abbot</LegalSurname>
    <Gender>Male</Gender>
    <GenderID>0</GenderID>
    <DOB>1993-07-12T00:00:00</DOB>
    <BirthCertificateSeen>T</BirthCertificateSeen>
    <AttendanceMode>All Day</AttendanceMode>
    <AttendanceModeID>-1</AttendanceModeID>
    <FormerUPN />
    <UniqueLearnerNumber />
    <YearTaughtIn>Curriculum Year 12</YearTaughtIn>
    <YearTaughtInID>25</YearTaughtInID>
    <EmergencyConsent>T</EmergencyConsent>
    <NHSNumber />
    <BloodGroup>AB-</BloodGroup>
    <EthnicDataSource>Provided by the parent</EthnicDataSource>
    <EthnicDataSourceID>2019</EthnicDataSourceID>
    <HomeLanguage>English</HomeLanguage>
    <HomeLanguageID>366</HomeLanguageID>
    <FirstLanguage>English</FirstLanguage>
    <FirstLanguageID>2027</FirstLanguageID>
    <EnglishAdditionalLanguage />
    <EnglishAdditionalLanguageID />
    <NationalIdentity>English</NationalIdentity>
    <NationalIdentityID>2</NationalIdentityID>
    <QuickNote />
    <PhotoID>87</PhotoID>
    <AdmissionNumber>002912</AdmissionNumber>
    <UPN>X820432104001</UPN>
    <Religion>Christian</Religion>
    <ReligionID>2099</ReligionID>
    <RegGroup>N</RegGroup>
    <RegGroupID>421</RegGroupID>
    <YearGroup>Year 12</YearGroup>
    <YearGroupID>32</YearGroupID>
    <House>Hooke</House>
    <HouseID>43</HouseID>
    <RollMode>Single Registration</RollMode>
    <RollModeID>2</RollModeID>
    <AdmissionDate>2004-09-01T00:00:00</AdmissionDate>
    <DateOfLeaving />
    <ParentalSalutation>Mr and Mrs Abbot</ParentalSalutation>
  </Student>
</StudentExtendeds>

b) Add a new Student with Surname and Forename as TestSurname and TestForename

Calling this interface will get the information of this newly added student.

TPPersonStudent studInfo = new TPPersonStudent();
string changeddata = studInfo.GetXmlChangedStudents(System.DateTime.Now);

Output :

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<StudentExtendeds>
  <Student>
    <PersonID>7660</PersonID>
    <Forename>TestForename</Forename>
    <Surname>TestSurname</Surname>
    <ChosenName>TestForename</ChosenName>
    <MiddleName />
    <LegalSurname>TestSurname</LegalSurname>
    <Gender>Male</Gender>
    <GenderID>0</GenderID>
    <DOB>1993-07-15T00:00:00</DOB>
    <BirthCertificateSeen>T</BirthCertificateSeen>
    <AttendanceMode>All Day</AttendanceMode>
    <AttendanceModeID>-1</AttendanceModeID>
    <FormerUPN />
    <UniqueLearnerNumber />
    <YearTaughtIn>Curriculum Year 12</YearTaughtIn>
    <YearTaughtInID>25</YearTaughtInID>
    <EmergencyConsent>F</EmergencyConsent>
    <NHSNumber />
    <BloodGroup />
    <EthnicDataSource />
    <EthnicDataSourceID />
    <HomeLanguage />
    <HomeLanguageID />
    <FirstLanguage />
    <FirstLanguageID />
    <EnglishAdditionalLanguage />
    <EnglishAdditionalLanguageID />
    <NationalIdentity />
    <NationalIdentityID />
    <QuickNote />
    <PhotoID />
    <AdmissionNumber>003762</AdmissionNumber>
    <UPN>P823432109001</UPN>
    <Religion />
    <ReligionID />
    <RegGroup>N</RegGroup>
    <RegGroupID>421</RegGroupID>
    <YearGroup>Year 12</YearGroup>
    <YearGroupID>32</YearGroupID>
    <House>Newton</House>
    <HouseID>44</HouseID>
    <RollMode>Single Registration</RollMode>
    <RollModeID>2</RollModeID>
    <AdmissionDate>2010-01-12T00:00:00</AdmissionDate>
    <DateOfLeaving />
    <ParentalSalutation />
  </Student>
</StudentExtendeds>

c) Deleting the Student [personId - 7660 ] added above in Step 2b) and calling this interface:

TPPersonStudent studInfo = new TPPersonStudent();
string changeddata = studInfo.GetXmlChangedStudents(System.DateTime.Now);

Output:


<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<StudentExtendeds>
  <Student deleted="true">
    <PersonID>7660</PersonID>
  </Student
</StudentExtendeds

 

SIMS 7 RESOURCES

Related resources for SIMS 7