Let insertLoyaltyCard return the new ID

Card IDs for new cards will soon need to be known once they
are created. This change updates this call to return the
new id.
This commit is contained in:
Branden Archer
2017-11-24 21:39:30 -05:00
parent 0207e12aed
commit 94accc951d
3 changed files with 12 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ public class DBHelper extends SQLiteOpenHelper
}
}
public boolean insertLoyaltyCard(final String store, final String note, final String cardId,
public long insertLoyaltyCard(final String store, final String note, final String cardId,
final String barcodeType)
{
SQLiteDatabase db = getWritableDatabase();
@@ -61,7 +61,7 @@ public class DBHelper extends SQLiteOpenHelper
contentValues.put(LoyaltyCardDbIds.CARD_ID, cardId);
contentValues.put(LoyaltyCardDbIds.BARCODE_TYPE, barcodeType);
final long newId = db.insert(LoyaltyCardDbIds.TABLE, null, contentValues);
return (newId != -1);
return newId;
}
public boolean insertLoyaltyCard(final SQLiteDatabase db, final int id,