| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 
 | }else if (action.equals("confirmation")) {		
 
			    System.out.println("confirmation");					
			    String param = request.getParameter("produit_id");
                System.out.println("param = "+param);
                if(param != null) {
                System.out.println("param non null");
                try {
                	Integer id = Integer.parseInt(param);
                	System.out.println("conversion ID success");
                	String hql = "select p.quantite_stock from Produit p where p.id=:id"; 
                	Query query = sessionDb.createQuery(hql);
 
                   	System.out.println("execution query success");
                	query.setParameter("id", id);
 
                	Integer produit = (Integer) query.uniqueResult();
 
    				request.setAttribute("produit", produit);
                	System.out.println(query);
                	} catch (NumberFormatException e) {
			                         System.out.println("echec ... ");
			                         e.printStackTrace();
                										}
                	}
 
 
 
 
			Integer id_commandeF = null;
			try {
				id_commandeF = Integer.parseInt(request.getParameter("id"));
			} catch (NumberFormatException e) {
 
			}
 
			if (id_commandeF != null) {
				CommandeFournisseur commandeFournisseur = (CommandeFournisseur) sessionDb.load(CommandeFournisseur.class, id_commandeF);
				request.setAttribute("commandeFournisseur", commandeFournisseur);
				            			}
			Query q1 = sessionDb.createQuery("UPDATE Produit SET quantite_stock=:quantite_livree where id=:id");
			q1.setParameter("quantite_livree", 1);
			q1.setParameter("id", 101);
			int result=q1.executeUpdate();
 
					gotoPage("/jsp/commandeFournisseur/index.jsp", request, response);
 
		} | 
Partager