Skip to content

Commit 9c8391a

Browse files
author
Jana Hoch
committed
Updated RecordRepo to handle notes
1 parent 584af9b commit 9c8391a

File tree

1 file changed

+3
-0
lines changed
  • app/src/main/java/com/blogspot/e_kanivets/moneytracker/repo/data

1 file changed

+3
-0
lines changed

app/src/main/java/com/blogspot/e_kanivets/moneytracker/repo/data/RecordRepo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ protected ContentValues contentValues(@Nullable Record record) {
4444
contentValues.put(DbHelper.TYPE_COLUMN, record.getType());
4545
contentValues.put(DbHelper.TITLE_COLUMN, record.getTitle());
4646
contentValues.put(DbHelper.CATEGORY_ID_COLUMN, record.getCategory().getId());
47+
contentValues.put(DbHelper.NOTES_COLUMN, record.getNotes());
4748
contentValues.put(DbHelper.PRICE_COLUMN, record.getPrice());
4849
contentValues.put(DbHelper.ACCOUNT_ID_COLUMN, record.getAccount().getId());
4950
contentValues.put(DbHelper.CURRENCY_COLUMN, record.getCurrency());
@@ -64,6 +65,7 @@ protected List<Record> getListFromCursor(Cursor cursor) {
6465
int typeColIndex = cursor.getColumnIndex(DbHelper.TYPE_COLUMN);
6566
int titleColIndex = cursor.getColumnIndex(DbHelper.TITLE_COLUMN);
6667
int categoryColIndex = cursor.getColumnIndex(DbHelper.CATEGORY_ID_COLUMN);
68+
int notesColIndex = cursor.getColumnIndex(DbHelper.NOTES_COLUMN);
6769
int priceColIndex = cursor.getColumnIndex(DbHelper.PRICE_COLUMN);
6870
int accountIdColIndex = cursor.getColumnIndex(DbHelper.ACCOUNT_ID_COLUMN);
6971
int currencyColIndex = cursor.getColumnIndex(DbHelper.CURRENCY_COLUMN);
@@ -75,6 +77,7 @@ protected List<Record> getListFromCursor(Cursor cursor) {
7577
cursor.getInt(typeColIndex),
7678
cursor.getString(titleColIndex),
7779
cursor.getLong(categoryColIndex),
80+
cursor.getString(notesColIndex),
7881
cursor.getLong(priceColIndex),
7982
cursor.getLong(accountIdColIndex),
8083
cursor.getString(currencyColIndex),

0 commit comments

Comments
 (0)