/** * Updates an existing currency * * @author Coni * @param currency */ public void update(Currency currency) throws BusinessException { logger.debug("update - START"); try { currencyDao.update(currency); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_UPDATE, e); } logger.debug("update - END"); }
/** * Gets all an organization available currencies * * @author Coni * @param organizationId * @return * @throws BusinessException */ public List<Currency> getByOrganizationId(int organizationId) throws BusinessException { logger.debug("getByOrganizationId - START"); List<Currency> currencies = null; try { currencies = currencyDao.getByOrganizationId(organizationId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_GET_BY_ORGANIZATION_ID, e); } logger.debug("getByOrganizationId - END"); return currencies; }
/** * Get's a currency identified by it's initials and organisation * * @param initials * @param organisationId * @return the currency * @throws BusinessException */ public Currency getByInitials(String initials, Integer organisationId) throws BusinessException { logger.debug("getByInitials - START"); Currency currency = null; try { currency = currencyDao.getByInitials(initials, organisationId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_GET_BY_INITIALS, e); } logger.debug("getByInitials - END"); return currency; }
/** * Get's a currency identified by it's name and organisation * * @param name * @param organisationId * @return the currency * @throws BusinessException */ public Currency getByName(String name, Integer organisationId) throws BusinessException { logger.debug("getByName - START"); Currency currency = null; try { currency = currencyDao.getByName(name, organisationId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_GET_BY_NAME, e); } logger.debug("getByName - END"); return currency; }
/** * Gets the currency identified by the specified currencyId * * @author Coni * @param currencyId * @return * @throws BusinessException */ public Currency getAll(int currencyId) throws BusinessException { logger.debug("getAll - START"); Currency currency = null; try { currency = currencyDao.getAll(currencyId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_GET_ALL, e); } logger.debug("getAll - END"); return currency; }
/** * Adds a new currency * * @author Coni * @param currency */ public Currency add(Currency currency) throws BusinessException { logger.debug("add - START"); try { Integer currencyId = currencyDao.add(currency); currency.setCurrencyId(currencyId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_ADD, e); } logger.debug("add - END"); return currency; }
/** * Deletes a currency * * @author Coni * @param currencyId * @return * @throws BusinessException */ public Currency delete(int currencyId) throws BusinessException { logger.debug("delete - START"); Currency currency = null; try { currency = currencyDao.delete(currencyId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_DELETE, e); } logger.debug("delete - END"); return currency; }
/** * Searches for currencies using the criterion defined in searchCurrencyBean * * @author Coni * @param searchCurrencyBean * @param isDeleteAction * @return * @throws BusinessException */ public List<Currency> getResultsForSearch( SearchCurrencyBean searchCurrencyBean, boolean isDeleteAction) throws BusinessException { logger.debug("getResultsForSearch - START"); List<Currency> result = null; try { result = currencyDao.getCurrencyBeanFromSearch(searchCurrencyBean, isDeleteAction); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_GET_FROM_SEARCH, e); } logger.debug("getResultsForSearch - END"); return result; }
/** * Get's a currency identified by it's name or initials in the organisation * * @param name * @param initials * @param organisationId * @return the currency list * @throws BusinessException */ public List<Currency> getByNameOrInitials(String name, String initials, Integer organisationId) throws BusinessException { logger.debug("getByNameOrInitials - START"); List<Currency> currencyList = null; try { currencyList = currencyDao.getByNameOrInitials(name, initials, organisationId); } catch (Exception e) { throw new BusinessException(ICodeException.CURRENCY_GET_BY_NAME_OR_INITIALS, e); } logger.debug("getByNameOrInitials - END"); return currencyList; }