protected void update_suplier(HttpServletRequest request, HttpServletResponse response) throws IOException { // int idp = Integer.valueOf(request.getParameter("f_id")); String msj = ""; String idp = request.getParameter("f_id"); String ruc = request.getParameter("f_ruc"); String phone = request.getParameter("f_phone"); String address = request.getParameter("f_address"); String state = request.getParameter("f_state"); p.setIdSuplier(idp); p.setRuc(ruc); p.setPhone(phone); p.setAddress(address); p.setState(state); int valor = 0; try { valor = p.updateSuplier(p); // Meto el objeto en la BBDD } catch (SQLException ex) { Logger.getLogger(cSuplier.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(cSuplier.class.getName()).log(Level.SEVERE, null, ex); } if (valor == 1) { msj = "3"; // Correcto } else { msj = "4"; // Error en la eliminacion } response.sendRedirect("suplier.jsp?msj=" + msj); }
protected void register_suplier(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException, ClassNotFoundException { String ruc = request.getParameter("f_ruc"); String phone = request.getParameter("f_phone"); String address = request.getParameter("f_address"); String state = request.getParameter("f_state"); p.setRuc(ruc); p.setPhone(phone); p.setAddress(address); p.setState(state); p.registrationSuplier(p); // Meto el objeto en la BBDD response.sendRedirect("suplier.jsp"); }