feat: added editing cards feature

This commit is contained in:
2026-06-10 11:50:09 +03:00
parent ab4dffd877
commit a5e25d3c19
8 changed files with 93 additions and 15 deletions
@@ -33,6 +33,20 @@ class DbHelper(val context: Context, val factory: SQLiteDatabase.CursorFactory?)
db.close()
}
fun editCard(id: Int, name: String, codeValue: String, codeType: BarcodeFormat) {
val values = ContentValues()
values.put("name", name)
values.put("codeValue", codeValue)
values.put("codeType", codeType.name)
val db = this.writableDatabase
db.update("cards", values, "id = ?", arrayOf(id.toString()))
db.close()
}
fun getCards(): List<CardInfo> {
val db = this.readableDatabase