public long AddStation(Station station) { var values = new ContentValues (); values.Put ("ID", station.ID); values.Put ("locationX", station.LocationX); values.Put ("locationY", station.LocationY); values.Put ("name", station.Name); values.Put ("standardName", station.StandardName); return stationHelp.WritableDatabase.Insert ("Station", null, values); }
void SaveStations(string resultString) { var dbStation = new StationCommands (this); var result = JsonValue.Parse (resultString); var stationArray = result ["station"]; var allStations = JsonArray.Parse (stationArray.ToString ()); foreach (var _station in allStations) { var stationString = JsonValue.Parse (_station.ToString ()); var id = stationString ["id"]; var locationX = stationString ["locationX"]; var locationY = stationString ["locationY"]; var name = stationString ["name"]; var standardName = stationString ["standardname"]; Station station = new Station (id, locationX, locationY, name, standardName); dbStation.AddStation (station); } dbStation.Close (); }
private Station NewStation(Android.Database.ICursor cursor) { var id = cursor.GetString (1); var locationX = cursor.GetString (2); var locationY = cursor.GetString (3); var name = cursor.GetString (4); var standardName = cursor.GetString (5); Station station = new Station (id, locationX, locationY, name, standardName); return station; }