private SifDataObject createPerson(string id,
                                       string lastName,
                                       string firstName,
                                       string number,
                                       string street,
                                       string locality,
                                       string town,
                                       string post,
                                       string phone,
                                       string gender,
                                       string grade,
                                       EthnicityCodes ethnicity,
                                       string birthDateyyyyMMdd)

    {
        SifDataObject person = createPersonObject(id);

        person.SetElementOrAttribute("@RefId", Adk.MakeGuid());

        Name name = new Name(NameType.CURRENT_LEGAL, firstName, lastName);
        PersonalInformation personal = new PersonalInformation(name);

        person.AddChild(CommonDTD.PERSONALINFORMATION, personal);

        AddressableObjectName aon = new AddressableObjectName();

        aon.StartNumber = number;
        Address address = new Address(AddressType.CURRENT, aon);

        address.Street   = street;
        address.Locality = locality;
        address.Town     = town;
        address.PostCode = post;
        address.SetCountry(CountryCode.GBR);
        personal.Address = address;

        personal.PhoneNumber = new PhoneNumber(PhoneType.HOME, phone);

        Demographics dem = new Demographics();

        dem.SetEthnicityList(new Ethnicity(ethnicity));
        dem.SetGender(Gender.Wrap(gender));
        try
        {
            dem.BirthDate = SifDate.ParseSifDateString(birthDateyyyyMMdd, SifVersion.SIF15r1);
        }
        catch (Exception pex)
        {
            Console.WriteLine(pex);
        }

        personal.Demographics = dem;

        return(person);
    }
Example #2
0
        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);
        }