Lenovo
7 months ago
commit
1f0e8d1122
120 changed files with 12023 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||
/nbproject/private/ |
|||
/SystemInventory-ejb/nbproject/private/ |
|||
/SystemInventory-war/nbproject/private/ |
|||
/SystemInventory-ejb/build/ |
|||
/SystemInventory-war/build/ |
|||
/build/ |
|||
/SystemInventory-ejb/dist/ |
|||
/SystemInventory-war/dist/ |
|||
/dist/ |
@ -0,0 +1,68 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- You may freely edit this file. See commented blocks below for --> |
|||
<!-- some examples of how to customize the build. --> |
|||
<!-- (If you delete it and reopen the project it will be recreated.) --> |
|||
<!-- By default, only the Clean and Build commands use this build script. --> |
|||
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
|||
<!-- the Compile on Save feature is turned off for the project. --> |
|||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
|||
<!-- in the project's Project Properties dialog box.--> |
|||
<project name="SystemInventory-ejb" default="default" basedir="." xmlns:ejbjarproject="http://www.netbeans.org/ns/j2ee-ejbjarproject/3"> |
|||
<description>Builds, tests, and runs the project SystemInventory-ejb.</description> |
|||
<import file="nbproject/build-impl.xml"/> |
|||
<!-- |
|||
|
|||
There exist several targets which are by default empty and which can be |
|||
used for execution of your tasks. These targets are usually executed |
|||
before and after some main targets. They are: |
|||
|
|||
-pre-init: called before initialization of project properties |
|||
-post-init: called after initialization of project properties |
|||
-pre-compile: called before javac compilation |
|||
-post-compile: called after javac compilation |
|||
-pre-compile-single: called before javac compilation of single file |
|||
-post-compile-single: called after javac compilation of single file |
|||
-pre-dist: called before archive building |
|||
-post-dist: called after archive building |
|||
-post-clean: called after cleaning build products |
|||
-pre-run-deploy: called before deploying |
|||
-post-run-deploy: called after deploying |
|||
|
|||
(Targets beginning with '-' are not intended to be called on their own.) |
|||
|
|||
Example of pluging an obfuscator after the compilation could look like |
|||
|
|||
<target name="-post-compile"> |
|||
<obfuscate> |
|||
<fileset dir="${build.classes.dir}"/> |
|||
</obfuscate> |
|||
</target> |
|||
|
|||
For list of available properties check the imported |
|||
nbproject/build-impl.xml file. |
|||
|
|||
|
|||
Other way how to customize the build is by overriding existing main targets. |
|||
The target of interest are: |
|||
|
|||
init-macrodef-javac: defines macro for javac compilation |
|||
init-macrodef-debug: defines macro for class debugging |
|||
do-dist: archive building |
|||
run: execution of project |
|||
javadoc-build: javadoc generation |
|||
|
|||
Example of overriding the target for project execution could look like |
|||
|
|||
<target name="run" depends="<PROJNAME>-impl.jar"> |
|||
<exec dir="bin" executable="launcher.exe"> |
|||
<arg file="${dist.jar}"/> |
|||
</exec> |
|||
</target> |
|||
|
|||
Notice that overridden target depends on jar target and not only on |
|||
compile target as regular run target does. Again, for list of available |
|||
properties which you can use check the target you are overriding in |
|||
nbproject/build-impl.xml file. |
|||
|
|||
--> |
|||
</project> |
@ -0,0 +1,131 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
|
|||
Licensed to the Apache Software Foundation (ASF) under one |
|||
or more contributor license agreements. See the NOTICE file |
|||
distributed with this work for additional information |
|||
regarding copyright ownership. The ASF licenses this file |
|||
to you under the Apache License, Version 2.0 (the |
|||
"License"); you may not use this file except in compliance |
|||
with the License. You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, |
|||
software distributed under the License is distributed on an |
|||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
KIND, either express or implied. See the License for the |
|||
specific language governing permissions and limitations |
|||
under the License. |
|||
|
|||
--> |
|||
<project default="-deploy-ant" basedir="."> |
|||
<target name="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<property file="${deploy.ant.properties.file}" /> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> |
|||
<available file="${deploy.ant.resource.dir}" property="has.setup"/> |
|||
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> |
|||
</target> |
|||
|
|||
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<sun-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.sun.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.sun.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.gf.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.gf.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> |
|||
<property name="deploy.context.root.argument" value=""/> |
|||
</target> |
|||
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> |
|||
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}/META-INF"/> |
|||
<copy todir="${gfv3.resources.dir}/META-INF"> |
|||
<fileset dir="${deploy.ant.resource.dir}"/> |
|||
</copy> |
|||
<jar destfile="${deploy.ant.archive}" update="true"> |
|||
<fileset dir="${gfv3.resources.dir}"/> |
|||
</jar> |
|||
<delete dir="${gfv3.resources.dir}"/> |
|||
</target> |
|||
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> |
|||
<antcall target="-deploy-without-pw"/> |
|||
<antcall target="-deploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-deploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-deploy-with-pw" if="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<antcall target="-undeploy-without-pw"/> |
|||
<antcall target="-undeploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-undeploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-with-pw" if="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
</project> |
File diff suppressed because it is too large
@ -0,0 +1,8 @@ |
|||
build.xml.data.CRC32=1914e9dc |
|||
build.xml.script.CRC32=af2c0e6c |
|||
build.xml.stylesheet.CRC32=a737d6c5@1.75 |
|||
# 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=1914e9dc |
|||
nbproject/build-impl.xml.script.CRC32=8e621c99 |
|||
nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75 |
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://www.netbeans.org/ns/project/1"> |
|||
<type>org.netbeans.modules.j2ee.ejbjarproject</type> |
|||
<configuration> |
|||
<data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3"> |
|||
<name>SystemInventory-ejb</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<explicit-platform explicit-source-supported="true"/> |
|||
<source-roots> |
|||
<root id="src.dir"/> |
|||
</source-roots> |
|||
<test-roots> |
|||
<root id="test.src.dir"/> |
|||
</test-roots> |
|||
</data> |
|||
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> |
|||
<definitions>..\.\lib\nblibraries.properties</definitions> |
|||
</libraries> |
|||
</configuration> |
|||
</project> |
@ -0,0 +1,2 @@ |
|||
Manifest-Version: 1.0 |
|||
|
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> |
|||
<resources> |
|||
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false"> |
|||
<property name="serverName" value=""/> |
|||
<property name="User" value="root"/> |
|||
<property name="Password" value="juanca13"/> |
|||
<property name="URL" value="jdbc:mysql://:3306/inventario"/> |
|||
<property name="driverClass" value="org.gjt.mm.mysql.Driver"/> |
|||
</jdbc-connection-pool> |
|||
<jdbc-resource enabled="true" jndi-name="java:module/inventario" object-type="user" pool-name="mysql_rootPool"/> |
|||
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_inventario_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false"> |
|||
<property name="serverName" value="localhost"/> |
|||
<property name="portNumber" value="3306"/> |
|||
<property name="databaseName" value="inventario"/> |
|||
<property name="User" value="root"/> |
|||
<property name="Password" value="33475"/> |
|||
<property name="URL" value="jdbc:mysql://localhost:3306/inventario"/> |
|||
<property name="driverClass" value="org.gjt.mm.mysql.Driver"/> |
|||
</jdbc-connection-pool> |
|||
<jdbc-resource enabled="true" jndi-name="java:module/driver inventario" object-type="user" pool-name="mysql_inventario_rootPool"/> |
|||
</resources> |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> |
|||
<persistence-unit name="SystemInventory-ejbPU" transaction-type="JTA"> |
|||
<jta-data-source>jdbc/inventario</jta-data-source> |
|||
<exclude-unlisted-classes>false</exclude-unlisted-classes> |
|||
<properties/> |
|||
</persistence-unit> |
|||
</persistence> |
@ -0,0 +1,12 @@ |
|||
package mx.edu.tsj.chapala.sistemas; |
|||
|
|||
|
|||
public enum Mensaje { |
|||
SIN_ERROR, |
|||
CAMPOS_iNCOMPLETOS, |
|||
DATOS_INCORRECTOS, |
|||
ELEMENTO_DUPLICADO, |
|||
ELEMENTO_BORRADO |
|||
|
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Categoria; |
|||
|
|||
|
|||
public class CategoriaDao { |
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public CategoriaDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Categoria a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Categoria a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Categoria p = em.find(Categoria.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setNombre(p.getNombre()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Categoria a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Categoria buscarPorId(Categoria a){ |
|||
Query q =em.createNamedQuery("Categoria.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Categoria)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Categoria> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Categoria.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Estante; |
|||
|
|||
public class EstanteDao { |
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public EstanteDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Estante a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Estante a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Estante p = em.find(Estante.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setNumeroE(p.getNumeroE()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Estante a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Estante buscarPorId(Estante a){ |
|||
Query q =em.createNamedQuery("Estante.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Estante)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Estante> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Estante.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
} |
@ -0,0 +1,81 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Marca; |
|||
|
|||
|
|||
public class MarcaDao { |
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public MarcaDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Marca a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Marca a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Marca p = em.find(Marca.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setNombre(p.getNombre()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Marca a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Marca buscarPorId(Marca a){ |
|||
Query q =em.createNamedQuery("Marca.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Marca)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Marca> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Marca.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
public Marca buscarPorNombre(Marca a){ |
|||
Query q =em.createNamedQuery("Marca.findByNombre"); |
|||
q.setParameter("nombre", a.getNombre()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Marca)q.getResultList().get(0); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
@ -0,0 +1,82 @@ |
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; |
|||
|
|||
|
|||
public class PasilloDao { |
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public PasilloDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Pasillo a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Pasillo a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Pasillo p = em.find(Pasillo.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setId(p.getId()); |
|||
a.setNumeroP(p.getNumeroP()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Pasillo a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Pasillo buscarPorId(Pasillo a){ |
|||
Query q =em.createNamedQuery("Pasillo.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Pasillo)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Pasillo> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Pasillo.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
public Pasillo buscarPorNombre(Pasillo a){ |
|||
Query q =em.createNamedQuery("Pasillo.findByNumeroP"); |
|||
q.setParameter("Numero", a.getNumeroP()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Pasillo)q.getResultList().get(0); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,86 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Producto; |
|||
|
|||
|
|||
public class ProductoDao { |
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public ProductoDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Producto a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Producto a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Producto p = em.find(Producto.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setCodigo(p.getCodigo()); |
|||
a.setNombre(p.getNombre()); |
|||
a.setMarcaid(p.getMarcaid()); |
|||
a.setCategoriaid(p.getCategoriaid()); |
|||
a.setPrecio(p.getPrecio()); |
|||
a.setUbicacionid(p.getUbicacionid()); |
|||
a.setProovedorid(p.getProovedorid()); |
|||
a.setFecha(p.getFecha()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Producto a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Producto buscarPorId(Producto a){ |
|||
Query q =em.createNamedQuery("Producto.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Producto)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Producto> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Producto.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
public Producto buscarPorNombre(Producto a){ |
|||
Query q =em.createNamedQuery("Producto.findByNombre"); |
|||
q.setParameter("nombre", a.getNombre()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Producto)q.getResultList().get(0); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,73 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; |
|||
|
|||
|
|||
public class ProovedorDao { |
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public ProovedorDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Proovedor a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Proovedor a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Proovedor p = em.find(Proovedor.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setNombre(p.getNombre()); |
|||
a.setDireccion(p.getDireccion()); |
|||
a.setMail(p.getMail()); |
|||
a.setTelefono(p.getTelefono()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Proovedor a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Proovedor buscarPorId(Proovedor a){ |
|||
Query q =em.createNamedQuery("Proovedor.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Proovedor)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Proovedor> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Proovedor.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,79 @@ |
|||
/* |
|||
* 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.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; |
|||
|
|||
/** |
|||
* |
|||
* @author mauricionunezrodriguez |
|||
*/ |
|||
public class ResguardoDao { |
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public ResguardoDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Resguardo a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Resguardo a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Resguardo p = em.find(Resguardo.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setProductoId(p.getProductoId()); |
|||
a.setUsuarioid(p.getUsuarioid()); |
|||
a.setFecha(p.getFecha()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Resguardo a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Resguardo buscarPorId(Resguardo a){ |
|||
Query q =em.createNamedQuery("Resguardo.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Resguardo)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Resguardo> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Resguardo.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/* |
|||
* 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.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Rol; |
|||
|
|||
/** |
|||
* |
|||
* @author mauricionunezrodriguez |
|||
*/ |
|||
public class RolDao { |
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public RolDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Rol a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Rol a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Rol p = em.find(Rol.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setNombre(p.getNombre()); |
|||
a.setDescripcion(p.getDescripcion()); |
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Rol a){ |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Rol buscarPorId(Rol a){ |
|||
Query q =em.createNamedQuery("Rol.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Rol)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Rol> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Rol.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
} |
@ -0,0 +1,83 @@ |
|||
package mx.edu.tsj.chapala.sistemas.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; |
|||
|
|||
|
|||
public class UbicacionDao { |
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public UbicacionDao(){ |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
} |
|||
|
|||
|
|||
public void agregar(Ubicacion a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Ubicacion a) { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Ubicacion p = em.find(Ubicacion.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setEstanteid(p.getEstanteid()); |
|||
a.setPasilloId(p.getPasilloId()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
|
|||
} |
|||
|
|||
public void editar(Ubicacion a){ |
|||
buscarPorId(a); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Ubicacion buscarPorId(Ubicacion a){ |
|||
Query q =em.createNamedQuery("Ubicacion.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Ubicacion)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Ubicacion> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Ubicacion.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
public Ubicacion buscarPorNombre(Ubicacion a){ |
|||
Query q =em.createNamedQuery("Ubicacion.findById"); |
|||
q.setParameter("Ubicacion", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Ubicacion)q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,101 @@ |
|||
/* |
|||
* 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.Dao; |
|||
|
|||
import java.util.List; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.NoResultException; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import javax.persistence.TypedQuery; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Usuario; |
|||
|
|||
/** |
|||
* |
|||
* @author mauricionunezrodriguez |
|||
*/ |
|||
public class UsuarioDao { |
|||
|
|||
|
|||
private EntityManager em;//Manejador de Entidades
|
|||
|
|||
public UsuarioDao(){ |
|||
|
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
em=emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
|
|||
public void agregar(Usuario a){ |
|||
em.getTransaction().begin(); |
|||
em.persist(a); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public boolean eliminar(Usuario a) { |
|||
em.getTransaction().begin(); |
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Usuario u = em.find(Usuario.class, a.getId()); |
|||
|
|||
// Conservar datos existentes
|
|||
a.setNombre(u.getNombre()); |
|||
a.setPass(u.getPass()); |
|||
a.setMail(u.getMail()); |
|||
a.setTelefono(u.getTelefono()); |
|||
a.setRolid(u.getRolid()); |
|||
|
|||
// Modificar solo el estado
|
|||
a.setStatus(0); |
|||
// Fusionar los cambios en la entidad proveedor
|
|||
em.merge(a); |
|||
// Finalizar transacción
|
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
|
|||
public void editar(Usuario a){ |
|||
a.setStatus(1); |
|||
em.getTransaction().begin(); |
|||
em.merge(a);//edita en la base de datos
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public Usuario buscarPorId(Usuario a){ |
|||
Query q =em.createNamedQuery("Usuario.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if(q.getResultList().isEmpty()){ |
|||
return null; |
|||
}else{ |
|||
|
|||
return (Usuario)q.getResultList().get(0); |
|||
} |
|||
} |
|||
public List<Usuario> getTodos(boolean status){ |
|||
Query q =em.createNamedQuery("Usuario.findByStatus"); |
|||
int s = status?1:0; |
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
public boolean validarLogin(String nombre, String pass) { |
|||
try { |
|||
// Crear la consulta nombrada
|
|||
TypedQuery<Usuario> query = em.createNamedQuery("Usuario.Login", Usuario.class); |
|||
// Establecer los parámetros de la consulta
|
|||
query.setParameter("nombre", nombre); |
|||
query.setParameter("pass", pass); |
|||
// Ejecutar la consulta y obtener el resultado
|
|||
Usuario usuario = query.getSingleResult(); |
|||
// Si se encontró un usuario, la validación es exitosa
|
|||
return usuario != null; |
|||
} catch (NoResultException e) { |
|||
// Si no se encontró ningún resultado, la validación falla
|
|||
return false; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,60 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.CategoriaDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Categoria; |
|||
|
|||
|
|||
@Stateless |
|||
public class CategoriaBL implements CategoriaBLLocal { |
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Categoria a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
CategoriaDao categoriaDao =new CategoriaDao(); |
|||
categoriaDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Categoria buscarId(Categoria b) { |
|||
CategoriaDao a = new CategoriaDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Categoria b) { |
|||
CategoriaDao a = new CategoriaDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Categoria b) { |
|||
CategoriaDao a = new CategoriaDao(); |
|||
a.editar(b); |
|||
} |
|||
|
|||
@Override |
|||
public List<Categoria> getALLCategoria(boolean status) { |
|||
CategoriaDao n = new CategoriaDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Categoria; |
|||
|
|||
|
|||
@Local |
|||
public interface CategoriaBLLocal { |
|||
|
|||
Mensaje agregar(Categoria b); |
|||
|
|||
Categoria buscarId(Categoria b); |
|||
|
|||
Mensaje eliminar(Categoria b); |
|||
|
|||
void editar(Categoria b); |
|||
|
|||
public List<Categoria> getALLCategoria(boolean status); |
|||
} |
@ -0,0 +1,66 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.EstanteDao; |
|||
|
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Estante; |
|||
|
|||
|
|||
|
|||
@Stateless |
|||
public class EstanteBL implements EstanteBLLocal { |
|||
|
|||
|
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Estante a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
EstanteDao ubicacionDao =new EstanteDao(); |
|||
ubicacionDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Estante buscarId(Estante b) { |
|||
EstanteDao a = new EstanteDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Estante b) { |
|||
EstanteDao a = new EstanteDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Estante b) { |
|||
EstanteDao a = new EstanteDao(); |
|||
a.editar(b); |
|||
} |
|||
|
|||
@Override |
|||
public List<Estante> getALLE(boolean status) { |
|||
EstanteDao n = new EstanteDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Estante; |
|||
|
|||
|
|||
@Local |
|||
public interface EstanteBLLocal { |
|||
|
|||
|
|||
Mensaje agregar(Estante b); |
|||
|
|||
Estante buscarId(Estante b); |
|||
|
|||
Mensaje eliminar(Estante b); |
|||
|
|||
void editar(Estante b); |
|||
|
|||
List<Estante> getALLE(boolean status); |
|||
|
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.MarcaDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Marca; |
|||
|
|||
|
|||
@Stateless |
|||
public class MarcaBL implements MarcaBLLocal { |
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Marca a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
MarcaDao marcaDao =new MarcaDao(); |
|||
marcaDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Marca buscarId(Marca b) { |
|||
MarcaDao a = new MarcaDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Marca b) { |
|||
MarcaDao a = new MarcaDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Marca b) { |
|||
MarcaDao a = new MarcaDao(); |
|||
a.editar(b); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Marca> getALL (boolean status) { |
|||
MarcaDao n = new MarcaDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Marca; |
|||
|
|||
|
|||
@Local |
|||
public interface MarcaBLLocal { |
|||
|
|||
Mensaje agregar(Marca b); |
|||
|
|||
Marca buscarId(Marca b); |
|||
|
|||
Mensaje eliminar(Marca b); |
|||
|
|||
void editar(Marca b); |
|||
|
|||
public List<Marca> getALL(boolean status); |
|||
} |
@ -0,0 +1,60 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.PasilloDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; |
|||
|
|||
|
|||
@Stateless |
|||
public class PasilloBL implements PasilloBLLocal { |
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
@Override |
|||
public Mensaje agregar(Pasillo a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
PasilloDao pasilloDao =new PasilloDao(); |
|||
pasilloDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Pasillo buscarId(Pasillo b) { |
|||
PasilloDao a = new PasilloDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Pasillo b) { |
|||
PasilloDao a = new PasilloDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Pasillo b) { |
|||
PasilloDao a = new PasilloDao(); |
|||
a.editar(b); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Pasillo> getALL (boolean status) { |
|||
PasilloDao n = new PasilloDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; |
|||
|
|||
@Local |
|||
public interface PasilloBLLocal { |
|||
|
|||
|
|||
Mensaje agregar(Pasillo b); |
|||
|
|||
Pasillo buscarId(Pasillo b); |
|||
|
|||
Mensaje eliminar(Pasillo b); |
|||
|
|||
void editar(Pasillo b); |
|||
|
|||
public List<Pasillo> getALL (boolean status); |
|||
} |
@ -0,0 +1,61 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.ProductoDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Producto; |
|||
|
|||
@Stateless |
|||
public class ProductoBL implements ProductoBLLocal { |
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Producto a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
ProductoDao productoDao =new ProductoDao(); |
|||
productoDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Producto buscarId(Producto b) { |
|||
ProductoDao a = new ProductoDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Producto b) { |
|||
ProductoDao a = new ProductoDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Producto b) { |
|||
ProductoDao a = new ProductoDao(); |
|||
a.editar(b); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Producto> getALL (boolean status) { |
|||
ProductoDao n = new ProductoDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
|
|||
*/ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Producto; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; |
|||
|
|||
|
|||
@Local |
|||
public interface ProductoBLLocal { |
|||
|
|||
Mensaje agregar(Producto b); |
|||
|
|||
Producto buscarId(Producto b); |
|||
|
|||
Mensaje eliminar(Producto b); |
|||
|
|||
void editar(Producto b); |
|||
|
|||
public List<Producto> getALL(boolean status); |
|||
} |
@ -0,0 +1,61 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
|
|||
import mx.edu.tsj.chapala.sistemas.Dao.ProovedorDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
|
|||
import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; |
|||
|
|||
|
|||
@Stateless |
|||
public class ProovedorBL implements ProovedorBLLocal { |
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Proovedor a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
ProovedorDao proovedorDao =new ProovedorDao(); |
|||
proovedorDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Proovedor buscarId(Proovedor b) { |
|||
ProovedorDao a = new ProovedorDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public Mensaje eliminar(Proovedor b) { |
|||
ProovedorDao a = new ProovedorDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Proovedor b) { |
|||
ProovedorDao a = new ProovedorDao(); |
|||
a.editar(b); |
|||
} |
|||
@Override |
|||
public List<Proovedor> getALLProveedor(boolean status) { |
|||
ProovedorDao n = new ProovedorDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; |
|||
|
|||
@Local |
|||
public interface ProovedorBLLocal { |
|||
|
|||
Mensaje agregar(Proovedor b); |
|||
|
|||
Proovedor buscarId(Proovedor b); |
|||
|
|||
Mensaje eliminar(Proovedor b); |
|||
|
|||
void editar(Proovedor b); |
|||
|
|||
List<Proovedor> getALLProveedor(boolean status); |
|||
|
|||
} |
@ -0,0 +1,67 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
|
|||
*/ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.ResguardoDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; |
|||
|
|||
/** |
|||
* |
|||
* @author mauricionunezrodriguez |
|||
*/ |
|||
@Stateless |
|||
public class ResguardoBL implements ResguardoBLLocal { |
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Resguardo a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
ResguardoDao RD =new ResguardoDao(); |
|||
RD.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Resguardo buscarId(Resguardo b) { |
|||
ResguardoDao a = new ResguardoDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public Mensaje eliminar(Resguardo b) { |
|||
ResguardoDao a = new ResguardoDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Resguardo b) { |
|||
ResguardoDao a = new ResguardoDao(); |
|||
a.editar(b); |
|||
} |
|||
|
|||
@Override |
|||
public List<Resguardo> getALL(boolean status){ |
|||
ResguardoDao n = new ResguardoDao(); |
|||
List<Resguardo> l = n.getTodos(status); |
|||
return l; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
|
|||
*/ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; |
|||
|
|||
/** |
|||
* |
|||
* @author mauricionunezrodriguez |
|||
*/ |
|||
@Local |
|||
public interface ResguardoBLLocal { |
|||
|
|||
Mensaje agregar( Resguardo b); |
|||
|
|||
Resguardo buscarId( Resguardo b); |
|||
|
|||
Mensaje eliminar( Resguardo b); |
|||
|
|||
void editar( Resguardo b); |
|||
|
|||
public List<Resguardo> getALL(boolean status); |
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
|
|||
*/ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.RolDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Rol; |
|||
|
|||
@Stateless |
|||
public class RolBL implements RolBLLocal { |
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Rol a) { |
|||
System.out.println("llegaste al metodo"); |
|||
RolDao Rol =new RolDao(); |
|||
Rol.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Rol buscarId(Rol a) { |
|||
RolDao Rol = new RolDao(); |
|||
|
|||
return Rol.buscarPorId(a); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Rol a) { |
|||
RolDao Rol = new RolDao(); |
|||
Rol.eliminar(a); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Rol a) { |
|||
RolDao Rol = new RolDao(); |
|||
Rol.editar(a); |
|||
} |
|||
|
|||
@Override |
|||
public List<Rol> getALL(boolean status){ |
|||
RolDao n = new RolDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
} |
|||
|
|||
|
@ -0,0 +1,26 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
|
|||
*/ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Rol; |
|||
|
|||
|
|||
@Local |
|||
public interface RolBLLocal { |
|||
|
|||
Mensaje agregar(Rol a); |
|||
|
|||
Rol buscarId(Rol a); |
|||
|
|||
Mensaje eliminar(Rol a); |
|||
|
|||
void editar(Rol a); |
|||
|
|||
public List<Rol> getALL(boolean status); |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.UbicacionDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; |
|||
|
|||
|
|||
@Stateless |
|||
public class UbicacionBL implements UbicacionBLLocal { |
|||
|
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
@Override |
|||
public Mensaje agregar(Ubicacion a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
UbicacionDao ubicacionDao =new UbicacionDao(); |
|||
ubicacionDao.agregar(a); |
|||
return Mensaje.SIN_ERROR; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Ubicacion buscarId(Ubicacion b) { |
|||
UbicacionDao a = new UbicacionDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Ubicacion b) { |
|||
UbicacionDao a = new UbicacionDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Ubicacion b) { |
|||
UbicacionDao a = new UbicacionDao(); |
|||
a.editar(b); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public List<Ubicacion> getALL (boolean status) { |
|||
UbicacionDao n = new UbicacionDao(); |
|||
return n.getTodos(status); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; |
|||
|
|||
@Local |
|||
public interface UbicacionBLLocal { |
|||
|
|||
|
|||
|
|||
Mensaje agregar( Ubicacion b); |
|||
|
|||
Ubicacion buscarId( Ubicacion b); |
|||
|
|||
Mensaje eliminar( Ubicacion b); |
|||
|
|||
void editar( Ubicacion b); |
|||
|
|||
public List<Ubicacion> getALL(boolean status); |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
|
|||
*/ |
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Stateless; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.NoResultException; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.TypedQuery; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.UsuarioDao; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Usuario; |
|||
|
|||
|
|||
@Stateless |
|||
public class UsuarioBL implements UsuarioBLLocal { |
|||
|
|||
private EntityManager em; |
|||
EntityManagerFactory emf= Persistence.createEntityManagerFactory("SystemInventory-ejbPU"); |
|||
|
|||
|
|||
|
|||
@Override |
|||
public Mensaje agregar(Usuario a) { |
|||
|
|||
System.out.println("llegaste al metodo"); |
|||
UsuarioDao u =new UsuarioDao(); |
|||
u.agregar(a); |
|||
return Mensaje.ELEMENTO_DUPLICADO; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Usuario buscarId(Usuario b) { |
|||
UsuarioDao a = new UsuarioDao(); |
|||
|
|||
return a.buscarPorId(b); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje eliminar(Usuario b) { |
|||
UsuarioDao a = new UsuarioDao(); |
|||
a.eliminar(b); |
|||
return Mensaje.ELEMENTO_BORRADO; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Usuario b) { |
|||
UsuarioDao a = new UsuarioDao(); |
|||
a.editar(b); |
|||
} |
|||
|
|||
@Override |
|||
public List<Usuario> getALL (boolean status){ |
|||
UsuarioDao u = new UsuarioDao(); |
|||
List<Usuario> l = u.getTodos(status); |
|||
return l; |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
|
|||
package mx.edu.tsj.chapala.sistemas.controller; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Usuario; |
|||
|
|||
|
|||
@Local |
|||
public interface UsuarioBLLocal { |
|||
|
|||
Mensaje agregar(Usuario b); |
|||
|
|||
Usuario buscarId(Usuario b); |
|||
|
|||
Mensaje eliminar(Usuario b); |
|||
|
|||
void editar(Usuario b); |
|||
|
|||
public List<Usuario> getALL(boolean status); |
|||
|
|||
} |
@ -0,0 +1,128 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "categoria", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Categoria.findAll", query = "SELECT c FROM Categoria c"), |
|||
@NamedQuery(name = "Categoria.findById", query = "SELECT c FROM Categoria c WHERE c.id = :id"), |
|||
@NamedQuery(name = "Categoria.findByNombre", query = "SELECT c FROM Categoria c WHERE c.nombre = :nombre"), |
|||
@NamedQuery(name = "Categoria.findByStatus", query = "SELECT c FROM Categoria c WHERE c.status = :status")}) |
|||
public class Categoria implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 30) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaid") |
|||
private List<Producto> productoList; |
|||
|
|||
public Categoria() { |
|||
} |
|||
|
|||
public Categoria(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Categoria(Integer id, String nombre, int status) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> productoList) { |
|||
this.productoList = productoList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Categoria)) { |
|||
return false; |
|||
} |
|||
Categoria other = (Categoria) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Categoria[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,126 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "estante", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Estante.findAll", query = "SELECT e FROM Estante e"), |
|||
@NamedQuery(name = "Estante.findById", query = "SELECT e FROM Estante e WHERE e.id = :id"), |
|||
@NamedQuery(name = "Estante.findByNumeroE", query = "SELECT e FROM Estante e WHERE e.numeroE = :numeroE"), |
|||
@NamedQuery(name = "Estante.findByStatus", query = "SELECT e FROM Estante e WHERE e.status = :status")}) |
|||
public class Estante implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "numeroE") |
|||
private int numeroE; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "estanteid") |
|||
private List<Ubicacion> ubicacionList; |
|||
|
|||
public Estante() { |
|||
} |
|||
|
|||
public Estante(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Estante(Integer id, int numeroE, int status) { |
|||
this.id = id; |
|||
this.numeroE = numeroE; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public int getNumeroE() { |
|||
return numeroE; |
|||
} |
|||
|
|||
public void setNumeroE(int numeroE) { |
|||
this.numeroE = numeroE; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Ubicacion> getUbicacionList() { |
|||
return ubicacionList; |
|||
} |
|||
|
|||
public void setUbicacionList(List<Ubicacion> ubicacionList) { |
|||
this.ubicacionList = ubicacionList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Estante)) { |
|||
return false; |
|||
} |
|||
Estante other = (Estante) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Estante[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,128 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "marca", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Marca.findAll", query = "SELECT m FROM Marca m"), |
|||
@NamedQuery(name = "Marca.findById", query = "SELECT m FROM Marca m WHERE m.id = :id"), |
|||
@NamedQuery(name = "Marca.findByNombre", query = "SELECT m FROM Marca m WHERE m.nombre = :nombre"), |
|||
@NamedQuery(name = "Marca.findByStatus", query = "SELECT m FROM Marca m WHERE m.status = :status")}) |
|||
public class Marca implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 20) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "marcaid") |
|||
private List<Producto> productoList; |
|||
|
|||
public Marca() { |
|||
} |
|||
|
|||
public Marca(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Marca(Integer id, String nombre, int status) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> productoList) { |
|||
this.productoList = productoList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Marca)) { |
|||
return false; |
|||
} |
|||
Marca other = (Marca) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Marca[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,126 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "pasillo", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Pasillo.findAll", query = "SELECT p FROM Pasillo p"), |
|||
@NamedQuery(name = "Pasillo.findById", query = "SELECT p FROM Pasillo p WHERE p.id = :id"), |
|||
@NamedQuery(name = "Pasillo.findByNumeroP", query = "SELECT p FROM Pasillo p WHERE p.numeroP = :numeroP"), |
|||
@NamedQuery(name = "Pasillo.findByStatus", query = "SELECT p FROM Pasillo p WHERE p.status = :status")}) |
|||
public class Pasillo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "numeroP") |
|||
private int numeroP; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "pasilloId") |
|||
private List<Ubicacion> ubicacionList; |
|||
|
|||
public Pasillo() { |
|||
} |
|||
|
|||
public Pasillo(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Pasillo(Integer id, int numeroP, int status) { |
|||
this.id = id; |
|||
this.numeroP = numeroP; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public int getNumeroP() { |
|||
return numeroP; |
|||
} |
|||
|
|||
public void setNumeroP(int numeroP) { |
|||
this.numeroP = numeroP; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Ubicacion> getUbicacionList() { |
|||
return ubicacionList; |
|||
} |
|||
|
|||
public void setUbicacionList(List<Ubicacion> ubicacionList) { |
|||
this.ubicacionList = ubicacionList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Pasillo)) { |
|||
return false; |
|||
} |
|||
Pasillo other = (Pasillo) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Pasillo[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,221 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.JoinColumn; |
|||
import javax.persistence.ManyToOne; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.persistence.Temporal; |
|||
import javax.persistence.TemporalType; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "producto", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Producto.findAll", query = "SELECT p FROM Producto p"), |
|||
@NamedQuery(name = "Producto.findById", query = "SELECT p FROM Producto p WHERE p.id = :id"), |
|||
@NamedQuery(name = "Producto.findByCodigo", query = "SELECT p FROM Producto p WHERE p.codigo = :codigo"), |
|||
@NamedQuery(name = "Producto.findByNombre", query = "SELECT p FROM Producto p WHERE p.nombre = :nombre"), |
|||
@NamedQuery(name = "Producto.findByPrecio", query = "SELECT p FROM Producto p WHERE p.precio = :precio"), |
|||
@NamedQuery(name = "Producto.findByFecha", query = "SELECT p FROM Producto p WHERE p.fecha = :fecha"), |
|||
@NamedQuery(name = "Producto.findByStatus", query = "SELECT p FROM Producto p WHERE p.status = :status")}) |
|||
public class Producto implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 20) |
|||
@Column(name = "codigo") |
|||
private String codigo; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 50) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "precio") |
|||
private float precio; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "fecha") |
|||
@Temporal(TemporalType.DATE) |
|||
private Date fecha; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "productoId") |
|||
private List<Resguardo> resguardoList; |
|||
@JoinColumn(name = "Categoria_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Categoria categoriaid; |
|||
@JoinColumn(name = "Marca_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Marca marcaid; |
|||
@JoinColumn(name = "Proovedor_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Proovedor proovedorid; |
|||
@JoinColumn(name = "Ubicacion_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Ubicacion ubicacionid; |
|||
|
|||
public Producto() { |
|||
} |
|||
|
|||
public Producto(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Producto(Integer id, String codigo, String nombre, float precio, Date fecha, int status) { |
|||
this.id = id; |
|||
this.codigo = codigo; |
|||
this.nombre = nombre; |
|||
this.precio = precio; |
|||
this.fecha = fecha; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getCodigo() { |
|||
return codigo; |
|||
} |
|||
|
|||
public void setCodigo(String codigo) { |
|||
this.codigo = codigo; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public float getPrecio() { |
|||
return precio; |
|||
} |
|||
|
|||
public void setPrecio(float precio) { |
|||
this.precio = precio; |
|||
} |
|||
|
|||
public Date getFecha() { |
|||
return fecha; |
|||
} |
|||
|
|||
public void setFecha(Date fecha) { |
|||
this.fecha = fecha; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Resguardo> getResguardoList() { |
|||
return resguardoList; |
|||
} |
|||
|
|||
public void setResguardoList(List<Resguardo> resguardoList) { |
|||
this.resguardoList = resguardoList; |
|||
} |
|||
|
|||
public Categoria getCategoriaid() { |
|||
return categoriaid; |
|||
} |
|||
|
|||
public void setCategoriaid(Categoria categoriaid) { |
|||
this.categoriaid = categoriaid; |
|||
} |
|||
|
|||
public Marca getMarcaid() { |
|||
return marcaid; |
|||
} |
|||
|
|||
public void setMarcaid(Marca marcaid) { |
|||
this.marcaid = marcaid; |
|||
} |
|||
|
|||
public Proovedor getProovedorid() { |
|||
return proovedorid; |
|||
} |
|||
|
|||
public void setProovedorid(Proovedor proovedorid) { |
|||
this.proovedorid = proovedorid; |
|||
} |
|||
|
|||
public Ubicacion getUbicacionid() { |
|||
return ubicacionid; |
|||
} |
|||
|
|||
public void setUbicacionid(Ubicacion ubicacionid) { |
|||
this.ubicacionid = ubicacionid; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Producto)) { |
|||
return false; |
|||
} |
|||
Producto other = (Producto) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Producto[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,173 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "proovedor", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Proovedor.findAll", query = "SELECT p FROM Proovedor p"), |
|||
@NamedQuery(name = "Proovedor.findById", query = "SELECT p FROM Proovedor p WHERE p.id = :id"), |
|||
@NamedQuery(name = "Proovedor.findByNombre", query = "SELECT p FROM Proovedor p WHERE p.nombre = :nombre"), |
|||
@NamedQuery(name = "Proovedor.findByDireccion", query = "SELECT p FROM Proovedor p WHERE p.direccion = :direccion"), |
|||
@NamedQuery(name = "Proovedor.findByMail", query = "SELECT p FROM Proovedor p WHERE p.mail = :mail"), |
|||
@NamedQuery(name = "Proovedor.findByTelefono", query = "SELECT p FROM Proovedor p WHERE p.telefono = :telefono"), |
|||
@NamedQuery(name = "Proovedor.findByStatus", query = "SELECT p FROM Proovedor p WHERE p.status = :status")}) |
|||
public class Proovedor implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 40) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 20) |
|||
@Column(name = "direccion") |
|||
private String direccion; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 30) |
|||
@Column(name = "mail") |
|||
private String mail; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 15) |
|||
@Column(name = "telefono") |
|||
private String telefono; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "proovedorid") |
|||
private List<Producto> productoList; |
|||
|
|||
public Proovedor() { |
|||
} |
|||
|
|||
public Proovedor(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Proovedor(Integer id, String nombre, String direccion, String mail, String telefono, int status) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.direccion = direccion; |
|||
this.mail = mail; |
|||
this.telefono = telefono; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public String getDireccion() { |
|||
return direccion; |
|||
} |
|||
|
|||
public void setDireccion(String direccion) { |
|||
this.direccion = direccion; |
|||
} |
|||
|
|||
public String getMail() { |
|||
return mail; |
|||
} |
|||
|
|||
public void setMail(String mail) { |
|||
this.mail = mail; |
|||
} |
|||
|
|||
public String getTelefono() { |
|||
return telefono; |
|||
} |
|||
|
|||
public void setTelefono(String telefono) { |
|||
this.telefono = telefono; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> productoList) { |
|||
this.productoList = productoList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Proovedor)) { |
|||
return false; |
|||
} |
|||
Proovedor other = (Proovedor) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Proovedor[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,139 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.JoinColumn; |
|||
import javax.persistence.ManyToOne; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.Table; |
|||
import javax.persistence.Temporal; |
|||
import javax.persistence.TemporalType; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "resguardo", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Resguardo.findAll", query = "SELECT r FROM Resguardo r"), |
|||
@NamedQuery(name = "Resguardo.findById", query = "SELECT r FROM Resguardo r WHERE r.id = :id"), |
|||
@NamedQuery(name = "Resguardo.findByFecha", query = "SELECT r FROM Resguardo r WHERE r.fecha = :fecha"), |
|||
@NamedQuery(name = "Resguardo.findByStatus", query = "SELECT r FROM Resguardo r WHERE r.status = :status")}) |
|||
public class Resguardo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "fecha") |
|||
@Temporal(TemporalType.DATE) |
|||
private Date fecha; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@JoinColumn(name = "producto_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Producto productoId; |
|||
@JoinColumn(name = "Usuario_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Usuario usuarioid; |
|||
|
|||
public Resguardo() { |
|||
} |
|||
|
|||
public Resguardo(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Resguardo(Integer id, Date fecha, int status) { |
|||
this.id = id; |
|||
this.fecha = fecha; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Date getFecha() { |
|||
return fecha; |
|||
} |
|||
|
|||
public void setFecha(Date fecha) { |
|||
this.fecha = fecha; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Producto getProductoId() { |
|||
return productoId; |
|||
} |
|||
|
|||
public void setProductoId(Producto productoId) { |
|||
this.productoId = productoId; |
|||
} |
|||
|
|||
public Usuario getUsuarioid() { |
|||
return usuarioid; |
|||
} |
|||
|
|||
public void setUsuarioid(Usuario usuarioid) { |
|||
this.usuarioid = usuarioid; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Resguardo)) { |
|||
return false; |
|||
} |
|||
Resguardo other = (Resguardo) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Resguardo[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,143 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "rol", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Rol.findAll", query = "SELECT r FROM Rol r"), |
|||
@NamedQuery(name = "Rol.findById", query = "SELECT r FROM Rol r WHERE r.id = :id"), |
|||
@NamedQuery(name = "Rol.findByNombre", query = "SELECT r FROM Rol r WHERE r.nombre = :nombre"), |
|||
@NamedQuery(name = "Rol.findByDescripcion", query = "SELECT r FROM Rol r WHERE r.descripcion = :descripcion"), |
|||
@NamedQuery(name = "Rol.findByStatus", query = "SELECT r FROM Rol r WHERE r.status = :status")}) |
|||
public class Rol implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 30) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 100) |
|||
@Column(name = "descripcion") |
|||
private String descripcion; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "rolid") |
|||
private List<Usuario> usuarioList; |
|||
|
|||
public Rol() { |
|||
} |
|||
|
|||
public Rol(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Rol(Integer id, String nombre, String descripcion, int status) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.descripcion = descripcion; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public String getDescripcion() { |
|||
return descripcion; |
|||
} |
|||
|
|||
public void setDescripcion(String descripcion) { |
|||
this.descripcion = descripcion; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Usuario> getUsuarioList() { |
|||
return usuarioList; |
|||
} |
|||
|
|||
public void setUsuarioList(List<Usuario> usuarioList) { |
|||
this.usuarioList = usuarioList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Rol)) { |
|||
return false; |
|||
} |
|||
Rol other = (Rol) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Rol[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,136 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.JoinColumn; |
|||
import javax.persistence.ManyToOne; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "ubicacion", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Ubicacion.findAll", query = "SELECT u FROM Ubicacion u"), |
|||
@NamedQuery(name = "Ubicacion.findById", query = "SELECT u FROM Ubicacion u WHERE u.id = :id"), |
|||
@NamedQuery(name = "Ubicacion.findByStatus", query = "SELECT u FROM Ubicacion u WHERE u.status = :status")}) |
|||
public class Ubicacion implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@JoinColumn(name = "Estante_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Estante estanteid; |
|||
@JoinColumn(name = "pasillo_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Pasillo pasilloId; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "ubicacionid") |
|||
private List<Producto> productoList; |
|||
|
|||
public Ubicacion() { |
|||
} |
|||
|
|||
public Ubicacion(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Ubicacion(Integer id, int status) { |
|||
this.id = id; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public Estante getEstanteid() { |
|||
return estanteid; |
|||
} |
|||
|
|||
public void setEstanteid(Estante estanteid) { |
|||
this.estanteid = estanteid; |
|||
} |
|||
|
|||
public Pasillo getPasilloId() { |
|||
return pasilloId; |
|||
} |
|||
|
|||
public void setPasilloId(Pasillo pasilloId) { |
|||
this.pasilloId = pasilloId; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Producto> getProductoList() { |
|||
return productoList; |
|||
} |
|||
|
|||
public void setProductoList(List<Producto> productoList) { |
|||
this.productoList = productoList; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Ubicacion)) { |
|||
return false; |
|||
} |
|||
Ubicacion other = (Ubicacion) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Ubicacion[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,188 @@ |
|||
/* |
|||
* 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.modelo; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import javax.persistence.Basic; |
|||
import javax.persistence.CascadeType; |
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.JoinColumn; |
|||
import javax.persistence.ManyToOne; |
|||
import javax.persistence.NamedQueries; |
|||
import javax.persistence.NamedQuery; |
|||
import javax.persistence.OneToMany; |
|||
import javax.persistence.Table; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
import javax.xml.bind.annotation.XmlTransient; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Entity |
|||
@Table(name = "usuario", catalog = "inventario", schema = "") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u"), |
|||
@NamedQuery(name = "Usuario.findById", query = "SELECT u FROM Usuario u WHERE u.id = :id"), |
|||
@NamedQuery(name = "Usuario.findByNombre", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre"), |
|||
@NamedQuery(name = "Usuario.findByPass", query = "SELECT u FROM Usuario u WHERE u.pass = :pass"), |
|||
@NamedQuery(name = "Usuario.findByMail", query = "SELECT u FROM Usuario u WHERE u.mail = :mail"), |
|||
@NamedQuery(name = "Usuario.findByTelefono", query = "SELECT u FROM Usuario u WHERE u.telefono = :telefono"), |
|||
@NamedQuery(name = "Usuario.findByStatus", query = "SELECT u FROM Usuario u WHERE u.status = :status"), |
|||
@NamedQuery(name = "Usuario.Login", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre and u.pass = :pass") |
|||
}) |
|||
public class Usuario implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Basic(optional = false) |
|||
@Column(name = "id") |
|||
private Integer id; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 40) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 20) |
|||
@Column(name = "pass") |
|||
private String pass; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 30) |
|||
@Column(name = "mail") |
|||
private String mail; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 15) |
|||
@Column(name = "telefono") |
|||
private String telefono; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "usuarioid") |
|||
private List<Resguardo> resguardoList; |
|||
@JoinColumn(name = "Rol_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Rol rolid; |
|||
|
|||
public Usuario() { |
|||
} |
|||
|
|||
public Usuario(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Usuario(Integer id, String nombre, String pass, String mail, String telefono, int status) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.pass = pass; |
|||
this.mail = mail; |
|||
this.telefono = telefono; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public String getPass() { |
|||
return pass; |
|||
} |
|||
|
|||
public void setPass(String pass) { |
|||
this.pass = pass; |
|||
} |
|||
|
|||
public String getMail() { |
|||
return mail; |
|||
} |
|||
|
|||
public void setMail(String mail) { |
|||
this.mail = mail; |
|||
} |
|||
|
|||
public String getTelefono() { |
|||
return telefono; |
|||
} |
|||
|
|||
public void setTelefono(String telefono) { |
|||
this.telefono = telefono; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Resguardo> getResguardoList() { |
|||
return resguardoList; |
|||
} |
|||
|
|||
public void setResguardoList(List<Resguardo> resguardoList) { |
|||
this.resguardoList = resguardoList; |
|||
} |
|||
|
|||
public Rol getRolid() { |
|||
return rolid; |
|||
} |
|||
|
|||
public void setRolid(Rol rolid) { |
|||
this.rolid = rolid; |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
int hash = 0; |
|||
hash += (id != null ? id.hashCode() : 0); |
|||
return hash; |
|||
} |
|||
|
|||
@Override |
|||
public boolean equals(Object object) { |
|||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|||
if (!(object instanceof Usuario)) { |
|||
return false; |
|||
} |
|||
Usuario other = (Usuario) object; |
|||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "mx.edu.tsj.chapala.sistemas.modelo.Usuario[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- You may freely edit this file. See commented blocks below for --> |
|||
<!-- some examples of how to customize the build. --> |
|||
<!-- (If you delete it and reopen the project it will be recreated.) --> |
|||
<!-- By default, only the Clean and Build commands use this build script. --> |
|||
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
|||
<!-- the Compile on Save feature is turned off for the project. --> |
|||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
|||
<!-- in the project's Project Properties dialog box.--> |
|||
<project name="SystemInventory-war" default="default" basedir="."> |
|||
<description>Builds, tests, and runs the project SystemInventory-war.</description> |
|||
<import file="nbproject/build-impl.xml"/> |
|||
<!-- |
|||
|
|||
There exist several targets which are by default empty and which can be |
|||
used for execution of your tasks. These targets are usually executed |
|||
before and after some main targets. They are: |
|||
|
|||
-pre-init: called before initialization of project properties |
|||
-post-init: called after initialization of project properties |
|||
-pre-compile: called before javac compilation |
|||
-post-compile: called after javac compilation |
|||
-pre-compile-single: called before javac compilation of single file |
|||
-post-compile-single: called after javac compilation of single file |
|||
-pre-compile-test: called before javac compilation of JUnit tests |
|||
-post-compile-test: called after javac compilation of JUnit tests |
|||
-pre-compile-test-single: called before javac compilation of single JUnit test |
|||
-post-compile-test-single: called after javac compilation of single JUunit test |
|||
-pre-dist: called before archive building |
|||
-post-dist: called after archive building |
|||
-post-clean: called after cleaning build products |
|||
-pre-run-deploy: called before deploying |
|||
-post-run-deploy: called after deploying |
|||
|
|||
Example of pluging an obfuscator after the compilation could look like |
|||
|
|||
<target name="-post-compile"> |
|||
<obfuscate> |
|||
<fileset dir="${build.classes.dir}"/> |
|||
</obfuscate> |
|||
</target> |
|||
|
|||
For list of available properties check the imported |
|||
nbproject/build-impl.xml file. |
|||
|
|||
|
|||
Other way how to customize the build is by overriding existing main targets. |
|||
The target of interest are: |
|||
|
|||
init-macrodef-javac: defines macro for javac compilation |
|||
init-macrodef-junit: defines macro for junit execution |
|||
init-macrodef-debug: defines macro for class debugging |
|||
do-dist: archive building |
|||
run: execution of project |
|||
javadoc-build: javadoc generation |
|||
|
|||
Example of overriding the target for project execution could look like |
|||
|
|||
<target name="run" depends="<PROJNAME>-impl.jar"> |
|||
<exec dir="bin" executable="launcher.exe"> |
|||
<arg file="${dist.jar}"/> |
|||
</exec> |
|||
</target> |
|||
|
|||
Notice that overridden target depends on jar target and not only on |
|||
compile target as regular run target does. Again, for list of available |
|||
properties which you can use check the target you are overriding in |
|||
nbproject/build-impl.xml file. |
|||
|
|||
--> |
|||
</project> |
Binary file not shown.
@ -0,0 +1,131 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
|
|||
Licensed to the Apache Software Foundation (ASF) under one |
|||
or more contributor license agreements. See the NOTICE file |
|||
distributed with this work for additional information |
|||
regarding copyright ownership. The ASF licenses this file |
|||
to you under the Apache License, Version 2.0 (the |
|||
"License"); you may not use this file except in compliance |
|||
with the License. You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, |
|||
software distributed under the License is distributed on an |
|||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
KIND, either express or implied. See the License for the |
|||
specific language governing permissions and limitations |
|||
under the License. |
|||
|
|||
--> |
|||
<project default="-deploy-ant" basedir="."> |
|||
<target name="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<property file="${deploy.ant.properties.file}" /> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> |
|||
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> |
|||
<available file="${deploy.ant.resource.dir}" property="has.setup"/> |
|||
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/> |
|||
</target> |
|||
|
|||
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.sun.web}"> |
|||
<replacetoken><![CDATA[<sun-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.sun.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.sun.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="sun-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> |
|||
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> |
|||
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> |
|||
<!-- The doctype triggers resolution which can fail --> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> |
|||
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> |
|||
</replace> |
|||
<replace file="${temp.gf.web}"> |
|||
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> |
|||
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> |
|||
</replace> |
|||
<xmlproperty file="${temp.gf.web}" validate="false"> |
|||
</xmlproperty> |
|||
<delete file="${temp.gf.web}"/> |
|||
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
<condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> |
|||
<isset property="glassfish-web-app.context-root"/> |
|||
</condition> |
|||
</target> |
|||
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> |
|||
<property name="deploy.context.root.argument" value=""/> |
|||
</target> |
|||
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup"> |
|||
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}"/> |
|||
<mkdir dir="${gfv3.resources.dir}/META-INF"/> |
|||
<copy todir="${gfv3.resources.dir}/META-INF"> |
|||
<fileset dir="${deploy.ant.resource.dir}"/> |
|||
</copy> |
|||
<jar destfile="${deploy.ant.archive}" update="true"> |
|||
<fileset dir="${gfv3.resources.dir}"/> |
|||
</jar> |
|||
<delete dir="${gfv3.resources.dir}"/> |
|||
</target> |
|||
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> |
|||
<antcall target="-deploy-without-pw"/> |
|||
<antcall target="-deploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-deploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-deploy-with-pw" if="gfv3.password"> |
|||
<echo message="Deploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&force=true&name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> |
|||
<antcall target="-undeploy-without-pw"/> |
|||
<antcall target="-undeploy-with-pw"/> |
|||
</target> |
|||
|
|||
<target name="-undeploy-without-pw" unless="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
<target name="-undeploy-with-pw" if="gfv3.password"> |
|||
<echo message="Undeploying ${deploy.ant.archive}"/> |
|||
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! --> |
|||
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" |
|||
dest="${gfv3.results.file}"/> |
|||
<delete file="${gfv3.results.file}"/> |
|||
</target> |
|||
</project> |
File diff suppressed because it is too large
@ -0,0 +1,8 @@ |
|||
build.xml.data.CRC32=702499fa |
|||
build.xml.script.CRC32=38b4df03 |
|||
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=702499fa |
|||
nbproject/build-impl.xml.script.CRC32=309b01d6 |
|||
nbproject/build-impl.xml.stylesheet.CRC32=334708a0@1.96.0.1 |
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://www.netbeans.org/ns/project/1"> |
|||
<type>org.netbeans.modules.web.project</type> |
|||
<configuration> |
|||
<data xmlns="http://www.netbeans.org/ns/web-project/3"> |
|||
<name>SystemInventory-war</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<explicit-platform explicit-source-supported="true"/> |
|||
<web-module-libraries> |
|||
<library dirs="100"> |
|||
<file>${reference.SystemInventory-ejb.dist}</file> |
|||
</library> |
|||
<library dirs="200"> |
|||
<file>${file.reference.primefaces-12.0.0.jar}</file> |
|||
<path-in-war>WEB-INF/lib</path-in-war> |
|||
</library> |
|||
</web-module-libraries> |
|||
<web-module-additional-libraries/> |
|||
<source-roots> |
|||
<root id="src.dir"/> |
|||
</source-roots> |
|||
<test-roots> |
|||
<root id="test.src.dir"/> |
|||
</test-roots> |
|||
</data> |
|||
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> |
|||
<definitions>..\.\lib\nblibraries.properties</definitions> |
|||
</libraries> |
|||
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> |
|||
<reference> |
|||
<foreign-project>SystemInventory-ejb</foreign-project> |
|||
<artifact-type>jar</artifact-type> |
|||
<script>build.xml</script> |
|||
<target>dist</target> |
|||
<clean-target>clean</clean-target> |
|||
<id>dist</id> |
|||
</reference> |
|||
</references> |
|||
</configuration> |
|||
</project> |
@ -0,0 +1,2 @@ |
|||
Manifest-Version: 1.0 |
|||
|
@ -0,0 +1,58 @@ |
|||
package 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 mike |
|||
*/ |
|||
@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.getSession(); |
|||
|
|||
//Revisar que no sea la pafina index y que no estes logueado
|
|||
//para redireccionar
|
|||
if (!paginaActual.contains("index.xhtml") && Login.getStatus()== false) { |
|||
FacesContext.getCurrentInstance().getExternalContext().redirect("faces/index.xhtml?faces-redirect=true"); |
|||
|
|||
NavigationHandler nh = event.getFacesContext().getApplication().getNavigationHandler(); |
|||
nh.handleNavigation(event.getFacesContext(), null, "index"); |
|||
} |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void beforePhase(PhaseEvent event) {} |
|||
|
|||
@Override |
|||
public PhaseId getPhaseId() { |
|||
return PhaseId.RESTORE_VIEW; |
|||
} |
|||
} |
@ -0,0 +1,81 @@ |
|||
package seguridad; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import javax.faces.context.FacesContext; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.Persistence; |
|||
|
|||
import javax.servlet.http.HttpSession; |
|||
import mx.edu.tsj.chapala.sistemas.Dao.UsuarioDao; |
|||
|
|||
@Named(value = "login") |
|||
@SessionScoped |
|||
public class Login implements Serializable { |
|||
|
|||
private static HttpSession httpsesion; |
|||
private String nombre; |
|||
private String pass; |
|||
private UsuarioDao usuarioDao; |
|||
|
|||
public Login() { |
|||
this.usuarioDao = new UsuarioDao(); |
|||
} |
|||
|
|||
public static void getSession() { |
|||
httpsesion = (HttpSession) FacesContext.getCurrentInstance(). |
|||
getExternalContext().getSession(false); |
|||
} |
|||
|
|||
public static String logout() { |
|||
httpsesion.removeAttribute("sesionActiva"); |
|||
httpsesion.invalidate(); |
|||
return "index.xhtml"; |
|||
} |
|||
// Getter y Setter para el nombre de usuario
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
// Getter y Setter para la contraseña
|
|||
public String getPass() { |
|||
return pass; |
|||
} |
|||
|
|||
public void setPass(String pass) { |
|||
this.pass = pass; |
|||
} |
|||
|
|||
|
|||
|
|||
public String login() { |
|||
|
|||
|
|||
|
|||
if (usuarioDao.validarLogin(nombre, pass)) { |
|||
|
|||
httpsesion.setAttribute("sesionActiva", "true"); |
|||
return "ProductoLista.xhtml"; |
|||
} else { |
|||
return "index.xhtml"; |
|||
} |
|||
} |
|||
|
|||
public static boolean getStatus() { |
|||
|
|||
if (httpsesion != null |
|||
&& httpsesion.getId() != null |
|||
&& !httpsesion.getId().isEmpty() |
|||
&& httpsesion.getAttribute("sesionActiva") != null) { |
|||
return true; |
|||
} else { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,112 @@ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
import mx.edu.tsj.chapala.sistemas.controller.CategoriaBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Categoria; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author mauricionunezrodriguez |
|||
*/ |
|||
@Named(value = "categoriaBean") |
|||
@SessionScoped |
|||
public class CategoriaBean implements Serializable { |
|||
|
|||
@EJB |
|||
private CategoriaBLLocal CategoriaBL; |
|||
private Categoria categoria = new Categoria(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Categoria> filteredCustomers3; |
|||
|
|||
public CategoriaBean() { |
|||
|
|||
} |
|||
|
|||
public List<Categoria> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Categoria> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
Categoria a = (Categoria) value; |
|||
return String.valueOf(a.getId()).contains(filterText) |
|||
|| a.getNombre().toLowerCase().contains(filterText); |
|||
|
|||
} |
|||
|
|||
|
|||
public String agregarCategoria() { |
|||
categoria.setStatus(1); |
|||
CategoriaBL.agregar(categoria); |
|||
categoria = new Categoria(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "CategoriaLista.xhtml"; |
|||
} |
|||
|
|||
public void PrepararEditar(Categoria categoria) { |
|||
nuevo = false; |
|||
titulo = "Editando Categoria"; |
|||
this.categoria = categoria; |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando Categoria"; |
|||
categoria = new Categoria(); |
|||
|
|||
} |
|||
|
|||
public void PrepararEliminar(Categoria categoria) { |
|||
this.categoria = categoria; |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public void editarCategoria() { |
|||
nuevo = false; |
|||
CategoriaBL.editar(categoria); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public void eliminarCategoria() { |
|||
CategoriaBL.eliminar(categoria); |
|||
} |
|||
|
|||
public List<Categoria> getCategoria() { |
|||
return CategoriaBL.getALLCategoria(true); |
|||
} |
|||
|
|||
public Categoria getCategorias() { |
|||
return categoria; |
|||
} |
|||
|
|||
public void setCategorias(Categoria categoria) { |
|||
this.categoria = categoria; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
|
|||
*/ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import javax.inject.Named; |
|||
|
|||
|
|||
|
|||
@Named(value = "LoginBean") |
|||
@SessionScoped |
|||
public class LoginBean implements Serializable { |
|||
|
|||
|
|||
private String nombre; |
|||
private String pass; |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public String getPass() { |
|||
return pass; |
|||
} |
|||
|
|||
public void setPass(String pass) { |
|||
this.pass = pass; |
|||
} |
|||
|
|||
public String login() { |
|||
|
|||
// Simulando una autenticación exitosa
|
|||
if ("admin".equals(nombre) && "admin".equals(pass)) { |
|||
return "Lobby.xhtml?faces-redirect=true"; |
|||
} else { |
|||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Credenciales incorrectas")); |
|||
return null; |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,106 @@ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
import mx.edu.tsj.chapala.sistemas.controller.MarcaBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Marca; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
@Named(value = "marcaBean") |
|||
@SessionScoped |
|||
public class MarcaBean implements Serializable { |
|||
|
|||
@EJB |
|||
private MarcaBLLocal marcaBL; |
|||
private Marca marca = new Marca(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Marca> filteredCustomers3; |
|||
|
|||
public MarcaBean() { |
|||
|
|||
} |
|||
|
|||
public List<Marca> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Marca> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
Marca a = (Marca) value; |
|||
return String.valueOf(a.getId()).contains(filterText) |
|||
|| a.getNombre().toLowerCase().contains(filterText); |
|||
|
|||
} |
|||
|
|||
public String agregarMarca() { |
|||
marca.setStatus(1); |
|||
marcaBL.agregar(marca); |
|||
marca = new Marca(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "MarcaLista.xhtml"; |
|||
} |
|||
|
|||
public void PrepararEditar(Marca marca) { |
|||
nuevo = false; |
|||
titulo = "Editando Marca"; |
|||
this.marca = marca; |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando Marca"; |
|||
marca = new Marca(); |
|||
|
|||
} |
|||
|
|||
public void PrepararEliminar(Marca marca) { |
|||
this.marca = marca; |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public void editarMarca() { |
|||
nuevo = false; |
|||
marcaBL.editar(marca); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public void eliminarMarca() { |
|||
marcaBL.eliminar(marca); |
|||
} |
|||
|
|||
public List<Marca> getMarcas() { |
|||
return marcaBL.getALL(true); |
|||
} |
|||
|
|||
public Marca getMarca() { |
|||
return marca; |
|||
} |
|||
|
|||
public void setMarca(Marca marca) { |
|||
this.marca = marca; |
|||
} |
|||
} |
@ -0,0 +1,104 @@ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
import mx.edu.tsj.chapala.sistemas.controller.PasilloBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
@Named(value = "pasilloBean") |
|||
@SessionScoped |
|||
public class PasilloBean implements Serializable { |
|||
|
|||
@EJB |
|||
private PasilloBLLocal pasilloBL; |
|||
private Pasillo pasillo = new Pasillo(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Pasillo> filteredCustomers3; |
|||
|
|||
public PasilloBean() { |
|||
|
|||
} |
|||
|
|||
public List<Pasillo> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Pasillo> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
Pasillo a = (Pasillo) value; |
|||
return String.valueOf(a.getNumeroP()).contains(filterText); |
|||
|
|||
} |
|||
|
|||
public String agregarPasillo() { |
|||
pasillo.setStatus(1); |
|||
pasilloBL.agregar(pasillo); |
|||
pasillo = new Pasillo(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "PasilloLista.xhtml"; |
|||
} |
|||
|
|||
public void PrepararEditar(Pasillo pasillo) { |
|||
nuevo = false; |
|||
titulo = "Editando Pasillo"; |
|||
this.pasillo = pasillo; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando Pasillo"; |
|||
pasillo = new Pasillo(); |
|||
|
|||
} |
|||
|
|||
public void PrepararEliminar(Pasillo pasillo) { |
|||
this.pasillo = pasillo; |
|||
} |
|||
|
|||
public void editarPasillo() { |
|||
nuevo = false; |
|||
pasilloBL.editar(pasillo); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public void eliminarPasillo() { |
|||
pasilloBL.eliminar(pasillo); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public List<Pasillo> getPasillos() { |
|||
return pasilloBL.getALL(true); |
|||
} |
|||
|
|||
public Pasillo getPasillo() { |
|||
return pasillo; |
|||
} |
|||
|
|||
public void setPasillo(Pasillo pasillo) { |
|||
this.pasillo = pasillo; |
|||
} |
|||
} |
@ -0,0 +1,115 @@ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import static java.lang.Integer.getInteger; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
import mx.edu.tsj.chapala.sistemas.controller.ProductoBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Producto; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
@Named(value = "productoBean") |
|||
@SessionScoped |
|||
public class ProductoBean implements Serializable { |
|||
|
|||
@EJB |
|||
private ProductoBLLocal productoBL; |
|||
private Producto producto = new Producto(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Producto> filteredCustomers3; |
|||
|
|||
public ProductoBean() { |
|||
|
|||
} |
|||
|
|||
public List<Producto> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Producto> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
Producto a = (Producto) value; |
|||
return a.getNombre().toLowerCase().contains(filterText) |
|||
|| a.getCodigo().toLowerCase().contains(filterText) |
|||
|| String.valueOf(a.getPrecio()).contains(filterText) |
|||
|| a.getFecha().toString().toLowerCase().contains(filterText) |
|||
|| a.getCategoriaid().getNombre().contains(filterText) |
|||
|| a.getMarcaid().getNombre().contains(filterText) |
|||
|| a.getProovedorid().getNombre().contains(filterText) |
|||
; |
|||
|
|||
} |
|||
|
|||
public String agregarProducto() { |
|||
producto.setStatus(1); |
|||
productoBL.agregar(producto); |
|||
producto = new Producto(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "ProductoLista.xhtml"; |
|||
} |
|||
|
|||
public void PrepararEditar(Producto producto) { |
|||
nuevo = false; |
|||
titulo = "Editando Producto"; |
|||
this.producto = producto; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando Producto"; |
|||
producto = new Producto(); |
|||
|
|||
} |
|||
|
|||
public void PrepararEliminar(Producto producto) { |
|||
this.producto = producto; |
|||
} |
|||
|
|||
public void editarProducto() { |
|||
|
|||
nuevo = false; |
|||
productoBL.editar(producto); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
|
|||
} |
|||
|
|||
public void eliminarProducto() { |
|||
|
|||
productoBL.eliminar(producto); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public List<Producto> getProductos() { |
|||
return productoBL.getALL(true); |
|||
} |
|||
|
|||
public Producto getProducto() { |
|||
return producto; |
|||
} |
|||
|
|||
public void setProducto(Producto producto) { |
|||
this.producto = producto; |
|||
} |
|||
} |
@ -0,0 +1,114 @@ |
|||
/* |
|||
* 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 vistas; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import mx.edu.tsj.chapala.sistemas.controller.ResguardoBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Named(value = "resguardoBean") |
|||
@SessionScoped |
|||
public class ResguardoBean implements Serializable { |
|||
|
|||
@EJB |
|||
private ResguardoBLLocal resguardoBL; |
|||
|
|||
private Resguardo resguardo = new Resguardo(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Resguardo> filteredCustomers3; |
|||
|
|||
public ResguardoBean() { |
|||
} |
|||
|
|||
public List<Resguardo> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Resguardo> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
|
|||
Resguardo r = (Resguardo) value; |
|||
return r.getFecha().toString().toLowerCase().contains(filterText) |
|||
|| r.getProductoId().getNombre().toLowerCase().contains(filterText) |
|||
|| r.getUsuarioid().getNombre().toLowerCase().contains(filterText); |
|||
|
|||
} |
|||
|
|||
public String agregarResguardo(){ |
|||
resguardo.setStatus(1); |
|||
resguardoBL.agregar(resguardo); |
|||
resguardo= new Resguardo(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "ResguardoLista.xhtml"; |
|||
} |
|||
public void PrepararEditar(Resguardo resguardo){ |
|||
nuevo=false; |
|||
titulo="Editando Resguardo"; |
|||
this.resguardo=resguardo; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo(){ |
|||
nuevo=true; |
|||
titulo="Agregando Resguardo"; |
|||
resguardo= new Resguardo(); |
|||
} |
|||
|
|||
public void PrepararEliminar(Resguardo resguardo){ |
|||
this.resguardo=resguardo; |
|||
} |
|||
|
|||
public void editarResguardo(){ |
|||
nuevo=false; |
|||
resguardoBL.editar(resguardo); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public void eliminarResguardo(){ |
|||
resguardoBL.eliminar(resguardo); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public List<Resguardo> getResguardos(){ |
|||
return resguardoBL.getALL(true); |
|||
} |
|||
|
|||
public Resguardo getResguardo() { |
|||
return resguardo; |
|||
} |
|||
|
|||
public void setResguardo(Resguardo resguardo) { |
|||
this.resguardo = resguardo; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,110 @@ |
|||
/* |
|||
* 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 vistas; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import mx.edu.tsj.chapala.sistemas.controller.RolBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Rol; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author Moises Ibarra |
|||
*/ |
|||
@Named(value = "rolBean") |
|||
@SessionScoped |
|||
public class RolBean implements Serializable { |
|||
|
|||
@EJB |
|||
private RolBLLocal rolBL; |
|||
private Rol rol = new Rol(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Rol> filteredCustomers3; |
|||
|
|||
public RolBean() { |
|||
} |
|||
|
|||
public List<Rol> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Rol> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
Rol u = (Rol) value; |
|||
return u.getNombre().toLowerCase().contains(filterText) |
|||
|| u.getDescripcion().toLowerCase().contains(filterText); |
|||
|
|||
} |
|||
|
|||
public String agregarRol(){ |
|||
rol.setStatus(1); |
|||
rolBL.agregar(rol); |
|||
rol= new Rol(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "RolLista.xhtml"; |
|||
} |
|||
|
|||
public void PrepararEditar(Rol rol){ |
|||
nuevo=false; |
|||
titulo="Editando Rol"; |
|||
this.rol=rol; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo(){ |
|||
nuevo=true; |
|||
titulo="Agregando Rol"; |
|||
rol= new Rol(); |
|||
} |
|||
public void PrepararEliminar(Rol rol){ |
|||
this.rol=rol; |
|||
} |
|||
public void editarRol(){ |
|||
nuevo=false; |
|||
rolBL.editar(rol); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
public void eliminarRol(){ |
|||
rolBL.eliminar(rol); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public List<Rol> getRoles(){ |
|||
return rolBL.getALL(true); |
|||
} |
|||
|
|||
public Rol getRol() { |
|||
return rol; |
|||
} |
|||
|
|||
public void setRol(Rol rol) { |
|||
this.rol = rol; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
package vistas; |
|||
|
|||
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<Object> elements = (List<Object>) 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); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,109 @@ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import static java.lang.Integer.getInteger; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
|
|||
import mx.edu.tsj.chapala.sistemas.controller.UbicacionBLLocal; |
|||
|
|||
import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
@Named(value = "ubicacionBean") |
|||
@SessionScoped |
|||
public class UbicacionBean implements Serializable { |
|||
|
|||
@EJB |
|||
private UbicacionBLLocal ubicacionBL; |
|||
private Ubicacion ubicacion = new Ubicacion(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Ubicacion> filteredCustomers3; |
|||
|
|||
public UbicacionBean() { |
|||
|
|||
} |
|||
|
|||
public List<Ubicacion> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Ubicacion> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
|
|||
Ubicacion a = (Ubicacion) value; |
|||
return String.valueOf(a.getEstanteid().getNumeroE()).contains(filterText) |
|||
|| String.valueOf(a.getPasilloId().getNumeroP()).contains(filterText); |
|||
|
|||
|
|||
} |
|||
|
|||
public String agregarUbicacion() { |
|||
ubicacion.setStatus(1); |
|||
ubicacionBL.agregar(ubicacion); |
|||
ubicacion = new Ubicacion(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "UbicacionLista.xhtml"; |
|||
} |
|||
|
|||
public void PrepararEditar(Ubicacion ubicacion) { |
|||
nuevo = false; |
|||
titulo = "Editando Ubicacion"; |
|||
this.ubicacion = ubicacion; |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando Ubicacion"; |
|||
ubicacion = new Ubicacion(); |
|||
|
|||
} |
|||
|
|||
public void PrepararEliminar(Ubicacion ubicacion) { |
|||
this.ubicacion = ubicacion; |
|||
} |
|||
|
|||
public void editarUbicacion() { |
|||
nuevo = false; |
|||
ubicacionBL.editar(ubicacion); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public void eliminarUbicacion() { |
|||
ubicacionBL.eliminar(ubicacion); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public List<Ubicacion> getUbicaciones() { |
|||
return ubicacionBL.getALL(true); |
|||
} |
|||
|
|||
public Ubicacion getUbicacion() { |
|||
return ubicacion; |
|||
} |
|||
|
|||
public void setUbicacion(Ubicacion ubicacion) { |
|||
this.ubicacion = ubicacion; |
|||
} |
|||
} |
@ -0,0 +1,120 @@ |
|||
package vistas; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import static java.lang.Integer.getInteger; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import mx.edu.tsj.chapala.sistemas.controller.UsuarioBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Usuario; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
@Named(value = "usuarioBean") |
|||
@SessionScoped |
|||
public class UsuarioBean implements Serializable { |
|||
|
|||
@EJB |
|||
private UsuarioBLLocal usuarioBL; |
|||
|
|||
//variable
|
|||
private int Rolid; |
|||
|
|||
private Usuario usuario = new Usuario(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Usuario> filteredCustomers3; |
|||
|
|||
public UsuarioBean() { |
|||
} |
|||
|
|||
public List<Usuario> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Usuario> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
|
|||
Usuario a = (Usuario) value; |
|||
return a.getNombre().toLowerCase().contains(filterText) |
|||
|| a.getPass().toLowerCase().contains(filterText) |
|||
|| a.getMail().toLowerCase().contains(filterText) |
|||
|| String.valueOf(a.getTelefono()).contains(filterText) |
|||
|| a.getRolid().getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public String agregarUsuario() { |
|||
usuario.setStatus(1); |
|||
usuarioBL.agregar(usuario); |
|||
usuario = new Usuario(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "usuarioLista.xhtml"; |
|||
|
|||
} |
|||
|
|||
public void PrepararEditar(Usuario usuario) { |
|||
nuevo=false; |
|||
titulo = "Editando Usuario"; |
|||
this.usuario = usuario; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void PrepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "Agregando Usuario"; |
|||
usuario = new Usuario(); |
|||
} |
|||
|
|||
public void PrepararEliminar(Usuario usuario) { |
|||
this.usuario = usuario; |
|||
} |
|||
|
|||
public void editarUsuario() { |
|||
nuevo = false; |
|||
usuarioBL.editar(usuario); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public void eliminarUsuario() { |
|||
usuarioBL.eliminar(usuario); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
|
|||
public List<Usuario> getUsuarios() { |
|||
return usuarioBL.getALL(true); |
|||
} |
|||
|
|||
public Usuario getUsuario() { |
|||
return usuario; |
|||
} |
|||
|
|||
public void setUsuario(Usuario usuario) { |
|||
this.usuario = usuario; |
|||
} |
|||
|
|||
//get y set rolid
|
|||
public int getRolid() { |
|||
return Rolid; |
|||
} |
|||
|
|||
public void setRolid(int Rolid) { |
|||
this.Rolid = Rolid; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,747 @@ |
|||
package vistas; |
|||
|
|||
import java.io.Serializable; |
|||
import java.time.Instant; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.controller.CategoriaBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.EstanteBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.MarcaBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.PasilloBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.ProductoBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.ProovedorBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.ResguardoBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.RolBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.UbicacionBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.controller.UsuarioBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Estante; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Marca; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Pasillo; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Producto; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Resguardo; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Rol; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Ubicacion; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Usuario; |
|||
|
|||
@Named(value = "demoBean") |
|||
@SessionScoped |
|||
public class demoBean implements Serializable { |
|||
|
|||
@EJB |
|||
private MarcaBLLocal marcaBL; |
|||
|
|||
@EJB |
|||
private CategoriaBLLocal categoriaBL; |
|||
|
|||
@EJB |
|||
private UbicacionBLLocal ubicacionBL; |
|||
|
|||
@EJB |
|||
private ProovedorBLLocal proovedorBL; |
|||
|
|||
@EJB |
|||
private EstanteBLLocal estanteBL; |
|||
|
|||
@EJB |
|||
private PasilloBLLocal pasilloBL; |
|||
|
|||
@EJB |
|||
private RolBLLocal RolBL; |
|||
|
|||
@EJB |
|||
private ResguardoBLLocal ResguardoBL; |
|||
|
|||
@EJB |
|||
private ProductoBLLocal ProductoBL; |
|||
|
|||
@EJB |
|||
private UsuarioBLLocal UsuarioBL; |
|||
|
|||
public demoBean() { |
|||
} |
|||
//---------------------------------------------Producto-------------------------------------------------
|
|||
|
|||
public String agregarProducto() { |
|||
|
|||
Producto a = new Producto(); |
|||
|
|||
a.setCodigo("3423423"); |
|||
a.setNombre("OG kush"); |
|||
|
|||
Marca ma = new Marca(); |
|||
ma.setId(1); |
|||
a.setMarcaid(ma); |
|||
|
|||
Categoria c = new Categoria(); |
|||
c.setId(1); |
|||
a.setCategoriaid(c); |
|||
|
|||
a.setPrecio(50.50f); |
|||
|
|||
Ubicacion u = new Ubicacion(); |
|||
u.setId(1); |
|||
a.setUbicacionid(u); |
|||
|
|||
Proovedor p = new Proovedor(); |
|||
p.setId(1); |
|||
a.setProovedorid(p); |
|||
|
|||
a.setFecha(java.util.Date.from(Instant.now())); |
|||
|
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = ProductoBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarProducto() { |
|||
|
|||
Producto a = new Producto(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el Producto: "); |
|||
System.out.println(ProductoBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarProducto() { |
|||
|
|||
Producto a = new Producto(); |
|||
a.setId(1); |
|||
|
|||
Mensaje m = ProductoBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarProducto() { |
|||
Producto a = new Producto(); |
|||
a.setId(1); |
|||
a.setCodigo("111111"); |
|||
a.setNombre("Mota"); |
|||
a.setMarcaid(marcaBL.buscarId(new Marca(1))); |
|||
a.setCategoriaid(categoriaBL.buscarId(new Categoria(1))); |
|||
a.setPrecio(60.10f); |
|||
a.setUbicacionid(ubicacionBL.buscarId(new Ubicacion(1))); |
|||
a.setProovedorid(proovedorBL.buscarId(new Proovedor(1))); |
|||
a.setFecha(java.util.Date.from(Instant.now())); |
|||
a.setStatus(1); |
|||
|
|||
ProductoBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
//--------------------------Categoria----------------------------
|
|||
public String agregarCategoria() { |
|||
|
|||
Categoria a = new Categoria(); |
|||
|
|||
a.setNombre("hombre"); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = categoriaBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarCategoria() { |
|||
|
|||
Categoria a = new Categoria(); |
|||
a.setId(1); |
|||
System.out.println("Encontre la categoria: "); |
|||
System.out.println(categoriaBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarCategoria() { |
|||
|
|||
Categoria a = new Categoria(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = categoriaBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarCategoria() { |
|||
Categoria a = new Categoria(); |
|||
a.setId(1); |
|||
a.setNombre("tennis"); |
|||
a.setStatus(1); |
|||
|
|||
categoriaBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
//-------------------------Marca----------------------------------------
|
|||
public String agregarMarca() { |
|||
|
|||
Marca a = new Marca(); |
|||
|
|||
a.setNombre("NO Registrada"); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = marcaBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarMarca() { |
|||
|
|||
Marca a = new Marca(); |
|||
a.setId(1); |
|||
System.out.println("Encontre la Marca: "); |
|||
System.out.println(marcaBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarMarca() { |
|||
|
|||
Marca a = new Marca(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = marcaBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarMarca() { |
|||
Marca a = new Marca(); |
|||
a.setId(1); |
|||
a.setNombre("registrado"); |
|||
a.setStatus(1); |
|||
|
|||
marcaBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
//---------------------------------Ubicacion--------------------------------
|
|||
public String Agregarubicacion() { |
|||
|
|||
Ubicacion a = new Ubicacion(); |
|||
|
|||
Estante e = new Estante(); |
|||
e.setId(2); |
|||
a.setEstanteid(e); |
|||
|
|||
|
|||
Pasillo f = new Pasillo (); |
|||
f.setId(2); |
|||
a.setPasilloId(f); |
|||
|
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = ubicacionBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
public String buscarUbicacion() { |
|||
|
|||
Ubicacion a = new Ubicacion(); |
|||
a.setId(1); |
|||
System.out.println("Encontre la ubicacion: "); |
|||
System.out.println(ubicacionBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarUbicacion() { |
|||
|
|||
Ubicacion a = new Ubicacion(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = ubicacionBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarUbicacion() { |
|||
Ubicacion a = new Ubicacion(); |
|||
a.setId(1); |
|||
a.setEstanteid(estanteBL.buscarId(new Estante(1))); |
|||
a.setPasilloId(pasilloBL.buscarId(new Pasillo(1))); |
|||
a.setStatus(1); |
|||
|
|||
|
|||
|
|||
ubicacionBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//-----------------------Estante-------------------------------------------
|
|||
|
|||
|
|||
public String agregarEstante() { |
|||
|
|||
Estante a = new Estante(); |
|||
|
|||
a.setNumeroE(4); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = estanteBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarEstante() { |
|||
|
|||
Estante a = new Estante(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el Producto: "); |
|||
System.out.println(estanteBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarEstante() { |
|||
|
|||
Estante a = new Estante(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = estanteBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarEstante() { |
|||
Estante a = new Estante(); |
|||
a.setId(2); |
|||
a.setNumeroE(5); |
|||
a.setStatus(1); |
|||
|
|||
estanteBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
//-----------------------Pasillo------------------------------------
|
|||
|
|||
|
|||
public String agregarPasillo() { |
|||
|
|||
Pasillo a = new Pasillo (); |
|||
|
|||
a.setNumeroP(1); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = pasilloBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No Se agrego"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarPasillo() { |
|||
|
|||
Pasillo a = new Pasillo (); |
|||
a.setId(1); |
|||
System.out.println("Encontre el Producto: "); |
|||
System.out.println(pasilloBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarPasillo() { |
|||
|
|||
Pasillo a = new Pasillo(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = pasilloBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarPasillo() { |
|||
Pasillo a = new Pasillo (); |
|||
a.setId(1); |
|||
a.setNumeroP(3); |
|||
a.setStatus(1); |
|||
|
|||
pasilloBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
//-----------------------Rol-------------------------------------------
|
|||
|
|||
|
|||
public String agregarRol() { |
|||
|
|||
Rol a = new Rol(); |
|||
|
|||
a.setNombre("dasdasdas"); |
|||
a.setDescripcion("Coblpdaddsara"); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = RolBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarRol() { |
|||
|
|||
Rol a = new Rol(); |
|||
|
|||
a.setId(1); |
|||
System.out.println("Encontre el Rol: "); |
|||
System.out.println(RolBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarRol() { |
|||
|
|||
Rol a = new Rol(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = RolBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarRol() { |
|||
|
|||
Rol a = new Rol(); |
|||
a.setId(1); |
|||
a.setNombre("empleado"); |
|||
a.setDescripcion("dasdasda"); |
|||
a.setStatus(1); |
|||
|
|||
RolBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
/*----------------------------RESGUARDO----------------------------*/ |
|||
|
|||
public String AgregarResguardo() { |
|||
|
|||
Resguardo a = new Resguardo(); |
|||
|
|||
Producto f = new Producto(); |
|||
a.setProductoId(f); |
|||
|
|||
Usuario e = new Usuario(); |
|||
a.setUsuarioid(e); |
|||
|
|||
a.setFecha(java.util.Date.from(Instant.now())); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = ResguardoBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarResguardo() { |
|||
|
|||
Resguardo a = new Resguardo(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el Resguardo: "); |
|||
System.out.println(ResguardoBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarResguardo() { |
|||
|
|||
Resguardo a = new Resguardo(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = ResguardoBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarResguardo() { |
|||
|
|||
Resguardo a = new Resguardo(); |
|||
a.setId(1); |
|||
|
|||
Producto f = new Producto(); |
|||
a.setProductoId(f); |
|||
|
|||
Usuario e = new Usuario(); |
|||
a.setUsuarioid(e); |
|||
|
|||
a.setFecha(java.util.Date.from(Instant.now())); |
|||
a.setStatus(1); |
|||
|
|||
ResguardoBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
/*----------------------------USUARIO----------------------------*/ |
|||
|
|||
public String AgregarUsuario() { |
|||
|
|||
Usuario a = new Usuario(); |
|||
|
|||
|
|||
a.setNombre("eeee"); |
|||
a.setPass("eee"); |
|||
a.setMail("uno@dos"); |
|||
a.setTelefono("1255553333"); |
|||
|
|||
Rol f = new Rol(); |
|||
f.setId(2); |
|||
a.setRolid(f); |
|||
|
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = UsuarioBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarusuario() { |
|||
|
|||
Usuario a = new Usuario(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el Usuario: "); |
|||
System.out.println(UsuarioBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarUsuario() { |
|||
|
|||
Usuario a = new Usuario(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = UsuarioBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarusuario() { |
|||
Usuario a = new Usuario(); |
|||
a.setId(1); |
|||
a.setNombre("mauricio"); |
|||
a.setPass("ma1234"); |
|||
a.setMail("mau@gmail.com"); |
|||
a.setTelefono("3338323330"); |
|||
|
|||
Rol f = new Rol(); |
|||
f.setId(1); |
|||
a.setRolid(f); |
|||
a.setStatus(1); |
|||
|
|||
UsuarioBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
/*----------------------------PROVEEDOR----------------------------*/ |
|||
|
|||
|
|||
public String agregarProveedor() { |
|||
|
|||
Proovedor a = new Proovedor (); |
|||
|
|||
a.setNombre("Gamesa"); |
|||
a.setDireccion("Mezcala"); |
|||
a.setMail("Juanc.jcsr73@gmail.com"); |
|||
a.setTelefono("234324234"); |
|||
a.setStatus(1); |
|||
|
|||
|
|||
|
|||
Mensaje m = proovedorBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
|
|||
//autorBL.agregar(null);
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarProveedor() { |
|||
|
|||
Proovedor a = new Proovedor(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el proveedor: "); |
|||
System.out.println(proovedorBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
public String buscarProveedortodos() { |
|||
|
|||
Proovedor a = new Proovedor(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el proveedor: "); |
|||
System.out.println(); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarProveedor() { |
|||
|
|||
Proovedor a = new Proovedor(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = proovedorBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarProveedor() { |
|||
Proovedor a = new Proovedor(); |
|||
a.setId(1); |
|||
|
|||
a.setNombre("Juana Bacoa"); |
|||
a.setDireccion("Mi casa"); |
|||
a.setMail("Juanc.jcsr73@gmail.com"); |
|||
a.setTelefono("3313232"); |
|||
a.setStatus(1); |
|||
|
|||
|
|||
|
|||
proovedorBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,165 @@ |
|||
/* |
|||
* 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 vistas; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import static java.lang.Integer.getInteger; |
|||
import static java.lang.String.valueOf; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.controller.EstanteBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Estante; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author david |
|||
*/ |
|||
@Named(value = "estanteBean") |
|||
@SessionScoped |
|||
public class estanteBean implements Serializable { |
|||
|
|||
@EJB |
|||
private EstanteBLLocal estanteBL; |
|||
|
|||
private Estante estante = new Estante(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Estante> filteredCustomers3; |
|||
|
|||
|
|||
public estanteBean() { |
|||
} |
|||
|
|||
public List<Estante> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Estante> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
|
|||
Estante a = (Estante) value; |
|||
return String.valueOf(a.getNumeroE()).contains(filterText); |
|||
|
|||
} |
|||
|
|||
public String agregarEstante() { |
|||
|
|||
estante.setStatus(1); |
|||
estanteBL.agregar(estante); |
|||
estante = new Estante(); |
|||
/*Estante a = new Estante(); |
|||
|
|||
a.setNumeroE(4); |
|||
a.setStatus(1); |
|||
|
|||
Mensaje m = estanteBL.agregar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("Se agrego"); |
|||
} else { |
|||
System.out.println("No se pudo"); |
|||
} |
|||
*/ |
|||
//autorBL.agregar(null);
|
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "estanteLista.xhtml"; |
|||
} |
|||
|
|||
public String buscarEstante() { |
|||
|
|||
Estante a = new Estante(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el Producto: "); |
|||
System.out.println(estanteBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarEstante() { |
|||
|
|||
Estante a = new Estante(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = estanteBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public void editarEstantes(){ |
|||
nuevo = false; |
|||
estanteBL.editar(estante); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
|
|||
public String editarEstante() { |
|||
Estante a = new Estante(); |
|||
a.setId(2); |
|||
a.setNumeroE(5); |
|||
a.setStatus(1); |
|||
|
|||
estanteBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public List<Estante> getEstantes(){ |
|||
return estanteBL.getALLE(true); |
|||
} |
|||
|
|||
public Estante getEstante() { |
|||
return estante; |
|||
} |
|||
|
|||
public void setEstante(Estante estante) { |
|||
this.estante = estante; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
|
|||
public void prepararEditar(Estante estante){ |
|||
nuevo=false; |
|||
titulo="Editando Estante"; |
|||
this.estante = estante; |
|||
} |
|||
public void prepararNuevo(){ |
|||
nuevo=true; |
|||
titulo="Agregando Estante"; |
|||
estante = new Estante(); |
|||
} |
|||
public void prepararEliminar(Estante estante){ |
|||
this.estante=estante; |
|||
} |
|||
public void eliminarEstantes(){ |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
estanteBL.eliminar(estante); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,170 @@ |
|||
/* |
|||
* 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 vistas; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import mx.edu.tsj.chapala.sistemas.Mensaje; |
|||
import mx.edu.tsj.chapala.sistemas.controller.ProovedorBLLocal; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Estante; |
|||
import mx.edu.tsj.chapala.sistemas.modelo.Proovedor; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author david |
|||
*/ |
|||
@Named(value = "proveedorBean") |
|||
@SessionScoped |
|||
public class proveedorBean implements Serializable { |
|||
|
|||
@EJB |
|||
private ProovedorBLLocal proovedorBL; |
|||
|
|||
private Proovedor proveedor = new Proovedor(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Proovedor> filteredCustomers3; |
|||
|
|||
|
|||
public proveedorBean() { |
|||
} |
|||
|
|||
public List<Proovedor> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Proovedor> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
|
|||
Proovedor a = (Proovedor) value; |
|||
return String.valueOf(a.getId()).contains(filterText) |
|||
|| a.getNombre().toLowerCase().contains(filterText) |
|||
|| a.getDireccion().toLowerCase().contains(filterText) |
|||
|| a.getMail().toLowerCase().contains(filterText) |
|||
|| String.valueOf(a.getStatus()).contains(filterText) |
|||
|| String.valueOf(a.getTelefono()).contains(filterText) |
|||
|| String.valueOf(a.getId()).contains(filterText); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
public String agregarProveedor() { |
|||
|
|||
proveedor.setStatus(1); |
|||
proovedorBL.agregar(proveedor); |
|||
proveedor = new Proovedor(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "proveedoresLista.xhtml"; |
|||
} |
|||
|
|||
public String buscarProveedor() { |
|||
|
|||
Proovedor a = new Proovedor(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el proveedor: "); |
|||
System.out.println(proovedorBL.buscarId(a)); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
public String buscarProveedortodos() { |
|||
|
|||
Proovedor a = new Proovedor(); |
|||
a.setId(1); |
|||
System.out.println("Encontre el proveedor: "); |
|||
System.out.println(); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminarProveedor() { |
|||
|
|||
Proovedor a = new Proovedor(); |
|||
a.setId(2); |
|||
|
|||
Mensaje m = proovedorBL.eliminar(a); |
|||
System.out.println(m); |
|||
if (m.compareTo(Mensaje.SIN_ERROR) == 0) { |
|||
System.out.println("no se elimino"); |
|||
} else { |
|||
System.out.println("Se elimino"); |
|||
} |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String editarProveedor() { |
|||
Proovedor a = new Proovedor(); |
|||
a.setId(1); |
|||
|
|||
a.setNombre("Juana Bacoa"); |
|||
a.setDireccion("Mi casa"); |
|||
a.setMail("Juanc.jcsr73@gmail.com"); |
|||
a.setTelefono("3313232"); |
|||
a.setStatus(1); |
|||
|
|||
|
|||
|
|||
proovedorBL.editar(a); |
|||
System.out.println("se edito"); |
|||
|
|||
return "index.xhtml"; |
|||
} |
|||
public void editarProvedores(){ |
|||
nuevo = false; |
|||
proovedorBL.editar(proveedor); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
public List<Proovedor> getProovedors(){ |
|||
return proovedorBL.getALLProveedor(true); |
|||
} |
|||
|
|||
public Proovedor getProveedor() { |
|||
return proveedor; |
|||
} |
|||
|
|||
public void setProveedor(Proovedor proveedor) { |
|||
this.proveedor = proveedor; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
public void prepararEditar(Proovedor proovedor){ |
|||
nuevo=false; |
|||
titulo="Editando Proveedor"; |
|||
this.proveedor=proovedor; |
|||
} |
|||
public void prepararNuevo(){ |
|||
nuevo=true; |
|||
titulo="Agregando Proveedor"; |
|||
proveedor = new Proovedor(); |
|||
} |
|||
public void prepararEliminar(Proovedor proovedor){ |
|||
this.proveedor=proovedor; |
|||
} |
|||
public void eliminarProveedores(){ |
|||
proovedorBL.eliminar(proveedor); |
|||
PrimeFaces.current().executeScript("PF('dlg2').hide()"); |
|||
} |
|||
} |
@ -0,0 +1,179 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 14px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 14px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
|
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA CATEGORÍA</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{categoriaBean.categoria}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{categoriaBean.filteredCustomers3}" |
|||
globalFilterFunction="#{categoriaBean.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{categoriaBean.PrepararNuevo()}" value="Nuevo" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{categoriaBean.PrepararEditar(item)}" value="Editar" update=":dialog" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success"/> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" update=":dialog2" actionListener="#{categoriaBean.PrepararEliminar(item)}" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
|
|||
</h:form> |
|||
|
|||
<p:dialog id="dialog" widgetVar="dlg" width="625" height="250" modal="true"> |
|||
|
|||
<h:form> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{categoriaBean.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{categoriaBean.categorias.nombre}" title="Nombre" required="true" validatorMessage="Al menos una letra debe estar presente en la cadena" requiredMessage="Este Campo Es Requerido"> |
|||
<f:validateRegex pattern="^(?=.*[a-zA-Z])[\w\d]*$"/> |
|||
</p:inputText> |
|||
<p:message for="nombre"/> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p style="text-align: center;"> |
|||
<p:commandButton action="#{categoriaBean.agregarCategoria()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{categoriaBean.nuevo}"/> |
|||
<p:commandButton action="CategoriaLista.xhtml" actionListener="#{categoriaBean.editarCategoria()}" value="Editar" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{!categoriaBean.nuevo}" style="margin-left: 10px; margin-right: 10px;" /> |
|||
<p:commandButton ajax="false" action="CategoriaLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p> |
|||
|
|||
</h:form> |
|||
|
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="625" height="250" modal="true"> |
|||
|
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">ELIMINANDO CATEGORIA</h1> |
|||
|
|||
<p:panelGrid columns="3" style="margin: 0 auto;"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{categoriaBean.categorias.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{categoriaBean.categorias.nombre}" title="Nombre"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{categoriaBean.categorias.status}" title="Status"/> |
|||
</p:panelGrid> |
|||
<p style="text-align: center;"> |
|||
<p:commandButton ajax="true" action="CategoriaLista.xhtml" actionListener="#{categoriaBean.eliminarCategoria()}" update="formtabla:tabla" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
<p:commandButton ajax="false" action="CategoriaLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
</body> |
|||
</html> |
@ -0,0 +1,58 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<style> |
|||
.login-container { |
|||
background-color: white; |
|||
border-radius: 5px; |
|||
padding: 5px; |
|||
width: 600px; |
|||
margin: 0 auto; |
|||
text-align: center; |
|||
} |
|||
</style> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<h3 style="text-align: center;">SISTEMA INVENTARIO</h3> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<h:form id="loginForm"> |
|||
<div class="login-container"> |
|||
|
|||
<p:panelGrid id="grid" columns="3" style="margin-bottom: 10px;"> |
|||
<p:outputLabel for="username" value="Usuario:" /> |
|||
<p:inputText id="username" value="#{LoginBean.nombre}" title="username" required="true" requiredMessage="El campo es obligatorio." /> |
|||
<p:message for="username"/> |
|||
|
|||
<p:outputLabel for="password" value="Contraseña:" /> |
|||
<p:password id="password" value="#{LoginBean.pass}" title="password" required="true" requiredMessage="El campo es obligatorio" /> |
|||
<p:message for="password"/> |
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton value="Iniciar Sesión" action="#{LoginBean.login}" update="grid"/> |
|||
|
|||
</div> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
|||
|
@ -0,0 +1,182 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 14px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 14px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
|
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA MARCA</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{marcaBean.marcas}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{marcaBean.filteredCustomers3}" |
|||
globalFilterFunction="#{marcaBean.globalFilterFunction}"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{marcaBean.PrepararNuevo()}" value="Nuevo" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info" /> |
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{marcaBean.PrepararEditar(item)}" value="Editar" update=":dialog" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" update=":dialog2" actionListener="#{marcaBean.PrepararEliminar(item)}" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
|
|||
</h:form> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="625" height="200" modal="true"> |
|||
|
|||
<h:form> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{marcaBean.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
|
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{marcaBean.marca.nombre}" title="Nombre" required="true" validatorMessage="Al menos una letra debe estar presente en la cadena" requiredMessage="Este Campo Es Requerido."> |
|||
<f:validateRegex pattern="^(?=.*[a-zA-Z])[\w\d]*$"/> |
|||
</p:inputText> |
|||
<p:message for="nombre" /> |
|||
|
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p style="text-align: center;"> |
|||
<p:commandButton action="#{marcaBean.agregarMarca()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{marcaBean.nuevo}" /> |
|||
<p:commandButton action="MarcaLista.xhtml" actionListener="#{marcaBean.editarMarca()}" value="Editar" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{!marcaBean.nuevo}" style="margin-left: 10px; margin-right: 10px;" /> |
|||
<p:commandButton ajax="false" action="MarcaLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</p> |
|||
|
|||
</h:form> |
|||
|
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="625" height="250" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">ELIMINANDO MARCA</h1> |
|||
|
|||
<p:panelGrid columns="3" style="margin: 0 auto;"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{marcaBean.marca.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{marcaBean.marca.nombre}" title="Nombre"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{marcaBean.marca.status}" title="Status"/> |
|||
</p:panelGrid> |
|||
<p style="text-align: center;"> |
|||
<p:commandButton ajax="true" action="MarcaLista.xhtml" actionListener="#{marcaBean.eliminarMarca()}" update="formtabla:tabla" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
<p:commandButton ajax="false" action="MarcaLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,170 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 15px;"> |
|||
<p:menuitem value="Ir" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 15px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 15px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA PASILLO</h1> |
|||
|
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{pasilloBean.pasillos}" var="item" widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{pasilloBean.filteredCustomers3}" |
|||
globalFilterFunction="#{pasilloBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" value="Nuevo" actionListener="#{pasilloBean.PrepararNuevo()}" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info" /> |
|||
|
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Numero de Pasillo"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.numeroP}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" update=":dialog" actionListener="#{pasilloBean.PrepararEditar(item)}" value="Editar" styleClass="ui-button-outlined ui-button-success" icon="pi pi-pencil"/> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" update=":dialog2" actionListener="#{pasilloBean.PrepararEliminar(item)}" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
|
|||
</h:form> |
|||
|
|||
<p:dialog id="dialog" widgetVar="dlg" width="500" height="250" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{pasilloBean.titulo}"/></h1> |
|||
<h:panelGrid columns="2" id="grid"> |
|||
|
|||
<p:outputLabel value="Numero de Pasillo:" for="numeroP" /> |
|||
<p:inputText id="numeroP" value="#{pasilloBean.pasillo.numeroP}" title="NumeroP" required="true" requiredMessage="The NumeroP field is required."/> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<center> |
|||
<p> |
|||
<p:commandButton action="#{pasilloBean.agregarPasillo()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{pasilloBean.nuevo}"/> |
|||
<p:commandButton action="PasilloLista.xhtml" actionListener="#{pasilloBean.editarPasillo()}" value="Editar" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-success" icon="pi pi-pencil" rendered="#{!pasilloBean.nuevo}"/> |
|||
<p:commandButton ajax="false" action="PasilloLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p> |
|||
</center> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="400" height="250" modal="true"> |
|||
|
|||
<h:form> |
|||
<center> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">Eliminar</h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{pasilloBean.pasillo.id}" title="Id"/> |
|||
<h:outputText value="NumeroP:"/> |
|||
<h:outputText value="#{pasilloBean.pasillo.numeroP}" title="NumeroP"/> |
|||
|
|||
</p:panelGrid> |
|||
<p:commandButton ajax="true" action="PasilloLista.xhtml" actionListener="#{pasilloBean.eliminarPasillo()}" update="formtabla:tabla" value="Eliminar" icon="pi pi-trash" styleClass="ui-button-danger mr-2"/> |
|||
<p:commandButton ajax="false" action="PasilloLista.xhtml" value="Cancelar" update="grid,formtabla:tabla" immediate="true"/> |
|||
</center> |
|||
</h:form> |
|||
|
|||
</p:dialog> |
|||
</f:view> |
|||
|
|||
|
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
|
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,291 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top" > |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 15px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 15px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
|
|||
|
|||
</p:menubar> |
|||
|
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
|
|||
|
|||
<ui:define name="content"> |
|||
|
|||
|
|||
<f:view > |
|||
|
|||
|
|||
<h:form id="formtabla" > |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA PRODUCTOS</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{productoBean.productos}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{productoBean.filteredCustomers3}" |
|||
globalFilterFunction="#{productoBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right; " |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{productoBean.PrepararNuevo()}" immediate="true" icon="pi pi-plus" value="Nuevo" update=":dialog" styleClass="rounded-button ui-button-info" /> |
|||
|
|||
|
|||
|
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Codigo"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.codigo}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Precio"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.precio}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Fecha"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.fecha}"> |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Categoria"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.categoriaid.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Marca"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.marcaid.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Proovedor"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.proovedorid.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Ubicacion"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.ubicacionid.estanteid.numeroE}-#{item.ubicacionid.pasilloId.numeroP}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{productoBean.PrepararEditar(item)}" value="Editar" update=":dialog" styleClass="ui-button-outlined ui-button-success" icon="pi pi-pencil" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{productoBean.PrepararEliminar(item)}" value="Eliminar" update=":dialog2" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p:column> |
|||
|
|||
|
|||
</p:dataTable> |
|||
|
|||
|
|||
</h:form> |
|||
|
|||
<p:dialog id="dialog" widgetVar="dlg" width="600" height="550" modal="true"> |
|||
<h:form> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{productoBean.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3" > |
|||
|
|||
<p:outputLabel value="Codigo:" for="codigo" /> |
|||
<p:inputText id="codigo" value="#{productoBean.producto.codigo}" title="Codigo" required="true" validatorMessage="Solo se aceptan Numeros" requiredMessage="Este campo es requerido."> |
|||
<f:validateRegex pattern="^\d{10}$" for="codigo"/> |
|||
</p:inputText> |
|||
<p:message for="codigo"/> |
|||
|
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{productoBean.producto.nombre}" title="Nombre" required="true" validatorMessage="Solo se aceptan letras" requiredMessage="Este campo es requerido."> |
|||
<f:validateRegex pattern="^[a-zA-Z0-]*$" for="nombre"/> |
|||
</p:inputText> |
|||
<p:message for="nombre"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel value="Precio:" for="precio" /> |
|||
<p:inputText id="precio" value="#{productoBean.producto.precio}" title="Precio" required="true" requiredMessage="Escribe el Precio."/> |
|||
|
|||
<br> |
|||
<p:outputLabel value="Fecha:" for="fecha" /> |
|||
<p:inputText id="fecha" value="#{productoBean.producto.fecha}" title="Fecha" required="true" requiredMessage="Este campo es requerido."> |
|||
|
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</p:inputText> |
|||
</br> |
|||
|
|||
|
|||
<br> |
|||
<p:outputLabel value="Categoria:" for="categoriaid" /> |
|||
<p:selectOneMenu id="categoriaid" value="#{productoBean.producto.categoriaid}" converter="selectOneMenuConverter" required="true" requiredMessage="Selecciona la Categoria."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{categoriaBean.categoria}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
</br> |
|||
<br> |
|||
<p:outputLabel value="Marca:" for="marcaid" /> |
|||
<p:selectOneMenu id="marcaid" value="#{productoBean.producto.marcaid}" converter="selectOneMenuConverter" required="true" requiredMessage="The Marcaid field is required."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{marcaBean.marcas}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
</br> |
|||
<br> |
|||
<p:outputLabel value="Proovedor:" for="proovedorid" /> |
|||
<p:selectOneMenu id="proovedorid" value="#{productoBean.producto.proovedorid}" converter="selectOneMenuConverter" required="true" requiredMessage="The Proovedorid field is required."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{proveedorBean.proovedors}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
</br> |
|||
<p:outputLabel value="Ubicacion:" for="ubicacionid" /> |
|||
<p:selectOneMenu id="ubicacionid" value="#{productoBean.producto.ubicacionid}" converter="selectOneMenuConverter" required="true" requiredMessage="The Ubicacionid field is required."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{ubicacionBean.ubicaciones}" var="item" itemLabel="#{item.estanteid.numeroE}-#{item.pasilloId.numeroP}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
</h:panelGrid> |
|||
<center> |
|||
|
|||
<p> |
|||
|
|||
<p:commandButton action="#{productoBean.agregarProducto()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{productoBean.nuevo}"/> |
|||
<p:commandButton action="ProductoLista.xhtml" actionListener="#{productoBean.editarProducto()}" value="Editar" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-success" icon="pi pi-pencil" rendered="#{!productoBean.nuevo}"/> |
|||
<p:commandButton ajax="false" action="ProductoLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p> |
|||
</center> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="500" height="650" modal="true"> |
|||
<h:form> |
|||
<center> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">Eliminar</h1> |
|||
<p:panelGrid columns="2"> |
|||
<p:outputLabel value="Id:"/> |
|||
<h:outputText value="#{productoBean.producto.id}" title="Id" /> |
|||
<p:outputLabel value="Codigo:" /> |
|||
<h:outputText value="#{productoBean.producto.codigo}" title="Codigo" /> |
|||
<p:outputLabel value="Nombre:" /> |
|||
<h:outputText value="#{productoBean.producto.nombre}" title="Nombre" /> |
|||
<p:outputLabel value="Precio:" /> |
|||
<h:outputText value="#{productoBean.producto.precio}" title="Precio" /> |
|||
<p:outputLabel value="Fecha:" /> |
|||
<h:outputText value="#{productoBean.producto.fecha}" title="Fecha" > |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
<p:outputLabel value="Categoria:" /> |
|||
<h:outputText value="#{productoBean.producto.categoriaid.nombre}" title="Categoria" /> |
|||
<p:outputLabel value="Marca:" /> |
|||
<h:outputText value="#{productoBean.producto.marcaid.nombre}" title="Marca" /> |
|||
<p:outputLabel value="Proovedor:" /> |
|||
<h:outputText value="#{productoBean.producto.proovedorid.nombre}" title="Proovedor" /> |
|||
<p:outputLabel value="Proovedor:" /> |
|||
<h:outputText value="#{productoBean.producto.ubicacionid.estanteid.numeroE}-#{productoBean.producto.ubicacionid.pasilloId.numeroP}" title="Proovedor" /> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton ajax="true" action="ProductoLista.xhtml" actionListener="#{productoBean.eliminarProducto()}" value="Eliminar" update="formtabla:tabla" icon="pi pi-trash" styleClass="ui-button-danger mr-2"/> |
|||
<p:commandButton ajax="false" action="ProductoLista.xhtml" value="Cancelar" immediate="true" update="grid,formtabla:tabla" icon="pi pi-times" styleClass="ui-button-danger" /> |
|||
</center> |
|||
</h:form> |
|||
|
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,210 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 14px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 14px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
left |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA RESGUARDOS</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{resguardoBean.resguardos}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{resguardoBean.filteredCustomers3}" |
|||
globalFilterFunction="#{resguardoBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{resguardoBean.PrepararNuevo()}" value="Nuevo" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info"/> |
|||
|
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Fecha"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.fecha}"> |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1?'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Producto"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.productoId.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Usuario"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.usuarioid.nombre}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{resguardoBean.PrepararEditar(item)}" value="Editar" icon="pi pi-pencil" update=":dialog" styleClass="ui-button-outlined ui-button-success" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{resguardoBean.PrepararEliminar(item)}" value="Eliminar" update=":dialog2" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</p:column> |
|||
|
|||
</p:dataTable> |
|||
</h:form> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="625" height="300" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{resguardoBean.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
|
|||
<p:outputLabel value="Fecha:" for="fecha" /> |
|||
<p:inputText id="fecha" value="#{resguardoBean.resguardo.fecha}" title="Fecha" required="true" validatorMessage="Fecha invalida. Ejemplo: 10/03/2024" requiredMessage="Este campo es requerido."> |
|||
<f:convertDateTime pattern="dd/MM/yyyy"/> |
|||
</p:inputText> |
|||
<p:message for="fecha"/> |
|||
|
|||
<p:outputLabel value="Producto:" for="productoId" /> |
|||
<p:selectOneMenu id="productoId" value="#{resguardoBean.resguardo.productoId}" converter="selectOneMenuConverter" title="Productoid" required="true" requiredMessage="Este campo es requerido."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{productoBean.productos}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}" /> |
|||
</p:selectOneMenu> |
|||
<p:message for="productoId"/> |
|||
<p:outputLabel value="Usuario:" for="usuarioid" /> |
|||
<p:selectOneMenu id="usuarioid" value="#{resguardoBean.resguardo.usuarioid}" converter="selectOneMenuConverter" title="Usuarioid" required="true" requiredMessage="Este campo es requerido." > |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{usuarioBean.usuarios}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="usuarioid"/> |
|||
</h:panelGrid> |
|||
|
|||
<p style="text-align: center;"> |
|||
<p:commandButton action="#{resguardoBean.agregarResguardo()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{resguardoBean.nuevo}"/> |
|||
<p:commandButton action="ResguardoLista.xhtml" actionListener="#{resguardoBean.editarResguardo()}" value="Editar" icon="pi pi-pencil" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-success" rendered="#{!resguardoBean.nuevo}" style="margin-left: 10px; margin-right: 10px;"/> |
|||
<p:commandButton ajax="false" action="ResguardoLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</p> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="625" height="350" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">Eliminar Resguardo</h1> |
|||
|
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{resguardoBean.resguardo.id}" title="Id"/> |
|||
<h:outputText value="Producto:"/> |
|||
<h:outputText value="#{resguardoBean.resguardo.productoId.nombre}" title="Productoid"/> |
|||
<h:outputText value="Usuario:"/> |
|||
<h:outputText value="#{resguardoBean.resguardo.usuarioid.nombre}" title="Usuarioid"/> |
|||
<h:outputText value="Fecha:"/> |
|||
<h:outputText value="#{resguardoBean.resguardo.fecha}" title="Fecha"> |
|||
<f:convertDateTime pattern="dd/MM/yyyy"/> |
|||
</h:outputText> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton ajax="true" action="ResguardoLista.xhtml" actionListener="#{resguardoBean.eliminarResguardo()}" value="Eliminar" update="formtabla:tabla" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
<p:commandButton ajax="false" action="ResguardoLista.xhtml" value="Cancelar" immediate="true" update="grid,formtabla:tabla" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,191 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 14px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 14px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
left |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA ROLES</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{rolBean.roles}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{rolBean.filteredCustomers3}" |
|||
globalFilterFunction="#{rolBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{rolBean.PrepararNuevo()}" value="Nuevo" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info"/> |
|||
|
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Descripcion"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.descripcion}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1?'activo':'inactivo'}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{rolBean.PrepararEditar(item)}" value="Editar" icon="pi pi-pencil" update=":dialog" styleClass="ui-button-outlined ui-button-success" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{rolBean.PrepararEliminar(item)}" value="Eliminar" update=":dialog2" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
|
|||
<p:dialog id="dialog" widgetVar="dlg" width="625" height="200" modal="true"> |
|||
|
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{rolBean.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{rolBean.rol.nombre}" title="Nombre" required="true" requiredMessage="Este campo es requerido."/> |
|||
<p:message for="nombre"/> |
|||
<p:outputLabel value="Descripcion:" for="descripcion" /> |
|||
<p:inputText id="descripcion" value="#{rolBean.rol.descripcion}" title="Descripcion" required="true" requiredMessage="Este campo es requerido."/> |
|||
<p:message for="descripcion"/> |
|||
|
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p style="text-align: center;"> |
|||
<p:commandButton ajax="false" action="#{rolBean.agregarRol()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{rolBean.nuevo}"/> |
|||
<p:commandButton ajax="false" action="RolLista.xhtml" actionListener="#{rolBean.editarRol()}" value="Editar" icon="pi pi-pencil" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-success" rendered="#{!rolBean.nuevo}" style="margin-left: 10px; margin-right: 10px;"/> |
|||
<p:commandButton action="RolLista.xhtml" ajax="false" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</p> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="625" height="280" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">Eliminar Usuario</h1> |
|||
|
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{rolBean.rol.id}" title="Id" /> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{rolBean.rol.nombre}" title="Nombre"/> |
|||
<h:outputText value="Descripcion:"/> |
|||
<h:outputText value="#{rolBean.rol.descripcion}" title="Descripcion" /> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton ajax="true" action="RolLista.xhtml" actionListener="#{rolBean.eliminarRol()}" value="Eliminar" update="formtabla:tabla" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
<p:commandButton ajax="false" action="RolLista.xhtml" value="Cancelar" immediate="true" update="grid,formtabla:tabla" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
<script> |
|||
$.fn.dataTable.ext.errMode = 'none'; |
|||
new DataTable('table'); |
|||
|
|||
</script> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,177 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml" > |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 15px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 15px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA UBICACION</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{ubicacionBean.ubicaciones}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{ubicacionBean.filteredCustomers3}" |
|||
globalFilterFunction="#{ubicacionBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float:right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" value="Nuevo" actionListener="#{ubicacionBean.PrepararNuevo()}" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info" /> |
|||
|
|||
|
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Estante"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.estanteid.numeroE}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Pasillo"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.pasilloId.numeroP}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{ubicacionBean.PrepararEditar(item)}" value="Editar" update=":dialog" styleClass="ui-button-outlined ui-button-success" icon="pi pi-pencil"/> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{ubicacionBean.PrepararEliminar(item)}" value="Eliminar" update=":dialog2" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="500" height="270" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{ubicacionBean.titulo}"/></h1> |
|||
<h:panelGrid id="grid" columns="2"> |
|||
<p:outputLabel value="Estante:" for="estanteid" /> |
|||
<p:selectOneMenu id="estanteid" value="#{ubicacionBean.ubicacion.estanteid}" title="Estanteid" converter="selectOneMenuConverter" required="true" requiredMessage="The Estanteid field is required."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{estanteBean.estantes}" var="item" itemLabel="#{item.numeroE}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:outputLabel value="Pasillo:" for="pasilloId" /> |
|||
<p:selectOneMenu id="pasilloId" value="#{ubicacionBean.ubicacion.pasilloId}" title="Pasilloid" converter="selectOneMenuConverter" required="true" requiredMessage="The PasilloId field is required."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{pasilloBean.pasillos}" var="item" itemLabel="#{item.numeroP}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<p:message for="estanteid"/> |
|||
</h:panelGrid> |
|||
<center> |
|||
<p> |
|||
<p:commandButton action="#{ubicacionBean.agregarUbicacion()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{ubicacionBean.nuevo}"/> |
|||
<p:commandButton action="UbicacionLista.xhtml" actionListener="#{ubicacionBean.editarUbicacion()}" update="grid,formtabla:tabla" value="Editar" styleClass="ui-button-outlined ui-button-success" icon="pi pi-pencil" rendered="#{!ubicacionBean.nuevo}"/> |
|||
<p:commandButton ajax="false" action="UbicacionLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p> |
|||
</center> |
|||
</h:form> |
|||
</p:dialog> |
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="400" height="250" modal="true"> |
|||
<h:form> |
|||
<center> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">Eliminar</h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{ubicacionBean.ubicacion.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{ubicacionBean.ubicacion.estanteid.numeroE}" title="Nombre"/> |
|||
|
|||
</p:panelGrid> |
|||
<p:commandButton ajax="true" action="UbicacionLista.xhtml" actionListener="#{ubicacionBean.eliminarUbicacion()}" update="formtabla:tabla" value="Eliminar" icon="pi pi-trash" styleClass="ui-button-danger mr-2"/> |
|||
<p:commandButton ajax="false" action="UbicacionLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times" update="grid,formtabla:tabla" styleClass="ui-button-danger" /> |
|||
</center> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,32 @@ |
|||
<?xml version='1.0' encoding='UTF-8'?> |
|||
<!-- |
|||
|
|||
Licensed to the Apache Software Foundation (ASF) under one |
|||
or more contributor license agreements. See the NOTICE file |
|||
distributed with this work for additional information |
|||
regarding copyright ownership. The ASF licenses this file |
|||
to you under the Apache License, Version 2.0 (the |
|||
"License"); you may not use this file except in compliance |
|||
with the License. You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, |
|||
software distributed under the License is distributed on an |
|||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
KIND, either express or implied. See the License for the |
|||
specific language governing permissions and limitations |
|||
under the License. |
|||
|
|||
--> |
|||
<faces-config version="2.2" |
|||
xmlns="http://xmlns.jcp.org/xml/ns/javaee" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> |
|||
<lifecycle> |
|||
<phase-listener> |
|||
seguridad.AutorizacionListener |
|||
</phase-listener> |
|||
</lifecycle> |
|||
|
|||
</faces-config> |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> |
|||
<!-- |
|||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. |
|||
|
|||
This program and the accompanying materials are made available under the |
|||
terms of the Eclipse Public License v. 2.0, which is available at |
|||
http://www.eclipse.org/legal/epl-2.0. |
|||
|
|||
This Source Code may also be made available under the following Secondary |
|||
Licenses when the conditions for such availability set forth in the |
|||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
|||
version 2 with the GNU Classpath Exception, which is available at |
|||
https://www.gnu.org/software/classpath/license.html. |
|||
|
|||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
|||
--> |
|||
<glassfish-web-app error-url=""> |
|||
<class-loader delegate="true"/> |
|||
<jsp-config> |
|||
<property name="keepgenerated" value="true"> |
|||
<description>Keep a copy of the generated servlet class' java code.</description> |
|||
</property> |
|||
</jsp-config> |
|||
</glassfish-web-app> |
@ -0,0 +1,32 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> |
|||
<context-param> |
|||
<param-name>javax.faces.PROJECT_STAGE</param-name> |
|||
<param-value>Development</param-value> |
|||
</context-param> |
|||
<servlet> |
|||
<servlet-name>Faces Servlet</servlet-name> |
|||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> |
|||
<load-on-startup>1</load-on-startup> |
|||
</servlet> |
|||
<servlet-mapping> |
|||
<servlet-name>Faces Servlet</servlet-name> |
|||
<url-pattern>/faces/*</url-pattern> |
|||
</servlet-mapping> |
|||
<mime-mapping> |
|||
<extension>eot</extension> |
|||
<mime-type>application/vnd.ms-fontobject</mime-type> |
|||
</mime-mapping> |
|||
<session-config> |
|||
<session-timeout> |
|||
30 |
|||
</session-timeout> |
|||
</session-config> |
|||
<welcome-file-list> |
|||
<welcome-file>faces/ProductoLista.xhtml</welcome-file> |
|||
</welcome-file-list> |
|||
<context-param> |
|||
<param-name>javax.faces.CONFIG_FILES</param-name> |
|||
<param-value>/WEB-INF/faces-config.xml</param-value> |
|||
</context-param> |
|||
</web-app> |
@ -0,0 +1,172 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:p="http://primefaces.org/ui" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 14px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 14px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
left |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA ESTANTE</h1> |
|||
|
|||
<p:dataTable id="tabla" value="#{estanteBean.estantes}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{estanteBean.filteredCustomers3}" |
|||
globalFilterFunction="#{estanteBean.globalFilterFunction}"> |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{estanteBean.prepararNuevo()}" update=":dialog" value="Nuevo" immediate="true"/> |
|||
|
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="NumeroE"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.numeroE}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{estanteBean.prepararEditar(item)}" value="Editar" update=":dialog" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" update=":dialog2" actionListener="#{estanteBean.prepararEliminar(item)}" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
|
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="625" height="400" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{estanteBean.titulo}"/></h1> |
|||
<h:panelGrid id="grid" columns="3"> |
|||
<p:outputLabel value="NumeroE:" for="numeroE" /> |
|||
<p:inputText id="numeroE" value="#{estanteBean.estante.numeroE}" title="NumeroE" required="true" requiredMessage="Agregar un estante"> |
|||
</p:inputText> |
|||
<p:message for="numeroE"/> |
|||
|
|||
|
|||
</h:panelGrid> |
|||
|
|||
|
|||
<p:commandButton action="#{estanteBean.agregarEstante()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{estanteBean.nuevo}" /> |
|||
<p:commandButton action="estanteLista.xhtml" actionListener="#{estanteBean.editarEstantes()}" value="Editar" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{!estanteBean.nuevo}" style="margin-left: 10px; margin-right: 10px;" /> |
|||
<p:commandButton ajax="false" action="estanteLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
|
|||
</h:form> |
|||
</p:dialog> |
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="625" height="400" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">ELIMINANDO LISTA</h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{estanteBean.estante.id}" title="Id"/> |
|||
<h:outputText value="NumeroE:"/> |
|||
<h:outputText value="#{estanteBean.estante.numeroE}" title="NumeroE"/> |
|||
<h:outputText value="Status:"/> |
|||
<h:outputText value="#{estanteBean.estante.status}" title="Status"/> |
|||
</p:panelGrid> |
|||
<p:commandButton ajax="true" action="estanteLista.xhtml" actionListener="#{estanteBean.eliminarEstantes()}" update="formtabla:tabla" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
<p:commandButton ajax="false" action="estanteLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" update="grid,formtabla:tabla" styleClass="ui-button-outlined ui-button-danger"/> |
|||
|
|||
|
|||
</h:form> |
|||
|
|||
</p:dialog> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,15 @@ |
|||
<!DOCTYPE html> |
|||
<!-- |
|||
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
|||
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Html.html to edit this template |
|||
--> |
|||
<html> |
|||
<head> |
|||
<title>TODO supply a title</title> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
</head> |
|||
<body> |
|||
<div>normal/<div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,55 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
|||
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template |
|||
--> |
|||
<!DOCTYPE html> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
|
|||
<body> |
|||
|
|||
|
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<h:form> |
|||
|
|||
|
|||
|
|||
<p:panelGrid columns="2"> |
|||
<p:outputLabel for="nombre">Nombre de usuario:</p:outputLabel> |
|||
<p:inputText id="nombre" value="#{login.nombre}" required="true" /> |
|||
|
|||
<p:outputLabel for="pass">Contraseña:</p:outputLabel> |
|||
<p:password id="pass" value="#{login.pass}" required="true" /> |
|||
|
|||
|
|||
</p:panelGrid> |
|||
|
|||
|
|||
<p:commandButton value="Iniciar sesión" action="#{login.login}" /> |
|||
|
|||
</h:form> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,201 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 14px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 14px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 14px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA PROVEEDORES</h1> |
|||
|
|||
<p:dataTable id="tabla" value="#{proveedorBean.proovedors}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{proveedorBean.filteredCustomers3}" |
|||
globalFilterFunction="#{proveedorBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:400px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" update=":dialog" actionListener="#{proveedorBean.prepararNuevo()}" value="Nuevo" icon="pi pi-plus" styleClass="rounded-button ui-button-info" immediate="true"/> |
|||
|
|||
</div> |
|||
</f:facet> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Direccion"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.direccion}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Mail"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.mail}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Telefono"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.telefono}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{proveedorBean.prepararEditar(item)}" update=":dialog" value="Editar" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success"/> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{proveedorBean.prepararEliminar(item)}" update=":dialog2" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
|
|||
</p:column> |
|||
|
|||
</p:dataTable> |
|||
|
|||
</h:form> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="500" height="300" modal="true"> |
|||
<h:form> |
|||
|
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{proveedorBean.titulo}"/></h1> |
|||
|
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{proveedorBean.proveedor.nombre}" title="Nombre" required="true" requiredMessage="Este Campo es Requerido"/> |
|||
<p:message for="nombre"/> |
|||
<p:outputLabel value="Direccion:" for="direccion" /> |
|||
<p:inputText id="direccion" value="#{proveedorBean.proveedor.direccion}" title="Direccion" required="true" requiredMessage="Este Campo es Requerido"/> |
|||
<p:message for="direccion"/> |
|||
<p:outputLabel value="Mail:" for="mail" /> |
|||
<p:inputText id="mail" value="#{proveedorBean.proveedor.mail}" validatorMessage="Agregue un Correo valido" title="Mail" required="true" requiredMessage="Este Campo es Requerido"> |
|||
<f:validateRegex pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}" for="mail"/> |
|||
</p:inputText> |
|||
<p:message for="mail"/> |
|||
<p:outputLabel value="Telefono:" for="telefono" /> |
|||
<p:inputText id="telefono" value="#{proveedorBean.proveedor.telefono}" validatorMessage="Agregue un numero de telefono valido" title="Telefono" required="true" requiredMessage="Este Campo es Requerido"> |
|||
<f:validateRegex pattern="^\d{10}$" for="telefono"/> |
|||
</p:inputText> |
|||
<p:message for="telefono"/> |
|||
</h:panelGrid> |
|||
<p:commandButton action="#{proveedorBean.agregarProveedor()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{proveedorBean.nuevo}"/> |
|||
<p:commandButton action="proveedoresLista.xhtml" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" actionListener="#{proveedorBean.editarProvedores()}" value="Editar" rendered="#{!proveedorBean.nuevo}" style="margin-left: 10px; margin-right: 10px;" /> |
|||
<p:commandButton ajax="false" action="proveedoresLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</h:form> |
|||
|
|||
|
|||
</p:dialog> |
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="500" height="370" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 20px; color: #000; font-size: 2em; margin-bottom: 20px;">ELIMINANDO PROVEEDOR</h1> |
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{proveedorBean.proveedor.nombre}" title="Nombre"/> |
|||
<h:outputText value="Direccion:"/> |
|||
<h:outputText value="#{proveedorBean.proveedor.direccion}" title="Direccion"/> |
|||
<h:outputText value="Mail:"/> |
|||
<h:outputText value="#{proveedorBean.proveedor.mail}" title="Mail"/> |
|||
<h:outputText value="Telefono:"/> |
|||
<h:outputText value="#{proveedorBean.proveedor.telefono}" title="Telefono"/> |
|||
</p:panelGrid> |
|||
<p:commandButton action="proveedoresLista.xhtml" ajax="true" update="formtabla:tabla" actionListener="#{proveedorBean.eliminarProveedores()}" value="Eliminar" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
<p:commandButton action="proveedoresLista.xhtml" ajax="false" value="Cancelar" update="formtabla:tabla" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
</h:form> |
|||
</p:dialog> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
After Width: | Height: | Size: 475 KiB |
@ -0,0 +1,61 @@ |
|||
|
|||
#top { |
|||
position: relative; |
|||
background-color: #036fab; |
|||
color: white; |
|||
padding: 5px; |
|||
margin: 0px 0px 10px 0px; |
|||
} |
|||
|
|||
#bottom { |
|||
position: relative; |
|||
background-color: #c2dfef; |
|||
padding: 5px; |
|||
margin: 10px 0px 0px 0px; |
|||
} |
|||
|
|||
#left { |
|||
float: left; |
|||
background-color: #ece3a5; |
|||
padding: 5px; |
|||
width: 150px; |
|||
} |
|||
|
|||
#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; |
|||
} |
|||
|
|||
|
@ -0,0 +1,29 @@ |
|||
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: 16px; |
|||
font-weight: bold; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
color: #D20005; |
|||
} |
|||
|
|||
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; |
|||
} |
After Width: | Height: | Size: 23 KiB |
@ -0,0 +1,32 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html"> |
|||
|
|||
<h:head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|||
<h:outputStylesheet name="./css/default.css"/> |
|||
<h:outputStylesheet name="./css/cssLayout.css"/> |
|||
<title>Facelets Template</title> |
|||
</h:head> |
|||
|
|||
<h:body> |
|||
|
|||
<div id="top"> |
|||
<ui:insert name="top">Top</ui:insert> |
|||
</div> |
|||
|
|||
<div id="content" class="center_content"> |
|||
<ui:insert name="content">Content</ui:insert> |
|||
</div> |
|||
|
|||
<div id="bottom" style="background-color: #5F9FDB;"> |
|||
<center> <h5 > Derechos Reservados</h5> |
|||
<ui:insert name="bottom"></ui:insert> |
|||
<span>2024</span> </center> |
|||
</div> |
|||
|
|||
</h:body> |
|||
|
|||
</html> |
@ -0,0 +1,236 @@ |
|||
<?xml version='1.0' encoding='UTF-8' ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" |
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" |
|||
xmlns:h="http://xmlns.jcp.org/jsf/html" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core" |
|||
xmlns:p="http://primefaces.org/ui"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/VistasChidas.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<h:form> |
|||
<p:menubar> |
|||
<p:submenu label="USUARIOS" icon="pi pi-user" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="usuarioLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PRODUCTOS" icon="pi pi-shopping-bag" style="font-size: 15px;"> |
|||
<p:menuitem value="Ir" action="ProductoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="MARCA" icon="pi pi-tags" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="MarcaLista.xhtml" /> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="CATEGORIA" icon="pi pi-th-large" style="font-size: 15px;" > |
|||
<p:menuitem value="Agregar" action="CategoriaLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PASILLO" icon="pi pi-paypal" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="PasilloLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="RESGUARDO" icon="pi pi-cloud" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="ResguardoLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ROL" icon="pi pi-id-card" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="RolLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="UBICACION" icon="pi pi-map" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="UbicacionLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="ESTANTE" icon="pi pi-map-marker" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="estanteLista.xhtml"/> |
|||
</p:submenu> |
|||
|
|||
<p:submenu label="PROVEEDORES" icon="pi pi-users" style="font-size: 15px;"> |
|||
<p:menuitem value="Agregar" action="proveedoresLista.xhtml"/> |
|||
</p:submenu> |
|||
<p:submenu label="Cerrar sesion" icon="pi pi-sign-out" style="font-size: 15px; " > |
|||
<p:menuitem value="Cerrar" action="#{login.logout}"/> |
|||
</p:submenu> |
|||
</p:menubar> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">LISTA USUARIOS</h1> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{usuarioBean.usuarios}" var="item" |
|||
widgetVar="customersTable3" |
|||
emptyMessage="No customers found with given criteria" |
|||
filteredValue="#{usuarioBean.filteredCustomers3}" |
|||
globalFilterFunction="#{usuarioBean.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="350"> |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end"> |
|||
<p:inputText id="globalFilter" onkeyup="PF('customersTable3').filter()" style="width:300px; float: right;" |
|||
placeholder="Buscar" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{usuarioBean.PrepararNuevo()}" value="Nuevo" immediate="true" icon="pi pi-plus" update=":dialog" styleClass="rounded-button ui-button-info"/> |
|||
|
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Pass"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.pass}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Mail"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.mail}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Telefono"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.telefono}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status == 1? 'activo':'inactivo'}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Rol"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.rolid.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones"/> |
|||
</f:facet> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{usuarioBean.PrepararEditar(item)}" value="Editar" icon="pi pi-pencil" update=":dialog" styleClass="ui-button-outlined ui-button-success" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{usuarioBean.PrepararEliminar(item)}" value="Eliminar" update=":dialog2" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger"/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="625" height="350" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;"><h:outputText value="#{usuarioBean.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{usuarioBean.usuario.nombre}" title="Nombre" required="true" validatorMessage="Solo se aceptan letras" requiredMessage="Este campo es requerido."> |
|||
<f:validateRegex pattern="^[a-zA-Z0-]*$" for="nombre"/> |
|||
</p:inputText> |
|||
<p:message for="nombre"/> |
|||
|
|||
<p:outputLabel value="Pass:" for="pass" /> |
|||
<p:inputText id="pass" value="#{usuarioBean.usuario.pass}" title="Pass" required="true" validatorMessage="Minimo 6 caracteres, 1 mayuscula, 1 miniscula, 1 numero sin espacio" requiredMessage="Este campo es requerido."> |
|||
<f:validateRegex pattern="^((?=\S*?[A-Z])(?=\S*?[a-z])(?=\S*?[0-9]).{6,})\S$"/> |
|||
</p:inputText> |
|||
<p:message for="pass"/> |
|||
|
|||
<p:outputLabel value="Mail:" for="mail" /> |
|||
<p:inputText id="mail" value="#{usuarioBean.usuario.mail}" title="Mail" required="true" validatorMessage="Correo Invalido" requiredMessage="Este campo es requerido."> |
|||
<f:validateRegex pattern="^((?!\.)[\w\-_.]*[^.])(@\w+)(\.\w+(\.\w+)?[^.\W])$"/> |
|||
</p:inputText> |
|||
<p:message for="mail"/> |
|||
|
|||
<p:outputLabel value="Telefono:" for="telefono" /> |
|||
<p:inputText id="telefono" value="#{usuarioBean.usuario.telefono}" title="Telefono" required="true" validatorMessage="Telefono Invalido" requiredMessage="Este campo es requerido."> |
|||
<f:validateRegex pattern="^\d{10}$"/> |
|||
</p:inputText> |
|||
<p:message for="telefono"/> |
|||
|
|||
<p:outputLabel value="Rol" for="rolid" /> |
|||
<p:selectOneMenu id="rolid" value="#{usuarioBean.usuario.rolid}" converter="selectOneMenuConverter" title="Rolid" required="true" requiredMessage="Este campo es requerido."> |
|||
<!-- TODO: update below reference to list of available items--> |
|||
<f:selectItems value="#{rolBean.roles}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}" /> |
|||
</p:selectOneMenu> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p style="text-align: center;"> |
|||
<p:commandButton action="#{usuarioBean.agregarUsuario()}" value="Agregar" icon="pi pi-plus-circle" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{usuarioBean.nuevo}"/> |
|||
<p:commandButton action="usuarioLista.xhtml" actionListener="#{usuarioBean.editarUsuario()}" value="Editar" icon="pi pi-pencil" styleClass="ui-button-outlined ui-button-success" update="grid,formtabla:tabla" rendered="#{!usuarioBean.nuevo}" style="margin-left: 10px; margin-right: 10px;"/> |
|||
<p:commandButton action="usuarioLista.xhtml" value="Cancelar" immediate="true" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" ajax="false"/> |
|||
</p> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="625" height="450" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #5F9FDB; padding: 30px; color: #000; font-size: 2em; margin-bottom: 20px;">Eliminar Usuario</h1> |
|||
|
|||
<p:panelGrid columns="2"> |
|||
<h:outputText value="Id:"/> |
|||
<h:outputText value="#{usuarioBean.usuario.id}" title="Id"/> |
|||
<h:outputText value="Nombre:"/> |
|||
<h:outputText value="#{usuarioBean.usuario.nombre}" title="Nombre"/> |
|||
<h:outputText value="Pass:"/> |
|||
<h:outputText value="#{usuarioBean.usuario.pass}" title="Pass"/> |
|||
<h:outputText value="Mail:"/> |
|||
<h:outputText value="#{usuarioBean.usuario.mail}" title="Mail"/> |
|||
<h:outputText value="Telefono:"/> |
|||
<h:outputText value="#{usuarioBean.usuario.telefono}" title="Telefono"/> |
|||
<h:outputText value="Rol:"/> |
|||
<h:outputText value="#{usuarioBean.usuario.rolid.nombre}" title="Rol"/> |
|||
</p:panelGrid> |
|||
|
|||
<p:commandButton ajax="true" action="usuarioLista.xhtml" actionListener="#{usuarioBean.eliminarUsuario()}" value="Eliminar" update="formtabla:tabla" title="Delete" icon="pi pi-trash" styleClass="ui-button-outlined ui-button-danger" /> |
|||
<p:commandButton ajax="false" action="usuarioLista.xhtml" value="Cancelar" immediate="true" update="grid,formtabla:tabla" icon="pi pi-times-circle" styleClass="ui-button-outlined ui-button-danger" /> |
|||
|
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
</f:view> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="bottom"> |
|||
bottom |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,61 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- You may freely edit this file. See commented blocks below for --> |
|||
<!-- some examples of how to customize the build. --> |
|||
<!-- (If you delete it and reopen the project it will be recreated.) --> |
|||
<!-- By default, only the Clean and Build commands use this build script. --> |
|||
<!-- Commands such as Run, Debug, and Test only use this build script if --> |
|||
<!-- the Compile on Save feature is turned off for the project. --> |
|||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
|||
<!-- in the project's Project Properties dialog box.--> |
|||
<project name="SystemInventory" default="default" basedir="." xmlns:ear="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<description>Builds, tests, and runs the project SystemInventory.</description> |
|||
<import file="nbproject/build-impl.xml"/> |
|||
<!-- |
|||
|
|||
There exist several targets which are by default empty and which can be |
|||
used for execution of your tasks. These targets are usually executed |
|||
before and after some main targets. They are: |
|||
|
|||
pre-init: called before initialization of project properties |
|||
post-init: called after initialization of project properties |
|||
pre-compile: called before javac compilation |
|||
post-compile: called after javac compilation |
|||
pre-dist: called before archive building |
|||
post-dist: called after archive building |
|||
post-clean: called after cleaning build products |
|||
pre-run-deploy: called before deploying |
|||
post-run-deploy: called after deploying |
|||
|
|||
Example of pluging an obfuscator after the compilation could look like |
|||
|
|||
<target name="post-compile"> |
|||
<obfuscate> |
|||
<fileset dir="${build.classes.dir}"/> |
|||
</obfuscate> |
|||
</target> |
|||
|
|||
For list of available properties check the imported |
|||
nbproject/build-impl.xml file. |
|||
|
|||
|
|||
Other way how to customize the build is by overriding existing main targets. |
|||
The target of interest are: |
|||
|
|||
do-dist: archive building |
|||
run: execution of project |
|||
|
|||
Example of overriding the target for project execution could look like |
|||
|
|||
<target name="run" depends="<PROJNAME>-impl.jar"> |
|||
<exec dir="bin" executable="launcher.exe"> |
|||
<arg file="${dist.jar}"/> |
|||
</exec> |
|||
</target> |
|||
|
|||
Notice that overridden target depends on jar target and not only on |
|||
compile target as regular run target does. Again, for list of available |
|||
properties which you can use check the target you are overriding in |
|||
nbproject/build-impl.xml file. |
|||
|
|||
--> |
|||
</project> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue