Flushed Kit number, Kit count and Buffer value for new kit

This commit is contained in:
mohamedkaif356
2023-08-03 13:12:28 +05:30
parent 8237e753c0
commit 0dd77027e9

View File

@@ -55,6 +55,14 @@ class KitScanActivity : AppCompatActivity() {
if (checkHemoCubeKitData()) {
DataHolder.selectedTest!!.kitSerial =
sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
moveToNext()
} else {
with(sharedPreference.edit()) {
putString(Constants.KIT_NUMBER, "")
putInt(Constants.KIT_COUNT, 0)
putInt(Constants.BUFFER_VALUE, 0)
apply()
}
}
binding.nameEditText.setText("SMI/SC/")
@@ -86,6 +94,7 @@ class KitScanActivity : AppCompatActivity() {
private fun checkHemoCubeKitData(): Boolean {
return sharedPreference.getString(Constants.KIT_NUMBER, "")
?.isNotBlank() == true || sharedPreference.getInt(Constants.KIT_COUNT, 0) > 0
|| sharedPreference.getInt(Constants.KIT_COUNT, 0) < 35
}
private fun isSerialValid(s: String): Boolean {