@Override public boolean removeFromStore(Store store, int amount) { Integer newQuant = store.getQuantity() - amount; store.setQuantity(newQuant); return menu.getStoreDao().update(store); }
@Override public Long sale(Long storeId, int amount) { Store store = menu.getStoreDao().read(storeId); Integer curAmount = store.getQuantity(); Integer newAmount = curAmount - amount; store.setQuantity(newAmount); Sales nwSale = new Sales(store, new java.util.Date(), amount); Long id = salesDao.create(nwSale); return id; }
@Override public List getNotebooksFromStore() { return menu.getStoreDao().getNotebooksFromStore(); }
@Override public List getNotebooksByCpuVendor(Vendor cpuVendor) { return menu.getStoreDao().getNotebooksByCpuVendor(cpuVendor); }
@Override public List getNotebooksGtAmount(int amount) { return menu.getStoreDao().getNotebooksGtAmount(amount); }
@Override public List getNotebooksByPortion(int size) { return menu.getStoreDao().getNotebooksByPortion(size); }
public NotebookServiceImpl() { salesDao = menu.getSalesDao(); storeDao = menu.getStoreDao(); }
@Override public Map getNotebooksStorePresent() { return menu.getStoreDao().getNotebooksStorePresent(); }