public void insertTravel(Travel travel) { SQLiteDatabase db = getReadableDatabase(); ContentValues values = new ContentValues(); values.put(TravelsConstants.CITY, travel.getCity()); values.put(TravelsConstants.COUNTRY, travel.getCountry()); values.put(TravelsConstants.YEAR, travel.getYear()); values.put(TravelsConstants.NOTE, travel.getNote()); values.put(TravelsConstants.IMAGE_VIAJE, travel.getImage()); db.insert(TABLE_NAME, null, values); }
public void updateTravel(Travel travel) { SQLiteDatabase db = getReadableDatabase(); ContentValues values = new ContentValues(); values.put(TravelsConstants.CITY, travel.getCity()); values.put(TravelsConstants.COUNTRY, travel.getCountry()); values.put(TravelsConstants.YEAR, travel.getYear()); values.put(TravelsConstants.NOTE, travel.getNote()); values.put(TravelsConstants.IMAGE_VIAJE, travel.getImage()); db.update(TABLE_NAME, values, TravelsConstants._ID + "=" + travel.getIdTravel(), null); }