mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-10 07:51:20 +01:00
disabled demo mode;
Use DBHelper to updateDrug after currentStock updateed
This commit is contained in:
parent
58d709152e
commit
f90c0df17b
1 changed files with 5 additions and 3 deletions
|
@ -62,8 +62,8 @@ public class MedicamentListActivity extends AppCompatActivity {
|
||||||
|
|
||||||
// TODO: Change DEMO/DBDEMO form statci to non-static. In order to create fake data at only at launchtime
|
// TODO: Change DEMO/DBDEMO form statci to non-static. In order to create fake data at only at launchtime
|
||||||
private boolean mTwoPane;
|
private boolean mTwoPane;
|
||||||
final static Boolean DEMO = true;
|
final Boolean DEMO = false;
|
||||||
final static Boolean DBDEMO = true;
|
final Boolean DBDEMO = false;
|
||||||
final static Random random = new Random();
|
final static Random random = new Random();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -232,12 +232,14 @@ public class MedicamentListActivity extends AppCompatActivity {
|
||||||
public void newStockCalculation() {
|
public void newStockCalculation() {
|
||||||
|
|
||||||
Medicament currentMedicament;
|
Medicament currentMedicament;
|
||||||
|
DBHelper dbHelper = new DBHelper();
|
||||||
|
|
||||||
for (int position = 0 ; position < this. getCount() ; position++ ) {
|
for (int position = 0 ; position < this. getCount() ; position++ ) {
|
||||||
currentMedicament = this.getItem(position);
|
currentMedicament = this.getItem(position);
|
||||||
currentMedicament.newStock(currentMedicament.getStock());
|
currentMedicament.newStock(currentMedicament.getStock());
|
||||||
|
dbHelper.updateDrug(currentMedicament);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Must record new stock in DB
|
|
||||||
// TODO: si un des médicaments est en rouge, on déclanche une notification visuelle pour dans 5 secondes
|
// TODO: si un des médicaments est en rouge, on déclanche une notification visuelle pour dans 5 secondes
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
Loading…
Reference in a new issue