Пример #1
0
 // invoked in DrinkDisplayListener;
 public void displayDrinks(int idx) {
   StoreController sctrl = mCtrl.getStoreController();
   DrinksStoreItem item;
   try {
     item = (DrinksStoreItem) sctrl.getStoreItem(Store.DRINK, idx);
     DrinksBrand db = (DrinksBrand) item.getContent();
     mpanel.getDrinksDisplay().displayQty(idx, item.getQuantity());
     mpanel.displayPrice(db.getPrice());
   } catch (VMCSException e) {
     System.out.println("MaintenanceController.displayDrink:" + e);
   }
 }
 public void updateDrinkSelection(int selection) {
   DrinksStore drinksStore =
       (DrinksStore)
           transactionController.getMainCtrl().getStoreController().getStore(Store.DRINK);
   DrinksStoreItem drinksStoreItem = null;
   try {
     drinksStoreItem = (DrinksStoreItem) drinksStore.getStoreItem(selection);
   } catch (Exception e) {
     e.printStackTrace();
   }
   DrinksBrand drinksBrand = (DrinksBrand) drinksStoreItem.getContent();
   int qty = drinksStoreItem.getQuantity();
   int price = drinksBrand.getPrice();
   String name = drinksBrand.getName();
   // transactionController.getCustomerPanel().updateDrinkInput(selection, qty, price, name) ;
 }