public void addLocation(Location venue, City toCity) { //look up the City database and add the location to the city /* if (venue is School) { toCity.schools.Add((School)venue); ((School)venue).city = toCity; } else if (venue is Hospital) { toCity.hospitals.Add((Hospital)venue); ((Hospital)venue).city = toCity; } else { toCity.venues.Add(venue); } * */ }
public List<Models.Location> parseLocations() { CsvReader csv = new CsvReader(reader, true); int fieldCount = csv.FieldCount; List<Location> exList = new List<Location>(); Location exObj = null; String[] headers = csv.GetFieldHeaders(); while (csv.ReadNextRecord()) { double lat = 0, lng = 0; string theName = null; for (int i = 0; i < fieldCount; i++) { // this is where you actually create your dB object if (headers[i].Equals("longitude")) { lng = Convert.ToDouble(csv[i]); } else if (headers[i].Equals("latitute")) { lat = Convert.ToDouble(csv[i]); } else if (headers[i].Equals("name")) { theName = csv[i]; } exObj = new Location(lat, lng, theName); } exList.Add(exObj); } return exList; //throw new NotImplementedException(); }
public City deleteLocation(Location venue, City fromCity) { return null; }