/** @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response) */ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { s = HibernateUtils.getSession(); InventaireClient inventaireClient = new InventaireClient(); Client client = new Client(); ArrayList<Client> listC = ServiceClientCortex2i.listObjectToClientCortex2i(s); ArrayList<Object> listInventaireo = ServiceInventaireClient.listeInventaireClient(s, inventaireClient); try { ArrayList<InventaireClient> listInventaire = ServiceInventaireClient.listeInventaireClientToInventaireClient(listInventaireo); request.setAttribute("listI", listInventaire); } catch (Exception e) { // TODO: handle exception } request.setAttribute("listC", listC); System.out.println(listC); request.setAttribute("message", request.getAttribute("message")); request.setAttribute("messageR", request.getAttribute("messageR")); request.setAttribute("invR", request.getAttribute("invR")); request .getServletContext() .getRequestDispatcher("/GestionInventaire.jsp") .forward(request, response); s.close(); }
/** @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response) */ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Session s = HibernateUtils.getSession(); int id; String attr = null; @SuppressWarnings("rawtypes") Enumeration lf = request.getParameterNames(); while (lf.hasMoreElements()) { attr = (String) lf.nextElement(); if (!("idinv").equals(attr)) { id = Integer.parseInt(attr); ImprimantesClient f = new ImprimantesClient(); f.setIdImprimante(id); f = ServiceImprimanteClient.rechercheImprimantesClient(s, f); ServiceImprimanteClient.removeImprimantesClient(s, f); } } request.setAttribute("messageAdd", "Supression faite avec succès..."); request.setAttribute( "inv", Utilitaire.setInventaire(s, Integer.parseInt(request.getParameter("idinv")))); request .getServletContext() .getRequestDispatcher("/modificationInventaire.jsp") .forward(request, response); s.close(); }
/** @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response) */ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Session s = HibernateUtils.getSession(); String message = null; int id = Integer.parseInt(request.getParameter("nomliv")); Livraison liv = new Livraison(); liv.setIdLivraison(id); liv = ServiceLivraison.rechercheLivraison(s, liv); if (liv != null) { message = ServiceLivraison.removeObject(s, liv); } else { message = "Livraison n'existe pas !"; } request.setAttribute("message", message); request .getServletContext() .getRequestDispatcher("/ServletGestionLivraison") .forward(request, response); s.close(); }