/// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="pickupOrDropoff">Specifies if this is a pickup or dropoff address. This property may be needed by a transportation application.</param>
 ///<param name="dayOfWeek">This attribute indicates the days of the week for which the pickup or dropoff address is valid. The attribute if relevant only if the value of the PickupOrDropoff attribute is "Pickup," "Dropoff" or "Both."</param>
 ///<param name="address">This is the actual address.</param>
 ///
 public StudentAddress( string pickupOrDropoff, string dayOfWeek, Address address )
     : base(StudentDTD.STUDENTADDRESS)
 {
     this.PickupOrDropoff = pickupOrDropoff;
     this.DayOfWeek = dayOfWeek;
     this.Address = address;
 }
 /// <summary>Adds a new <c>&lt;Address&gt;</c> child element.</summary>
 /// <param name="val">A Address object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "The address(es) of the student."</para>
 /// <para>Version: 2.5</para>
 /// <para>Since: 1.5r1</para>
 /// </remarks>
 public void AddAddress( Address val )
 {
     AddChild( ReportingDTD.STUDENTLOCATOR_ADDRESS, val );
 }
 /// <summary>
 /// Sets all Address object instances. All existing 
 /// <c>Address</c> instances 
 /// are removed and replaced with this list. Calling this method with the 
 /// parameter value set to null removes all <c>Addresses</c>.
 /// </summary>
 /// <remarks>
 /// <para>Version: 2.5</para>
 /// <para>Since: 1.5r1</para>
 /// </remarks>
 public void SetAddresses( Address[] items)
 {
     SetChildren( ReportingDTD.STUDENTLOCATOR_ADDRESS, items );
 }
 ///<summary>Sets the value of the <c>&lt;AddressList&gt;</c> element.</summary>
 /// <param name="PickupOrDropoff">Specifies if this is a pickup or dropoff address</param>
 /// <param name="DayOfWeek">The days of the week for which the pickup or dropoff address is valid</param>
 /// <param name="Address">The street address</param>
 ///<remarks>
 /// <para>This form of <c>setAddressList</c> is provided as a convenience method
 /// that is functionally equivalent to the <c>AddressList</c></para>
 /// <para>Version: 2.5</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void SetAddressList( PickupOrDropoff PickupOrDropoff, string DayOfWeek, Address Address )
 {
     RemoveChild( StudentDTD.STUDENTPERSONAL_ADDRESSLIST);
     AddChild( StudentDTD.STUDENTPERSONAL_ADDRESSLIST, new StudentAddressList( PickupOrDropoff, DayOfWeek, Address ) );
 }
 ///<summary>Adds the value of the <c>&lt;StudentAddress&gt;</c> element.</summary>
 /// <param name="PickupOrDropoff">Specifies if this is a pickup or dropoff address. This property may be needed by a transportation application.</param>
 /// <param name="DayOfWeek">This attribute indicates the days of the week for which the pickup or dropoff address is valid. The attribute if relevant only if the value of the PickupOrDropoff attribute is "Pickup," "Dropoff" or "Both."</param>
 /// <param name="Address">This is the actual address.</param>
 ///<remarks>
 /// <para>This form of <c>setStudentAddress</c> is provided as a convenience method
 /// that is functionally equivalent to the method <c>AddStudentAddress</c></para>
 /// <para>Version: 2.5</para>
 /// <para>Since: 2.0r1</para>
 /// </remarks>
 public void AddStudentAddress( string PickupOrDropoff, string DayOfWeek, Address Address )
 {
     AddChild( StudentDTD.STUDENTPERSONAL_STUDENTADDRESS, new StudentAddress( PickupOrDropoff, DayOfWeek, Address ) );
 }
 /// <summary>
 /// Adds a StudentAddressList instance for interoperating with multiple addresses in SIF Version 1.x
 /// </summary>
 /// <remarks>
 /// <para>In SIF 2.0, the StudentAddressList object is not a repeatable element. Use this method of adding
 ///  student address only if you are creating an object for use in SIF 1.x
 /// </para>
 /// <para>In SIF 2.0, or if you are only dealing with a single Student address, you can add the address 
 /// to the StudentPersonal object by calling the <see cref="StudentAddressList#Add"/> method
 /// </remarks>
 /// <param name="pickupOrDropoff">Specifies if this is a pickup or dropoff address</param>
 /// <param name="dayOfWeek"> The days of the week for which the pickup or dropoff address is valid</param>
 /// <param name="address">The street address</param>
 public void AddAddressList( PickupOrDropoff pickupOrDropoff, String dayOfWeek, Address address )
 {
     AddChild( StudentDTD.STUDENTPERSONAL_ADDRESSLIST, new StudentAddressList( pickupOrDropoff, dayOfWeek, address ) );
 }
        private static StudentPersonal CreateStudent(
          String id,
          String lastName,
            String firstName,
            String street,
            String city,
            StatePrCode state,
            CountryCode country,
            String post,
            String phone,
            Gender gender,
            GradeLevelCode grade,
            RaceType race,
            String birthDateyyyyMMdd)
        {
            StudentPersonal student = new StudentPersonal();
             ;
             student.RefId = Adk.MakeGuid();
             student.LocalId = id;

             // Set the Name
             Name name = new Name(NameType.LEGAL, firstName, lastName);
             student.Name = name;

             Address addr = new Address();
             addr.SetType(AddressType.C0369_PERMANENT);
             addr.SetStreet(street);
             addr.City = city;
             addr.SetStateProvince(state);
             addr.PostalCode = post;
             addr.SetCountry(country);

             student.AddressList = new StudentAddressList(PickupOrDropoff.NA, "NA", addr);
             student.PhoneNumberList =
             new PhoneNumberList(new PhoneNumber(PhoneNumberType.PRIMARY, phone));

             Demographics dem = new Demographics();
             dem.RaceList = new RaceList(new Race("", race));
             dem.SetGender(gender);
             dem.BirthDate =
             DateTime.ParseExact
                 (birthDateyyyyMMdd, "yyyyMMdd", CultureInfo.InvariantCulture.DateTimeFormat);

             student.Demographics = dem;

             return student;
        }
 private void assertCountry( Address address, String expectedCountryCode )
 {
     Assertion.AssertNotNull( "Address is null", address );
     Assertion.AssertEquals( "Country Code", expectedCountryCode, address.Country );
 }