public void addProduct(Product product) { if (!permissions.editProduct()) { throw new PermissionsException("Error:" + userName.getUsername() + " has no permissions to edit products in store " + store.getStoreName()); } store.addProduct(product); DBProduct.getInstance().addProduct(product); }
public void closeStore(Store store) { List <StoreRole> roles = store.getRoles(); foreach (StoreRole role in roles) { //SubscribedUser sub = role.getUser(); //sub.removeStoreRole(role); } dbStore.removeStore(store); DBProduct.getInstance().removeAllProductsFromStore(store); }