public NameAddressCreator(string pathToDataFiles) { DataPath = pathToDataFiles; //DataPath = HostingEnvironment.MapPath(DataPath); Boys = File.ReadAllLines(Path.Combine(DataPath, "boys1000.csv")).ToList(); Girls = File.ReadAllLines(Path.Combine(DataPath, "girls1000.csv")).ToList(); Families = File.ReadAllLines(Path.Combine(DataPath, "family1000.csv")).ToList(); Streets = File.ReadAllLines(Path.Combine(DataPath, "streetnames.csv")).ToList(); Companies = File.ReadAllLines(Path.Combine(DataPath, "companies.csv")).ToList(); Letters = new List <string>() { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; StreetTypes = new List <string>() { "St", "Street", "Ave", "Avenue", "Pl", "Place", "Pkwy", "Parkway", "Ln", "Lane", "Dr", "Drive", "Way", "Circle", "Hill" }; Address2Types = new List <string>() { "Ste", "Suite", "Bldg", "Building", "Box", "Route", "Ext" }; Headings = new List <string>() { "N", "S", "E", "W", "North", "South", "East", "West" }; List <string> lines = File.ReadAllLines(Path.Combine(DataPath, "citystatezipcounty.csv")).ToList(); Cities = new List <CityStateZipCounty>(); char[] seperators = new char[] { ',' }; foreach (var line in lines) { string[] items = line.Split(seperators).ToArray(); CityStateZipCounty location = new CityStateZipCounty() { Zip = Convert.ToInt32(items[0]).ToString("00000"), City = ToTitleCase(items[1]), State = items[2], County = ToTitleCase(items[3]) }; Cities.Add(location); } Rnd = new Random(DateTime.Now.Second * DateTime.Now.Minute * DateTime.Now.Millisecond); }
public PersonalNameAddress RandomPersonalAddress() { CityStateZipCounty loc = RandomLocation(); PersonalNameAddress address = new PersonalNameAddress() { FirstName = RandomFirstName(), LastName = RandomLastName(), Address1 = RandomAddress1(), Address2 = RandomAddress2(), City = loc.City, State = loc.State, Zip = loc.Zip, County = loc.County, Phone = RandomPhone(), }; address.FullName = address.FirstName + " " + address.LastName; address.Email = RandomEmail(address.FirstName, address.LastName); return(address); }