Exemple #1
0
 public void removeFav(View view) {
   View inFav = findViewById(R.id.buttonAddFav);
   View notinFav = findViewById(R.id.ButtonRemoveFav);
   inFav.setVisibility(View.VISIBLE);
   notinFav.setVisibility(View.GONE);
   WineDAO db;
   db = new WineDAO(this);
   db.open();
   Cursor c = db.getWine(rowId);
   db.updateWine(
       rowId, c.getString(1), c.getString(2), c.getString(3), c.getString(4), 0, c.getInt(6));
   Toast.makeText(this, "Removed from Favorites!", Toast.LENGTH_LONG).show();
   db.close();
 }
Exemple #2
0
 public void addtoWish(View view) {
   View inWish = findViewById(R.id.buttonAddWish);
   View notinWish = findViewById(R.id.ButtonRemoveWish);
   inWish.setVisibility(View.GONE);
   notinWish.setVisibility(View.VISIBLE);
   WineDAO db;
   db = new WineDAO(this);
   db.open();
   Cursor c = db.getWine(rowId);
   db.updateWine(
       rowId, c.getString(1), c.getString(2), c.getString(3), c.getString(4), c.getInt(5), 1);
   Toast.makeText(this, "Added to Wishlist!", Toast.LENGTH_LONG).show();
   db.close();
 }