commit 3d9c3d1c62995cba45436f51415d1212da770717 Author: IVAN ALEJANDRO PADILLA CORDOVA Date: Fri May 10 08:40:56 2024 -0600 principal diff --git a/Inventario-war/build.xml b/Inventario-war/build.xml new file mode 100644 index 0000000..e559f9f --- /dev/null +++ b/Inventario-war/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project Inventario-war. + + + diff --git a/Inventario-war/libs/primefaces-12.0.0.jar b/Inventario-war/libs/primefaces-12.0.0.jar new file mode 100644 index 0000000..88dab24 Binary files /dev/null and b/Inventario-war/libs/primefaces-12.0.0.jar differ diff --git a/Inventario-war/nbproject/ant-deploy.xml b/Inventario-war/nbproject/ant-deploy.xml new file mode 100644 index 0000000..fdc06d5 --- /dev/null +++ b/Inventario-war/nbproject/ant-deploy.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Inventario-war/nbproject/build-impl.xml b/Inventario-war/nbproject/build-impl.xml new file mode 100644 index 0000000..f9b43be --- /dev/null +++ b/Inventario-war/nbproject/build-impl.xml @@ -0,0 +1,1465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set platform.home + Must set platform.bootcp + Must set platform.java + Must set platform.javac + + The J2SE Platform is not correctly set up. + Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files. + Either open the project in the IDE and setup the Platform with the same name or add it manually. + For example like this: + ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file) + or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Inventario-war/nbproject/faces-config.NavData b/Inventario-war/nbproject/faces-config.NavData new file mode 100644 index 0000000..298bfc5 --- /dev/null +++ b/Inventario-war/nbproject/faces-config.NavData @@ -0,0 +1,6 @@ + + + + + + diff --git a/Inventario-war/nbproject/genfiles.properties b/Inventario-war/nbproject/genfiles.properties new file mode 100644 index 0000000..3f5752b --- /dev/null +++ b/Inventario-war/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d0ca52af +build.xml.script.CRC32=796f502a +build.xml.stylesheet.CRC32=1707db4f@1.96.0.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=d0ca52af +nbproject/build-impl.xml.script.CRC32=d8f0ad16 +nbproject/build-impl.xml.stylesheet.CRC32=334708a0@1.96.0.1 diff --git a/Inventario-war/nbproject/project.properties b/Inventario-war/nbproject/project.properties new file mode 100644 index 0000000..e5b1dd3 --- /dev/null +++ b/Inventario-war/nbproject/project.properties @@ -0,0 +1,94 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=JSP +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +# Files to be excluded from distribution war +dist.archive.excludes= +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-7.0.classpath} +excludes= +file.reference.primefaces-12.0.0.jar=libs\\primefaces-12.0.0.jar +includes=** +j2ee.compile.on.save=true +j2ee.copy.static.files.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.7 +j2ee.platform.classpath=${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv4ee7 +jar.compress=false +javac.classpath=\ + ${reference.Inventario-ejb.dist}:\ + ${file.reference.primefaces-12.0.0.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +persistence.xml.dir=${conf.dir} +platform.active=JDK_1.8 +project.Inventario-ejb=../Inventario-ejb +reference.Inventario-ejb.dist=${project.Inventario-ejb}/dist/Inventario-ejb.jar +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=Inventario-war.war +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/Inventario-war/nbproject/project.xml b/Inventario-war/nbproject/project.xml new file mode 100644 index 0000000..a54b9ab --- /dev/null +++ b/Inventario-war/nbproject/project.xml @@ -0,0 +1,37 @@ + + + org.netbeans.modules.web.project + + + Inventario-war + 1.6.5 + + + + ${reference.Inventario-ejb.dist} + + + ${file.reference.primefaces-12.0.0.jar} + WEB-INF/lib + + + + + + + + + + + + + Inventario-ejb + jar + + dist + clean + dist + + + + diff --git a/Inventario-war/src/conf/MANIFEST.MF b/Inventario-war/src/conf/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/Inventario-war/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/AutorizacionListener.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/AutorizacionListener.java new file mode 100644 index 0000000..3755623 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/AutorizacionListener.java @@ -0,0 +1,66 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.seguridad; + +import java.io.IOException; +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import javax.faces.application.NavigationHandler; +import javax.faces.context.FacesContext; +import javax.faces.event.PhaseEvent; +import javax.faces.event.PhaseId; +import javax.faces.event.PhaseListener; + +/** + * + * @author Ivan Alejandro PC + */ + + +//-------------------------------------------------------------- + +@Named(value = "autorizacionListener") +@SessionScoped +public class AutorizacionListener implements PhaseListener { + + /** + * Creates a new instance of AutorizacionListener + */ + public AutorizacionListener() { + } + + + private static final long serialVersionUID = 1L; + + @Override + public void afterPhase(PhaseEvent event) { + try { + //Obtener la pagina actual para validar la sesion + String paginaActual = event.getFacesContext().getViewRoot().getViewId(); + + //inicializar la sesion en caso de no haber sesion + Login.getSesion(); + + //Revisar que no sea la pafina index y que no estes logueado + //para redireccionar + if (!paginaActual.contains("login.xhtml") && Login.getEstatus() == false) { + FacesContext.getCurrentInstance().getExternalContext().redirect("faces/login.xhtml?faces-redirect=true"); + + NavigationHandler nh = event.getFacesContext().getApplication().getNavigationHandler(); + nh.handleNavigation(event.getFacesContext(), null, "login"); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void beforePhase(PhaseEvent event) {} + + @Override + public PhaseId getPhaseId() { + return PhaseId.RESTORE_VIEW; + } +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/Login.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/Login.java new file mode 100644 index 0000000..c2f8a62 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/Login.java @@ -0,0 +1,108 @@ +package mx.edu.tsj.chapala.sistemas.inventario.seguridad; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import javax.annotation.PostConstruct; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import javax.servlet.http.HttpSession; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.UsuariosBL; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Usuarios; + +@Named(value = "demoBeanLogin") +@SessionScoped +public class Login implements Serializable { + private static HttpSession httpSession; + private UsuariosBL usuariosBL; + private String username; + private String password; + + public Login(){ + + } + + @PostConstruct + public void init() { + usuariosBL = new UsuariosBL(); // O cualquier método adecuado para inicializar usuariosBL + } + + public static void getSesion(){ + httpSession = (HttpSession) + FacesContext.getCurrentInstance().getExternalContext().getSession(false); + } + + public static String logout(){ + httpSession.removeAttribute("sesionActiva"); + httpSession.invalidate(); + return "login.xhtml"; + } + public void limpiarCampos() { + username = ""; + password = ""; +} + + public String buscarPorLogin() { + Usuarios usuario = new Usuarios(); + usuario.setUsuario(username); + usuario.setPassword(password); + short status = 1; + usuario.setStatus(status); + usuario = usuariosBL.buscarPorLoginStatus(true, usuario); + if (usuario != null) { + httpSession.setAttribute("sesionActiva", true); + limpiarCampos(); + FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Login exitoso", "Bienvenido, " + usuario.getUsuario())); + + return "productosLista.xhtml"; + } else { + FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error de inicio de sesión", "Usuario o contraseña incorrectos")); + return "login.xhtml"; + } +} + + + + public UsuariosBL getUsuariosBL() { + return usuariosBL; + } + + public void setUsuariosBL(UsuariosBL usuariosBL) { + this.usuariosBL = usuariosBL; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public static boolean getEstatus(){ + if(httpSession!=null&&httpSession.getId()!=null&&!httpSession.getId().isEmpty()&&httpSession.getAttribute("sesionActiva")!=null){ + return true; + }else{ + return false; + } + } + //private boolean mostrarError; + + // Getter y Setter para username y password + + /*public boolean isMostrarError() { + return mostrarError; + } + + public void setMostrarError(boolean mostrarError) { + this.mostrarError = mostrarError; + }*/ +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/PasswordValidator.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/PasswordValidator.java new file mode 100644 index 0000000..fe44077 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/seguridad/PasswordValidator.java @@ -0,0 +1,27 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.seguridad; + +/** + * + * @author Ivan Alejandro PC + */ +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.validator.Validator; +import javax.faces.validator.ValidatorException; + +public class PasswordValidator implements Validator { + + @Override + public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { + String password = (String) value; + if (password == null || !password.matches("[a-zA-Z0-9]+")) { + FacesMessage message = new FacesMessage("La contraseña debe contener solo letras y números"); + throw new ValidatorException(message); + } + } +} \ No newline at end of file diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBean.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBean.java new file mode 100644 index 0000000..6a0428d --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBean.java @@ -0,0 +1,22 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.faces.view.ViewScoped; +import java.io.Serializable; + + +@Named(value = "bean") +@ViewScoped +public class DemoBean implements Serializable { + + /** + * Creates a new instance of bean + */ + public DemoBean() { + } + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanCategoria.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanCategoria.java new file mode 100644 index 0000000..ad83e41 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanCategoria.java @@ -0,0 +1,155 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.List; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.CategoriaBL; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.CategoriaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; + +/** + * + * @author gael4 + */ +@Named(value = "demoBeanCategoria") +@SessionScoped +public class DemoBeanCategoria implements Serializable { + + /** + * Creates a new instance of DemoBeanCategoria + */ + @EJB + private CategoriaBLLocal marcaBL; + + private Categoria categoria = new Categoria(); + + private boolean nuevo; + + private String titulo; + + /** + * Creates a new instance of DemoBeanCategoria + */ + public DemoBeanCategoria() { + } + + public String agregar(){ + marcaBL.agregar(categoria); + categoria = new Categoria(); + return "categoriaLista.xhtml"; + /* + Categoria a = new Categoria(); + //Para que te marque como id duplicaod tienes que asignarlo + //a.setId(1); + a.setCategoria("Botas"); + + + Mensaje m = marcaBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + return "index.xhtml"; +*/ + } + + public void editarCategoria(){ + marcaBL.editarCategoria(categoria); + } + + public void eliminarCategoria(){ + marcaBL.eliminarCategoria(categoria); + } + + public String buscar(){ + Categoria a = new Categoria(); + a.setId(10); + Mensaje m = marcaBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre la Categoria: "); + System.out.println(marcaBL.buscarId(a)); + }else{ + System.out.println("NO SE ENCONTRO"); + } + //System.out.println("Encontre el Autor: "); + //System.out.println(autorBL.buscarId(a)); + return "index.xhtml"; + } + + public String eliminar(){ + Categoria a = marcaBL.buscarIdLi(new Categoria(3)); + System.out.println("Categoria eliminada: "); + Mensaje m = marcaBL.eliminarCategoria(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + //System.out.println(autorBL.eliminar(a)); + return "index.xhtml"; + } + + public String editar() { + try{ + Categoria a = marcaBL.buscarIdLi(new Categoria(10)); + a.setCategoria("Adidas"); + + Mensaje m = marcaBL.editarCategoria(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.ELEMENTO_NO_ENCONTRADO); + } + //autorBL.editar(a); + return "index.xhtml"; + } + public List getCategoria(){ + return marcaBL.buscarTodos(); + } + + public String getTitulo() { + return titulo; + } + + public Categoria getCategorias() { + return categoria; + } + + public void prepararEditar(Categoria categoria){ + nuevo=false; + titulo="Editando Categoria"; + this.categoria = categoria; + } + + public boolean isNuevo() { + return nuevo; + } + + + + public void prepararNuevo(){ + nuevo=true; + titulo="Agregando Categoria"; + categoria = new Categoria(); + } + + public void prepararEliminar(Categoria categoria){ + this.categoria = categoria; + } +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanColor.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanColor.java new file mode 100644 index 0000000..5eaa531 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanColor.java @@ -0,0 +1,117 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Color; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.ColorBLLocal; + +/** + * + * @author Ivan Alejandro PC + */ +@Named(value = "demoBeanColor") +@SessionScoped +public class DemoBeanColor implements Serializable { + + + + @EJB + private ColorBLLocal colorBL; + + private Color rol = new Color(); + private String titulo; + private boolean nuevo; + + + + + /** + * Creates a new instance of DemoBean + */ + public DemoBeanColor() { + } + + //Aqui empieza lo de la clase pasada + //Metodo para eliminar + + public void eliminarRoles(){ + colorBL.eliminar(rol); + } + + public void prepararEliminar(Color rol){ + this.rol=rol; + } + + //Metodo de editar + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + + public void editarRoles(){ + colorBL.editar(rol); + } + + + public void prepararEditar(Color rol){ + nuevo = false; + titulo="Editando Colores"; + this.rol=rol; + } + + public void prepararNuevo(){ + nuevo =true; + titulo="Agregando Colores"; + rol = new Color(); + } + + + + + //------------------ + + + public String agregarRol(){ + + colorBL.agregar(rol); + + rol = new Color(); + + return "colorLista.xhtml"; + } + + public Color getRol() { + return rol; + } + + public void setRol(Color rol) { + this.rol = rol; + } + + public List getListRolll(){ + //Este codigo es para poner los combos en blanco +/*List colores = colorBL.buscarTodos(); + colores.add(0, new Color(null, "")); // Agregar un color vacío al inicio + return colores;*/ +return colorBL.buscarTodos(); + } + + + + + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanGenero.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanGenero.java new file mode 100644 index 0000000..8a98b5e --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanGenero.java @@ -0,0 +1,106 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.GeneroBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Genero; + +@Named(value = "demoBeanGenero") +@SessionScoped +public class DemoBeanGenero implements Serializable { + + ArrayList Lista = new ArrayList(); + + private String Titulo; + private boolean nuevo; + private String gen; + + @EJB + private GeneroBLLocal GeneroBL; + + private Genero genero = new Genero(); + /** + * Creates a new instance of DemoBeanGenero + */ + public DemoBeanGenero() { + } + + + //METODOS DE VISTA + public List getGenero(){ + return GeneroBL.buscarTodos(); + } + + public String agregarGenero(){ + genero.setGenero(gen); + GeneroBL.agregar(genero); + genero = new Genero(); + + return "vistaGenero.xhtml"; + } + + public void prepararNuevo(){ + nuevo = true; + Titulo="Agregando Genero"; + genero = new Genero(); + } + + public void editarGenero(){ + genero.setGenero(gen); + nuevo = false; + GeneroBL.editarGenero(genero); + } + + public void prepararEditar(Genero g){ + nuevo = false; + Titulo="Editando Genero"; + this.genero = g; + } + public void eliminarGenero(){ + GeneroBL.eliminarGenero(genero); + } + + public void prepararEliminar(Genero g){ + this.genero = g; + } + + public List Seleccionar(){ + Lista.clear(); + Lista.add("Hombre"); + Lista.add("Mujer"); + Lista.add("Otro"); + return Lista; + } + + //METODOS GET Y SET + public String getGen() { + return gen; + } + + public void setGen(String gen) { + this.gen = gen; + } + public String getTitulo() { + return Titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + public Genero getGeneros() { + return genero; + } + + public void setGenero(Genero genero) { + this.genero = genero; + } +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanMarca.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanMarca.java new file mode 100644 index 0000000..6ea2711 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanMarca.java @@ -0,0 +1,153 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.List; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.MarcaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Marca; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; + +/** + * + * @author gael4 + */ +@Named(value = "demoBeanMarca") +@SessionScoped + +public class DemoBeanMarca implements Serializable { + + @EJB + private MarcaBLLocal marcaBL; + + private Marca marca = new Marca(); + + private boolean nuevo; + + private String titulo; + + /** + * Creates a new instance of DemoBeanMarca + */ + public DemoBeanMarca() { + } + + public String agregar(){ + + marcaBL.agregar(marca); + marca = new Marca(); + return "marcaLista.xhtml"; + /* + Marca a = new Marca(); + //Para que te marque como id duplicaod tienes que asignarlo + //a.setId(1); + a.setMarca("Nike"); + + + Mensaje m = marcaBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + return "index.xhtml"; +*/ + } + + public void editarMarca(){ + marcaBL.editarMarca(marca); + } + + public void eliminarMarca(){ + marcaBL.eliminarMarca(marca); + } + + public String buscar(){ + Marca a = new Marca(); + a.setId(10); + Mensaje m = marcaBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Autor: "); + System.out.println(marcaBL.buscarId(a)); + }else{ + System.out.println("NO SE ENCONTRO"); + } + //System.out.println("Encontre el Autor: "); + //System.out.println(autorBL.buscarId(a)); + return "index.xhtml"; + } + + public String eliminar(){ + Marca a = marcaBL.buscarIdLi(new Marca(30)); + System.out.println("Autor eliminado: "); + Mensaje m = marcaBL.eliminarMarca(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + //System.out.println(autorBL.eliminar(a)); + return "index.xhtml"; + } + + public String editar() { + try{ + Marca a = marcaBL.buscarIdLi(new Marca(40)); + a.setMarca("Adidas"); + + Mensaje m = marcaBL.editarMarca(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.ELEMENTO_NO_ENCONTRADO); + } + //autorBL.editar(a); + return "index.xhtml"; + } + + public List getMarca(){ + return marcaBL.buscarTodos(); + } + + public Marca getMarcas() { + return marca; + } + + public String getTitulo() { + return titulo; + } + + public void prepararEditar(Marca marca){ + nuevo=false; + titulo="Editando marca"; + this.marca = marca; + } + + public boolean isNuevo() { + return nuevo; + } + + public void prepararNuevo(){ + nuevo=true; + titulo="Agregando Marca"; + marca = new Marca(); + } + + public void prepararEliminar(Marca marca){ + this.marca = marca; + } + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanProductos.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanProductos.java new file mode 100644 index 0000000..546e311 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanProductos.java @@ -0,0 +1,338 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.ProveedoresBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.UbicacionBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.TallaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.MarcaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.CategoriaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.GeneroBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Productos; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.ProductosBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.ProductosDAO; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Genero; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Marca; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Proveedores; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Talla; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Ubicacion; + +/** + * + * @author Ivan Alejandro PC + */ +@Named(value = "demoBeanProductos") +@SessionScoped +public class DemoBeanProductos implements Serializable { + + @EJB + private ProductosBLLocal productosBL; + @EJB + private ProveedoresBLLocal proovedoresBL; + @EJB + private UbicacionBLLocal ubicacionBL; + @EJB + private TallaBLLocal tallaBL; + @EJB + private MarcaBLLocal marcaBL; + @EJB + private CategoriaBLLocal categoriaBL; + @EJB + private GeneroBLLocal generoBL; + + private Productos producto = new Productos(); + + private String titulo; + private boolean nuevo; + + + + public DemoBeanProductos() { + } + + //Aqui empieza lo de la clase pasada + //Metodo para eliminar + + public void eliminarProductos(){ + productosBL.desactivarProductos(producto); + } + + public void prepararEliminar(Productos productos){ + this.producto=productos; + } + + //Metodo de editar + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + + public void editarProductos(){ + productosBL.editar(producto); + } + + + public void prepararEditar(Productos productos){ + nuevo = false; + titulo="Editando Productos"; + this.producto=productos; + } + + public void prepararNuevo(){ + nuevo =true; + titulo="Agregando Productos"; + producto = new Productos(); + } + + + //------------------ + + + public String agregarProducto(){ + System.out.println(producto.getProveedoresid()); + System.out.println(producto.getUbicacionid()); + System.out.println(producto.getTallaid()); + System.out.println(producto.getMarcaid()); + System.out.println(producto.getCategoriaid()); + System.out.println(producto.getGeneroid()); + + /*producto.setStatus((short)1); + producto.setProveedoresid(proovedoresBL.buscarIdLi(new Proveedores(1))); + producto.setUbicacionid(ubicacionBL.buscarIdLi(new Ubicacion(3))); + producto.setTallaid(tallaBL.buscarIdLi(new Talla(1))); + producto.setMarcaid(marcaBL.buscarIdLi(new Marca(1))); + producto.setCategoriaid(categoriaBL.buscarIdLi(new Categoria(1))); + producto.setGeneroid(generoBL.buscarIdLi(new Genero(1)));*/ + + + productosBL.agregar(producto); + + producto = new Productos(); + + return "productosLista.xhtml"; + } + + public Productos getProducto() { + return producto; + } + + public void setProducto(Productos productos) { + this.producto = productos; + } + + public List getStatusProductos(){ + short status = 1; + return productosBL.buscarStatus(status); + } + + public String metodo(){ + // try{ + Productos a = new Productos(); + + a.setNombre("dsd"); + a.setDescripcion("Para uso otro"); + a.setPrecio("1,500$"); + + a.setMaterial("Textil"); + a.setExistencia(22); + a.setProveedoresid(proovedoresBL.buscarIdLi(new Proveedores(1))); + //Ubi riene ID 2 + a.setUbicacionid(ubicacionBL.buscarIdLi(new Ubicacion(2))); + a.setTallaid(tallaBL.buscarIdLi(new Talla(1))); + a.setMarcaid(marcaBL.buscarIdLi(new Marca(1))); + a.setCategoriaid(categoriaBL.buscarIdLi(new Categoria(1))); + a.setGeneroid(generoBL.buscarIdLi(new Genero(1))); + + + Mensaje m = productosBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Se agrego el producto: " + a.getNombre()); + }else{ + System.out.println("NO SE PUDO"); + } + /* }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.CAMPOS_INCOMPLETOS); + }*/ + return "index.xhtml"; + } + //BUSCAR POR ID este si funciona + public String buscarID(){ + Productos a = new Productos(); + a.setId(1); + Mensaje m = productosBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el ID_Producto: " + a.getId()); + //System.out.println("Encontre el Usuario: " + usuariosBL.buscarId(a)); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; + } + + + + // para buscar por nombre + public String buscarNombre(){ + Productos a = new Productos(); + a.setNombre("Zapato"); + Mensaje m = productosBL.buscarNombre(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Producto: " + a.getNombre()); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; +} + + //V3 status ganador + public String buscarSTATUS() { + //short status = 1; + List usuariosStatus1 = productosBL.buscarStatus((short) 1); + if (!usuariosStatus1.isEmpty()) { + System.out.println("Busqueda por Status: "); + for (Productos usuario : usuariosStatus1) { + + System.out.println("Encontre el Producto con status 1: " + usuario.getNombre()); + } + + } else { + System.out.println("No se encontraron Productos con status 1."); + } + + List usuariosStatus0 = productosBL.buscarStatus((short) 0); + if (!usuariosStatus0.isEmpty()) { + for (Productos usuario : usuariosStatus0) { + System.out.println("Encontre el Producto con status 0: " + usuario.getNombre()); + } + System.out.println("---------------------------------------------------------"); + } else { + System.out.println("No se encontraron Productos con status 0."); + } + + return "index.xhtml"; +} + + public String buscarTODOS() { + //short status = 1; + List usuariosStatus1 = productosBL.buscarStatus((short) 1); + if (!usuariosStatus1.isEmpty()) { + System.out.println("Buscar Todos: "); + for (Productos usuario : usuariosStatus1) { + + System.out.println("Encontre el Producto con status 1: " + usuario.getNombre()); + } + System.out.println("---------------------------------------------------------"); + } else { + System.out.println("No se encontraron usuarios con status 1."); + + } + + return "index.xhtml"; +} + + + public String activar(){ + try{ + Productos p = productosBL.buscarIdLi(new Productos(1)); + if(p.getStatus()==1){ + System.out.println("YA ESTA ACTIVADO"); + }else{ + p.setStatus((short)1); + Mensaje m = productosBL.activarProductos(p); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE ACTIVO CORRECTAMENTE"); + System.out.println(productosBL.activarProductos(p)); + }else{ + System.out.println("NO FUE POSIBLE ACTIVAR"); + } + + } + } catch (NullPointerException e) { + // Maneja la excepción o notifica el error + System.out.println("No se encontro el ID"); +} + return "index.xhtml"; + } + + + public String desactivar(){ + try{ + Productos p = productosBL.buscarIdLi(new Productos(1)); + if(p.getStatus()==0){ + System.out.println("YA ESTA DESACTIVADO"); + }else{ + p.setStatus((short)0); + Mensaje m = productosBL.desactivarProductos(p); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE DESACTIVO CORRECTAMENTE"); + System.out.println(productosBL.desactivarProductos(p)); + }else{ + System.out.println("NO FUE POSIBLE DESACTIVAR"); + } + } + } catch (NullPointerException e) { + // Maneja la excepción o notifica el error + System.out.println("No se encontro el ID"); +} + return "index.xhtml"; + } + + + + + public String editar() { + try{ + + Productos a = productosBL.buscarIdLi(new Productos(1)); + a.setNombre("Test"); + a.setDescripcion("Test"); + a.setPrecio("1,200$"); + + a.setMaterial("Textil"); + a.setExistencia(12); + a.setProveedoresid(proovedoresBL.buscarIdLi(new Proveedores(1))); + a.setUbicacionid(ubicacionBL.buscarIdLi(new Ubicacion(2))); + a.setTallaid(tallaBL.buscarIdLi(new Talla(1))); + a.setMarcaid(marcaBL.buscarIdLi(new Marca(1))); + a.setCategoriaid(categoriaBL.buscarIdLi(new Categoria(1))); + a.setGeneroid(generoBL.buscarIdLi(new Genero(1))); + + + Mensaje m = productosBL.editar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Se edito el producto"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch (NullPointerException e) { + // Maneja la excepción o notifica el error + System.out.println("No se encontro el ID"); +} + + + return "index.xhtml"; +} + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanProveedores.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanProveedores.java new file mode 100644 index 0000000..acbd11f --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanProveedores.java @@ -0,0 +1,285 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.CategoriaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.ProveedoresBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Proveedores; + +@Named(value = "demoBeanProveedores") +@SessionScoped +public class DemoBeanProveedores implements Serializable { + + + + @EJB + private ProveedoresBLLocal proveedorBL; + @EJB + private CategoriaBLLocal categoriaBL; + + private Proveedores proveedor = new Proveedores(); + + private String Titulo; + private boolean nuevo; + + //LISTAS + ArrayList Pais = new ArrayList(); + ArrayList Estados = new ArrayList(); + ArrayList Ciudad = new ArrayList(); + + //VARIABLES + private String p; + private String e; + private String c; + + /** + * Creates a new instance of DemoBeanProveedores + */ + public DemoBeanProveedores() { + } + + + public List getStatusProveedor(){ + return proveedorBL.buscarStatus((short)1); + } + + + public String agregarProveedor(){ + proveedor.setStatus((short)1); + proveedor.setPais(p); + proveedor.setEstado(e); + proveedor.setCiudad(c); + proveedorBL.agregar(proveedor); + proveedor = new Proveedores(); + + return "vistaProveedores.xhtml"; + } + + + public void prepararEditar(Proveedores p){ + nuevo = false; + Titulo="Editando Proveedor"; + this.proveedor = p; + } + + public void prepararNuevo(){ + nuevo = true; + Titulo="Agregando Proveedor"; + proveedor = new Proveedores(); + } + + public void editarProveedor(){ + nuevo = false; + proveedorBL.editarProveedor(proveedor); + } + + public void eliminarProveedor(){ + proveedorBL.eliminarProveedor(proveedor); + } + + public void prepararEliminar(Proveedores p){ + this.proveedor = p; + } + + //METODO PARA LISTAS + public List SeleccionarPais(){ + Pais.clear(); + Pais.add("Mexico"); + Pais.add("Estados Unidos"); + Pais.add("Venezuela"); + Pais.add("Colombia"); + return Pais; + } + + + public List SeleccionarEstado(){ + Estados.clear(); + if(getP() != null && getP().equals("Mexico")){ + Estados.add("Jalisco"); + Estados.add("Nuevo Leon"); + Estados.add("Yucatan"); + Estados.add("baja California"); + return Estados; + }else if(getP() != null && getP().equals("Estados Unidos")){ + Estados.add("California"); + Estados.add("Nueva York"); + Estados.add("Ohio"); + Estados.add("Washington"); + return Estados; + }else if(getP() != null && getP().equals("Venezuela")){ + Estados.add("Miranda"); + Estados.add("Lara"); + Estados.add("Trujillo"); + Estados.add("Mérida"); + return Estados; + }else if(getP() != null && getP().equals("Colombia")){ + Estados.add("Bolívar"); + Estados.add("Santander"); + Estados.add("Atlántico"); + Estados.add("Antioquia"); + return Estados; + }else{ + return null; + } + } + + public List SeleccionarCiudad(){ + Ciudad.clear(); + + //VALIDACIONES MEXICO + if(getE() != null && getE().equals("Jalisco")){ + Ciudad.add("Guadalajara"); + Ciudad.add("Zapopan"); + Ciudad.add("Tlaquepaque"); + Ciudad.add("Puerto Vallarta"); + return Ciudad; + }else if(getE() != null && getE().equals("Nuevo Leon")){ + Ciudad.add("Monterrey"); + Ciudad.add("Guadalupe"); + Ciudad.add("Apodaca"); + return Ciudad; + }else if(getE() != null && getE().equals("Yucatan")){ + Ciudad.add("Merida"); + Ciudad.add("Valladolid"); + Ciudad.add("Progreso"); + return Ciudad; + }else if(getE() != null && getE().equals("baja California")){ + Ciudad.add("Bolívar"); + Ciudad.add("Santander"); + Ciudad.add("Atlántico"); + Ciudad.add("Antioquia"); + return Ciudad; + } + + //VALIDACIONES DE ESTADOS UNIDOS. + else if(getE() != null && getE().equals("California")){ + Ciudad.add("Los Ángeles"); + Ciudad.add("San Francisco"); + Ciudad.add("San Diego"); + Ciudad.add("San José"); + return Ciudad; + }else if(getE() != null && getE().equals("Nueva York")){ + Ciudad.add("Manhattan"); + Ciudad.add("Brooklyn"); + Ciudad.add("Queens"); + return Ciudad; + }else if(getE() != null && getE().equals("Ohio")){ + Ciudad.add("Columbus"); + Ciudad.add("Cleveland"); + Ciudad.add("Dayton"); + Ciudad.add("Toledo"); + return Ciudad; + }else if(getE() != null && getE().equals("Washington")){ + Ciudad.add("Seattle"); + Ciudad.add("Spokane"); + Ciudad.add("Tacoma"); + Ciudad.add("Vancouver"); + return Ciudad; + } + + //VALIDACIONES DE VENEZUELA. + else if(getE() != null && getE().equals("Miranda")){ + Ciudad.add("Los Teques"); + Ciudad.add("Guarenas"); + Ciudad.add("Cúa"); + Ciudad.add("Santa Teresa del Tuy"); + return Ciudad; + }else if(getE() != null && getE().equals("Lara")){ + Ciudad.add("Barquisimeto"); + Ciudad.add("Carora"); + Ciudad.add("El Tocuyo"); + return Ciudad; + }else if(getE() != null && getE().equals("Trujillo")){ + Ciudad.add("Valera"); + Ciudad.add("Boconó"); + Ciudad.add("Escuque"); + Ciudad.add("Valle de la Pascua"); + return Ciudad; + }else if(getE() != null && getE().equals("Mérida")){ + Ciudad.add("El Vigía"); + Ciudad.add("Tovar"); + Ciudad.add("Mucuchíes"); + Ciudad.add("Ejido"); + return Ciudad; + } + + //VALIDACIONES DE COLOMBIA. + else if(getE() != null && getE().equals("Bolivar")){ + Ciudad.add("Cartagena de Indias"); + Ciudad.add("Sincelejo"); + Ciudad.add("Magangué"); + Ciudad.add("Turbaco"); + return Ciudad; + }else if(getE() != null && getE().equals("Santander")){ + Ciudad.add("Bucaramanga"); + Ciudad.add("Floridablanca"); + Ciudad.add("Girón"); + return Ciudad; + }else if(getE() != null && getE().equals("Atlántico")){ + Ciudad.add("Barranquilla"); + Ciudad.add("Soledad"); + Ciudad.add("Malambo"); + Ciudad.add("Sabanalarga"); + return Ciudad; + }else if(getE() != null && getE().equals("Antioquia")){ + Ciudad.add("Medellín"); + Ciudad.add("Bello"); + Ciudad.add("Envigado"); + Ciudad.add("Rionegro"); + return Ciudad; + }else{ + return null; + } + } + + //METODOS GET Y SET + public String getTitulo() { + return Titulo; + } + + + public boolean isNuevo() { + return nuevo; + } + + public Proveedores getProveedor() { + return proveedor; + } + + public void setProveedor(Proveedores proveedor) { + this.proveedor = proveedor; + } + + public String getP() { + return p; + } + + public void setP(String p) { + this.p = p; + } + + public String getE() { + return e; + } + + public void setE(String e) { + this.e = e; + } + + public String getC() { + return c; + } + + public void setC(String c) { + this.c = c; + } + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanRol.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanRol.java new file mode 100644 index 0000000..020d52c --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanRol.java @@ -0,0 +1,213 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.RolBLLocal; + +/** + * + * @author Ivan Alejandro PC + */ +@Named(value = "demoBeanRol") +@SessionScoped +public class DemoBeanRol implements Serializable { + + ArrayList Lista = new ArrayList(); + + @EJB + private RolBLLocal rolBL; + + private Rol rol = new Rol(); + private String titulo; + private boolean nuevo; + + + + + /** + * Creates a new instance of DemoBean + */ + public DemoBeanRol() { + } + + //Aqui empieza lo de la clase pasada + //Metodo para eliminar + + public void eliminarRoles(){ + rolBL.eliminar(rol); + } + + public void prepararEliminar(Rol rol){ + this.rol=rol; + } + + //Metodo de editar + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + + public void editarRoles(){ + rolBL.editar(rol); + } + + + public void prepararEditar(Rol rol){ + nuevo = false; + titulo="Editando Roles"; + this.rol=rol; + } + + public void prepararNuevo(){ + nuevo =true; + titulo="Agregando Roles"; + rol = new Rol(); + } + + public List Seleccionar(){ + Lista.clear(); + Lista.add("Administrador del sistema"); + Lista.add("Gestor de inventario"); + Lista.add("Supervisor de almacén"); + Lista.add("Auditor de inventario"); + return Lista; + } + + + //------------------ + + + public String agregarRol(){ + + rolBL.agregar(rol); + + rol = new Rol(); + + return "rolLista.xhtml"; + } + + public Rol getRol() { + return rol; + } + + public void setRol(Rol rol) { + this.rol = rol; + } + + public List getListRolll(){ + return rolBL.buscarTodos(); + } + + + public String metodo(){ + Rol a = new Rol(); + //Para que te marque como id duplicaod tienes que asignarlo + //a.setId(1); + a.setRolUsuario("Administrador"); + + + Mensaje m = rolBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + return "index.xhtml"; + } + + public String buscar(){ + Rol a = new Rol(); + a.setId(31); + Mensaje m = rolBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Rol: " + a.getId()); + System.out.println(rolBL.buscarId(a)); + }else{ + System.out.println("NO SE ENCONTRO"); + } + //System.out.println("Encontre el Autor: "); + //System.out.println(autorBL.buscarId(a)); + return "index.xhtml"; + } + public String buscarPorNombre(){ + Rol a = new Rol(); + a.setRolUsuario("Ivan Alejandro"); + Mensaje m = rolBL.buscarRol(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Rol: " + a.getRolUsuario()); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; +} + + public String buscarALLRol() { + //short status = 1; + List usuariosStatus1 = rolBL.buscarTodos(); + if (!usuariosStatus1.isEmpty()) { + System.out.println("Busqueda All: "); + for (Rol rol : usuariosStatus1) { + + System.out.println("Encontre los roles de usuario: "+ "ID: " + rol.getId() +" Rol: " + rol.getRolUsuario() ); + } + + } else { + System.out.println("No se encontraron roles de usuarios"); + } + return "index.xhtml"; + } + + + public String eliminar(){ + Rol a = rolBL.buscarIdLi(new Rol(33)); + System.out.println("Autor eliminado: "); + Mensaje m = rolBL.eliminar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + //System.out.println(autorBL.eliminar(a)); + return "index.xhtml"; + } + + public String editar() { + try{ + Rol a = rolBL.buscarIdLi(new Rol(35)); + a.setRolUsuario("Trabajador"); + + Mensaje m = rolBL.editar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.ELEMENTO_NO_ENCONTRADO); + } + //autorBL.editar(a); + return "index.xhtml"; +} + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanTalla.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanTalla.java new file mode 100644 index 0000000..9793510 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanTalla.java @@ -0,0 +1,152 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.List; +import javax.ejb.EJB; +import javax.enterprise.context.SessionScoped; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.TallaBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Talla; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; + +/** + * + * @author gael4 + */ +@Named(value = "demoBeanTalla") +@SessionScoped +public class DemoBeanTalla implements Serializable { + + @EJB + private TallaBLLocal tallaBL; + + private Talla talla = new Talla(); + + private boolean nuevo; + + private String titulo; + + /** + * Creates a new instance of DemoBeanTalla + */ + public DemoBeanTalla() { + } + + public String agregar(){ + + tallaBL.agregar(talla); + talla = new Talla(); + return "tallaLista.xhtml"; + /* + Talla a = new Talla(); + //Para que te marque como id duplicaod tienes que asignarlo + //a.setId(1); + a.setTalla("28"); + + + Mensaje m = tallaBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + return "index.xhtml"; +*/ + } + + public void editarTalla(){ + tallaBL.editarTalla(talla); + } + + public void eliminarTalla(){ + tallaBL.eliminarTalla(talla); + } + + public String buscar(){ + Talla a = new Talla(); + a.setId(10); + Mensaje m = tallaBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Autor: "); + System.out.println(tallaBL.buscarId(a)); + }else{ + System.out.println("NO SE ENCONTRO"); + } + //System.out.println("Encontre el Autor: "); + //System.out.println(autorBL.buscarId(a)); + return "index.xhtml"; + } + + public String eliminar(){ + Talla a = tallaBL.buscarIdLi(new Talla(30)); + System.out.println("Autor eliminado: "); + Mensaje m = tallaBL.eliminarTalla(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + //System.out.println(autorBL.eliminar(a)); + return "index.xhtml"; + } + + public String editar() { + try{ + Talla a = tallaBL.buscarIdLi(new Talla(40)); + a.setTalla("26"); + + Mensaje m = tallaBL.editarTalla(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.ELEMENTO_NO_ENCONTRADO); + } + //autorBL.editar(a); + return "index.xhtml"; + } + + public List getTalla(){ + return tallaBL.buscarTodos(); + } + + public Talla getTallas() { + return talla; + } + + public String getTitulo() { + return titulo; + } + + public void prepararEditar(Talla talla){ + nuevo=false; + titulo="Editando talla"; + this.talla = talla; + } + + public boolean isNuevo() { + return nuevo; + } + + public void prepararNuevo(){ + nuevo=true; + titulo="Agregando Talla"; + talla = new Talla(); + } + + public void prepararEliminar(Talla talla){ + this.talla = talla; + } + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanUbicacion.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanUbicacion.java new file mode 100644 index 0000000..43cf40e --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanUbicacion.java @@ -0,0 +1,232 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.List; +import javax.ejb.EJB; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Ubicacion; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.UbicacionBLLocal; + +/** + * + * @author Ivan Alejandro PC + */ +@Named(value = "demoBeanUbicacion") +@SessionScoped +public class DemoBeanUbicacion implements Serializable { + + @EJB + private UbicacionBLLocal ubicacionBL; + + private Ubicacion ubicacion = new Ubicacion(); + private String titulo; + private boolean nuevo; + + + + /** + * Creates a new instance of DemoBean + */ + public DemoBeanUbicacion() { + } + //Aqui empieza lo de la clase pasada + //Metodo para eliminar + + public void eliminarUbicacion(){ + ubicacionBL.eliminar(ubicacion); + } + + public void prepararEliminar(Ubicacion ubicacion){ + this.ubicacion=ubicacion; + } + + //Metodo de editar + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + + public void editarUbicaciones(){ + ubicacionBL.editar(ubicacion); + } + + + public void prepararEditar(Ubicacion ubicacion){ + nuevo = false; + titulo="Editando Almacenes"; + this.ubicacion=ubicacion; + } + + public void prepararNuevo(){ + nuevo =true; + titulo="Agregando Almacenes"; + ubicacion = new Ubicacion(); + } + + + //------------------ + + public String agregarUbicacion(){ + + ubicacionBL.agregar(ubicacion); + + ubicacion = new Ubicacion(); + + return "ubicacionLista.xhtml"; + } + + public Ubicacion getUbicacion() { + return ubicacion; + } + + public void setUbicacion(Ubicacion ubicacion) { + this.ubicacion = ubicacion; + } + + public List getListUbicacion(){ + return ubicacionBL.buscarTodos(); + } + + public String metodo(){ + Ubicacion a = new Ubicacion(); + //Para que te marque como id duplicaod tienes que asignarlo + //a.setId(1); + a.setNombreAlmacen("Chapala, Modulo DAS"); + a.setEstante("Computo 2"); + a.setFila(2); + + + + + Mensaje m = ubicacionBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE AGREGRO"+ a.getNombreAlmacen()); + }else{ + System.out.println("NO SE PUDO"); + } + return "index.xhtml"; + } + + public String buscar(){ + Ubicacion a = new Ubicacion(); + a.setId(3); + Mensaje m = ubicacionBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el ID_Ubicacion: " +a.getId()); + + }else{ + System.out.println("NO SE ENCONTRO"); + } + //System.out.println("Encontre el Autor: "); + //System.out.println(autorBL.buscarId(a)); + return "index.xhtml"; + } + + public String buscarNombre(){ + Ubicacion a = new Ubicacion(); + a.setNombreAlmacen("Chapala, Modulo B"); + Mensaje m = ubicacionBL.buscarNombre(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Almacen: " + a.getNombreAlmacen()); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; +} + public String buscarALLUbica() { + //short status = 1; + List usuariosStatus1 = ubicacionBL.buscarTodos(); + if (!usuariosStatus1.isEmpty()) { + System.out.println("Busqueda All: "); + for (Ubicacion ubicacion : usuariosStatus1) { + + System.out.println("Encontre las Ubicaciones: "+ "ID: " + ubicacion.getId() +" Ubicacion: " + ubicacion.getNombreAlmacen() + " Amacen: " + + ubicacion.getEstante() + " Fila: " + ubicacion.getFila()); + } + + } else { + System.out.println("No se encontraron roles de usuarios"); + } + return "index.xhtml"; + } + + + public String buscarEstante(){ + Ubicacion a = new Ubicacion(); + a.setEstante("Computo 3"); + Mensaje m = ubicacionBL.buscarEstante(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Estante: " + a.getEstante()); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; +} + + public String buscarFila(){ + Ubicacion a = new Ubicacion(); + a.setFila(5); + Mensaje m = ubicacionBL.buscarFila(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre la Fila: " + a.getFila()); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; +} + + public String eliminar(){ + Ubicacion a = ubicacionBL.buscarIdLi(new Ubicacion(2)); + + Mensaje m = ubicacionBL.eliminar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Ubicacion eliminada "); + }else{ + System.out.println("NO SE PUDO"); + } + //System.out.println(autorBL.eliminar(a)); + return "index.xhtml"; + } + + public String editar() { + try{ + Ubicacion a = ubicacionBL.buscarIdLi(new Ubicacion(3)); + a.setNombreAlmacen("Zapopan, Modulo TestA"); + a.setEstante("Computo 1"); + a.setFila(5); + + Mensaje m = ubicacionBL.editar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE EDITO"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.ELEMENTO_NO_ENCONTRADO); + } + + return "index.xhtml"; +} + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanUsuarios.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanUsuarios.java new file mode 100644 index 0000000..ddde066 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/DemoBeanUsuarios.java @@ -0,0 +1,317 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import javax.inject.Named; +import javax.enterprise.context.SessionScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.ejb.EJB; +import javax.faces.application.FacesMessage; +import javax.faces.context.FacesContext; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.RolBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.UsuariosBL; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Usuarios; +import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.bl.UsuariosBLLocal; +import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.UsuariosDAO; +import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol; +import static org.primefaces.component.keyboard.KeyboardBase.PropertyKeys.password; + +/** + * + * @author Ivan Alejandro PC + */ +@Named(value = "demoBeanUsuarios") +@SessionScoped +public class DemoBeanUsuarios implements Serializable { + + ArrayList Lista = new ArrayList(); + + @EJB + private UsuariosBLLocal usuariosBL; + @EJB + private RolBLLocal rolBL; + + private Usuarios usuario = new Usuarios(); + + private String user = new Usuarios().getUsuario(); + private String pass = new Usuarios().getPassword(); + + private String titulo; + + private boolean nuevo; + + + public DemoBeanUsuarios() { + + } + //Metodo para eliminar + + public void eliminarUsuario(){ + usuariosBL.desactivarUsuarios(usuario); + } + + public void prepararEliminar(Usuarios usuarios){ + this.usuario=usuarios; + } + + //Metodo de editar + + public String getTitulo() { + return titulo; + } + + public boolean isNuevo() { + return nuevo; + } + + + public void editarUsuarios(){ + usuariosBL.editar(usuario); + } + + + public void prepararEditar(Usuarios usuarios){ + nuevo = false; + titulo="Editando Usuarios"; + this.usuario=usuarios; + } + + public void prepararNuevo(){ + nuevo =true; + titulo="Agregando Usuarios"; + usuario = new Usuarios(); + } + + public List Seleccionar(){ + Lista.clear(); + Lista.add("Hombre"); + Lista.add("Mujer"); + + return Lista; + } + + public String metodo(){ + //try{ + Usuarios a = new Usuarios(); + + + + a.setUsuario("Pepe AAAA"); + a.setPassword("12345"); + a.setFechaRegistro(new Date ()); + //short status = 1; + //a.setStatus(status); + a.setRolid(rolBL.buscarIdLi(new Rol(6))); + + + Mensaje m = usuariosBL.agregar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Se gregro el usuario: " + a.getUsuario()); + }else{ + System.out.println("NO SE PUDO"); + } + /* }catch(Exception e){ + System.out.println("Ha ocurrido un error: " + Mensaje.CAMPOS_INCOMPLETOS); + }*/ + return "index.xhtml"; + } + //BUSCAR POR ID este si funciona + public String buscarID(){ + Usuarios a = new Usuarios(); + a.setId(6); + Mensaje m = usuariosBL.buscarId(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el ID_Usuario: " + a.getId()); + //System.out.println("Encontre el Usuario: " + usuariosBL.buscarId(a)); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; + } + + public List getStatusUser(){ + short status = 1; + return usuariosBL.buscarStatus(status); + } + + + + // para buscar por nombre + public String buscarNombre(){ + Usuarios a = new Usuarios(); + a.setUsuario("Pepe lopez"); + Mensaje m = usuariosBL.buscarNombre(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Encontre el Usuario: " + a.getUsuario()); + }else{ + System.out.println("NO SE ENCONTRO"); + } + + return "index.xhtml"; +} + + //V3 status ganador + public String buscarSTATUS() { + //short status = 1; + List usuariosStatus1 = usuariosBL.buscarStatus((short) 1); + if (!usuariosStatus1.isEmpty()) { + System.out.println("Busqueda por Status: "); + for (Usuarios usuario1 : usuariosStatus1) { + + System.out.println("Encontre el Usuario con status 1: " + usuario1.getUsuario()); + } + + } else { + System.out.println("No se encontraron usuarios con status 1."); + } + + List usuariosStatus0 = usuariosBL.buscarStatus((short) 0); + if (!usuariosStatus0.isEmpty()) { + for (Usuarios usuario1 : usuariosStatus0) { + System.out.println("Encontre el Usuario con status 0: " + usuario1.getUsuario()); + } + System.out.println("---------------------------------------------------------"); + } else { + System.out.println("No se encontraron usuarios con status 0."); + } + + return "index.xhtml"; +} + + public String buscarTODOS() { + //short status = 1; + List usuariosStatus1 = usuariosBL.buscarStatus((short) 1); + if (!usuariosStatus1.isEmpty()) { + System.out.println("Buscar Todos: "); + for (Usuarios usuario1 : usuariosStatus1) { + + System.out.println("Encontre el Usuario con status 1: " + usuario1.getUsuario()); + } + System.out.println("---------------------------------------------------------"); + } else { + System.out.println("No se encontraron usuarios con status 1."); + + } + + return "index.xhtml"; +} + + public String agregarUsuario(){ + //esto le quite para hacer el test con lo de la llave F + //usuario.setStatus((short)1); + //usuario.setRolid(rolBL.buscarIdLi(new Rol(44))); + System.out.println(usuario.getRolid()); + + usuariosBL.agregar(usuario); + + usuario = new Usuarios(); + + return "marcaLista3.xhtml"; + } + + + public String activar(){ + try{ + Usuarios p = usuariosBL.buscarIdLi(new Usuarios(4)); + + // Realizar operaciones con el objeto + if(p.getStatus()==1){ + System.out.println("YA ESTA ACTIVADO"); + }else{ + p.setStatus((short)1); + Mensaje m = usuariosBL.activarUsuarios(p); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE ACTIVO CORRECTAMENTE"); + System.out.println(usuariosBL.activarUsuarios(p)); + }else{ + System.out.println("NO FUE POSIBLE ACTIVAR"); + } + + } + } catch (NullPointerException e) { + // Maneja la excepción o notifica el error + System.out.println("No se encontro el ID"); +} + + return "index.xhtml"; + } + + + public String desactivar(){ + try{ + Usuarios p = usuariosBL.buscarIdLi(new Usuarios(4)); + if(p.getStatus()==0){ + System.out.println("YA ESTA DESACTIVADO"); + }else{ + p.setStatus((short)0); + Mensaje m = usuariosBL.desactivarUsuarios(p); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("SE DESACTIVO CORRECTAMENTE"); + System.out.println(usuariosBL.desactivarUsuarios(p)); + }else{ + System.out.println("NO FUE POSIBLE DESACTIVAR"); + } + } + }catch (NullPointerException e) { + // Maneja la excepción o notifica el error + System.out.println("No se encontro el ID"); +} + return "index.xhtml"; + } + + public Usuarios getUsuario() { + return usuario; + } + + public void setUsuario(Usuarios usuario) { + this.usuario = usuario; + } + // Esto es nuevo creo es para la llave foranea de rol + public void agregarRol(){ + System.out.println(usuario.getRolid()); + } + + + + + + + public String editar() { + try{ + Usuarios a = usuariosBL.buscarIdLi(new Usuarios(9)); + a.setUsuario("dddddddddddd new"); + a.setPassword("12345"); + a.setFechaRegistro(new Date ()); + a.setRolid(rolBL.buscarIdLi(new Rol(4))); + + + Mensaje m = usuariosBL.editar(a); + System.out.println(m); + if(m.compareTo(Mensaje.SIN_ERROR)==0){ + System.out.println("Se edito el usuario"); + }else{ + System.out.println("NO SE PUDO"); + } + }catch (NullPointerException e) { + // Maneja la excepción o notifica el error + System.out.println("No se encontro el ID"); +} + + return "index.xhtml"; +} + //Metodo de logion + + + + +} diff --git a/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/SelectOneMenuConverter.java b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/SelectOneMenuConverter.java new file mode 100644 index 0000000..e774ef7 --- /dev/null +++ b/Inventario-war/src/java/mx/edu/tsj/chapala/sistemas/inventario/vista/SelectOneMenuConverter.java @@ -0,0 +1,90 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package mx.edu.tsj.chapala.sistemas.inventario.vista; + +import java.util.List; +import javax.faces.component.UIComponent; +import javax.faces.component.UISelectItem; +import javax.faces.component.UISelectItems; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.FacesConverter; + +/** + * The Class SelectOneMenuConverter. + */ +@FacesConverter("selectOneMenuConverter") +public class SelectOneMenuConverter implements Converter { + + @Override + public Object getAsObject(final FacesContext arg0, final UIComponent arg1, final String objectString) { + if (objectString == null) { + return null; + } + + return fromSelect(arg1, objectString); + } + + /** + * Serialize. + * + * @param object + * the object + * @return the string + */ + private String serialize(final Object object) { + if (object == null) { + return null; + } + return object.getClass() + "@" + object.hashCode(); + } + + /** + * From select. + * + * @param currentcomponent + * the currentcomponent + * @param objectString + * the object string + * @return the object + */ + private Object fromSelect(final UIComponent currentcomponent, final String objectString) { + + if (currentcomponent.getClass() == UISelectItem.class) { + final UISelectItem item = (UISelectItem) currentcomponent; + final Object value = item.getValue(); + if (objectString.equals(serialize(value))) { + return value; + } + } + + if (currentcomponent.getClass() == UISelectItems.class) { + final UISelectItems items = (UISelectItems) currentcomponent; + final List elements = (List) items.getValue(); + for (final Object element : elements) { + if (objectString.equals(serialize(element))) { + return element; + } + } + } + + + if (!currentcomponent.getChildren().isEmpty()) { + for (final UIComponent component : currentcomponent.getChildren()) { + final Object result = fromSelect(component, objectString); + if (result != null) { + return result; + } + } + } + return null; + } + + @Override + public String getAsString(final FacesContext arg0, final UIComponent arg1, final Object object) { + return serialize(object); + } + +} \ No newline at end of file diff --git a/Inventario-war/web/GeneroEliminar.xhtml b/Inventario-war/web/GeneroEliminar.xhtml new file mode 100644 index 0000000..f09c7e2 --- /dev/null +++ b/Inventario-war/web/GeneroEliminar.xhtml @@ -0,0 +1,91 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+ + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/WEB-INF/faces-config.xml b/Inventario-war/web/WEB-INF/faces-config.xml new file mode 100644 index 0000000..a0e4cf1 --- /dev/null +++ b/Inventario-war/web/WEB-INF/faces-config.xml @@ -0,0 +1,30 @@ + + + + + + mx.edu.tsj.chapala.sistemas.inventario.seguridad.AutorizacionListener + + diff --git a/Inventario-war/web/WEB-INF/glassfish-web.xml b/Inventario-war/web/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..584a477 --- /dev/null +++ b/Inventario-war/web/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Inventario-war/web/WEB-INF/web.xml b/Inventario-war/web/WEB-INF/web.xml new file mode 100644 index 0000000..601c31d --- /dev/null +++ b/Inventario-war/web/WEB-INF/web.xml @@ -0,0 +1,28 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/productosLista.xhtml + + + avax.faces.CONFIG_FILES + /WEB-INF/faces-config.xml + + diff --git a/Inventario-war/web/categoriaCrear.xhtml b/Inventario-war/web/categoriaCrear.xhtml new file mode 100644 index 0000000..4728c33 --- /dev/null +++ b/Inventario-war/web/categoriaCrear.xhtml @@ -0,0 +1,89 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + + + +
+ + + + +
+
+
+
+
+ + diff --git a/Inventario-war/web/categoriaEliminar.xhtml b/Inventario-war/web/categoriaEliminar.xhtml new file mode 100644 index 0000000..56625ee --- /dev/null +++ b/Inventario-war/web/categoriaEliminar.xhtml @@ -0,0 +1,91 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+ + + +
+
+
+
+ +
+ + + diff --git a/Inventario-war/web/categoriaLista.xhtml b/Inventario-war/web/categoriaLista.xhtml new file mode 100644 index 0000000..50aba8c --- /dev/null +++ b/Inventario-war/web/categoriaLista.xhtml @@ -0,0 +1,112 @@ + + + + + + + + + + + top + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + right + + + + + + + + + Lista de Categorias +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + bottom + +
+ + + \ No newline at end of file diff --git a/Inventario-war/web/colorCrear.xhtml b/Inventario-war/web/colorCrear.xhtml new file mode 100644 index 0000000..f041539 --- /dev/null +++ b/Inventario-war/web/colorCrear.xhtml @@ -0,0 +1,98 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + + + +
+ + + + + + + +
+
+
+ + +
+ +
+ + + diff --git a/Inventario-war/web/colorEliminar.xhtml b/Inventario-war/web/colorEliminar.xhtml new file mode 100644 index 0000000..9c85c82 --- /dev/null +++ b/Inventario-war/web/colorEliminar.xhtml @@ -0,0 +1,93 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + +
+
+ + +
+ + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/colorLista.xhtml b/Inventario-war/web/colorLista.xhtml new file mode 100644 index 0000000..e4e8a7d --- /dev/null +++ b/Inventario-war/web/colorLista.xhtml @@ -0,0 +1,120 @@ + + + + + + + + + + + + top + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + right + + + + + + + + + Lista de Colores +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + bottom + + + + +
+ + + + diff --git a/Inventario-war/web/generoCrear.xhtml b/Inventario-war/web/generoCrear.xhtml new file mode 100644 index 0000000..56e0672 --- /dev/null +++ b/Inventario-war/web/generoCrear.xhtml @@ -0,0 +1,88 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +

+ +
+ + + + + +
+ + + +
+
+
+
+
+ + diff --git a/Inventario-war/web/index.html b/Inventario-war/web/index.html new file mode 100644 index 0000000..4cea0a0 --- /dev/null +++ b/Inventario-war/web/index.html @@ -0,0 +1,15 @@ + + + + + TODO supply a title + + + + +
TODO write content
+ + diff --git a/Inventario-war/web/index.xhtml b/Inventario-war/web/index.xhtml new file mode 100644 index 0000000..af5262f --- /dev/null +++ b/Inventario-war/web/index.xhtml @@ -0,0 +1,85 @@ + + + + + Inventario + + +

OPCIONES:

+ +

Menu de Roles:

+ + + + + + + +

Menu de Usuarios:

+ + + + + + + + + +

Menu de Ubicaciones:

+ + + + + + + + + +

Menu de Productos

+ + + + + + + + + +

Menu de Genero:

+ + + + + +

Menu de Proveedores:

+ + + + + + + + + +

Menu de Categoria:

+ + + + + +

Menu de Marca:

+ + + + + +

Menu de Talla:

+ + + + + +
+
+ \ No newline at end of file diff --git a/Inventario-war/web/login.xhtml b/Inventario-war/web/login.xhtml new file mode 100644 index 0000000..957f6b2 --- /dev/null +++ b/Inventario-war/web/login.xhtml @@ -0,0 +1,37 @@ + + + + Inicio de sesión + + + + + + + + +

Iniciar sesión

+ + + + + + + + + + + + + + + + + +
+
+ diff --git a/Inventario-war/web/loginNew.xhtml b/Inventario-war/web/loginNew.xhtml new file mode 100644 index 0000000..f3963ad --- /dev/null +++ b/Inventario-war/web/loginNew.xhtml @@ -0,0 +1,15 @@ + + + + + + TODO supply a title + + + +
TODO write content
+ + diff --git a/Inventario-war/web/marcaCrear.xhtml b/Inventario-war/web/marcaCrear.xhtml new file mode 100644 index 0000000..469fb48 --- /dev/null +++ b/Inventario-war/web/marcaCrear.xhtml @@ -0,0 +1,91 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + + + +
+ + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/marcaEliminar.xhtml b/Inventario-war/web/marcaEliminar.xhtml new file mode 100644 index 0000000..d135994 --- /dev/null +++ b/Inventario-war/web/marcaEliminar.xhtml @@ -0,0 +1,90 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+ + +
+
+
+
+ +
+ + + diff --git a/Inventario-war/web/marcaLista.xhtml b/Inventario-war/web/marcaLista.xhtml new file mode 100644 index 0000000..3f0d607 --- /dev/null +++ b/Inventario-war/web/marcaLista.xhtml @@ -0,0 +1,110 @@ + + + + + + + + + + top + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + right + + + + + + + Lista de Marca +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + bottom + +
+ + + + diff --git a/Inventario-war/web/marcaLista3.xhtml b/Inventario-war/web/marcaLista3.xhtml new file mode 100644 index 0000000..da839a7 --- /dev/null +++ b/Inventario-war/web/marcaLista3.xhtml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + right + + + + + + + Lista de Usuarios +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + bottom + + + + +
+ + + + diff --git a/Inventario-war/web/productosCrear.xhtml b/Inventario-war/web/productosCrear.xhtml new file mode 100644 index 0000000..b4b5c25 --- /dev/null +++ b/Inventario-war/web/productosCrear.xhtml @@ -0,0 +1,177 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
+ +

+ + + + + + + + + + + + + +
+ + +
+
+ + +
+
+ + + + +
+ +
+ + +
+
+ + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+ + + + + + +
+
+
+ + + +
+ +
+ + + diff --git a/Inventario-war/web/productosEliminar.xhtml b/Inventario-war/web/productosEliminar.xhtml new file mode 100644 index 0000000..d312b92 --- /dev/null +++ b/Inventario-war/web/productosEliminar.xhtml @@ -0,0 +1,142 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/productosLista.xhtml b/Inventario-war/web/productosLista.xhtml new file mode 100644 index 0000000..fbfc46f --- /dev/null +++ b/Inventario-war/web/productosLista.xhtml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + top + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + right + + + + + + + + + Lista de Productos +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + bottom + + + + +
+ + + + + + diff --git a/Inventario-war/web/proveedorCrear.xhtml b/Inventario-war/web/proveedorCrear.xhtml new file mode 100644 index 0000000..de0d641 --- /dev/null +++ b/Inventario-war/web/proveedorCrear.xhtml @@ -0,0 +1,136 @@ + + + + + + + + + +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +

+ + +
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+ + + + +
+
+
+
+ +
+ + + diff --git a/Inventario-war/web/proveedorEliminar.xhtml b/Inventario-war/web/proveedorEliminar.xhtml new file mode 100644 index 0000000..e760779 --- /dev/null +++ b/Inventario-war/web/proveedorEliminar.xhtml @@ -0,0 +1,114 @@ + + + + + + + + + +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + +
+
+
+
+
+ + + diff --git a/Inventario-war/web/resources/css/cssLayout.css b/Inventario-war/web/resources/css/cssLayout.css new file mode 100644 index 0000000..c3b0026 --- /dev/null +++ b/Inventario-war/web/resources/css/cssLayout.css @@ -0,0 +1,104 @@ + +#top { + position: relative; + + background-color: #171a4a; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +.bottom-fixed { + position: fixed; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 90%; /* Ajusta el ancho según sea necesario */ + max-width: 600px; /* Ancho máximo opcional */ + background-color: #c2dfef; /* Color de fondo sólido */ + padding: 5px; + margin: 10px auto 0; /* Margen superior de 10px y centrado horizontal */ +} + + + +#left { + position: fixed; + top: 50px; /* Altura de la barra de navegación */ + left: 0; + bottom: 0; + width: 120px; + background-color: #FDFEFE; + padding: 5px; +} + + + + +#right { + float: right; + /*background-color: #ece3a5;*/ + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + +.container { + display:flex; + justify-content: center; + align-items: center; + height: 100%; + } + + .content { + background-color: white; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + max-width: 800px; /* Ajusta el ancho máximo según sea necesario */ + width: 100%; + + } + + .columnas{ + width: 10px; + } + + .columnas2{ + width: 17px; + } + + .centrar{ + text-align: center; + } + + diff --git a/Inventario-war/web/resources/css/default.css b/Inventario-war/web/resources/css/default.css new file mode 100644 index 0000000..334d1da --- /dev/null +++ b/Inventario-war/web/resources/css/default.css @@ -0,0 +1,32 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 20px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #1ABC9C; +} +tiered-menu-left { + text-align: left; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/Inventario-war/web/resources/css/styles.css b/Inventario-war/web/resources/css/styles.css new file mode 100644 index 0000000..b76e893 --- /dev/null +++ b/Inventario-war/web/resources/css/styles.css @@ -0,0 +1,72 @@ +body { + background-color: #f2f2f2; /* Color de fondo gris claro */ + font-family: Arial, sans-serif; /* Fuente para todo el cuerpo */ + margin: 0; + padding: 0; +} + +h1 { + text-align: center; + color: #333333; /* Color del texto de los títulos */ +} + +h2 { + text-align: center; + color: #333333; /* Color del texto de los subtítulos */ +} + +#loginForm { + width: 300px; + margin: 0 auto; /* Esto centra el formulario horizontalmente */ + margin-top: 30vh; /* Esto centra verticalmente el formulario */ + padding: 20px; + background-color: #ffffff; /* Color de fondo blanco */ + border-radius: 5px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra ligera */ + text-align: center; + +} + + + +#loginPanel { + margin-bottom: 20px; +} + +label { + display: block; + margin-bottom: 5px; + color: #333333; /* Color del texto de las etiquetas */ +} + +input[type="text"], +input[type="password"] { + width: 100%; + padding: 8px; + margin-bottom: 10px; + box-sizing: border-box; /* Para incluir el padding en el ancho total */ + border: 1px solid #cccccc; /* Borde gris claro */ + border-radius: 3px; +} + +input[type="submit"] { + width: 100%; + padding: 10px; + background-color: #007bff; /* Color de fondo azul */ + color: white; /* Color del texto blanco */ + border: none; + border-radius: 3px; + cursor: pointer; + + +} + +input[type="submit"]:hover { + background-color: #0056b3; /* Color de fondo azul oscuro al pasar el mouse */ +} + +.error { + color: #dc3545; /* Color rojo para mensajes de error */ + font-style: italic; +} + diff --git a/Inventario-war/web/rolCrear.xhtml b/Inventario-war/web/rolCrear.xhtml new file mode 100644 index 0000000..1a96fe3 --- /dev/null +++ b/Inventario-war/web/rolCrear.xhtml @@ -0,0 +1,98 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + + + + + + +
+ + + + + + +
+
+
+ + +
+ +
+ + + diff --git a/Inventario-war/web/rolEliminar.xhtml b/Inventario-war/web/rolEliminar.xhtml new file mode 100644 index 0000000..e8e8b9b --- /dev/null +++ b/Inventario-war/web/rolEliminar.xhtml @@ -0,0 +1,93 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + +
+
+ + +
+ + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/rolLista.xhtml b/Inventario-war/web/rolLista.xhtml new file mode 100644 index 0000000..b2b3430 --- /dev/null +++ b/Inventario-war/web/rolLista.xhtml @@ -0,0 +1,120 @@ + + + + + + + + + + + + top + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + right + + + + + + + + + Lista de Roles +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + bottom + + + + +
+ + + + diff --git a/Inventario-war/web/tallaCrear.xhtml b/Inventario-war/web/tallaCrear.xhtml new file mode 100644 index 0000000..04c5985 --- /dev/null +++ b/Inventario-war/web/tallaCrear.xhtml @@ -0,0 +1,94 @@ + + + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + + + + + +
+ + + + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/tallaEliminar.xhtml b/Inventario-war/web/tallaEliminar.xhtml new file mode 100644 index 0000000..9f2d6c1 --- /dev/null +++ b/Inventario-war/web/tallaEliminar.xhtml @@ -0,0 +1,89 @@ + + + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+ + +
+
+
+
+ +
+ + + diff --git a/Inventario-war/web/tallaLista.xhtml b/Inventario-war/web/tallaLista.xhtml new file mode 100644 index 0000000..15b3361 --- /dev/null +++ b/Inventario-war/web/tallaLista.xhtml @@ -0,0 +1,115 @@ + + + + + + + + + + top + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + right + + + + + + + + + Lista de Talla +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + bottom + + + + +
+ + + + diff --git a/Inventario-war/web/template/principal.xhtml b/Inventario-war/web/template/principal.xhtml new file mode 100644 index 0000000..223ce8a --- /dev/null +++ b/Inventario-war/web/template/principal.xhtml @@ -0,0 +1,50 @@ + + + + + + + + + Facelets Template + + + + + + + + + + + + + +
+ Top +
+ Sistema de Inventario +
+
+
+
+ Left +
+
+ +
+ Content +
+
+
+
+ +
+ +
+ + diff --git a/Inventario-war/web/template/productosP.xhtml b/Inventario-war/web/template/productosP.xhtml new file mode 100644 index 0000000..6130d51 --- /dev/null +++ b/Inventario-war/web/template/productosP.xhtml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + Facelets Template + + + + + + + +
+
+ Sistema de Inventario +
+
+
+
+ +
+ Opciones: + +
+ +
+
+ Content +
+
+
+ +
+ +
+ + diff --git a/Inventario-war/web/ubicacionCrear.xhtml b/Inventario-war/web/ubicacionCrear.xhtml new file mode 100644 index 0000000..7700148 --- /dev/null +++ b/Inventario-war/web/ubicacionCrear.xhtml @@ -0,0 +1,104 @@ + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ + +
+ + +
+
+ + +
+
+ + + + +
+ + + + + + +
+
+
+ + +
+ +
+ + + diff --git a/Inventario-war/web/ubicacionEliminar.xhtml b/Inventario-war/web/ubicacionEliminar.xhtml new file mode 100644 index 0000000..eb5bf1c --- /dev/null +++ b/Inventario-war/web/ubicacionEliminar.xhtml @@ -0,0 +1,99 @@ + + + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/ubicacionLista.xhtml b/Inventario-war/web/ubicacionLista.xhtml new file mode 100644 index 0000000..66c6797 --- /dev/null +++ b/Inventario-war/web/ubicacionLista.xhtml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + Lista de Almacenes +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + bottom + + + + +
+ + + + diff --git a/Inventario-war/web/usuarioCrear.xhtml b/Inventario-war/web/usuarioCrear.xhtml new file mode 100644 index 0000000..9a03c3f --- /dev/null +++ b/Inventario-war/web/usuarioCrear.xhtml @@ -0,0 +1,122 @@ + + + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+ +
+ + +
+ + + +
+ + + + +
+ +
+ + + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + + +
+
+
+ + +
+ +
+ + + diff --git a/Inventario-war/web/usuariosEliminar.xhtml b/Inventario-war/web/usuariosEliminar.xhtml new file mode 100644 index 0000000..463cd06 --- /dev/null +++ b/Inventario-war/web/usuariosEliminar.xhtml @@ -0,0 +1,113 @@ + + + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ +

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
+
+ + +
+
+ + +
+ + + +
+
+
+ +
+ +
+ + + diff --git a/Inventario-war/web/vistaGenero.xhtml b/Inventario-war/web/vistaGenero.xhtml new file mode 100644 index 0000000..b634d19 --- /dev/null +++ b/Inventario-war/web/vistaGenero.xhtml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + Lista de Genero +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + bottom + + + + +
+ + + diff --git a/Inventario-war/web/vistaProveedores.xhtml b/Inventario-war/web/vistaProveedores.xhtml new file mode 100644 index 0000000..81323d6 --- /dev/null +++ b/Inventario-war/web/vistaProveedores.xhtml @@ -0,0 +1,154 @@ + + + + + + + + + + + + top + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + Lista de Proveedores +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
+
+
+ + + bottom + + +
+ + + +