| 
						
						
							
								
							
						
						
					 | 
					@ -64,7 +64,7 @@ public class ProductosServlet extends HttpServlet { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // Verificar el token
 | 
					 | 
					 | 
					            // Verificar el token
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            String token = request.getParameter("token"); | 
					 | 
					 | 
					            String token = request.getParameter("token"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (!"4jLz8mQ1sT2nEw7Vb9XRp6Aa".equals(token)) { | 
					 | 
					 | 
					            if (!"4jLz8mQ1sT2nEw7Vb9XRp6Aa".equals(token)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                out.print("Acceso Denegado"); | 
					 | 
					 | 
					                out.print("<h1> Acceso Denegado ❌ </h1> "); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                | 
					 | 
					 | 
					                | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                return; | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -73,29 +73,54 @@ public class ProductosServlet extends HttpServlet { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            switch (opcion) { | 
					 | 
					 | 
					            switch (opcion) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                case "1": | 
					 | 
					 | 
					                case "1": | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    Producto p = productoBL.buscarPorIdInt(Integer.parseInt(request.getParameter("id"))); | 
					 | 
					 | 
					                    if(productoBL.buscarPorIdInt(Integer.parseInt(request.getParameter("id")))==null){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    if (p.getStatus() == 0) { | 
					 | 
					 | 
					                       out.print("<h1 style=color:red;>No existe ese producto ❌ </h1>");   | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        out.print("No existe ese producto"); | 
					 | 
					 | 
					                    }else{ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    } else { | 
					 | 
					 | 
					                        Producto p = productoBL.buscarPorIdInt(Integer.parseInt(request.getParameter("id"))); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                          out.println("<head>"); | 
					 | 
					 | 
					                        if(p.getStatus() == 0){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            out.println("<h1 style=color:red;>No existe ese producto ❌ </h1>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        }else{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                             out.println("<head>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.println("<!DOCTYPE html>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.println("<html>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                          out.println("<title>"+p.getNombre()+"</title>");             | 
					 | 
					 | 
					                          out.println("<title>"+p.getNombre()+"</title>");             | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                          out.println("</head>"); | 
					 | 
					 | 
					                          out.println("</head>"); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                          out.print("<h1>" + p.getCategoriaidCategoria().getNombre() + "</h1>"); | 
					 | 
					 | 
					                          out.println("<body>"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                          out.print("<h1>" + p.getMarcaidMarca().getNombre() + "</h1>"); | 
					 | 
					 | 
					                          out.print("<h1> PROUCTO 📦 </h1>"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                          out.print("<h1>" + p.getUbicacionidUbicacion().getAnaquel() + "</h1>"); | 
					 | 
					 | 
					                            out.print("<h2>Nombre: "+p.getNombre()+"</h2>"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                          out.print("<h1>" + p.getProovedoridProovedor().getProovedor() + "</h1>"); | 
					 | 
					 | 
					                          out.print("<h2>Categoria: " + p.getCategoriaidCategoria().getNombre()+"</h2>"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                              | 
					 | 
					 | 
					                          out.print("<h2> Marca: " + p.getMarcaidMarca().getNombre() + "</h2>"); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.print("<h2> Ubicación: " + p.getUbicacionidUbicacion().getAnaquel() + "</h2>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.print("<h2> Proveedor: " + p.getProovedoridProovedor().getProovedor() + "</h2>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.print("<h2> Codigo:" +p.getCodigo()+" </h2>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.print("<h2> Descripcion: "+p.getDescripcion()+"</h2>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.print("<h2> Precio: " +p.getPrecio()+"</h2>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                         | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                           | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          out.println("</body>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                           out.println("</html>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                         | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                          | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                     | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                case "2": | 
					 | 
					 | 
					                case "2": | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    Producto pE = productoBL.buscarPorIdInt(Integer.parseInt(request.getParameter("id"))); | 
					 | 
					 | 
					                    if(productoBL.buscarPorIdInt(Integer.parseInt(request.getParameter("id")))==null){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    if (pE.getStatus() == 0) { | 
					 | 
					 | 
					                        out.print("<h1 style=color:red;> No existe ese elemento ❌ </h1>"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        out.print("No existe ese elemento"); | 
					 | 
					 | 
					                    }else{ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                      Producto pE = productoBL.buscarPorIdInt(Integer.parseInt(request.getParameter("id"))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                      if (pE.getStatus() == 0) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        out.print("<h1 style=color:red;> No existe ese elemento ❌ </h1>"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } else { | 
					 | 
					 | 
					                    } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        productoBL.eliminar(pE); | 
					 | 
					 | 
					                        productoBL.eliminar(pE); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        out.print("Eliminado con éxito"); | 
					 | 
					 | 
					                        out.print("<h1 style=color:green;> Eliminado con éxito ✅ </h1> "); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                  | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                     | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                case "3": | 
					 | 
					 | 
					                case "3": | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -106,7 +131,7 @@ public class ProductosServlet extends HttpServlet { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    Proovedor prov = proveedorBL.buscarIdInt(Integer.parseInt(request.getParameter("idProv"))); | 
					 | 
					 | 
					                    Proovedor prov = proveedorBL.buscarIdInt(Integer.parseInt(request.getParameter("idProv"))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (m == null || u == null || c == null || prov == null) { | 
					 | 
					 | 
					                    if (m == null || u == null || c == null || prov == null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        out.print("Ocurrió un error con éxito"); | 
					 | 
					 | 
					                     out.print("<h1 style=color:red;>Ocurrió un error con éxito ❌ </h1>"); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    } else { | 
					 | 
					 | 
					                    } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        nuevo.setMarcaidMarca(m); | 
					 | 
					 | 
					                        nuevo.setMarcaidMarca(m); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        nuevo.setCategoriaidCategoria(c); | 
					 | 
					 | 
					                        nuevo.setCategoriaidCategoria(c); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -118,14 +143,15 @@ public class ProductosServlet extends HttpServlet { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        nuevo.setCantidadTotal(Integer.parseInt(request.getParameter("cant"))); | 
					 | 
					 | 
					                        nuevo.setCantidadTotal(Integer.parseInt(request.getParameter("cant"))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        nuevo.setStatus((short) 1); | 
					 | 
					 | 
					                        nuevo.setStatus((short) 1); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        nuevo.setNombre(request.getParameter("nombre")); | 
					 | 
					 | 
					                        nuevo.setNombre(request.getParameter("nombre")); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                         | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        productoBL.agregar(nuevo); | 
					 | 
					 | 
					                        productoBL.agregar(nuevo); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        out.print("Agregado con éxito"); | 
					 | 
					 | 
					                        out.print("<h1 style=color:green;> Agregado con éxito ✅ </h1>");  | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                default: | 
					 | 
					 | 
					                default: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    out.print("<h1> No existe esa opcion </h1>"); | 
					 | 
					 | 
					                    out.print("<h1 style=color:red;> No existe esa opción ❌ </h1>"); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    break; | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |