Пример #1
0
  @Override
  public boolean removeFromStore(Store store, int amount) {

    Integer newQuant = store.getQuantity() - amount;
    store.setQuantity(newQuant);
    return menu.getStoreDao().update(store);
  }
Пример #2
0
  @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;
  }
Пример #3
0
 @Override
 public List getNotebooksFromStore() {
   return menu.getStoreDao().getNotebooksFromStore();
 }
Пример #4
0
 @Override
 public List getNotebooksByCpuVendor(Vendor cpuVendor) {
   return menu.getStoreDao().getNotebooksByCpuVendor(cpuVendor);
 }
Пример #5
0
 @Override
 public List getNotebooksGtAmount(int amount) {
   return menu.getStoreDao().getNotebooksGtAmount(amount);
 }
Пример #6
0
 @Override
 public List getNotebooksByPortion(int size) {
   return menu.getStoreDao().getNotebooksByPortion(size);
 }
Пример #7
0
 public NotebookServiceImpl() {
   salesDao = menu.getSalesDao();
   storeDao = menu.getStoreDao();
 }
Пример #8
0
 @Override
 public Map getNotebooksStorePresent() {
   return menu.getStoreDao().getNotebooksStorePresent();
 }