Exemplo n.º 1
0
        public static VoterResidenceAddress BuildAddress(string housenum, string predir, string streetname, string streettype, string postdir,
                                                         string apt, string city, string st, string zip, string country)
        {
            VoterResidenceAddress            ra = new VoterResidenceAddress();
            NumberedThoroughfareAddress_type nt = new NumberedThoroughfareAddress_type();
            CompletePlaceName_type           pn = new CompletePlaceName_type();
            PlaceName_type ptt = new PlaceName_type();

            ptt.PlaceNameType       = PlaceNameType_type.MunicipalJurisdiction;
            ptt.Value               = city;
            pn.PlaceName            = new PlaceName_type[1];
            pn.PlaceName[0]         = ptt;
            nt.CompletePlaceName    = new CompletePlaceName_type[1];
            nt.CompletePlaceName[0] = pn;
            CompleteAddressNumber_type hn = new CompleteAddressNumber_type();

            hn.AddressNumber         = housenum;
            nt.CompleteAddressNumber = hn;
            CompleteStreetName_type sn = new CompleteStreetName_type();
            string fn = predir + " " + streetname + " " + streettype + " " + postdir;

            sn.StreetName         = fn.Trim();
            nt.CompleteStreetName = sn;
            SubaddressElement_type subaddress = new SubaddressElement_type();

            nt.CompleteSubaddress = new SubaddressElement_type[2];
            if (apt != "")
            {
                subaddress.SubaddressIdentifier = " APT " + apt;
            }
            else
            {
                subaddress.SubaddressIdentifier = "";
            }
            nt.CompleteSubaddress[0] = subaddress;
            SubaddressElement_type subaddress1 = new SubaddressElement_type();

            subaddress1.SubaddressIdentifier = city + ", " + st + " " + zip + " " + country;
            nt.CompleteSubaddress[1]         = subaddress1;


            ra.NumberedThoroughfareAddress_type = nt;

            return(ra);
        }
Exemplo n.º 2
0
        public static VoterResidenceAddress voterAddress(Voter voter)
        {
            VoterResidenceAddress va = new VoterResidenceAddress();

            NumberedThoroughfareAddress_type na = new NumberedThoroughfareAddress_type();
            CompletePlaceName_type           pn = new CompletePlaceName_type();
            PlaceName_type ptt = new PlaceName_type();

            ptt.PlaceNameType = PlaceNameType_type.MunicipalJurisdiction;
            ptt.Value         = "RICHMOND CITY";
            pn.PlaceName      = new PlaceName_type[1];
            pn.PlaceName[0]   = ptt;


            CompleteAddressNumber_type hn = new CompleteAddressNumber_type();

            hn.AddressNumber = "1324";

            CompleteStreetName_type sn = new CompleteStreetName_type();

            sn.StreetName = "E Main Street";
            SubaddressElement_type subaddress = new SubaddressElement_type();


            subaddress.SubaddressIdentifier = "Richmond, VA 23222";
            na.CompletePlaceName            = new CompletePlaceName_type[1];
            na.CompletePlaceName[0]         = pn;
            na.CompleteAddressNumber        = hn;
            na.CompleteStreetName           = sn;
            na.CompleteSubaddress           = new SubaddressElement_type[1];
            na.CompleteSubaddress[0]        = subaddress;



            va.NumberedThoroughfareAddress_type = na;


            return(va);
        }