mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Add isMedicament exist
This commit is contained in:
parent
f7e3e86482
commit
0ed0386707
1 changed files with 17 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue