public static String AddLocation(string[] fields) { String ret = String.Empty; try { String name = fields[0]; String description = fields[1]; String cat = fields[2]; Double lat = Convert.ToDouble(fields[3]); Double lon = Convert.ToDouble(fields[4]); nearme_PR.Classes.Location loc = new Classes.Location() { Name = name, Description = description, Type = cat, Latitude = lat, Longitude = lon }; nearme_PR.Classes.LocationDataset ds = new Classes.LocationDataset(); ds.LoadLocations(); ds.AddLocation(loc); } catch (Exception ex) { ret = ex.Message; } return ret; }
public void AddLocation(Location loc) { locations.Add(loc); SaveLocations(); }