Examples of YFTheme


Examples of com.supinfo.youfood.entity.YFTheme

    @Override
    public void addTheme(YFTheme theme) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();

        if (theme.getActive()) {
            YFTheme currentTheme = this.getCurrentTheme();
            if (currentTheme != null) {
                currentTheme.setActive(false);
                hem.merge(currentTheme);
            }
        }

        hem.persist(theme);
View Full Code Here

Examples of com.supinfo.youfood.entity.YFTheme

    @Override
    public void switchActivation(Long themeId) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        try {
            YFTheme theme = hem.find(YFTheme.class, themeId);
            if (theme.getActive()) {
                theme.setActive(false);
                hem.merge(theme);
            } else {
                YFTheme currentTheme = this.getCurrentTheme();
                if (currentTheme != null) {
                    currentTheme.setActive(false);
                    hem.merge(currentTheme);
                }

                theme.setActive(true);
                hem.merge(theme);
View Full Code Here

Examples of com.supinfo.youfood.entity.YFTheme

    @Override
    public YFTheme get(Long themeId) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();

        YFTheme theme = hem.find(YFTheme.class, themeId);

        return theme;
    }
View Full Code Here

Examples of com.supinfo.youfood.entity.YFTheme

    }

    @Override
    public void update(Long themeId, String name, String description, Boolean isActive) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        YFTheme theme = hem.find(YFTheme.class, themeId);

        if (theme != null) {
            theme.setName(name);
            theme.setDescription(description);
            theme.setActive(isActive);

            hem.merge(theme);
        }
    }
View Full Code Here

Examples of com.supinfo.youfood.entity.YFTheme

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getSession().setAttribute("locked", true);
       
        YFTheme currentTheme = themeService.getCurrentTheme();
       
        ArrayList<YFOrder> orders = (ArrayList<YFOrder>) req.getSession().getAttribute("orders");
        Float amount = 0F;
        for(YFOrder order : orders) {
            if (null != order.getMenu()) {
View Full Code Here

Examples of com.supinfo.youfood.entity.YFTheme

        } else {
            isCurrent = false;
        }
       
        if(isOk) {
            YFTheme theme = new YFTheme();
            theme.setName(name);
            theme.setActive(!isCurrent);
            if(description != null) {
                theme.setDescription(description);
            }
           
            this.themeService.addTheme(theme);
            req.getRequestDispatcher("/administrator/theme/list").forward(req, resp);
        } else {
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.