// Save the property information which related to the geoddata to the database public static string InsertPropertyToGeodata(Property prop, GeoData data) { using (SQLiteConnection db = new SQLiteConnection(App.DatabaseLocation)) { CreateTables(db); int rows = db.Insert(prop); data.InsertProperty(prop); db.UpdateWithChildren(data); return(rows > 0 ? "Success" : "Fail"); } }
// Insert New Geodata into Geodata Table public static string InsertNewGeodataToDB(List <Coordinate> coorList, GeoData data) { using (SQLiteConnection db = new SQLiteConnection(App.DatabaseLocation)) { CreateTables(db); coorList.ForEach((Coordinate coor) => db.Insert(coor)); int rows = db.Insert(data); data.InsertCoordinate(coorList); db.UpdateWithChildren(data); return(rows > 0 ? "Success" : "Fail"); } }