public void verificarRastro() { RequestContext context = RequestContext.getCurrentInstance(); System.out.println("lol"); if (!listEmpresa.isEmpty()) { if (secRegistro != null) { System.out.println("lol 2"); int resultado = administrarRastros.obtenerTabla( secRegistro, "CENTROSCOSTOS"); // En ENCARGATURAS lo cambia por el nombre de su tabla System.out.println("resultado: " + resultado); if (resultado == 1) { context.execute("errorObjetosDB.show()"); } else if (resultado == 2) { context.execute("confirmarRastro.show()"); } else if (resultado == 3) { context.execute("errorRegistroRastro.show()"); } else if (resultado == 4) { context.execute("errorTablaConRastro.show()"); } else if (resultado == 5) { context.execute("errorTablaSinRastro.show()"); } } else { context.execute("seleccionarRegistro.show()"); } } else { if (administrarRastros.verificarHistoricosTabla("CENTROSCOSTOS")) { // igual acá context.execute("confirmarRastroHistorico.show()"); } else { context.execute("errorRastroHistorico.show()"); } } index = -1; }
@PostConstruct public void inicializarAdministrador() { try { FacesContext x = FacesContext.getCurrentInstance(); HttpSession ses = (HttpSession) x.getExternalContext().getSession(false); administrarEmpresas.obtenerConexion(ses.getId()); administrarRastros.obtenerConexion(ses.getId()); } catch (Exception e) { System.out.println("Error postconstruct " + this.getClass().getName() + ": " + e); System.out.println("Causa: " + e.getCause()); } }