예제 #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();
 }