Add debug code

This commit is contained in:
jacques 2020-05-03 20:32:23 +02:00
parent 6f06c4986e
commit 911dfb5a99

View file

@ -262,7 +262,7 @@ class DBHelper extends SQLiteOpenHelper {
*/
public void updateDrug(Medicament medicament) {
Log.d(TAG, "Update Drug == " + medicament.toString());
Log.d(TAG, "Update Drug == " + medicament);
// Get reference to writable DB
SQLiteDatabase db = this.getWritableDatabase();
@ -276,6 +276,7 @@ class DBHelper extends SQLiteOpenHelper {
values.put(KEY_PRES, medicament.getPresentation());
values.put(KEY_STOCK, medicament.getStock());
Log.d(TAG, "values are " +values.toString());
// Update row
int i = db.update(TABLE_DRUG, // table
values, // column/value
@ -286,6 +287,11 @@ class DBHelper extends SQLiteOpenHelper {
// Close DB
db.close();
// DEBUG
Medicament toto = getDrug(medicament.getId());
Log.d(TAG, "toto stock== " + toto.getStock());
}
/**
@ -305,7 +311,7 @@ class DBHelper extends SQLiteOpenHelper {
db.close();
// log
Log.d(TAG, "delete drug "+medicament.toString());
Log.d(TAG, "delete drug "+medicament);
}
/**