Examples of FidelityOffer


Examples of org.jayasoft.woj.portal.model.FidelityOffer

        if (u instanceof UserImpl) {
            try {
                UserImpl user = (UserImpl)u;
                UserPointDao upDao = DaoFactory.getUserPointDao();
                FidelityOfferDao foDao = DaoFactory.getFidelityOfferDao();
                FidelityOffer fo = (FidelityOffer)foDao.find(giftId);
                if (fo != null) {
                    UserPoint oldUP = getUserPoint(user);
                    if (oldUP.getPoints() < fo.getNeededPoints()) {
                        throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.fidelity.offers.not.enough.points", null));
                    }
                    UserPoint up = UserPointFactory.orderGift(u, oldUP, fo);
                    upDao.save(up);
                    ServiceFactory.getRegistrationService().sendOrderGiftMail(user, Messages.DEFAULT.getString(fo.getKey()), fo.getNeededPoints(), up.getPoints());
                    LOGGER.info("removing " + fo.getNeededPoints() + " from user: " + user.getId() + ", he ordered: " + fo.getKey());
                } else {
                    LOGGER.warn("gift " + giftId + " not found on db");
                }
            } catch (DaoException e) {
                LOGGER.warn("cannot order gift " + giftId + " for user: " + u.getId(), e);
View Full Code Here

Examples of org.jayasoft.woj.portal.model.FidelityOffer

            }
        );
    }

    public WOJObject newHandledObject() {
        return new FidelityOffer();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.