Add isMedicament exist

This commit is contained in:
jacques 2020-06-24 06:33:56 +02:00
parent f7e3e86482
commit 0ed0386707

View file

@ -6,6 +6,7 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import android.widget.Toast;
import java.util.LinkedList;
import java.util.List;
@ -325,5 +326,21 @@ class DBHelper extends SQLiteOpenHelper {
mCount.close();
return count;
}
boolean isMedicamentExist(String cip13) {
boolean value = false;
try {
Cursor c = this.getReadableDatabase().rawQuery("SELECT * FROM "+ TABLE_DRUG + " where cip13 = "+cip13, null);
if(c.getCount()>0)
{
value = true;
}
c.close();
} catch(Exception e)
{
e.printStackTrace();
}
return value;
}
}