Examples of YFJob


Examples of com.supinfo.youfood.enumeration.YFJob

                req.setAttribute("restaurantError", "Une erreur est survenue lors de la récupération du restaurant.");
                isOk = false;
            }
        }

        YFJob job = null;
        if (req.getParameter("group") != null && !req.getParameter("group").isEmpty()) {
            try {
                job = YFJob.valueOf(req.getParameter("group"));

                if (job.equals(YFJob.ADMINISTRATOR) && restaurant == null) {
                    ArrayList<YFEmployee> administrators = (ArrayList<YFEmployee>) employeeService.getEmployees(YFJob.ADMINISTRATOR);
                    if (administrators != null && administrators.size() == 1) {
                        if (employee.getId() != null && employee.getId().equals(administrators.get(0).getId())
                                && !job.equals(YFJob.ADMINISTRATOR) || employee.getRestaurant() != null) {
                            isOk = false;
                            req.setAttribute("groupError", "Il doit rester au moins un superadministrateur. Donc ne lui assignez pas un restaurant.");
                        }
                    } else if (!job.equals(YFJob.ADMINISTRATOR) && restaurant == null) {
                        req.setAttribute("groupError", "Impossible de définir un autre groupe qu'administrateur à quelqu'un de non assigné à un restaurant");
                        isOk = false;
                    }
                }
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.