nickdalyrendon
7 months ago
commit
4492fe8453
111 changed files with 11858 additions and 0 deletions
@ -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="Inventario-ejb" default="default" basedir="." xmlns:ejbjarproject="http://www.netbeans.org/ns/j2ee-ejbjarproject/3"> |
|||
<description>Builds, tests, and runs the project Inventario-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=3dd259b3 |
|||
build.xml.script.CRC32=d98c699b |
|||
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=3dd259b3 |
|||
nbproject/build-impl.xml.script.CRC32=17664588 |
|||
nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75 |
@ -0,0 +1,76 @@ |
|||
annotation.processing.enabled=true |
|||
annotation.processing.enabled.in.editor=true |
|||
annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false |
|||
annotation.processing.processors.list= |
|||
annotation.processing.run.all.processors=true |
|||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output |
|||
build.classes.dir=${build.dir}/classes |
|||
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs |
|||
build.dir=build |
|||
build.ear.classes.dir=${build.dir}/classes |
|||
build.generated.dir=${build.dir}/generated |
|||
build.generated.sources.dir=${build.dir}/generated-sources |
|||
build.test.classes.dir=${build.dir}/test/classes |
|||
build.test.results.dir=${build.dir}/test/results |
|||
debug.classpath=${javac.classpath}:${build.classes.dir} |
|||
debug.test.classpath=\ |
|||
${run.test.classpath} |
|||
dist.dir=dist |
|||
dist.ear.jar=${dist.dir}/${jar.name} |
|||
dist.jar=${dist.dir}/${jar.name} |
|||
dist.javadoc.dir=${dist.dir}/javadoc |
|||
endorsed.classpath=\ |
|||
${libs.javaee-endorsed-api-7.0.classpath} |
|||
excludes= |
|||
includes=** |
|||
j2ee.compile.on.save=true |
|||
j2ee.deploy.on.save=true |
|||
j2ee.platform=1.7 |
|||
j2ee.platform.classpath=${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar |
|||
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar |
|||
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar |
|||
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar |
|||
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar |
|||
j2ee.platform.wsit.classpath= |
|||
j2ee.server.type=gfv4ee7 |
|||
jar.compress=false |
|||
jar.name=Inventario-ejb.jar |
|||
jars.in.ejbjar=false |
|||
javac.classpath= |
|||
javac.debug=true |
|||
javac.deprecation=false |
|||
javac.processorpath=\ |
|||
${javac.classpath}:\ |
|||
${libs.EclipseLink-GlassFish-v3.classpath} |
|||
javac.source=1.8 |
|||
javac.target=1.8 |
|||
javac.test.classpath=\ |
|||
${javac.classpath}:\ |
|||
${build.classes.dir} |
|||
javac.test.processorpath=${javac.test.classpath} |
|||
javadoc.additionalparam= |
|||
javadoc.author=false |
|||
javadoc.encoding=${source.encoding} |
|||
javadoc.noindex=false |
|||
javadoc.nonavbar=false |
|||
javadoc.notree=false |
|||
javadoc.preview=true |
|||
javadoc.private=false |
|||
javadoc.splitindex=true |
|||
javadoc.use=true |
|||
javadoc.version=false |
|||
javadoc.windowtitle= |
|||
meta.inf=${source.root}/conf |
|||
meta.inf.excludes=sun-cmp-mappings.xml |
|||
platform.active=default_platform |
|||
resource.dir=setup |
|||
run.test.classpath=\ |
|||
${javac.test.classpath}:\ |
|||
${build.test.classes.dir} |
|||
# Space-separated list of JVM arguments used when running a class with a main method or a unit test |
|||
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): |
|||
runmain.jvmargs= |
|||
source.encoding=UTF-8 |
|||
source.root=src |
|||
src.dir=${source.root}/java |
|||
test.src.dir=test |
@ -0,0 +1,19 @@ |
|||
<?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>Inventario-ejb</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<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,12 @@ |
|||
<?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="elizabeth"/> |
|||
<property name="URL" value="jdbc:mysql://:3306/proyectoInventario?allowPublicKeyRetrieval=true&useSSL=false"/> |
|||
<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"/> |
|||
</resources> |
@ -0,0 +1,12 @@ |
|||
<?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="root"/> |
|||
<property name="URL" value="jdbc:mysql://:3306/proyectoInventario"/> |
|||
<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"/> |
|||
</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="Inventario-ejbPU" transaction-type="JTA"> |
|||
<jta-data-source>jdbc/proyectoInventario</jta-data-source> |
|||
<exclude-unlisted-classes>false</exclude-unlisted-classes> |
|||
<properties/> |
|||
</persistence-unit> |
|||
</persistence> |
@ -0,0 +1,156 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import mx.edu.tjs.chapala.sistemas.dao.CategoriaDAO; |
|||
import mx.edu.tjs.chapala.sistemas.dao.MarcaDAO; |
|||
import mx.edu.tjs.chapala.sistemas.dao.ProveedorDAO; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Stateless |
|||
public class CategoriaBL implements CategoriaBLLocal { |
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance(). |
|||
addMessage(null, new FacesMessage(severity, summary, detail)); |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje agregar(Categoria categoria) { |
|||
System.out.println("Llegaste al metodo de agregar categoria"); |
|||
CategoriaDAO categoriaDAO = new CategoriaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
//Toda la logica
|
|||
Optional<Categoria> categoriaEncontradoOptional = categoriaDAO.buscarCategoria(categoria); |
|||
Categoria e = categoriaDAO.buscarPorId(categoria); |
|||
|
|||
if(categoria.getNombre().isEmpty() || categoria.getStatus()==0){ |
|||
m = Mensaje.CAMPOS_INCOMPLETOS; |
|||
System.out.println("LOS CAMPOS SON INCOMPLETOS"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "Campos incompletos"); |
|||
} |
|||
|
|||
if(categoria.getNombre().length()>=45 ){ |
|||
m= Mensaje.DATOS_INCORRECTOS; |
|||
System.out.println("DATOS INCORRECTOS"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "Datos incorrectos"); |
|||
} |
|||
|
|||
if (categoriaEncontradoOptional.isPresent()) { |
|||
categoriaEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "La categoria ya existe"); |
|||
} else { |
|||
categoriaDAO.agregar(categoria); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "Se agrego la categoria"); |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Categoria buscarId(Categoria categoria) { |
|||
System.out.println("Llegaste al metodo de buscar por id"); |
|||
CategoriaDAO a = new CategoriaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Categoria c = a.buscarPorId(categoria); |
|||
|
|||
if (c == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE LA CATEGORIA"); |
|||
|
|||
return c; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("CATEGORIA ENCONTRADO CON EXITO: " + c.getId()); |
|||
return c; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Categoria buscarNombre(Categoria categoria) { |
|||
System.out.println("Llegaste al metodo de buscar por nombre"); |
|||
CategoriaDAO a = new CategoriaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Categoria ce = a.buscarPorNombre(categoria); |
|||
|
|||
if (ce == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE LA CATEGORIA"); |
|||
return ce; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("CATEGORIA ENCONTRADO CON EXITO: " + ce.getNombre()); |
|||
return ce; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Categoria> buscarStatus(boolean b) { |
|||
CategoriaDAO a = new CategoriaDAO(); |
|||
List l = a.buscarStatus(b); |
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Categoria categoria) { |
|||
CategoriaDAO a = new CategoriaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
if (a.eliminar(categoria)) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("ELIMINADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "Se ha eliminado correctamente"); |
|||
} else { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO SE PUDO ELIMINAR"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "No se pudo eliminar"); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void editar(Categoria categoria) { |
|||
CategoriaDAO ed = new CategoriaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
|
|||
Optional<Categoria> categoriaEncontradoOptional = ed.buscarCategoria(categoria); |
|||
|
|||
if (categoriaEncontradoOptional.isPresent()) { |
|||
categoriaEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "La categoria ya existe"); |
|||
} else { |
|||
ed.editar(categoria); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "Categoria editada correctamente"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,31 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Local |
|||
public interface CategoriaBLLocal { |
|||
Mensaje agregar(Categoria categoria); |
|||
|
|||
Categoria buscarId(Categoria categoria); |
|||
|
|||
Categoria buscarNombre(Categoria categoria); |
|||
|
|||
List<Categoria> buscarStatus(boolean b); |
|||
|
|||
|
|||
void eliminarId(Categoria categoria); |
|||
|
|||
public void editar(Categoria p); |
|||
} |
@ -0,0 +1,143 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import mx.edu.tjs.chapala.sistemas.dao.CategoriaDAO; |
|||
import mx.edu.tjs.chapala.sistemas.dao.MarcaDAO; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Marca; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Stateless |
|||
public class MarcaBL implements MarcaBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
|
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance(). |
|||
addMessage(null, new FacesMessage(severity, summary, detail)); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje agregar(Marca marca) { |
|||
System.out.println("Llegaste al metodo de agregar marca"); |
|||
MarcaDAO marcaDAO = new MarcaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
//Toda la logica
|
|||
//Optional<Marca> me = marcaDAO.buscarMarca(marca);
|
|||
Optional<Marca> marcaEncontradoOptional = marcaDAO.buscarMarca(marca); |
|||
Marca e = marcaDAO.buscarPorId(marca); |
|||
|
|||
if (marcaEncontradoOptional.isPresent()) { |
|||
marcaEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "La marca ya existe"); |
|||
} else { |
|||
marcaDAO.agregar(marca); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "Se agrego la marca"); |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Marca buscarId(Marca marca) { |
|||
System.out.println("Llegaste al metodo de buscar por id"); |
|||
MarcaDAO a = new MarcaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Marca c = a.buscarPorId(marca); |
|||
|
|||
if (c == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL PROVEEDOR"); |
|||
return c; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("CATEGORIA ENCONTRADO CON EXITO: " + c.getId()); |
|||
return c; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Marca buscarNombre(Marca marca) { |
|||
System.out.println("Llegaste al metodo de buscar por nombre"); |
|||
MarcaDAO a = new MarcaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Marca ce = a.buscarPorNombre(marca); |
|||
|
|||
if (ce == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL PROVEEDOR"); |
|||
return ce; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("PROVEEDOR ENCONTRADO CON EXITO: " + ce.getNombre()); |
|||
return ce; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Marca> buscarStatus(boolean b) { |
|||
MarcaDAO a = new MarcaDAO(); |
|||
List l = a.buscarStatus(b); |
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Marca marca) { |
|||
MarcaDAO a = new MarcaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
if (a.eliminar(marca)) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("ELIMINADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "Se ha eliminado correctamente"); |
|||
} else { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO SE PUDO ELIMINAR"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "No se pudo eliminar"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void editar(Marca marca) { |
|||
MarcaDAO ed = new MarcaDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Optional<Marca> marcaEncontradoOptional = ed.buscarMarca(marca); |
|||
|
|||
if (marcaEncontradoOptional.isPresent()) { |
|||
marcaEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR", "La marca ya existe"); |
|||
} else { |
|||
ed.editar(marca); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "Marca editada correctamente"); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Marca; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Local |
|||
public interface MarcaBLLocal { |
|||
Mensaje agregar(Marca marca); |
|||
|
|||
Marca buscarId(Marca marca); |
|||
|
|||
Marca buscarNombre(Marca marca); |
|||
|
|||
List<Marca> buscarStatus(boolean b); |
|||
|
|||
|
|||
void eliminarId(Marca marca); |
|||
|
|||
public void editar(Marca p); |
|||
} |
@ -0,0 +1,152 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import mx.edu.tjs.chapala.sistemas.dao.ProductoDAO; |
|||
import mx.edu.tjs.chapala.sistemas.dao.ProveedorDAO; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Producto; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Stateless |
|||
public class ProductoBL implements ProductoBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
|
|||
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail){ |
|||
FacesContext.getCurrentInstance(). |
|||
addMessage(null, new FacesMessage(severity, summary,detail)); |
|||
|
|||
} |
|||
@Override |
|||
public Mensaje agregar(Producto producto) { |
|||
System.out.println("Llegaste al metodo de agregar producto"); |
|||
ProductoDAO productoDAO = new ProductoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
//Toda la logica
|
|||
Optional<Producto> productoEncontradoOptional = productoDAO.buscarProducto(producto); |
|||
|
|||
if (productoEncontradoOptional.isPresent()) { |
|||
productoEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, EL PRODUCTO YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR","El producto ya existe"); |
|||
} else { |
|||
productoDAO.agregar(producto); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "CORRECTO","SE AGREGO CON EXITO"); |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Producto buscarId(Producto producto) { |
|||
System.out.println("Llegaste al metodo de buscar por id"); |
|||
ProductoDAO a = new ProductoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Producto productoEncontrado = a.buscarPorId(producto); |
|||
|
|||
if (productoEncontrado == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL PROVEEDOR"); |
|||
// addMessage(FacesMessage.SEVERITY_ERROR, "CORRECTO","NO SE ENCONTRO");
|
|||
return productoEncontrado; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("PROVEEDOR ENCONTRADO CON EXITO: " + productoEncontrado.getId()); |
|||
// addMessage(FacesMessage.SEVERITY_INFO, "CORRECTO","SE ENCONTRADO CON EXITO");
|
|||
return productoEncontrado; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Producto buscarNombre(Producto producto) { |
|||
System.out.println("Llegaste al metodo de buscar por nombre"); |
|||
ProductoDAO a = new ProductoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Producto productoEncontrado = a.buscarPorNombre(producto); |
|||
|
|||
if (productoEncontrado == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL PROVEEDOR"); |
|||
return productoEncontrado; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("PROVEEDOR ENCONTRADO CON EXITO: " + productoEncontrado.getNombre()); |
|||
return productoEncontrado; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Producto> buscarStatus(boolean b) { |
|||
ProductoDAO a = new ProductoDAO(); |
|||
List l = a.buscarStatus(b); |
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje eliminarId(Producto producto) { |
|||
ProductoDAO a = new ProductoDAO(); |
|||
Mensaje m = null; |
|||
|
|||
if (a.eliminar(producto)) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("ELIMINADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "ELIMINADO"," Se elimino correctamente"); |
|||
|
|||
} else { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO SE PUDO ELIMINAR"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "NO SE ELIMINO","No se puede eliminar"); |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Producto producto) { |
|||
ProductoDAO ed = new ProductoDAO(); |
|||
Mensaje m = null; |
|||
// ed.editar(producto);
|
|||
|
|||
Optional<Producto> proveedorEncontradoOptional = ed.buscarProducto(producto); |
|||
if (proveedorEncontradoOptional.isPresent()) { |
|||
proveedorEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE EDITAR, EL PRODUCTO YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "", "¡Error al editar! El elemento ya existe"); |
|||
} else { |
|||
ed.editar(producto); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡Elemento editado correctamente!"); |
|||
|
|||
|
|||
} |
|||
return m; |
|||
} |
|||
|
|||
public List<Producto> getAll() { |
|||
ProductoDAO p = new ProductoDAO(); |
|||
return p.buscarStatus(true); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,30 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Producto; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Local |
|||
public interface ProductoBLLocal { |
|||
Mensaje agregar(Producto producto); |
|||
|
|||
Producto buscarId(Producto producto); |
|||
|
|||
Producto buscarNombre(Producto producto); |
|||
|
|||
List<Producto> buscarStatus(boolean b); |
|||
|
|||
|
|||
Mensaje eliminarId(Producto producto); |
|||
|
|||
public Mensaje editar(Producto p); |
|||
} |
@ -0,0 +1,154 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import mx.edu.tjs.chapala.sistemas.dao.ProveedorDAO; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Stateless |
|||
public class ProveedorBL implements ProveedorBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance(). |
|||
addMessage("proveedorMsj", new FacesMessage(severity, summary, detail)); |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje agregar(Proveedor proveedor) { |
|||
System.out.println("Llegaste al metodo de agregar proveedor"); |
|||
ProveedorDAO proveedorDAO = new ProveedorDAO(); |
|||
Mensaje m = null; |
|||
|
|||
//Toda la logica
|
|||
if (proveedor.getNombre().isEmpty() || proveedor.getCorreo().isEmpty() || proveedor.getTelefono().isEmpty()) { |
|||
m = Mensaje.CAMPOS_INCOMPLETOS; |
|||
System.out.println("CAMPOS INCOMPLETOS"); |
|||
return m; |
|||
} |
|||
|
|||
Optional<Proveedor> proveedorEncontradoOptional = proveedorDAO.buscarProveedor(proveedor); |
|||
if (proveedorEncontradoOptional.isPresent()) { |
|||
proveedorEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, EL PROVEEDOR YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "", "¡Error! El elemento ya existe"); |
|||
} else { |
|||
proveedorDAO.agregar(proveedor); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡Elemento agregado con éxito!"); |
|||
|
|||
} |
|||
|
|||
return m; |
|||
} |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Proveedor buscarId(Proveedor proveedor) { |
|||
System.out.println("Llegaste al metodo de buscar por id"); |
|||
ProveedorDAO a = new ProveedorDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Proveedor proveedorEncontrado = a.buscarPorId(proveedor); |
|||
|
|||
if (proveedorEncontrado == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL PROVEEDOR"); |
|||
return proveedorEncontrado; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("PROVEEDOR ENCONTRADO CON EXITO: " + proveedorEncontrado.getId()); |
|||
return proveedorEncontrado; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Proveedor buscarNombre(Proveedor proveedor) { |
|||
System.out.println("Llegaste al metodo de buscar por nombre"); |
|||
ProveedorDAO a = new ProveedorDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Proveedor proveedorEncontrado = a.buscarPorNombre(proveedor); |
|||
|
|||
if (proveedorEncontrado == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL PROVEEDOR"); |
|||
return proveedorEncontrado; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("PROVEEDOR ENCONTRADO CON EXITO: " + proveedorEncontrado.getNombre()); |
|||
return proveedorEncontrado; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Proveedor> buscarStatus(boolean b) { |
|||
ProveedorDAO a = new ProveedorDAO(); |
|||
List l = a.buscarStatus(b); |
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje eliminarId(Proveedor proveedor) { |
|||
ProveedorDAO a = new ProveedorDAO(); |
|||
Mensaje m = null; |
|||
|
|||
if (a.eliminar(proveedor)) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("ELIMINADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡Elemento eliminado correctamente!"); |
|||
|
|||
} else { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO SE PUDO ELIMINAR"); |
|||
addMessage(FacesMessage.SEVERITY_WARN, "", "¡Error! No se pudo eliminar el elemento"); |
|||
|
|||
} |
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Proveedor proveedor) { |
|||
ProveedorDAO ed = new ProveedorDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Optional<Proveedor> proveedorEncontradoOptional = ed.buscarProveedor(proveedor); |
|||
if (proveedorEncontradoOptional.isPresent()) { |
|||
proveedorEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE EDITAR, EL PROVEEDOR YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "", "¡Error al editar! El elemento ya existe"); |
|||
} else { |
|||
ed.editar(proveedor); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡Elemento editado correctamente!"); |
|||
|
|||
|
|||
} |
|||
return m; |
|||
} |
|||
|
|||
public List<Proveedor> getAll() { |
|||
ProveedorDAO p = new ProveedorDAO(); |
|||
return p.buscarStatus(true); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Local |
|||
public interface ProveedorBLLocal { |
|||
|
|||
Mensaje agregar(Proveedor proveedor); |
|||
|
|||
Proveedor buscarId(Proveedor proveedor); |
|||
|
|||
Proveedor buscarNombre(Proveedor proveedor); |
|||
|
|||
List<Proveedor> buscarStatus(boolean b); |
|||
|
|||
|
|||
Mensaje eliminarId(Proveedor proveedor); |
|||
|
|||
Mensaje editar(Proveedor p); |
|||
|
|||
} |
@ -0,0 +1,145 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import mx.edu.tjs.chapala.sistemas.dao.UbicacionAlmacenDAO; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Ubicacionalmacen; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author carlosAldrete |
|||
*/ |
|||
@Stateless |
|||
public class UbicacionAlmacenBL implements UbicacionAlmacenBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail){ |
|||
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity, summary,detail)); |
|||
|
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Mensaje agregar(Ubicacionalmacen ubicacionalmacen) { |
|||
System.out.println("Llegaste al metodo de agregar ubicacion de almacenamiento"); |
|||
UbicacionAlmacenDAO UbicacionAlmacenDAO = new UbicacionAlmacenDAO(); |
|||
Mensaje m = null; |
|||
|
|||
//Toda la logica
|
|||
Optional<Ubicacionalmacen> me = UbicacionAlmacenDAO.buscarUbicacion(ubicacionalmacen); |
|||
|
|||
if (me.isPresent()) { |
|||
me.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR","La Ubicacion ya existe"); |
|||
} else { |
|||
UbicacionAlmacenDAO.agregar(ubicacionalmacen); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "CORRECTO","SE AGREGO CON EXITO"); |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
@Override |
|||
public Ubicacionalmacen buscarId(Ubicacionalmacen ubicacionalmacen) { |
|||
System.out.println("Llegaste al metodo de buscar por id"); |
|||
UbicacionAlmacenDAO a = new UbicacionAlmacenDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Ubicacionalmacen c = a.buscarPorId(ubicacionalmacen); |
|||
|
|||
if (c == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL BODEGA"); |
|||
return c; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("BODEGA ENCONTRADO CON EXITO: " + c.getId()); |
|||
return c; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Ubicacionalmacen buscarBodega(Ubicacionalmacen ubicacionalmacen) { |
|||
System.out.println("Llegaste al metodo de buscar por nombre"); |
|||
UbicacionAlmacenDAO a = new UbicacionAlmacenDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Ubicacionalmacen ce = a.buscarPorBodega(ubicacionalmacen); |
|||
|
|||
if (ce == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL ALMACEN"); |
|||
return ce; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("BODEGA ENCONTRADO CON EXITO: " + ce.getBodega()); |
|||
return ce; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Ubicacionalmacen> buscarStatus(boolean b) { |
|||
UbicacionAlmacenDAO a = new UbicacionAlmacenDAO(); |
|||
List l = a.buscarStatus(b); |
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
@Override |
|||
public void eliminarId(Ubicacionalmacen ubicacionAlmacen) { |
|||
UbicacionAlmacenDAO a = new UbicacionAlmacenDAO(); |
|||
Mensaje m = null; |
|||
|
|||
if (a.eliminar(ubicacionAlmacen)) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("ELIMINADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "CORRECTO","SE ELIMINO CON EXITO"); |
|||
} else { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO SE PUDO ELIMINAR"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "ERROR","NO SE PUEDE ELIMINAR"); |
|||
|
|||
|
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje editar(Ubicacionalmacen ubicacionAlmacen) { |
|||
UbicacionAlmacenDAO ed = new UbicacionAlmacenDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Optional<Ubicacionalmacen> proveedorEncontradoOptional = ed.buscarUbicacion(ubicacionAlmacen); |
|||
if (proveedorEncontradoOptional.isPresent()) { |
|||
proveedorEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE EDITAR, LA UBICACION YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "", "¡Error al editar! El elemento ya existe"); |
|||
} else { |
|||
ed.editar(ubicacionAlmacen); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡Elemento editado correctamente!"); |
|||
|
|||
|
|||
} |
|||
return m; |
|||
} |
|||
public List<Ubicacionalmacen> getAll() { |
|||
UbicacionAlmacenDAO p = new UbicacionAlmacenDAO(); |
|||
return p.buscarStatus(true); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Ubicacionalmacen; |
|||
|
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Local |
|||
public interface UbicacionAlmacenBLLocal { |
|||
Mensaje agregar(Ubicacionalmacen ubicacionalmacen); |
|||
|
|||
Ubicacionalmacen buscarId(Ubicacionalmacen Ubicacionalmacen); |
|||
|
|||
Ubicacionalmacen buscarBodega(Ubicacionalmacen Ubicacionalmacen); |
|||
|
|||
List<Ubicacionalmacen> buscarStatus(boolean b); |
|||
|
|||
|
|||
void eliminarId(Ubicacionalmacen Ubicacionalmacen); |
|||
|
|||
Mensaje editar(Ubicacionalmacen p); |
|||
} |
@ -0,0 +1,134 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.ejb.Stateless; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.context.FacesContext; |
|||
import mx.edu.tjs.chapala.sistemas.dao.UsuariosDAO; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Usuarios; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Stateless |
|||
public class UsuariosBL implements UsuariosBLLocal { |
|||
|
|||
// Add business logic below. (Right-click in editor and choose
|
|||
// "Insert Code > Add Business Method")
|
|||
|
|||
/** |
|||
* |
|||
* @param usuarios |
|||
* @return |
|||
*/ |
|||
public void addMessage(FacesMessage.Severity severity, String summary, String detail) { |
|||
FacesContext.getCurrentInstance(). |
|||
addMessage(null, new FacesMessage(severity, summary, detail)); |
|||
} |
|||
|
|||
@Override |
|||
public Mensaje agregar(Usuarios usuarios) { |
|||
System.out.println("Llegaste al metodo de agregar usuario"); |
|||
UsuariosDAO usuariosDAO = new UsuariosDAO(); |
|||
Mensaje m = null; |
|||
|
|||
//Toda la logica
|
|||
Optional<Usuarios> usuariosEncontradoOptional =usuariosDAO.buscarUsuarios(usuarios); |
|||
|
|||
if (usuariosEncontradoOptional.isPresent()) { |
|||
usuariosEncontradoOptional.get(); |
|||
m = Mensaje.ELEMENTO_DUPLICADO; |
|||
System.out.println("NO SE PUEDE AGREGAR, EL PROVEEDOR YA EXISTE"); |
|||
addMessage(FacesMessage.SEVERITY_ERROR, "", "¡Error! El elemento ya existe"); |
|||
|
|||
} else { |
|||
usuariosDAO.agregar(usuarios); |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("AGREGADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡Elemento agregado con éxito!"); |
|||
} |
|||
return m; |
|||
} |
|||
|
|||
@Override |
|||
public Usuarios buscarId(Usuarios usuarios) { |
|||
System.out.println("Llegaste al metodo de buscar por id"); |
|||
UsuariosDAO u = new UsuariosDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Usuarios usuariosEncontrado = u.buscarPorId(usuarios); |
|||
|
|||
if (usuariosEncontrado == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL Usuarios"); |
|||
return usuariosEncontrado; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("Usuarios ENCONTRADO CON EXITO: " + usuariosEncontrado.getId()); |
|||
return usuariosEncontrado; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Usuarios buscarNombre(Usuarios usuarios) { |
|||
System.out.println("Llegaste al metodo de buscar por nombre"); |
|||
UsuariosDAO u = new UsuariosDAO(); |
|||
Mensaje m = null; |
|||
|
|||
Usuarios usuariosEncontrado = u.buscarPorUsuarios(usuarios); |
|||
|
|||
if (usuariosEncontrado == null) { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO EXISTE EL Usuarios"); |
|||
return usuariosEncontrado; |
|||
} else { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("Usuarios ENCONTRADO CON EXITO: " + usuariosEncontrado.getUsuario()); |
|||
return usuariosEncontrado; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<Usuarios> buscarStatus(boolean b) { |
|||
UsuariosDAO u = new UsuariosDAO(); |
|||
List l = u.buscarStatus(b); |
|||
System.out.println(l); |
|||
return l; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public void eliminarId(Usuarios usuarios) { |
|||
UsuariosDAO u = new UsuariosDAO(); |
|||
Mensaje m = null; |
|||
|
|||
if (u.eliminar(usuarios)) { |
|||
m = Mensaje.SIN_ERROR; |
|||
System.out.println("ELIMINADO CON EXITO"); |
|||
addMessage(FacesMessage.SEVERITY_INFO, "", "¡usuario eliminado correctamente!"); |
|||
|
|||
} else { |
|||
m = Mensaje.ELEMENTO_NO_ENCONTRADO; |
|||
System.out.println("NO SE PUDO ELIMINAR"); |
|||
addMessage(FacesMessage.SEVERITY_WARN, "", "¡Error! No se pudo eliminar el usuario"); |
|||
|
|||
} |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public void editar(Usuarios usuarios) { |
|||
UsuariosDAO u = new UsuariosDAO(); |
|||
Mensaje m = null; |
|||
u.editar(usuarios); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.bl; |
|||
|
|||
import java.util.List; |
|||
import javax.ejb.Local; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Usuarios; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Local |
|||
public interface UsuariosBLLocal { |
|||
|
|||
public void editar(Usuarios usuarios); |
|||
|
|||
public void eliminarId(Usuarios usuarios); |
|||
|
|||
public List<Usuarios> buscarStatus(boolean b); |
|||
|
|||
public Usuarios buscarNombre(Usuarios usuarios); |
|||
|
|||
public Usuarios buscarId(Usuarios usuarios); |
|||
|
|||
public Mensaje agregar(Usuarios usuarios); |
|||
|
|||
} |
@ -0,0 +1,122 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.dao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public class CategoriaDAO { |
|||
private EntityManager em; //Manejador de entidades (entidad=bean del modelo)
|
|||
|
|||
public CategoriaDAO() { |
|||
//conexion
|
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Categoria p) { |
|||
em.getTransaction().begin(); |
|||
em.persist(p); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public void editar(Categoria p) { |
|||
buscarPorId(p); |
|||
em.getTransaction().begin(); |
|||
em.merge(p); //Editar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Categoria p) { |
|||
if (buscarPorId(p) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Categoria prov = em.find(Categoria.class, p.getId()); |
|||
|
|||
p.setNombre(prov.getNombre()); |
|||
|
|||
// Modificar solo el estado
|
|||
p.setStatus(0); |
|||
|
|||
em.merge(p); |
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Optional<Categoria> buscarCategoria(Categoria p) { |
|||
Query q1 = em.createNamedQuery("Categoria.findByNombre"); |
|||
q1.setParameter("nombre", p.getNombre()); |
|||
|
|||
|
|||
List<Categoria> resultadoNombre = q1.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Compara si el mismo autor está en los tres resultados
|
|||
Categoria a = resultadoNombre.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(a); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
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 Categoria buscarPorNombre(Categoria a) { |
|||
Query q = em.createNamedQuery("Categoria.findByNombre"); |
|||
q.setParameter("nombre", a.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Categoria) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<Categoria> buscarStatus(boolean status) { |
|||
Query q = em.createNamedQuery("Categoria.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
|
|||
if(s==1){ |
|||
System.out.println("Categoria activos"); |
|||
} else { |
|||
System.out.println("Categoria inactivos"); |
|||
} |
|||
|
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,117 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.dao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Marca; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public class MarcaDAO { |
|||
|
|||
private EntityManager em; //Manejador de entidades (entidad=bean del modelo)
|
|||
|
|||
public MarcaDAO() { |
|||
//conexion
|
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Marca p) { |
|||
em.getTransaction().begin(); |
|||
em.persist(p); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public void editar(Marca p) { |
|||
buscarPorId(p); |
|||
em.getTransaction().begin(); |
|||
em.merge(p); //Editar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Marca p) { |
|||
if (buscarPorId(p) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Marca prov = em.find(Marca.class, p.getId()); |
|||
|
|||
p.setNombre(prov.getNombre()); |
|||
|
|||
// Modificar solo el estado
|
|||
p.setStatus(0); |
|||
|
|||
em.merge(p); |
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Optional<Marca> buscarMarca(Marca p) { |
|||
Query q1 = em.createNamedQuery("Marca.findByNombre"); |
|||
q1.setParameter("nombre", p.getNombre()); |
|||
|
|||
|
|||
List<Marca> resultadoNombre = q1.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty()) { |
|||
// Compara si el mismo autor está en los tres resultados
|
|||
Marca a = resultadoNombre.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(a); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
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 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); |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<Marca> buscarStatus(boolean status) { |
|||
Query q = em.createNamedQuery("Marca.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
|
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,176 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.dao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Producto; |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public class ProductoDAO { |
|||
//CONEXION
|
|||
|
|||
private EntityManager em; //Manejador de entidades (entidad=bean del modelo)
|
|||
|
|||
public ProductoDAO() { |
|||
//conexion
|
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Producto p) { |
|||
em.getTransaction().begin(); |
|||
p.setStatus(1); |
|||
em.persist(p); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public void editar(Producto p) { |
|||
buscarPorId(p); |
|||
em.getTransaction().begin(); |
|||
em.merge(p); //Editar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Producto p) { |
|||
if (buscarPorId(p) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Producto prov = em.find(Producto.class, p.getId()); |
|||
//
|
|||
// Categoria prov1 =em.find(Categoria.class, p.getId());
|
|||
// Ubicacionalmacen prov2 =em.find(Ubicacionalmacen.class, p.getId());
|
|||
//
|
|||
|
|||
|
|||
p.setNombre(prov.getNombre()); |
|||
p.setCodigo(prov.getCodigo()); |
|||
p.setPrecio(prov.getPrecio()); |
|||
p.setDescripcion(prov.getDescripcion()); |
|||
p.setStock(prov.getStock()); |
|||
p.setEstadoproducto(prov.getEstadoproducto()); |
|||
p.setFechaadquisicion(prov.getFechaadquisicion()); |
|||
p.setStatus(prov.getStatus()); |
|||
p.setSubmarca(prov.getSubmarca()); |
|||
p.setMarcaId(prov.getMarcaId()); |
|||
p.setProveedorId(prov.getProveedorId()); |
|||
p.setUbicacionalmacenId(prov.getUbicacionalmacenId()); |
|||
p.setCategoriaId(prov.getCategoriaId()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
p.setStatus(0); |
|||
|
|||
em.merge(p); |
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Optional<Producto> buscarProducto(Producto p) { |
|||
Query q1 = em.createNamedQuery("Producto.findByNombre"); |
|||
q1.setParameter("nombre", p.getNombre()); |
|||
|
|||
Query q2 = em.createNamedQuery("Producto.findByCodigo"); |
|||
q2.setParameter("codigo", p.getCodigo()); |
|||
|
|||
Query q3 = em.createNamedQuery("Producto.findByEstadoproducto"); |
|||
q3.setParameter("estadoproducto", p.getEstadoproducto()); |
|||
|
|||
|
|||
Query q4 = em.createNamedQuery("Producto.findByFechaadquisicion"); |
|||
q4.setParameter("fechaadquisicion", p.getFechaadquisicion()); |
|||
|
|||
Query q5 = em.createNamedQuery("Producto.findByStock"); |
|||
q5.setParameter("stock", p.getStock()); |
|||
|
|||
Query q6 = em.createNamedQuery("Producto.findBySubmarca"); |
|||
q6.setParameter("submarca", p.getSubmarca()); |
|||
|
|||
|
|||
//lisotoootototootototot
|
|||
|
|||
List<Producto> resultadoNombre = q1.getResultList(); |
|||
List<Producto> resultadoCodigo = q2.getResultList(); |
|||
List<Producto> resultadoEstadoP = q3.getResultList(); |
|||
List<Producto> resultadoFehaAd = q4.getResultList(); |
|||
List<Producto> resultadoSatock = q5.getResultList(); |
|||
List<Producto> resultadoSubmarca = q6.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty() && !resultadoCodigo.isEmpty() && !resultadoEstadoP.isEmpty() |
|||
&& !resultadoFehaAd.isEmpty()&& !resultadoSatock.isEmpty()&& !resultadoSubmarca.isEmpty()) { |
|||
// Compara si el mismo autor está en los tres resultados
|
|||
Producto productoEncontrado = resultadoNombre.stream() |
|||
.filter(resultadoCodigo::contains) |
|||
.filter(resultadoEstadoP::contains) |
|||
.filter(resultadoFehaAd::contains) |
|||
.filter(resultadoSatock::contains) |
|||
.filter(resultadoSubmarca::contains) |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(productoEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
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 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); |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<Producto> buscarStatus(boolean status) { |
|||
Query q = em.createNamedQuery("Producto.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
|
|||
if(s==1){ |
|||
System.out.println("Producto activos"); |
|||
} else { |
|||
System.out.println("Producto inactivos"); |
|||
} |
|||
|
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
@ -0,0 +1,137 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.dao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public class ProveedorDAO { |
|||
//CONEXION
|
|||
|
|||
private EntityManager em; //Manejador de entidades (entidad=bean del modelo)
|
|||
|
|||
public ProveedorDAO() { |
|||
//conexion
|
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Proveedor p) { |
|||
em.getTransaction().begin(); |
|||
p.setStatus(1); |
|||
em.persist(p); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public void editar(Proveedor p) { |
|||
buscarPorId(p); |
|||
em.getTransaction().begin(); |
|||
em.merge(p); //Editar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Proveedor p) { |
|||
if (buscarPorId(p) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener proveedor actualizado desde la base de datos
|
|||
Proveedor prov = em.find(Proveedor.class, p.getId()); |
|||
|
|||
p.setNombre(prov.getNombre()); |
|||
p.setCorreo(prov.getCorreo()); |
|||
p.setTelefono(prov.getTelefono()); |
|||
|
|||
// Modificar solo el estado
|
|||
p.setStatus(0); |
|||
|
|||
em.merge(p); |
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Optional<Proveedor> buscarProveedor(Proveedor p) { |
|||
Query q1 = em.createNamedQuery("Proveedor.findByNombre"); |
|||
q1.setParameter("nombre", p.getNombre()); |
|||
|
|||
Query q2 = em.createNamedQuery("Proveedor.findByCorreo"); |
|||
q2.setParameter("correo", p.getCorreo()); |
|||
|
|||
Query q3 = em.createNamedQuery("Proveedor.findByTelefono"); |
|||
q3.setParameter("telefono", p.getTelefono()); |
|||
|
|||
List<Proveedor> resultadoNombre = q1.getResultList(); |
|||
List<Proveedor> resultadoCorreo = q2.getResultList(); |
|||
List<Proveedor> resultadoTelefono = q3.getResultList(); |
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoNombre.isEmpty() && !resultadoCorreo.isEmpty() && !resultadoTelefono.isEmpty()) { |
|||
// Compara si el mismo autor está en los tres resultados
|
|||
Proveedor autorEncontrado = resultadoNombre.stream() |
|||
.filter(resultadoCorreo::contains) |
|||
.filter(resultadoTelefono::contains) |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(autorEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
public Proveedor buscarPorId(Proveedor a) { |
|||
Query q = em.createNamedQuery("Proveedor.findById"); |
|||
q.setParameter("id", a.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Proveedor) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Proveedor buscarPorNombre(Proveedor a) { |
|||
Query q = em.createNamedQuery("Proveedor.findByNombre"); |
|||
q.setParameter("nombre", a.getNombre()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Proveedor) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<Proveedor> buscarStatus(boolean status) { |
|||
Query q = em.createNamedQuery("Proveedor.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
|
|||
if(s==1){ |
|||
System.out.println("Proveedores activos"); |
|||
} else { |
|||
System.out.println("Proveedores inactivos"); |
|||
} |
|||
|
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,123 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.dao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Ubicacionalmacen; |
|||
|
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public class UbicacionAlmacenDAO { |
|||
private EntityManager em; //Manejador de entidades (entidad=bean del modelo)
|
|||
|
|||
public UbicacionAlmacenDAO () { |
|||
//conexion
|
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Ubicacionalmacen u) { |
|||
em.getTransaction().begin(); |
|||
u.setStatus(1); |
|||
em.persist(u); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public void editar(Ubicacionalmacen u) { |
|||
buscarPorId(u); |
|||
em.getTransaction().begin(); |
|||
em.merge(u); //Editar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Ubicacionalmacen u) { |
|||
if (buscarPorId(u) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener usuarios actualizado desde la base de datos
|
|||
Ubicacionalmacen ubi = em.find(Ubicacionalmacen.class, u.getId()); |
|||
u.setBodega(ubi.getBodega()); |
|||
u.setPasillo(ubi.getPasillo()); |
|||
u.setEstante(ubi.getEstante()); |
|||
u.setSeccion(ubi.getSeccion()); |
|||
u.setStatus(0); |
|||
|
|||
em.merge(u); |
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Optional<Ubicacionalmacen> buscarUbicacion(Ubicacionalmacen u) { |
|||
Query q1 = em.createNamedQuery("Ubicacionalmacen.findByBodega"); |
|||
q1.setParameter("bodega", u.getBodega()); |
|||
|
|||
|
|||
|
|||
List<Ubicacionalmacen> resultadoUsuarios = q1.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoUsuarios.isEmpty()) { |
|||
// Compara si el mismo autor está en los tres resultados
|
|||
Ubicacionalmacen usuariosEncontrado = resultadoUsuarios.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(usuariosEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
public Ubicacionalmacen buscarPorId(Ubicacionalmacen u) { |
|||
Query q = em.createNamedQuery("Ubicacionalmacen.findById"); |
|||
q.setParameter("id", u.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Ubicacionalmacen) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
public Ubicacionalmacen buscarPorBodega(Ubicacionalmacen u) { |
|||
Query q = em.createNamedQuery("Ubicacionalmacen.findByBodega"); |
|||
q.setParameter("bodega", u.getBodega()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Ubicacionalmacen) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<Ubicacionalmacen> buscarStatus(boolean status) { |
|||
Query q = em.createNamedQuery("Ubicacionalmacen.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
|
|||
if(s==1){ |
|||
System.out.println("Usuarios activos"); |
|||
} else { |
|||
System.out.println("Usuarios inactivos"); |
|||
} |
|||
|
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
} |
@ -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.tjs.chapala.sistemas.dao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import javax.persistence.EntityManager; |
|||
import javax.persistence.EntityManagerFactory; |
|||
import javax.persistence.Persistence; |
|||
import javax.persistence.Query; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Usuarios; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public class UsuariosDAO { |
|||
private EntityManager em; //Manejador de entidades (entidad=bean del modelo)
|
|||
|
|||
public UsuariosDAO() { |
|||
//conexion
|
|||
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU"); |
|||
em = emf.createEntityManager(); |
|||
|
|||
} |
|||
|
|||
public void agregar(Usuarios u) { |
|||
em.getTransaction().begin(); |
|||
u.setStatus(1); |
|||
em.persist(u); //Almacenar en la BD
|
|||
em.getTransaction().commit(); |
|||
} |
|||
|
|||
public void editar(Usuarios u) { |
|||
buscarPorId(u); |
|||
em.getTransaction().begin(); |
|||
em.merge(u); //Editar en la BD
|
|||
em.getTransaction().commit(); |
|||
|
|||
} |
|||
|
|||
public boolean eliminar(Usuarios u) { |
|||
if (buscarPorId(u) == null) { |
|||
return false; |
|||
} else { |
|||
em.getTransaction().begin(); |
|||
|
|||
// Obtener usuarios actualizado desde la base de datos
|
|||
Usuarios usua = em.find(Usuarios.class, u.getId()); |
|||
|
|||
u.setUsuario(usua.getUsuario()); |
|||
u.setContrasenia(usua.getContrasenia()); |
|||
|
|||
|
|||
// Modificar solo el estado
|
|||
u.setStatus(0); |
|||
|
|||
em.merge(u); |
|||
em.getTransaction().commit(); |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
|
|||
public Optional<Usuarios> buscarUsuarios(Usuarios u) { |
|||
Query q1 = em.createNamedQuery("Usuarios.findByUsuario"); |
|||
q1.setParameter("usuario", u.getUsuario()); |
|||
|
|||
|
|||
|
|||
List<Usuarios> resultadoUsuarios = q1.getResultList(); |
|||
|
|||
|
|||
// Verifica si hay resultados para todos los campos
|
|||
if (!resultadoUsuarios.isEmpty()) { |
|||
// Compara si el mismo autor está en los tres resultados
|
|||
Usuarios usuariosEncontrado = resultadoUsuarios.stream() |
|||
.findFirst() |
|||
.orElse(null); |
|||
|
|||
return Optional.ofNullable(usuariosEncontrado); |
|||
} else { |
|||
// Devuelve Optional vacío para indicar ausencia de resultados
|
|||
return Optional.empty(); |
|||
} |
|||
} |
|||
|
|||
public Usuarios buscarPorId(Usuarios u) { |
|||
Query q = em.createNamedQuery("Usuarios.findById"); |
|||
q.setParameter("id", u.getId()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Usuarios) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
|
|||
public Usuarios buscarPorUsuarios(Usuarios u) { |
|||
Query q = em.createNamedQuery("Usuarios.findByUsuario"); |
|||
q.setParameter("usuario", u.getUsuario()); |
|||
if (q.getResultList().isEmpty()) { |
|||
return null; |
|||
} else { |
|||
return (Usuarios) q.getResultList().get(0); |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<Usuarios> buscarStatus(boolean status) { |
|||
Query q = em.createNamedQuery("Usuarios.findByStatus"); |
|||
int s = status ? 1 : 0; |
|||
|
|||
if(s==1){ |
|||
System.out.println("Usuarios activos"); |
|||
} else { |
|||
System.out.println("Usuarios inactivos"); |
|||
} |
|||
|
|||
q.setParameter("status", s); |
|||
return q.getResultList(); |
|||
} |
|||
|
|||
} |
@ -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.tjs.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 nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "categoria") |
|||
@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 = 45) |
|||
@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.tjs.chapala.sistemas.modelo.Categoria[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,204 @@ |
|||
/* |
|||
* 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.tjs.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 nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "domicilio") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Domicilio.findAll", query = "SELECT d FROM Domicilio d"), |
|||
@NamedQuery(name = "Domicilio.findById", query = "SELECT d FROM Domicilio d WHERE d.id = :id"), |
|||
@NamedQuery(name = "Domicilio.findByPais", query = "SELECT d FROM Domicilio d WHERE d.pais = :pais"), |
|||
@NamedQuery(name = "Domicilio.findByEstado", query = "SELECT d FROM Domicilio d WHERE d.estado = :estado"), |
|||
@NamedQuery(name = "Domicilio.findByMunicipio", query = "SELECT d FROM Domicilio d WHERE d.municipio = :municipio"), |
|||
@NamedQuery(name = "Domicilio.findByLocalidad", query = "SELECT d FROM Domicilio d WHERE d.localidad = :localidad"), |
|||
@NamedQuery(name = "Domicilio.findByCp", query = "SELECT d FROM Domicilio d WHERE d.cp = :cp"), |
|||
@NamedQuery(name = "Domicilio.findByCalle", query = "SELECT d FROM Domicilio d WHERE d.calle = :calle"), |
|||
@NamedQuery(name = "Domicilio.findByNumero", query = "SELECT d FROM Domicilio d WHERE d.numero = :numero")}) |
|||
public class Domicilio 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 = 45) |
|||
@Column(name = "pais") |
|||
private String pais; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "estado") |
|||
private String estado; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "municipio") |
|||
private String municipio; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "localidad") |
|||
private String localidad; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "cp") |
|||
private String cp; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "calle") |
|||
private String calle; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "numero") |
|||
private String numero; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "domicilioId") |
|||
private List<Usuarios> usuariosList; |
|||
|
|||
public Domicilio() { |
|||
} |
|||
|
|||
public Domicilio(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Domicilio(Integer id, String pais, String estado, String municipio, String localidad, String cp, String calle, String numero) { |
|||
this.id = id; |
|||
this.pais = pais; |
|||
this.estado = estado; |
|||
this.municipio = municipio; |
|||
this.localidad = localidad; |
|||
this.cp = cp; |
|||
this.calle = calle; |
|||
this.numero = numero; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getPais() { |
|||
return pais; |
|||
} |
|||
|
|||
public void setPais(String pais) { |
|||
this.pais = pais; |
|||
} |
|||
|
|||
public String getEstado() { |
|||
return estado; |
|||
} |
|||
|
|||
public void setEstado(String estado) { |
|||
this.estado = estado; |
|||
} |
|||
|
|||
public String getMunicipio() { |
|||
return municipio; |
|||
} |
|||
|
|||
public void setMunicipio(String municipio) { |
|||
this.municipio = municipio; |
|||
} |
|||
|
|||
public String getLocalidad() { |
|||
return localidad; |
|||
} |
|||
|
|||
public void setLocalidad(String localidad) { |
|||
this.localidad = localidad; |
|||
} |
|||
|
|||
public String getCp() { |
|||
return cp; |
|||
} |
|||
|
|||
public void setCp(String cp) { |
|||
this.cp = cp; |
|||
} |
|||
|
|||
public String getCalle() { |
|||
return calle; |
|||
} |
|||
|
|||
public void setCalle(String calle) { |
|||
this.calle = calle; |
|||
} |
|||
|
|||
public String getNumero() { |
|||
return numero; |
|||
} |
|||
|
|||
public void setNumero(String numero) { |
|||
this.numero = numero; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Usuarios> getUsuariosList() { |
|||
return usuariosList; |
|||
} |
|||
|
|||
public void setUsuariosList(List<Usuarios> usuariosList) { |
|||
this.usuariosList = usuariosList; |
|||
} |
|||
|
|||
@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 Domicilio)) { |
|||
return false; |
|||
} |
|||
Domicilio other = (Domicilio) 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.tjs.chapala.sistemas.modelo.Domicilio[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,141 @@ |
|||
/* |
|||
* 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.tjs.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 nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "marca") |
|||
@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 = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@JoinColumn(name = "proveedor_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Proveedor proveedorId; |
|||
@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; |
|||
} |
|||
|
|||
public Proveedor getProveedorId() { |
|||
return proveedorId; |
|||
} |
|||
|
|||
public void setProveedorId(Proveedor proveedorId) { |
|||
this.proveedorId = proveedorId; |
|||
} |
|||
|
|||
@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.tjs.chapala.sistemas.modelo.Marca[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,265 @@ |
|||
/* |
|||
* 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.tjs.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.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "producto") |
|||
@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.findByNombre", query = "SELECT p FROM Producto p WHERE p.nombre = :nombre"), |
|||
@NamedQuery(name = "Producto.findByCodigo", query = "SELECT p FROM Producto p WHERE p.codigo = :codigo"), |
|||
@NamedQuery(name = "Producto.findByPrecio", query = "SELECT p FROM Producto p WHERE p.precio = :precio"), |
|||
@NamedQuery(name = "Producto.findByDescripcion", query = "SELECT p FROM Producto p WHERE p.descripcion = :descripcion"), |
|||
@NamedQuery(name = "Producto.findByStock", query = "SELECT p FROM Producto p WHERE p.stock = :stock"), |
|||
@NamedQuery(name = "Producto.findByFechaadquisicion", query = "SELECT p FROM Producto p WHERE p.fechaadquisicion = :fechaadquisicion"), |
|||
@NamedQuery(name = "Producto.findByEstadoproducto", query = "SELECT p FROM Producto p WHERE p.estadoproducto = :estadoproducto"), |
|||
@NamedQuery(name = "Producto.findBySubmarca", query = "SELECT p FROM Producto p WHERE p.submarca = :submarca"), |
|||
@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 = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 15) |
|||
@Column(name = "codigo") |
|||
private String codigo; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "precio") |
|||
private float precio; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 255) |
|||
@Column(name = "descripcion") |
|||
private String descripcion; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "stock") |
|||
private int stock; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "fechaadquisicion") |
|||
@Temporal(TemporalType.DATE) |
|||
private Date fechaadquisicion; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "estadoproducto") |
|||
private String estadoproducto; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "submarca") |
|||
private String submarca; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@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 = "proveedor_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Proveedor proveedorId; |
|||
@JoinColumn(name = "ubicacionalmacen_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Ubicacionalmacen ubicacionalmacenId; |
|||
|
|||
public Producto() { |
|||
} |
|||
|
|||
public Producto(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Producto(Integer id, String nombre, String codigo, float precio, String descripcion, int stock, Date fechaadquisicion, String estadoproducto, String submarca, int status) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.codigo = codigo; |
|||
this.precio = precio; |
|||
this.descripcion = descripcion; |
|||
this.stock = stock; |
|||
this.fechaadquisicion = fechaadquisicion; |
|||
this.estadoproducto = estadoproducto; |
|||
this.submarca = submarca; |
|||
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 getCodigo() { |
|||
return codigo; |
|||
} |
|||
|
|||
public void setCodigo(String codigo) { |
|||
this.codigo = codigo; |
|||
} |
|||
|
|||
public float getPrecio() { |
|||
return precio; |
|||
} |
|||
|
|||
public void setPrecio(float precio) { |
|||
this.precio = precio; |
|||
} |
|||
|
|||
public String getDescripcion() { |
|||
return descripcion; |
|||
} |
|||
|
|||
public void setDescripcion(String descripcion) { |
|||
this.descripcion = descripcion; |
|||
} |
|||
|
|||
public int getStock() { |
|||
return stock; |
|||
} |
|||
|
|||
public void setStock(int stock) { |
|||
this.stock = stock; |
|||
} |
|||
|
|||
public Date getFechaadquisicion() { |
|||
return fechaadquisicion; |
|||
} |
|||
|
|||
public void setFechaadquisicion(Date fechaadquisicion) { |
|||
this.fechaadquisicion = fechaadquisicion; |
|||
} |
|||
|
|||
public String getEstadoproducto() { |
|||
return estadoproducto; |
|||
} |
|||
|
|||
public void setEstadoproducto(String estadoproducto) { |
|||
this.estadoproducto = estadoproducto; |
|||
} |
|||
|
|||
public String getSubmarca() { |
|||
return submarca; |
|||
} |
|||
|
|||
public void setSubmarca(String submarca) { |
|||
this.submarca = submarca; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
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 Proveedor getProveedorId() { |
|||
return proveedorId; |
|||
} |
|||
|
|||
public void setProveedorId(Proveedor proveedorId) { |
|||
this.proveedorId = proveedorId; |
|||
} |
|||
|
|||
public Ubicacionalmacen getUbicacionalmacenId() { |
|||
return ubicacionalmacenId; |
|||
} |
|||
|
|||
public void setUbicacionalmacenId(Ubicacionalmacen ubicacionalmacenId) { |
|||
this.ubicacionalmacenId = ubicacionalmacenId; |
|||
} |
|||
|
|||
@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.tjs.chapala.sistemas.modelo.Producto[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,259 @@ |
|||
/* |
|||
* 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.tjs.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 nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "proveedor") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Proveedor.findAll", query = "SELECT p FROM Proveedor p"), |
|||
@NamedQuery(name = "Proveedor.findById", query = "SELECT p FROM Proveedor p WHERE p.id = :id"), |
|||
@NamedQuery(name = "Proveedor.findByNombre", query = "SELECT p FROM Proveedor p WHERE p.nombre = :nombre"), |
|||
@NamedQuery(name = "Proveedor.findByCorreo", query = "SELECT p FROM Proveedor p WHERE p.correo = :correo"), |
|||
@NamedQuery(name = "Proveedor.findByTelefono", query = "SELECT p FROM Proveedor p WHERE p.telefono = :telefono"), |
|||
@NamedQuery(name = "Proveedor.findByStatus", query = "SELECT p FROM Proveedor p WHERE p.status = :status"), |
|||
@NamedQuery(name = "Proveedor.findByMunicipio", query = "SELECT p FROM Proveedor p WHERE p.municipio = :municipio"), |
|||
@NamedQuery(name = "Proveedor.findByPais", query = "SELECT p FROM Proveedor p WHERE p.pais = :pais"), |
|||
@NamedQuery(name = "Proveedor.findByEstado", query = "SELECT p FROM Proveedor p WHERE p.estado = :estado"), |
|||
@NamedQuery(name = "Proveedor.findByCp", query = "SELECT p FROM Proveedor p WHERE p.cp = :cp"), |
|||
@NamedQuery(name = "Proveedor.findByCalle", query = "SELECT p FROM Proveedor p WHERE p.calle = :calle"), |
|||
@NamedQuery(name = "Proveedor.findByNumero", query = "SELECT p FROM Proveedor p WHERE p.numero = :numero")}) |
|||
public class Proveedor 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 = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "correo") |
|||
private String correo; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "telefono") |
|||
private String telefono; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "municipio") |
|||
private String municipio; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "pais") |
|||
private String pais; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "estado") |
|||
private String estado; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "cp") |
|||
private String cp; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "calle") |
|||
private String calle; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "numero") |
|||
private String numero; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "proveedorId") |
|||
private List<Marca> marcaList; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "proveedorId") |
|||
private List<Producto> productoList; |
|||
|
|||
public Proveedor() { |
|||
} |
|||
|
|||
public Proveedor(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Proveedor(Integer id, String nombre, String correo, String telefono, int status, String municipio, String pais, String estado, String cp, String calle, String numero) { |
|||
this.id = id; |
|||
this.nombre = nombre; |
|||
this.correo = correo; |
|||
this.telefono = telefono; |
|||
this.status = status; |
|||
this.municipio = municipio; |
|||
this.pais = pais; |
|||
this.estado = estado; |
|||
this.cp = cp; |
|||
this.calle = calle; |
|||
this.numero = numero; |
|||
} |
|||
|
|||
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 getCorreo() { |
|||
return correo; |
|||
} |
|||
|
|||
public void setCorreo(String correo) { |
|||
this.correo = correo; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
|
|||
public String getMunicipio() { |
|||
return municipio; |
|||
} |
|||
|
|||
public void setMunicipio(String municipio) { |
|||
this.municipio = municipio; |
|||
} |
|||
|
|||
public String getPais() { |
|||
return pais; |
|||
} |
|||
|
|||
public void setPais(String pais) { |
|||
this.pais = pais; |
|||
} |
|||
|
|||
public String getEstado() { |
|||
return estado; |
|||
} |
|||
|
|||
public void setEstado(String estado) { |
|||
this.estado = estado; |
|||
} |
|||
|
|||
public String getCp() { |
|||
return cp; |
|||
} |
|||
|
|||
public void setCp(String cp) { |
|||
this.cp = cp; |
|||
} |
|||
|
|||
public String getCalle() { |
|||
return calle; |
|||
} |
|||
|
|||
public void setCalle(String calle) { |
|||
this.calle = calle; |
|||
} |
|||
|
|||
public String getNumero() { |
|||
return numero; |
|||
} |
|||
|
|||
public void setNumero(String numero) { |
|||
this.numero = numero; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Marca> getMarcaList() { |
|||
return marcaList; |
|||
} |
|||
|
|||
public void setMarcaList(List<Marca> marcaList) { |
|||
this.marcaList = marcaList; |
|||
} |
|||
|
|||
@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 Proveedor)) { |
|||
return false; |
|||
} |
|||
Proveedor other = (Proveedor) 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.tjs.chapala.sistemas.modelo.Proveedor[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,114 @@ |
|||
/* |
|||
* 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.tjs.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 nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "rol") |
|||
@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.findByRol", query = "SELECT r FROM Rol r WHERE r.rol = :rol")}) |
|||
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 = 45) |
|||
@Column(name = "rol") |
|||
private String rol; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "rolId") |
|||
private List<Usuarios> usuariosList; |
|||
|
|||
public Rol() { |
|||
} |
|||
|
|||
public Rol(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Rol(Integer id, String rol) { |
|||
this.id = id; |
|||
this.rol = rol; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getRol() { |
|||
return rol; |
|||
} |
|||
|
|||
public void setRol(String rol) { |
|||
this.rol = rol; |
|||
} |
|||
|
|||
@XmlTransient |
|||
public List<Usuarios> getUsuariosList() { |
|||
return usuariosList; |
|||
} |
|||
|
|||
public void setUsuariosList(List<Usuarios> usuariosList) { |
|||
this.usuariosList = usuariosList; |
|||
} |
|||
|
|||
@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.tjs.chapala.sistemas.modelo.Rol[ 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.tjs.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 nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "ubicacionalmacen") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Ubicacionalmacen.findAll", query = "SELECT u FROM Ubicacionalmacen u"), |
|||
@NamedQuery(name = "Ubicacionalmacen.findById", query = "SELECT u FROM Ubicacionalmacen u WHERE u.id = :id"), |
|||
@NamedQuery(name = "Ubicacionalmacen.findByBodega", query = "SELECT u FROM Ubicacionalmacen u WHERE u.bodega = :bodega"), |
|||
@NamedQuery(name = "Ubicacionalmacen.findByPasillo", query = "SELECT u FROM Ubicacionalmacen u WHERE u.pasillo = :pasillo"), |
|||
@NamedQuery(name = "Ubicacionalmacen.findByEstante", query = "SELECT u FROM Ubicacionalmacen u WHERE u.estante = :estante"), |
|||
@NamedQuery(name = "Ubicacionalmacen.findBySeccion", query = "SELECT u FROM Ubicacionalmacen u WHERE u.seccion = :seccion"), |
|||
@NamedQuery(name = "Ubicacionalmacen.findByStatus", query = "SELECT u FROM Ubicacionalmacen u WHERE u.status = :status")}) |
|||
public class Ubicacionalmacen 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 = 45) |
|||
@Column(name = "bodega") |
|||
private String bodega; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "pasillo") |
|||
private String pasillo; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "estante") |
|||
private String estante; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "seccion") |
|||
private String seccion; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "ubicacionalmacenId") |
|||
private List<Producto> productoList; |
|||
|
|||
public Ubicacionalmacen() { |
|||
} |
|||
|
|||
public Ubicacionalmacen(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Ubicacionalmacen(Integer id, String bodega, String pasillo, String estante, String seccion, int status) { |
|||
this.id = id; |
|||
this.bodega = bodega; |
|||
this.pasillo = pasillo; |
|||
this.estante = estante; |
|||
this.seccion = seccion; |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getBodega() { |
|||
return bodega; |
|||
} |
|||
|
|||
public void setBodega(String bodega) { |
|||
this.bodega = bodega; |
|||
} |
|||
|
|||
public String getPasillo() { |
|||
return pasillo; |
|||
} |
|||
|
|||
public void setPasillo(String pasillo) { |
|||
this.pasillo = pasillo; |
|||
} |
|||
|
|||
public String getEstante() { |
|||
return estante; |
|||
} |
|||
|
|||
public void setEstante(String estante) { |
|||
this.estante = estante; |
|||
} |
|||
|
|||
public String getSeccion() { |
|||
return seccion; |
|||
} |
|||
|
|||
public void setSeccion(String seccion) { |
|||
this.seccion = seccion; |
|||
} |
|||
|
|||
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 Ubicacionalmacen)) { |
|||
return false; |
|||
} |
|||
Ubicacionalmacen other = (Ubicacionalmacen) 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.tjs.chapala.sistemas.modelo.Ubicacionalmacen[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,259 @@ |
|||
/* |
|||
* 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.tjs.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.validation.constraints.Size; |
|||
import javax.xml.bind.annotation.XmlRootElement; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Entity |
|||
@Table(name = "usuarios") |
|||
@XmlRootElement |
|||
@NamedQueries({ |
|||
@NamedQuery(name = "Usuarios.findAll", query = "SELECT u FROM Usuarios u"), |
|||
@NamedQuery(name = "Usuarios.findById", query = "SELECT u FROM Usuarios u WHERE u.id = :id"), |
|||
@NamedQuery(name = "Usuarios.findByUsuario", query = "SELECT u FROM Usuarios u WHERE u.usuario = :usuario"), |
|||
@NamedQuery(name = "Usuarios.findByContrasenia", query = "SELECT u FROM Usuarios u WHERE u.contrasenia = :contrasenia"), |
|||
@NamedQuery(name = "Usuarios.findByStatus", query = "SELECT u FROM Usuarios u WHERE u.status = :status"), |
|||
@NamedQuery(name = "Usuarios.findByNombre", query = "SELECT u FROM Usuarios u WHERE u.nombre = :nombre"), |
|||
@NamedQuery(name = "Usuarios.findByApellidom", query = "SELECT u FROM Usuarios u WHERE u.apellidom = :apellidom"), |
|||
@NamedQuery(name = "Usuarios.findByApellidop", query = "SELECT u FROM Usuarios u WHERE u.apellidop = :apellidop"), |
|||
@NamedQuery(name = "Usuarios.findByFechanacimiento", query = "SELECT u FROM Usuarios u WHERE u.fechanacimiento = :fechanacimiento"), |
|||
@NamedQuery(name = "Usuarios.findByCorreo", query = "SELECT u FROM Usuarios u WHERE u.correo = :correo"), |
|||
@NamedQuery(name = "Usuarios.findByGenero", query = "SELECT u FROM Usuarios u WHERE u.genero = :genero"), |
|||
@NamedQuery(name = "Usuarios.findByTelefono", query = "SELECT u FROM Usuarios u WHERE u.telefono = :telefono")}) |
|||
public class Usuarios 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 = 45) |
|||
@Column(name = "usuario") |
|||
private String usuario; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "contrasenia") |
|||
private String contrasenia; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "status") |
|||
private int status; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "nombre") |
|||
private String nombre; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "apellidom") |
|||
private String apellidom; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "apellidop") |
|||
private String apellidop; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "fechanacimiento") |
|||
@Temporal(TemporalType.DATE) |
|||
private Date fechanacimiento; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 45) |
|||
@Column(name = "correo") |
|||
private String correo; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Column(name = "genero") |
|||
private Character genero; |
|||
@Basic(optional = false) |
|||
@NotNull |
|||
@Size(min = 1, max = 20) |
|||
@Column(name = "telefono") |
|||
private String telefono; |
|||
@JoinColumn(name = "domicilio_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Domicilio domicilioId; |
|||
@JoinColumn(name = "rol_id", referencedColumnName = "id") |
|||
@ManyToOne(optional = false) |
|||
private Rol rolId; |
|||
|
|||
public Usuarios() { |
|||
} |
|||
|
|||
public Usuarios(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public Usuarios(Integer id, String usuario, String contrasenia, int status, String nombre, String apellidom, String apellidop, Date fechanacimiento, String correo, Character genero, String telefono) { |
|||
this.id = id; |
|||
this.usuario = usuario; |
|||
this.contrasenia = contrasenia; |
|||
this.status = status; |
|||
this.nombre = nombre; |
|||
this.apellidom = apellidom; |
|||
this.apellidop = apellidop; |
|||
this.fechanacimiento = fechanacimiento; |
|||
this.correo = correo; |
|||
this.genero = genero; |
|||
this.telefono = telefono; |
|||
} |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getUsuario() { |
|||
return usuario; |
|||
} |
|||
|
|||
public void setUsuario(String usuario) { |
|||
this.usuario = usuario; |
|||
} |
|||
|
|||
public String getContrasenia() { |
|||
return contrasenia; |
|||
} |
|||
|
|||
public void setContrasenia(String contrasenia) { |
|||
this.contrasenia = contrasenia; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getNombre() { |
|||
return nombre; |
|||
} |
|||
|
|||
public void setNombre(String nombre) { |
|||
this.nombre = nombre; |
|||
} |
|||
|
|||
public String getApellidom() { |
|||
return apellidom; |
|||
} |
|||
|
|||
public void setApellidom(String apellidom) { |
|||
this.apellidom = apellidom; |
|||
} |
|||
|
|||
public String getApellidop() { |
|||
return apellidop; |
|||
} |
|||
|
|||
public void setApellidop(String apellidop) { |
|||
this.apellidop = apellidop; |
|||
} |
|||
|
|||
public Date getFechanacimiento() { |
|||
return fechanacimiento; |
|||
} |
|||
|
|||
public void setFechanacimiento(Date fechanacimiento) { |
|||
this.fechanacimiento = fechanacimiento; |
|||
} |
|||
|
|||
public String getCorreo() { |
|||
return correo; |
|||
} |
|||
|
|||
public void setCorreo(String correo) { |
|||
this.correo = correo; |
|||
} |
|||
|
|||
public Character getGenero() { |
|||
return genero; |
|||
} |
|||
|
|||
public void setGenero(Character genero) { |
|||
this.genero = genero; |
|||
} |
|||
|
|||
public String getTelefono() { |
|||
return telefono; |
|||
} |
|||
|
|||
public void setTelefono(String telefono) { |
|||
this.telefono = telefono; |
|||
} |
|||
|
|||
public Domicilio getDomicilioId() { |
|||
return domicilioId; |
|||
} |
|||
|
|||
public void setDomicilioId(Domicilio domicilioId) { |
|||
this.domicilioId = domicilioId; |
|||
} |
|||
|
|||
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 Usuarios)) { |
|||
return false; |
|||
} |
|||
Usuarios other = (Usuarios) 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.tjs.chapala.sistemas.modelo.Usuarios[ id=" + id + " ]"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.msg; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
public enum Mensaje { |
|||
SIN_ERROR, |
|||
CAMPOS_INCOMPLETOS, |
|||
DATOS_INCORRECTOS, |
|||
ELEMENTO_DUPLICADO, |
|||
ELEMENTO_NO_ENCONTRADO |
|||
} |
@ -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="Inventario-war" default="default" basedir="."> |
|||
<description>Builds, tests, and runs the project Inventario-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=3a64461f |
|||
build.xml.script.CRC32=796f502a |
|||
build.xml.stylesheet.CRC32=1707db4f@1.96.0.1 |
|||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. |
|||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. |
|||
nbproject/build-impl.xml.data.CRC32=3a64461f |
|||
nbproject/build-impl.xml.script.CRC32=ea47dfdd |
|||
nbproject/build-impl.xml.stylesheet.CRC32=334708a0@1.96.0.1 |
@ -0,0 +1,94 @@ |
|||
annotation.processing.enabled=true |
|||
annotation.processing.enabled.in.editor=true |
|||
annotation.processing.processors.list= |
|||
annotation.processing.run.all.processors=true |
|||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output |
|||
auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets |
|||
build.classes.dir=${build.web.dir}/WEB-INF/classes |
|||
build.classes.excludes=**/*.java,**/*.form |
|||
build.dir=build |
|||
build.generated.dir=${build.dir}/generated |
|||
build.generated.sources.dir=${build.dir}/generated-sources |
|||
build.test.classes.dir=${build.dir}/test/classes |
|||
build.test.results.dir=${build.dir}/test/results |
|||
build.web.dir=${build.dir}/web |
|||
build.web.excludes=${build.classes.excludes} |
|||
client.urlPart= |
|||
compile.jsps=false |
|||
conf.dir=${source.root}/conf |
|||
debug.classpath=${build.classes.dir}:${javac.classpath} |
|||
debug.test.classpath=\ |
|||
${run.test.classpath} |
|||
display.browser=true |
|||
# Files to be excluded from distribution war |
|||
dist.archive.excludes= |
|||
dist.dir=dist |
|||
dist.ear.war=${dist.dir}/${war.ear.name} |
|||
dist.javadoc.dir=${dist.dir}/javadoc |
|||
dist.war=${dist.dir}/${war.name} |
|||
endorsed.classpath=\ |
|||
${libs.javaee-endorsed-api-7.0.classpath} |
|||
excludes= |
|||
file.reference.primefaces-12.0.0.jar=libs/primefaces-12.0.0.jar |
|||
includes=** |
|||
j2ee.compile.on.save=true |
|||
j2ee.copy.static.files.on.save=true |
|||
j2ee.deploy.on.save=true |
|||
j2ee.platform=1.7 |
|||
j2ee.platform.classpath=${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar |
|||
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar |
|||
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar |
|||
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar |
|||
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar |
|||
j2ee.platform.wsit.classpath= |
|||
j2ee.server.type=gfv4ee7 |
|||
jar.compress=false |
|||
javac.classpath=\ |
|||
${reference.Inventario-ejb.dist}:\ |
|||
${file.reference.primefaces-12.0.0.jar} |
|||
# Space-separated list of extra javac options |
|||
javac.compilerargs= |
|||
javac.debug=true |
|||
javac.deprecation=false |
|||
javac.processorpath=\ |
|||
${javac.classpath} |
|||
javac.source=1.7 |
|||
javac.target=1.7 |
|||
javac.test.classpath=\ |
|||
${javac.classpath}:\ |
|||
${build.classes.dir} |
|||
javac.test.processorpath=\ |
|||
${javac.test.classpath} |
|||
javadoc.additionalparam= |
|||
javadoc.author=false |
|||
javadoc.encoding=${source.encoding} |
|||
javadoc.noindex=false |
|||
javadoc.nonavbar=false |
|||
javadoc.notree=false |
|||
javadoc.preview=true |
|||
javadoc.private=false |
|||
javadoc.splitindex=true |
|||
javadoc.use=true |
|||
javadoc.version=false |
|||
javadoc.windowtitle= |
|||
lib.dir=${web.docbase.dir}/WEB-INF/lib |
|||
persistence.xml.dir=${conf.dir} |
|||
platform.active=default_platform |
|||
project.Inventario-ejb=../Inventario-ejb |
|||
reference.Inventario-ejb.dist=${project.Inventario-ejb}/dist/Inventario-ejb.jar |
|||
resource.dir=setup |
|||
run.test.classpath=\ |
|||
${javac.test.classpath}:\ |
|||
${build.test.classes.dir} |
|||
# Space-separated list of JVM arguments used when running a class with a main method or a unit test |
|||
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): |
|||
runmain.jvmargs= |
|||
source.encoding=UTF-8 |
|||
source.root=src |
|||
src.dir=${source.root}/java |
|||
test.src.dir=test |
|||
war.content.additional= |
|||
war.ear.name=${war.name} |
|||
war.name=Inventario-war.war |
|||
web.docbase.dir=web |
|||
webinf.dir=web/WEB-INF |
@ -0,0 +1,39 @@ |
|||
<?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>Inventario-war</name> |
|||
<minimum-ant-version>1.6.5</minimum-ant-version> |
|||
<web-module-libraries> |
|||
<library dirs="100"> |
|||
<file>${reference.Inventario-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>Inventario-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,63 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
|
|||
*/ |
|||
package mx.edu.tjs.chapala.sistemas.seguridad; |
|||
|
|||
import java.io.IOException; |
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
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 52332 |
|||
*/ |
|||
@Named(value = "autorizacionListener") |
|||
@SessionScoped |
|||
public class AutorizacionListener implements PhaseListener{ |
|||
|
|||
/** |
|||
* Creates a new instance of AutorizacionListener |
|||
*/ |
|||
public AutorizacionListener() { |
|||
} |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Override |
|||
public void afterPhase(PhaseEvent event) { |
|||
try { |
|||
//Obtener la pagina actual para validar la sesion
|
|||
String paginaActual = event.getFacesContext().getViewRoot().getViewId(); |
|||
|
|||
//inicializar la sesion en caso de no haber sesion
|
|||
Login.getSesion(); |
|||
|
|||
//Revisar que no sea la pafina index y que no estes logueado
|
|||
//para redireccionar
|
|||
if (!paginaActual.contains("index.xhtml") && Login.getEstatus() == 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,67 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
|
|||
*/ |
|||
package mx.edu.tjs.chapala.sistemas.seguridad; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import javax.faces.context.FacesContext; |
|||
import javax.servlet.http.HttpSession; |
|||
|
|||
/** |
|||
* |
|||
* @author 52332 |
|||
*/ |
|||
@Named(value = "login") |
|||
@SessionScoped |
|||
|
|||
public class Login implements Serializable { |
|||
|
|||
private static HttpSession httpSession; |
|||
|
|||
/** |
|||
* Creates a new instance of Login |
|||
*/ |
|||
public Login() { |
|||
} |
|||
|
|||
public static void getSesion(){ |
|||
httpSession=(HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); |
|||
} |
|||
|
|||
|
|||
//metodo para salir
|
|||
|
|||
public static String logout(){ |
|||
httpSession.removeAttribute("sesionActiva"); |
|||
httpSession.invalidate(); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public static String login(){ |
|||
//llamar bl para autenticacion que regresa un boolean
|
|||
//todo:hacer un metodo en el bl que reciba el usuario y pass
|
|||
boolean login=true; |
|||
if(login){ |
|||
httpSession.setAttribute("sesionActiva","true"); |
|||
return "ProductoLista.xhtml"; |
|||
}else{ |
|||
return "index.xhtml"; |
|||
} |
|||
} |
|||
|
|||
|
|||
public static boolean getEstatus(){ |
|||
if(httpSession!=null&& |
|||
httpSession.getId()!=null&& |
|||
!httpSession.getId().isEmpty()&& |
|||
httpSession.getAttribute("sesionActiva")!=null){ |
|||
return true; |
|||
}else{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,163 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.vista; |
|||
|
|||
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.tjs.chapala.sistemas.bl.CategoriaBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.bl.ProveedorBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author nayelivilchismariscal |
|||
*/ |
|||
|
|||
@Named(value = "demoBeanCategoria") |
|||
@SessionScoped |
|||
public class DemoBeanCategoria implements Serializable { |
|||
|
|||
@EJB |
|||
private CategoriaBLLocal categoriaBL; |
|||
private Categoria categoria = new Categoria(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Categoria> filteredCustomers3; |
|||
|
|||
public DemoBeanCategoria (){ |
|||
} |
|||
public String agregar() { |
|||
Categoria p = new Categoria(); |
|||
p.setNombre("Limpieza"); |
|||
p.setStatus(1); |
|||
p.setId(1); |
|||
|
|||
categoriaBL.agregar(p); |
|||
return "index.xhtml"; |
|||
} |
|||
public String agregarCategoria() { |
|||
categoria.setStatus(1); |
|||
categoriaBL.agregar(categoria); |
|||
categoria = new Categoria(); //refresca el campo
|
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
return "categoriaLista.xhtml"; |
|||
} |
|||
|
|||
public String editar() { |
|||
Categoria p = new Categoria(); |
|||
p.setId(1); |
|||
p.setNombre("Carniceria"); |
|||
p.setStatus(1); |
|||
|
|||
categoriaBL.editar(p); |
|||
return "index.xhtml"; |
|||
} |
|||
public String buscarID() { |
|||
Categoria p = new Categoria(); |
|||
p.setId(20); |
|||
|
|||
categoriaBL.buscarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarNombre() { |
|||
Categoria p = new Categoria(); |
|||
p.setNombre("Carniceria"); |
|||
|
|||
categoriaBL.buscarNombre(p); |
|||
return "index.xhtml"; |
|||
} |
|||
public String buscarActivos() { |
|||
categoriaBL.buscarStatus(true); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarInactivos(){ |
|||
categoriaBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarTodos(){ |
|||
categoriaBL.buscarStatus(true); |
|||
categoriaBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminar() { |
|||
Categoria p = new Categoria(); |
|||
p.setId(1); |
|||
categoriaBL.eliminarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public List<Categoria> getCategorias(){ |
|||
return categoriaBL.buscarStatus(true); |
|||
} |
|||
|
|||
public Categoria getCategoria() { |
|||
return categoria; |
|||
} |
|||
|
|||
public void setCategoria(Categoria categoria) { |
|||
this.categoria = categoria; |
|||
} |
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public void preparareditar(Categoria categoria){ |
|||
titulo="Editanto Categoria"; |
|||
this.categoria= categoria; |
|||
} |
|||
public void prepararnuevo(){ |
|||
nuevo= true; |
|||
titulo="Agregando Categoria"; |
|||
categoria=new Categoria(); |
|||
} |
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void editarcategoria(){ |
|||
nuevo= false; |
|||
categoriaBL.editar(categoria); |
|||
PrimeFaces.current().executeScript("PF('dlg'.hide()"); |
|||
} |
|||
public void preparareliminar(Categoria categoria){ |
|||
this.categoria= categoria; |
|||
} |
|||
public void eliminarcategoria(){ |
|||
categoriaBL.eliminarId(categoria); |
|||
PrimeFaces.current().executeScript("PF('dlg2'.hide()"); |
|||
} |
|||
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 customer = (Categoria) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|| customer.getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public List<Categoria> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Categoria> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,181 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.vista; |
|||
|
|||
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.tjs.chapala.sistemas.bl.CategoriaBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.bl.MarcaBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Marca; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author nayelivilchismariscal |
|||
*/ |
|||
@Named(value = "demoBeanMarca") |
|||
@SessionScoped |
|||
public class DemoBeanMarca implements Serializable { |
|||
|
|||
@EJB |
|||
private MarcaBLLocal marcaBL; |
|||
private Marca marca = new Marca(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Marca> filteredCustomers3; |
|||
|
|||
public DemoBeanMarca() { |
|||
} |
|||
|
|||
public String agregar() { |
|||
Marca p = new Marca(); |
|||
p.setNombre("LG"); |
|||
p.setStatus(1); |
|||
|
|||
marcaBL.agregar(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
//////////////////////////////////////////////////////////
|
|||
public String agregarMarca() { |
|||
marca.setStatus(1); |
|||
marcaBL.agregar(marca); |
|||
marca = new Marca(); //refresca el campo
|
|||
PrimeFaces.current().executeScript("PF('dlg'.hide()"); |
|||
return "marcaLista.xhtml"; |
|||
} |
|||
|
|||
/////////////////////////////////////////////////////////
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public String editar() { |
|||
Marca p = new Marca(); |
|||
p.setId(1); |
|||
p.setNombre("Samsung"); |
|||
|
|||
p.setStatus(0); |
|||
|
|||
marcaBL.editar(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarID() { |
|||
Marca p = new Marca(); |
|||
p.setId(1); |
|||
|
|||
marcaBL.buscarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarNombre() { |
|||
Marca p = new Marca(); |
|||
p.setNombre("LG"); |
|||
|
|||
marcaBL.buscarNombre(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarActivos() { |
|||
marcaBL.buscarStatus(true); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarInactivos() { |
|||
marcaBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarTodos() { |
|||
marcaBL.buscarStatus(true); |
|||
marcaBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminar() { |
|||
Marca p = new Marca(); |
|||
p.setId(1); |
|||
marcaBL.eliminarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public List<Marca> getMarcas(){ |
|||
return marcaBL.buscarStatus(true); |
|||
} |
|||
|
|||
public Marca getMarca() { |
|||
return marca; |
|||
} |
|||
|
|||
public void setMarca(Marca marca) { |
|||
this.marca = marca; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public void preparareditar(Marca marca){ |
|||
nuevo=false; |
|||
titulo="Editar Marca"; |
|||
this.marca= marca; |
|||
} |
|||
public void prepararnuevo(){ |
|||
nuevo= true; |
|||
titulo="Agregar marca"; |
|||
marca=new Marca(); |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public void editarmarca(){ |
|||
nuevo= false; |
|||
marcaBL.editar(marca); |
|||
PrimeFaces.current().executeScript("PF('dlg'.hide()"); |
|||
} |
|||
public void preparareliminar(Marca marca){ |
|||
this.marca= marca; |
|||
|
|||
} |
|||
public void eliminarmarca(){ |
|||
marcaBL.eliminarId(marca); |
|||
} |
|||
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 customer = (Marca) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|| customer.getNombre().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public List<Marca> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Marca> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,193 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
|
|||
*/ |
|||
package mx.edu.tjs.chapala.sistemas.vista; |
|||
|
|||
import javax.inject.Named; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import java.io.Serializable; |
|||
import static java.lang.Integer.getInteger; |
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.faces.application.FacesMessage; |
|||
import javax.faces.component.UIComponent; |
|||
import javax.faces.context.FacesContext; |
|||
import javax.faces.validator.ValidatorException; |
|||
import mx.edu.tjs.chapala.sistemas.bl.ProveedorBL; |
|||
import mx.edu.tjs.chapala.sistemas.bl.ProveedorBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author nickdalyrendon |
|||
*/ |
|||
@Named(value = "demoBeanProveedor") |
|||
@SessionScoped |
|||
public class DemoBeanProveedor implements Serializable { |
|||
|
|||
@EJB |
|||
private ProveedorBLLocal proveedorBL; |
|||
private Proveedor proveedor = new Proveedor(); |
|||
private String titulo; //editar
|
|||
private boolean nuevo; |
|||
private List<Proveedor> filteredCustomers3; |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* Creates a new instance of DemoBeanProveedor |
|||
*/ |
|||
public DemoBeanProveedor() { |
|||
} |
|||
|
|||
public String agregarProveedor() { |
|||
Mensaje mensaje = proveedorBL.agregar(proveedor); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
proveedor = new Proveedor(); //limpiar
|
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
PrimeFaces.current().ajax().update("formtabla:growl"); |
|||
return "proveedorLista.xhtml"; |
|||
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
|
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
public String editarProveedor() { |
|||
|
|||
Mensaje mensaje = proveedorBL.editar(proveedor); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
proveedor = new Proveedor(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
PrimeFaces.current().ajax().update("formtabla:growl"); |
|||
return "proveedorLista.xhtml"; |
|||
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
|
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
public void eliminarProveedor() { |
|||
proveedorBL.eliminarId(proveedor); |
|||
} |
|||
|
|||
public String buscarActivos() { |
|||
proveedorBL.buscarStatus(true); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarInactivos() { |
|||
proveedorBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarTodos() { |
|||
proveedorBL.buscarStatus(true); |
|||
proveedorBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminar() { |
|||
Proveedor p = new Proveedor(); |
|||
p.setId(4); |
|||
proveedorBL.eliminarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public List<Proveedor> getAll() { |
|||
return proveedorBL.buscarStatus(true); |
|||
} |
|||
|
|||
public Proveedor getProveedor() { |
|||
return proveedor; |
|||
} |
|||
|
|||
public void setProveedor(Proveedor proveedor) { |
|||
this.proveedor = proveedor; |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
//editar
|
|||
public void prepararEditar(Proveedor proveedor) { |
|||
nuevo = false; |
|||
titulo = "E D I T A R"; |
|||
this.proveedor = proveedor; |
|||
|
|||
} |
|||
|
|||
public void prepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "A G R E G A R"; |
|||
proveedor = new Proveedor(); |
|||
|
|||
} |
|||
|
|||
public void prepararEliminar(Proveedor proveedor) { |
|||
this.proveedor = proveedor; |
|||
} |
|||
|
|||
public boolean globalFilterFunction(Object value, Object filter, Locale locale) { |
|||
String filterText = (filter == null) ? null : filter.toString().trim().toLowerCase(); |
|||
if (LangUtils.isBlank(filterText)) { |
|||
return true; |
|||
} |
|||
|
|||
Proveedor customer = (Proveedor) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|| customer.getCorreo().toLowerCase().contains(filterText) |
|||
|| customer.getTelefono().toLowerCase().contains(filterText) |
|||
|| customer.getMunicipio().toLowerCase().contains(filterText) |
|||
|| customer.getEstado().toLowerCase().contains(filterText) |
|||
|| customer.getCp().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
public List<Proveedor> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Proveedor> filteredCustomers3) { |
|||
this.filteredCustomers3 = filteredCustomers3; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
@ -0,0 +1,142 @@ |
|||
/* |
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|||
* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template
|
|||
*/ |
|||
package mx.edu.tjs.chapala.sistemas.vista; |
|||
|
|||
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.tjs.chapala.sistemas.bl.UsuariosBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Usuarios; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author Ely |
|||
*/ |
|||
@Named(value = "demoBeanUsuarios") |
|||
@SessionScoped |
|||
public class DemoBeanUsuarios implements Serializable { |
|||
|
|||
@EJB |
|||
private UsuariosBLLocal usuariosBL; |
|||
private Usuarios usuarios= new Usuarios(); |
|||
private String titulo; |
|||
private boolean nuevo; |
|||
private List<Usuarios> filteredCustomers3; |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
/** |
|||
* Creates a new instance of DemoBeanUsuarios |
|||
*/ |
|||
public DemoBeanUsuarios() { |
|||
} |
|||
|
|||
public String agregar() { |
|||
usuarios.setStatus(1); |
|||
usuariosBL.agregar(usuarios); |
|||
usuarios= new Usuarios(); |
|||
return "usuariosLista.xhtml"; |
|||
} |
|||
|
|||
public String editar() { |
|||
usuariosBL.editar(usuarios); |
|||
return "usuariosLista.xhtml"; |
|||
} |
|||
|
|||
public String eliminar() { |
|||
usuariosBL.eliminarId(usuarios); |
|||
return "usuariosLista.xhtml"; |
|||
} |
|||
|
|||
public String buscarID() { |
|||
Usuarios u = new Usuarios(); |
|||
u.setId(4); |
|||
|
|||
usuariosBL.buscarId(u); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarNombre() { |
|||
Usuarios u = new Usuarios(); |
|||
u.setUsuario("eli"); |
|||
|
|||
usuariosBL.buscarNombre(u); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarActivos() { |
|||
usuariosBL.buscarStatus(true); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarInactivos(){ |
|||
usuariosBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarTodos(){ |
|||
usuariosBL.buscarStatus(true); |
|||
usuariosBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
|
|||
public List<Usuarios>getAll(){ |
|||
return usuariosBL.buscarStatus(true); |
|||
} |
|||
public Usuarios getUsuarios(){ |
|||
return usuarios; |
|||
} |
|||
public void setUsuarios(Usuarios usuarios){ |
|||
this.usuarios= usuarios; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
public void prepararEditar(Usuarios usuarios){ |
|||
nuevo =false; |
|||
titulo="editando Usuario"; |
|||
this.usuarios=usuarios; |
|||
} |
|||
|
|||
public void prepararNuevo(){ |
|||
nuevo =true; |
|||
titulo="Agregando Usuario"; |
|||
usuarios= new Usuarios(); |
|||
} |
|||
public void prepararEliminar(Usuarios usuarios){ |
|||
this.usuarios=usuarios; |
|||
} |
|||
|
|||
public List<Usuarios> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Usuarios> 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; |
|||
} |
|||
|
|||
|
|||
Usuarios customer = (Usuarios) value; |
|||
return customer.getUsuario().toLowerCase().contains(filterText) |
|||
|| customer.getUsuario().toLowerCase().contains(filterText); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,281 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.vista; |
|||
|
|||
import java.io.Serializable; |
|||
import java.time.Instant; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Locale; |
|||
import javax.ejb.EJB; |
|||
import javax.enterprise.context.SessionScoped; |
|||
import javax.inject.Named; |
|||
import mx.edu.tjs.chapala.sistemas.bl.CategoriaBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.bl.MarcaBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.bl.ProductoBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.bl.ProveedorBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.bl.UbicacionAlmacenBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Categoria; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Marca; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Producto; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Proveedor; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Ubicacionalmacen; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
import static mx.edu.tjs.chapala.sistemas.msg.Mensaje.ELEMENTO_DUPLICADO; |
|||
import static mx.edu.tjs.chapala.sistemas.msg.Mensaje.SIN_ERROR; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author 52332 |
|||
*/ |
|||
@Named(value = "demoBeanProductos") |
|||
@SessionScoped |
|||
public class DemonBeanProducto implements Serializable { |
|||
|
|||
@EJB |
|||
private ProductoBLLocal productoBL; |
|||
|
|||
@EJB |
|||
private ProveedorBLLocal proveedorBL; |
|||
|
|||
@EJB |
|||
private MarcaBLLocal marcaBL; |
|||
|
|||
@EJB |
|||
private CategoriaBLLocal categoriaBL; |
|||
|
|||
@EJB |
|||
private UbicacionAlmacenBLLocal ubicacionAlmacenBL; |
|||
|
|||
private List<Producto> filteredCustomers3; |
|||
|
|||
|
|||
private Producto producto = new Producto(); |
|||
|
|||
private Marca marca = new Marca(); |
|||
|
|||
//crear el id de las llaves foraneas
|
|||
private int marcaid; |
|||
|
|||
private int ubicacionid; |
|||
|
|||
private int proveedorid; |
|||
|
|||
private int categoriaid; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
private Categoria categoria = new Categoria(); |
|||
|
|||
private Proveedor proveedor = new Proveedor(); |
|||
|
|||
private Ubicacionalmacen ubicacionalmacen = new Ubicacionalmacen(); |
|||
|
|||
private String titulo; |
|||
|
|||
private boolean nuevo; |
|||
|
|||
public DemonBeanProducto() { |
|||
} |
|||
|
|||
public String agregarProducto() { |
|||
Mensaje mensaje = productoBL.agregar(producto); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
producto = new Producto(); //limpiar
|
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
PrimeFaces.current().ajax().update("formtabla:growl"); |
|||
return "ProductoLista.xhtml"; |
|||
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
|
|||
default: |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public String buscarID() { |
|||
Producto p = new Producto(); |
|||
p.setId(1); |
|||
|
|||
productoBL.buscarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarNombre() { |
|||
Producto p = new Producto(); |
|||
p.setNombre("fanta"); |
|||
|
|||
productoBL.buscarNombre(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarActivos() { |
|||
productoBL.buscarStatus(true); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarInactivos() { |
|||
productoBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarTodos() { |
|||
productoBL.buscarStatus(true); |
|||
productoBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminar() { |
|||
Producto p = new Producto(); |
|||
p.setId(1); |
|||
productoBL.eliminarId(p); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public List<Producto> getAll() { |
|||
return productoBL.buscarStatus(true); |
|||
} |
|||
|
|||
public Producto getProducto() { |
|||
return producto; |
|||
} |
|||
|
|||
public void setProducto(Producto producto) { |
|||
this.producto = producto; |
|||
} |
|||
|
|||
//agregando para los botones de editar y eliminar
|
|||
public void PrepararEditar(Producto producto) { |
|||
nuevo=false; |
|||
titulo = "E D I T A R"; |
|||
this.producto = producto; |
|||
|
|||
} |
|||
|
|||
public void prepararNuevo() { |
|||
nuevo = true; |
|||
titulo = "A G R E G A R"; |
|||
producto = new Producto(); |
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
|
|||
public void setTitulo(String titulo) { |
|||
this.titulo = titulo; |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
|
|||
public String editarProducto() { |
|||
|
|||
Mensaje mensaje = productoBL.editar(producto); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
producto = new Producto(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
PrimeFaces.current().ajax().update("formtabla:growl"); |
|||
return "ProductoLista.xhtml"; |
|||
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
|
|||
default: |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
|||
//eliminar
|
|||
public void prepararEliminar(Producto producto) { |
|||
this.producto = producto; |
|||
} |
|||
|
|||
public void eliminarProducto() { |
|||
productoBL.eliminarId(producto); |
|||
// PrimeFaces.current().executeScript("PF('dlg2').hide()");
|
|||
} |
|||
|
|||
|
|||
|
|||
//se agregan los get y los set de las llaves foreaneas de id
|
|||
|
|||
public int getMarcaid() { |
|||
return marcaid; |
|||
} |
|||
|
|||
public void setMarcaid(int marcaid) { |
|||
this.marcaid = marcaid; |
|||
} |
|||
|
|||
public int getUbicacionid() { |
|||
return ubicacionid; |
|||
} |
|||
|
|||
public void setUbicacionid(int ubicacionid) { |
|||
this.ubicacionid = ubicacionid; |
|||
} |
|||
|
|||
public int getProveedorid() { |
|||
return proveedorid; |
|||
} |
|||
|
|||
public void setProveedorid(int proveedorid) { |
|||
this.proveedorid = proveedorid; |
|||
} |
|||
|
|||
public int getCategoriaid() { |
|||
return categoriaid; |
|||
} |
|||
|
|||
public void setCategoriaid(int categoriaid) { |
|||
this.categoriaid = categoriaid; |
|||
} |
|||
|
|||
//SE AÑADEN LOS GET Y LOS SET DE CUSTOM
|
|||
|
|||
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 customer = (Producto) value; |
|||
return customer.getNombre().toLowerCase().contains(filterText) |
|||
|
|||
|| customer.getCodigo().toLowerCase().contains(filterText) |
|||
|
|||
|| customer.getDescripcion().toLowerCase().contains(filterText); |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,199 @@ |
|||
/* |
|||
* 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.tjs.chapala.sistemas.vista; |
|||
|
|||
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.tjs.chapala.sistemas.bl.UbicacionAlmacenBLLocal; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Producto; |
|||
import mx.edu.tjs.chapala.sistemas.modelo.Ubicacionalmacen; |
|||
import mx.edu.tjs.chapala.sistemas.msg.Mensaje; |
|||
import static mx.edu.tjs.chapala.sistemas.msg.Mensaje.ELEMENTO_DUPLICADO; |
|||
import static mx.edu.tjs.chapala.sistemas.msg.Mensaje.SIN_ERROR; |
|||
import org.primefaces.PrimeFaces; |
|||
import org.primefaces.util.LangUtils; |
|||
|
|||
/** |
|||
* |
|||
* @author 52332 |
|||
* |
|||
*/ |
|||
@Named(value = "demoBeanUbicacionalmacen") |
|||
@SessionScoped |
|||
public class DemonBeanUbicacionalmacen implements Serializable { |
|||
|
|||
@EJB |
|||
private UbicacionAlmacenBLLocal ubicacionAlmacenBL; |
|||
|
|||
|
|||
private Ubicacionalmacen ubicacionalmacen = new Ubicacionalmacen(); |
|||
|
|||
private String titulo; |
|||
|
|||
private boolean nuevo; |
|||
private List<Ubicacionalmacen> filteredCustomers3; |
|||
|
|||
public DemonBeanUbicacionalmacen() { |
|||
} |
|||
//metodo de agregar en la vista
|
|||
public String agregarUbicacion(){ |
|||
Mensaje mensaje = ubicacionAlmacenBL.agregar(ubicacionalmacen); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
ubicacionalmacen = new Ubicacionalmacen(); //limpiar
|
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
PrimeFaces.current().ajax().update("formtabla:growl"); |
|||
return "UbicacionAlmacenLista.xhtml"; |
|||
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
|
|||
default: |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
public String buscarID() { |
|||
Ubicacionalmacen u = new Ubicacionalmacen(); |
|||
u.setId(1); |
|||
|
|||
ubicacionAlmacenBL.buscarId(u); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarNombre() { |
|||
Ubicacionalmacen u = new Ubicacionalmacen(); |
|||
u.setBodega("buenos aires"); |
|||
|
|||
ubicacionAlmacenBL.buscarBodega(u); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarActivos() { |
|||
ubicacionAlmacenBL.buscarStatus(true); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarInactivos(){ |
|||
ubicacionAlmacenBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String buscarTodos(){ |
|||
ubicacionAlmacenBL.buscarStatus(true); |
|||
ubicacionAlmacenBL.buscarStatus(false); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public String eliminar() { |
|||
Ubicacionalmacen u = new Ubicacionalmacen(); |
|||
u.setId(2); |
|||
ubicacionAlmacenBL.eliminarId(u); |
|||
return "index.xhtml"; |
|||
} |
|||
|
|||
public List<Ubicacionalmacen> getAll(){ |
|||
return ubicacionAlmacenBL.buscarStatus(true); |
|||
|
|||
|
|||
} |
|||
|
|||
public Ubicacionalmacen getUbicacionalmacen() { |
|||
return ubicacionalmacen; |
|||
} |
|||
|
|||
public void setUbicacionalmacen(Ubicacionalmacen ubicacionalmacen) { |
|||
this.ubicacionalmacen = ubicacionalmacen; |
|||
} |
|||
|
|||
|
|||
public void PrepararEditar(Ubicacionalmacen ubicacionalmacen){ |
|||
|
|||
nuevo=false; |
|||
|
|||
titulo ="E D I T A R"; |
|||
this.ubicacionalmacen=ubicacionalmacen; |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
} |
|||
public void prepararNuevo(){ |
|||
nuevo=true; |
|||
titulo="A G R E G A R"; |
|||
ubicacionalmacen=new Ubicacionalmacen(); |
|||
|
|||
} |
|||
|
|||
public String getTitulo() { |
|||
return titulo; |
|||
} |
|||
public String editarUbicacion(){ |
|||
Mensaje mensaje = ubicacionAlmacenBL.editar(ubicacionalmacen); |
|||
|
|||
switch (mensaje) { |
|||
case SIN_ERROR: |
|||
ubicacionalmacen = new Ubicacionalmacen(); |
|||
PrimeFaces.current().executeScript("PF('dlg').hide()"); |
|||
PrimeFaces.current().ajax().update("formtabla:growl"); |
|||
return "UbicacionAlmacen.xhtml"; |
|||
|
|||
case ELEMENTO_DUPLICADO: |
|||
return null; |
|||
|
|||
default: |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
public boolean isNuevo() { |
|||
return nuevo; |
|||
} |
|||
public void prepararEliminar(Ubicacionalmacen ubicacionalmacen){ |
|||
this.ubicacionalmacen=ubicacionalmacen; |
|||
} |
|||
|
|||
public void eliminarUbicacion(){ |
|||
ubicacionAlmacenBL.eliminarId(ubicacionalmacen); |
|||
// PrimeFaces.current().executeScript("PF('dlg2').hide()");
|
|||
} |
|||
|
|||
//se agregan los get y los set de custom
|
|||
|
|||
public List<Ubicacionalmacen> getFilteredCustomers3() { |
|||
return filteredCustomers3; |
|||
} |
|||
|
|||
public void setFilteredCustomers3(List<Ubicacionalmacen> 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; |
|||
} |
|||
|
|||
|
|||
Ubicacionalmacen customer = (Ubicacionalmacen) value; |
|||
return |
|||
customer.getBodega().toLowerCase().contains(filterText) |
|||
|
|||
|| customer.getEstante().toLowerCase().contains(filterText) |
|||
|
|||
|| customer.getPasillo().toLowerCase().contains(filterText) |
|||
|| customer.getSeccion().toLowerCase().contains(filterText); |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
|
|||
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,127 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
|
|||
<ui:define name="top"> |
|||
<center><h2> P R O D U C T O S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
<h:form style="height: 600px;" class="form-container"> |
|||
|
|||
<h1><h:outputText value="Crear Producto"/></h1> |
|||
<h:panelGrid id="grid" columns="6" style="width: 100%"> |
|||
<p:outputLabel style="font-weight:bolder" value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanProductos.producto.nombre}" title="Nombre" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="nombre"/> |
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Codigo:" for="codigo" /> |
|||
<p:inputText id="codigo" value="#{demoBeanProductos.producto.codigo}" title="Codigo" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="codigo"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Precio:" for="precio" /> |
|||
<p:inputText id="precio" value="#{demoBeanProductos.producto.precio}" title="Precio" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="precio"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Descripcion:" for="descripcion" /> |
|||
<p:inputText id="descripcion" value="#{demoBeanProductos.producto.descripcion}" title="Descripcion" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="descripcion"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Stock:" for="stock" /> |
|||
<p:inputText id="stock" value="#{demoBeanProductos.producto.stock}" title="Stock" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="stock"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Fecha Adquisicion:" for="fechaadquisicion" /> |
|||
<p:inputText id="fechaadquisicion" value="#{demoBeanProductos.producto.fechaadquisicion}" title="Fechaadquisicion" required="true" requiredMessage="Campo requerido" > |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</p:inputText> |
|||
<p:message for="fechaadquisicion"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Estado Producto:" for="estadoproducto" /> |
|||
<p:inputText id="estadoproducto" value="#{demoBeanProductos.producto.estadoproducto}" title="Estadoproducto" required="true" requiredMessage="Campo requerido"/> |
|||
<p:message for="estadoproducto"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Submarca:" for="submarca" /> |
|||
<p:inputText id="submarca" value="#{demoBeanProductos.producto.submarca}" title="Submarca" required="true" requiredMessage="Campo requerido"/> |
|||
<p:message for="submarca"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder;" value="Categoria:" for="categoriaId" /> |
|||
<p:selectOneMenu id="categoriaId" value="#{demoBeanProductos.producto.categoriaId}" converter="selectOneMenuConverter" > |
|||
<f:selectItems value="#{demoBeanCategoria.categorias}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}" /> |
|||
</p:selectOneMenu> |
|||
|
|||
<br></br> |
|||
<p:outputLabel style="font-weight:bolder" value="Marca:" for="marcaId" /> |
|||
<p:selectOneMenu id="marcaId" value="#{demoBeanProductos.producto.marcaId}" converter="selectOneMenuConverter" > |
|||
<f:selectItems value="#{demoBeanMarca.marcas}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
|
|||
|
|||
<br></br> |
|||
<p:outputLabel style="font-weight:bolder;" value="Proveedor:" for="proveedorId" /> |
|||
<p:selectOneMenu id="proveedorId" value="#{demoBeanProductos.producto.proveedorId}" converter="selectOneMenuConverter" > |
|||
|
|||
|
|||
<f:selectItems value="#{demoBeanProveedor.all}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<br></br> |
|||
<p:outputLabel style="font-weight:bolder; " value="Ubicacion Almacen:" for="ubicacionalmacenId" /> |
|||
<p:selectOneMenu id="ubicacionalmacenId" value="#{demoBeanProductos.producto.ubicacionalmacenId}" converter="selectOneMenuConverter" > |
|||
|
|||
|
|||
<f:selectItems value="#{demoBeanUbicacionalmacen.all}" var="item" itemLabel="#{item.bodega}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p:commandButton style="margin-left: 10px; background-color:green; border-color:green; " icon="pi pi-check" action="#{demoBeanProductos.agregarProducto()}" ajax="false" update="grid" rendered="#{demoBeanProductos.nuevo}"/> |
|||
<p:commandButton action="ProductoLista.xhtml" actionListener="#{demoBeanProductos.editarProducto()}" ajax="false" icon="pi pi-check" style="margin-left: 10px; background-color:green; border-color:green;" update="grid" rendered="#{!demoBeanProductos.nuevo}"/> |
|||
<label> </label> |
|||
<p:commandButton action="ProductoLista.xhtml" ajax="false" icon="pi pi-times" immediate="true" style="background-color: red; border-color:red;"/> |
|||
|
|||
</h:form> |
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,329 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>P R O D U C T O S</h2></center> |
|||
</ui:define> |
|||
<ui:define name="left" > |
|||
|
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
<h:form id="formtabla" style="width: 100%"> |
|||
<p:growl id="growl" showDetail="true"/> |
|||
|
|||
<p:dataTable id="tabla" value="#{demoBeanProductos.all}" var="item" |
|||
widgetVar="productos" emptyMessage="No se han encontrado producto" |
|||
filteredValue="#{demoBeanProductos.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanProductos.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="480" > |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="height: 30px;" > |
|||
<div> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanProductos.prepararNuevo()}" update=":dialog" value="Nuevo" icon="pi pi-plus" /> |
|||
|
|||
<i class="pi pi-search" style="margin-left: 800px; margin-top: -15px;"></i> |
|||
<p:inputText id="globalFilter" onkeyup="PF('productos').filter()" style="width:300px; margin-left: 10px; margin-top: -6px; float: right;" |
|||
placeholder="Buscar productos" /> |
|||
|
|||
</div> |
|||
</div> |
|||
</f:facet> |
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id" style="font-weight: bolder;" /> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}" /> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}" /> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Codigo" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.codigo}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Precio" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value=" $#{item.precio}" /> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Stock" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.stock}" /> |
|||
</p:column> |
|||
|
|||
|
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Categoria" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.categoriaId.nombre}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Marca" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.marcaId.nombre}"/> |
|||
</p:column> |
|||
|
|||
|
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones" style="font-weight: bolder;"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanProductos.PrepararEditar(item)}" icon="pi pi-file-edit" update=":dialog" style="margin-right: 10px "/> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{demoBeanProductos.prepararEliminar(item)}" icon="pi pi-trash" update=":dialog" style="background-color: red; color:white; border-color: white; "/> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg3').show();" actionListener="#{demoBeanProductos.PrepararEditar(item)}" icon="pi pi-eye" update=":dialog" style="background-color: #88DC65; color:black; margin-right: 10px; width: 85px; margin-top: 10px" /> |
|||
|
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
|
|||
|
|||
<!-- CREAR/EDITAR --> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="900" height="420" modal="true" appendTo="@(body)" > |
|||
|
|||
<h:form > |
|||
<p:growl id="growl" for="productoMsj" showDetail="true" /> |
|||
|
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; margin-bottom: 10px;"> |
|||
<h:outputText value="#{demoBeanProductos.titulo}"/></h3> |
|||
|
|||
<h:panelGrid id="grid" columns="6" style="width: 100%"> |
|||
<p:outputLabel style="font-weight:bolder" value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanProductos.producto.nombre}" title="Nombre" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="nombre"/> |
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Codigo:" for="codigo" /> |
|||
<p:inputText id="codigo" value="#{demoBeanProductos.producto.codigo}" title="Codigo" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="codigo"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Precio:" for="precio" /> |
|||
<p:inputText id="precio" value="#{demoBeanProductos.producto.precio}" title="Precio" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="precio"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Descripcion:" for="descripcion" /> |
|||
<p:inputText id="descripcion" value="#{demoBeanProductos.producto.descripcion}" title="Descripcion" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="descripcion"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Stock:" for="stock" /> |
|||
<p:inputText id="stock" value="#{demoBeanProductos.producto.stock}" title="Stock" required="true" requiredMessage="Campo requerido" /> |
|||
<p:message for="stock"/> |
|||
|
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Fecha Adquisicion:" for="fechaadquisicion" /> |
|||
<p:inputText id="fechaadquisicion" value="#{demoBeanProductos.producto.fechaadquisicion}" title="Fechaadquisicion" required="true" requiredMessage="Campo requerido" > |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</p:inputText> |
|||
<p:message for="fechaadquisicion"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Estado Producto:" for="estadoproducto" /> |
|||
<p:inputText id="estadoproducto" value="#{demoBeanProductos.producto.estadoproducto}" title="Estadoproducto" required="true" requiredMessage="Campo requerido"/> |
|||
<p:message for="estadoproducto"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder" value="Submarca:" for="submarca" /> |
|||
<p:inputText id="submarca" value="#{demoBeanProductos.producto.submarca}" title="Submarca" required="true" requiredMessage="Campo requerido"/> |
|||
<p:message for="submarca"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder;" value="Categoria:" for="categoriaId" /> |
|||
<p:selectOneMenu id="categoriaId" value="#{demoBeanProductos.producto.categoriaId}" converter="selectOneMenuConverter" style="width:200px" > |
|||
<f:selectItems value="#{demoBeanCategoria.categorias}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}" /> |
|||
</p:selectOneMenu> |
|||
|
|||
<br></br> |
|||
<p:outputLabel style="font-weight:bolder" value="Marca:" for="marcaId" /> |
|||
<p:selectOneMenu id="marcaId" value="#{demoBeanProductos.producto.marcaId}" converter="selectOneMenuConverter" style="width:200px" > |
|||
<f:selectItems value="#{demoBeanMarca.marcas}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
|
|||
|
|||
<br></br> |
|||
<p:outputLabel style="font-weight:bolder;" value="Proveedor:" for="proveedorId" /> |
|||
<p:selectOneMenu id="proveedorId" value="#{demoBeanProductos.producto.proveedorId}" converter="selectOneMenuConverter" style="width:200px"> |
|||
|
|||
|
|||
<f:selectItems value="#{demoBeanProveedor.all}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
<br></br> |
|||
<p:outputLabel style="font-weight:bolder; " value="Ubicacion Almacen:" for="ubicacionalmacenId" /> |
|||
<p:selectOneMenu id="ubicacionalmacenId" value="#{demoBeanProductos.producto.ubicacionalmacenId}" converter="selectOneMenuConverter" style="width:200px" > |
|||
|
|||
|
|||
<f:selectItems value="#{demoBeanUbicacionalmacen.all}" var="item" itemLabel="#{item.bodega}" itemValue="#{item}"/> |
|||
</p:selectOneMenu> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
|
|||
<p:commandButton action="ProductoLista.xhtml" ajax="false" icon="pi pi-times" immediate="true" update="grid, formtabla:tabla, growl" |
|||
style="background-color: red; border-color:red; float: right;"/> |
|||
|
|||
<p:commandButton action="#{demoBeanProductos.agregarProducto()}" update="grid, formtabla:tabla, growl" ajax="true" |
|||
rendered="#{demoBeanProductos.nuevo}" icon="pi pi-check" |
|||
style="margin-right: 10px; background-color:green; border-color:green; float: right; " /> |
|||
|
|||
<p:commandButton action="#{demoBeanProductos.editarProducto()}" |
|||
update="grid, formtabla:tabla, growl" ajax="true" rendered="#{!demoBeanProductos.nuevo}" icon="pi pi-check" |
|||
style="margin-right: 10px; background-color:green; border-color:green; float: right;" /> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
<!-- ELIMINAR --> |
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="700" height="490" modal="true"> |
|||
<h:form> |
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 30px; color: #FFFFFF; margin-bottom: 20px;"> |
|||
<h:outputText value="E L I M I N A R"/></h3> |
|||
|
|||
<div> |
|||
<h:panelGrid id="grid" columns="4" style="width: 100%" cellpadding="8" > |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.nombre}" title="Nombre"/> |
|||
<h:outputText style="font-weight:bolder" value="Codigo:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.codigo}" title="Codigo"/> |
|||
<h:outputText style="font-weight:bolder" value="Precio:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.precio}" title="Precio"/> |
|||
<h:outputText style="font-weight:bolder" value="Descripcion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.descripcion}" title="Descripcion"/> |
|||
<h:outputText style="font-weight:bolder" value="Stock:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.stock}" title="Stock"/> |
|||
<h:outputText style="font-weight:bolder" value="Fecha Adquisicion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.fechaadquisicion}" title="Fechaadquisicion"> |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
<h:outputText style="font-weight:bolder" value="Estado Producto:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.estadoproducto}" title="Estadoproducto"/> |
|||
<h:outputText style="font-weight:bolder" value="Submarca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.submarca}" title="Submarca"/> |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Categoria:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.categoriaId.nombre}" title="CategoriaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Marca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.marcaId.nombre}" title="MarcaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Proveedor:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.proveedorId.nombre}" title="ProveedorId"/> |
|||
<h:outputText style="font-weight:bolder" value="Ubicacion Almacen:"/> |
|||
|
|||
|
|||
<h:outputText value="#{demoBeanProductos.producto.ubicacionalmacenId.bodega}" title="UbicacionalmacenId" /> |
|||
|
|||
</h:panelGrid> |
|||
</div> |
|||
|
|||
<div style="margin-top: 20px;"> |
|||
<p:commandButton action="ProductoLista.xhtml" icon="pi pi-times" ajax="false" immediate="true" |
|||
style="margin-left: 10px; background-color:red; border-color:red; float: right;" /> |
|||
|
|||
<p:commandButton action="ProductoLista.xhtml" actionListener="#{demoBeanProductos.eliminarProducto()}" |
|||
ajax="false" icon="pi pi-check" |
|||
style=" background-color:green; border-color:green; float: right;"/> |
|||
</div> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<!-- DETALLES --> |
|||
<p:dialog id="dialog3" widgetVar="dlg3" width="900" height="400" modal="true"> |
|||
<h:form> |
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 30px; color: #FFFFFF; margin-bottom: 20px;"> |
|||
<h:outputText value="D E T A L L E S"/></h3> |
|||
|
|||
<div> |
|||
<h:panelGrid id="grid" columns="4" style="width: 100%" cellpadding="10" > |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.nombre}" title="Nombre"/> |
|||
<h:outputText style="font-weight:bolder" value="Codigo:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.codigo}" title="Codigo"/> |
|||
<h:outputText style="font-weight:bolder" value="Precio:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.precio}" title="Precio"/> |
|||
<h:outputText style="font-weight:bolder" value="Descripcion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.descripcion}" title="Descripcion"/> |
|||
<h:outputText style="font-weight:bolder" value="Stock:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.stock}" title="Stock"/> |
|||
<h:outputText style="font-weight:bolder" value="Fecha Adquisicion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.fechaadquisicion}" title="Fechaadquisicion"> |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
<h:outputText style="font-weight:bolder" value="Estado Producto:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.estadoproducto}" title="Estadoproducto"/> |
|||
<h:outputText style="font-weight:bolder" value="Submarca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.submarca}" title="Submarca"/> |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Categoria:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.categoriaId.nombre}" title="CategoriaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Marca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.marcaId.nombre}" title="MarcaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Proveedor:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.proveedorId.nombre}" title="ProveedorId"/> |
|||
<h:outputText style="font-weight:bolder" value="Ubicacion Almacen:"/> |
|||
|
|||
|
|||
<h:outputText value="#{demoBeanProductos.producto.ubicacionalmacenId.bodega}" title="UbicacionalmacenId" /> |
|||
|
|||
</h:panelGrid> |
|||
</div> |
|||
|
|||
|
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
|||
|
@ -0,0 +1,215 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <h2>A L M A C E N</h2></center> |
|||
</ui:define> |
|||
<ui:define name="left" > |
|||
|
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
|
|||
<ui:define name="content"> |
|||
|
|||
|
|||
<f:view> |
|||
|
|||
|
|||
|
|||
<h:form id="formtabla" style="width: 100%"> |
|||
<p:growl id="growl" showDetail="true"/> |
|||
|
|||
<p:dataTable id="tabla" value="#{demoBeanUbicacionalmacen.all}" var="item" |
|||
widgetVar="almacen" emptyMessage="No se han encontrado almacen" |
|||
filteredValue="#{demoBeanUbicacionalmacen.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanUbicacionalmacen.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="480" > |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="height: 30px;" > |
|||
<div> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanUbicacionalmacen.prepararNuevo()}" update=":dialog" value="Nuevo" icon="pi pi-plus" /> |
|||
|
|||
<i class="pi pi-search" style="margin-left: 800px; margin-top: -15px;"></i> |
|||
<p:inputText id="globalFilter" onkeyup="PF('almacen').filter()" style="width:300px; margin-left: 10px; margin-top: -6px; float: right;" |
|||
placeholder="Buscar ubicacion" /> |
|||
|
|||
</div> |
|||
</div> |
|||
</f:facet> |
|||
<p:column styleClass="columnaOpc" > |
|||
<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="Bodega" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.bodega}" /> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Pasillo" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.pasillo}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Estante" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.estante}"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Seccion" style="font-weight:bolder; float: left;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.seccion}"/> |
|||
</p:column> |
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
|
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones" style="font-weight: bolder"/> |
|||
</f:facet> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanUbicacionalmacen.PrepararEditar(item)}" icon="pi pi-file-edit" update=":dialog" style="margin-right: 10px" /> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{demoBeanUbicacionalmacen.prepararEliminar(item)}" icon="pi pi-trash" update=":dialog" style="background-color: red; color:white; border-color: white; "/> |
|||
</p:column> |
|||
</p:dataTable> |
|||
|
|||
</h:form> |
|||
|
|||
|
|||
<!-- CREAR/EDITAR --> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="540" height="250" modal="true" appendTo="@(body)" > |
|||
|
|||
<h:form > |
|||
<p:growl id="growl" for="productoMsj" showDetail="true" /> |
|||
|
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; margin-bottom: 10px;"> |
|||
<h:outputText value="#{demoBeanUbicacionalmacen.titulo}"/></h3> |
|||
|
|||
<h:panelGrid id="grid" columns="3" > |
|||
<p:outputLabel style="font-weight:bolder" value="Bodega:" for="bodega"/> |
|||
<p:inputText id="bodega" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.bodega}" title="Bodega" required="true" requiredMessage="Campo requerido."/> |
|||
|
|||
<p:message for="bodega"/> |
|||
<p:outputLabel style="font-weight:bolder" value="Pasillo:" for="pasillo"/> |
|||
<p:inputText id="pasillo" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.pasillo}" title="Pasillo" required="true" requiredMessage="Campo requerido."/> |
|||
<p:message for="pasillo"/> |
|||
<p:outputLabel style="font-weight:bolder" value="Estante:" for="estante"/> |
|||
<p:inputText id="estante" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.estante}" title="Estante" required="true" requiredMessage="Campo requerido."/> |
|||
<p:message for="estante"/> |
|||
<p:outputLabel style="font-weight:bolder" value="Seccion:" for="seccion"/> |
|||
<p:inputText id="seccion" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.seccion}" title="Seccion" required="true" requiredMessage="Campo requerido."/> |
|||
<p:message for="seccion"/> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
|
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" ajax="false" icon="pi pi-times" immediate="true" update="grid, formtabla:tabla, growl" |
|||
style="background-color: red; border-color:red; float: right;"/> |
|||
|
|||
<p:commandButton action="#{demoBeanUbicacionalmacen.agregarUbicacion()}" update="grid, formtabla:tabla, growl" ajax="true" |
|||
rendered="#{demoBeanUbicacionalmacen.nuevo}" icon="pi pi-check" |
|||
style="margin-right: 10px; background-color:green; border-color:green; float: right; " /> |
|||
|
|||
<p:commandButton action="#{demoBeanUbicacionalmacen.editarUbicacion()}" |
|||
update="grid, formtabla:tabla, growl" ajax="true" rendered="#{!demoBeanUbicacionalmacen.nuevo}" icon="pi pi-check" |
|||
style="margin-right: 10px; background-color:green; border-color:green; float: right;" /> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
<!-- ELIMINAR --> |
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="700" height="290" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #036FAB; padding: 30px; color: #FFFFFF; font-size: 2em; margin-bottom: 20px;"> |
|||
<h:outputText value="Eliminar"/></h1> |
|||
|
|||
<div> |
|||
<h:panelGrid columns="2" style="width: 80%"> |
|||
<h:outputLabel style="font-weight:bolder" value="Id:" for="id" /> |
|||
<h:outputText id="id" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.id}" title="Id" /> |
|||
<h:outputLabel style="font-weight:bolder" value="Bodega:" for="bodega" /> |
|||
<h:outputText id="bodega" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.bodega}" title="Bodega"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Pasillo:" for="pasillo" /> |
|||
<h:outputText id="pasillo" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.pasillo}" title="Pasillo"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Estante:" for="estante" /> |
|||
<h:outputText id="estante" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.estante}" title="Estante"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Seccion:" for="seccion" /> |
|||
<h:outputText id="seccion" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.seccion}" title="Seccion" /> |
|||
|
|||
</h:panelGrid> |
|||
</div> |
|||
|
|||
<div style="margin-top: 20px;"> |
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" icon="pi pi-times" ajax="false" immediate="true" |
|||
style="margin-left: 10px; background-color:red; border-color:red; float: right;" /> |
|||
|
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" actionListener="#{demoBeanUbicacionalmacen.eliminarUbicacion()}" |
|||
ajax="false" icon="pi pi-check" |
|||
style=" background-color:green; border-color:green; float: right;"/> |
|||
</div> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<!-- DETALLES --> |
|||
<p:dialog id="dialog3" widgetVar="dlg3" width="900" height="400" modal="true"> |
|||
<h:form> |
|||
<h1 style="text-align: center; background-color: #036FAB; padding: 30px; color: #FFFFFF; font-size: 2em; margin-bottom: 20px;"> |
|||
<h:outputText value="Detalles"/></h1> |
|||
|
|||
<div> |
|||
<p:panelGrid columns="2" style="width: 100%"> |
|||
<h:outputLabel style="font-weight:bolder" value="Id:" for="id" /> |
|||
<h:outputText id="id" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.id}" title="Id" /> |
|||
<h:outputLabel style="font-weight:bolder" value="Bodega:" for="bodega" /> |
|||
<h:outputText id="bodega" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.bodega}" title="Bodega"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Pasillo:" for="pasillo" /> |
|||
<h:outputText id="pasillo" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.pasillo}" title="Pasillo"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Estante:" for="estante" /> |
|||
<h:outputText id="estante" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.estante}" title="Estante"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Seccion:" for="seccion" /> |
|||
<h:outputText id="seccion" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.seccion}" title="Seccion" /> |
|||
|
|||
</p:panelGrid> |
|||
</div> |
|||
|
|||
|
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
</f:view> |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,33 @@ |
|||
<?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> |
|||
mx.edu.tjs.chapala.sistemas.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,29 @@ |
|||
<?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> |
|||
<session-config> |
|||
<session-timeout> |
|||
30 |
|||
</session-timeout> |
|||
</session-config> |
|||
<welcome-file-list> |
|||
<welcome-file>faces/marcaLista.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,60 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>C A T E G O R I A S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
right |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="height: 600px;" class="form-container" > |
|||
<h1><h:outputText value="#{demoBeanCategoria.titulo}"/></h1> |
|||
|
|||
<h:panelGrid id="grid" columns="3"> |
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanCategoria.categoria.nombre}" title="Nombre" required="true" requiredMessage="Falta el campo Nombre." styleClass="formulario-elemento" /> |
|||
<p:message for="nombre"/> |
|||
</h:panelGrid> |
|||
|
|||
<p:commandButton action="#{demoBeanCategoria.agregarCategoria()}" update="grid" rendered="#{demoBeanCategoria.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="categoriaLista.xhtml" actionListener="#{demoBeanCategoria.editarcategoria()}" update="grid" rendered="#{!demoBeanCategoria.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="categoriaLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red; margin-right: 15px;"/> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,63 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>C A T E G O R I A S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="height: 600px;"> |
|||
|
|||
<h1><h:outputText value="Eliminar Categoria" style="left:806px;"/></h1> |
|||
|
|||
<p:panelGrid columns="2" style="width: 100%"> |
|||
<h:outputText value="Id:" style="font-weight:bolder; "/> |
|||
<h:outputText value="#{demoBeanCategoria.categoria.id}" title="Id" style="width: 350px; height: 150px; margin-right: 1000px;"/> |
|||
<h:outputText value="Nombre:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanCategoria.categoria.nombre}" title="Nombre" style="width: 350px; height: 150px; margin-right: 10px;"/> |
|||
<h:outputText value="Status:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanCategoria.categoria.status==1?'Activo':'Inactivo'}" title="Status" style="width: 350px; height: 150px; margin-right: 10px;"/> |
|||
</p:panelGrid> |
|||
<div> |
|||
<p:commandButton action="categoriaLista.xhtml" actionListener="#{demoBeanCategoria.eliminarcategoria()}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="categoriaLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red;"/> |
|||
</div> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,99 @@ |
|||
<?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" |
|||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>C A T E G O R I A S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
|
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="width: 100%"> |
|||
<p:growl id="growl" showDetail="true" /> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{demoBeanCategoria.categorias}" var="item" |
|||
widgetVar="categorias" emptyMessage="No se han encontrado categorias" |
|||
filteredValue="#{demoBeanCategoria.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanCategoria.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="480" > |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="height: 30px;" > |
|||
<div> |
|||
<p:commandButton action="categoriaCrearEditar.xhtml" actionListener="#{demoBeanCategoria.prepararnuevo()}" value="Nuevo" icon="pi pi-plus" /> |
|||
|
|||
<i class="pi pi-search" style="margin-left: 765px; margin-top: 10px;"></i> |
|||
<p:inputText id="globalFilter" onkeyup="PF('categorias').filter()" style="width:300px; margin-left: 10px; margin-top: -40px; float: right;" |
|||
placeholder="Buscar categoria" /> |
|||
|
|||
</div> |
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id" style="font-weight:bolder" /> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}" /> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre" style="font-weight:bolder; float:lefth "/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}" style="margin-left: 400px"/> |
|||
</p:column> |
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones" style="font-weight:bolder"/> |
|||
</f:facet> |
|||
<p:commandButton action="categoriaCrearEditar.xhtml" actionListener="#{demoBeanCategoria.preparareditar(item)}" ajax="false" style="margin-right: 10px; " icon="pi pi-file-edit" /> |
|||
<p:commandButton action="categoriaEliminar.xhtml" actionListener="#{demoBeanCategoria.preparareliminar(item)}" ajax="false" style="background-color: red; color:white; border-color: red; " icon="pi pi-trash"/> |
|||
</p:column> |
|||
|
|||
</p:dataTable> |
|||
</h:form> |
|||
|
|||
|
|||
|
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,93 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>P R O D U C T O S</h2></center> |
|||
</ui:define> |
|||
<ui:define name="left" > |
|||
|
|||
<h:form> |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-fw pi-file" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-fw pi-file" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-fw pi-file" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-fw pi-file" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
|
|||
</ui:define> |
|||
|
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h1><h:outputText value="Eliminar Producto"/></h1> |
|||
<div style="max-height: 550px; overflow-y: auto;"> |
|||
<p:panelGrid id="grid" columns="2" style="width: 100%" > |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.nombre}" title="Nombre"/> |
|||
<h:outputText style="font-weight:bolder" value="Codigo:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.codigo}" title="Codigo"/> |
|||
<h:outputText style="font-weight:bolder" value="Precio:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.precio}" title="Precio"/> |
|||
<h:outputText style="font-weight:bolder" value="Descripcion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.descripcion}" title="Descripcion"/> |
|||
<h:outputText style="font-weight:bolder" value="Stock:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.stock}" title="Stock"/> |
|||
<h:outputText style="font-weight:bolder" value="Fecha Adquisicion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.fechaadquisicion}" title="Fechaadquisicion"> |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
<h:outputText style="font-weight:bolder" value="Estado Producto:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.estadoproducto}" title="Estadoproducto"/> |
|||
<h:outputText style="font-weight:bolder" value="Submarca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.submarca}" title="Submarca"/> |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Categoria:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.categoriaId.nombre}" title="CategoriaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Marca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.marcaId.nombre}" title="MarcaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Proveedor:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.proveedorId.nombre}" title="ProveedorId"/> |
|||
<h:outputText style="font-weight:bolder" value="Ubicacion Almacen:"/> |
|||
|
|||
|
|||
<h:outputText value="#{demoBeanProductos.producto.ubicacionalmacenId.bodega}" title="UbicacionalmacenId" /> |
|||
|
|||
</p:panelGrid> |
|||
</div> |
|||
<p:commandButton style="margin-left: 10px; background-color:green; border-color:green;" action="ProductoLista.xhtml" actionListener="#{demoBeanProductos.eliminarProducto()}" ajax="false" icon="pi pi-check" /> |
|||
|
|||
<label> </label> |
|||
|
|||
<p:commandButton action="ProductoLista.xhtml" icon="pi pi-times" style=" background-color:red; border-color:red;" immediate="true"/> |
|||
|
|||
</h:form> |
|||
|
|||
</f:view> |
|||
|
|||
|
|||
|
|||
|
|||
</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>TODO write content</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,23 @@ |
|||
<?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:h="http://xmlns.jcp.org/jsf/html"> |
|||
<h:head> |
|||
<title>Inventario</title> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
|||
</h:head> |
|||
<h:body> |
|||
|
|||
<h2>login</h2> |
|||
<h:form> |
|||
<h:commandButton value="Login" action="#{login.login()}"/> |
|||
|
|||
</h:form> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</h:body> |
|||
</html> |
@ -0,0 +1,87 @@ |
|||
<?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 |
|||
--> |
|||
<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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <h2>P R O V E E D O R</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
<h:form style="height: 600px;"> |
|||
|
|||
<p:panelGrid columns="2" style="width: 100%" columnClasses="column1,column2" > |
|||
<h:outputText value="Id:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.id}" title="Id"/> |
|||
|
|||
<h:outputText value="Nombre:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre"/> |
|||
|
|||
<h:outputText value="Correo:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.correo}" title="Correo"/> |
|||
|
|||
<h:outputText value="Telefono:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono"/> |
|||
|
|||
<h:outputText value="Direccion:" style=" font-weight:bolder"/> |
|||
<h:outputText value=" #{demoBeanProveedor.proveedor.calle} ##{demoBeanProveedor.proveedor.numero} " title="Direccion"/> |
|||
|
|||
|
|||
|
|||
<h:outputText value="CP:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.cp}" title="Cp"/> |
|||
|
|||
<h:outputText value="Municipio:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.municipio}" title="Municipio"/> |
|||
|
|||
<h:outputText value="Estado:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.estado}" title="Estado"/> |
|||
|
|||
<h:outputText value="Pais:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.pais}" title="Pais"/> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
<div> |
|||
<p:commandButton action="proveedorLista.xhtml" ajax="false" icon="pi pi-arrow-left" style=" width:100px;margin-right: 1150px; margin-top: 20px " /> |
|||
</div> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,68 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>M A R C A S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="height: 600px;" class="form-container" > |
|||
<h1><h:outputText value="#{demoBeanMarca.titulo}"/></h1> |
|||
<h:panelGrid id="grid" columns="3"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanMarca.marca.nombre}" title="Nombre" required="true" requiredMessage="Falta el campo Nombre." styleClass="formulario-elemento" /> |
|||
<p:message for="nombre"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder;" value="Proveedor:" for="proveedorId" /> |
|||
<p:selectOneMenu id="proveedorId" value="#{demoBeanMarca.marca.proveedorId}" converter="selectOneMenuConverter" > |
|||
<f:selectItems value="#{demoBeanProveedor.all}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}" /> |
|||
</p:selectOneMenu> |
|||
|
|||
|
|||
</h:panelGrid> |
|||
|
|||
<p:commandButton action="#{demoBeanMarca.agregarMarca()}" update="grid" rendered="#{demoBeanMarca.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="marcaLista.xhtml" actionListener="#{demoBeanMarca.editarmarca()}" update="grid" rendered="#{!demoBeanMarca.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="marcaLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red; margin-right: 15px;"/> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,60 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>Eliminar Marca</h2></center> |
|||
</ui:define> |
|||
|
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="height: 600px;"> |
|||
|
|||
|
|||
<p:panelGrid columns="2" style="width: 100%" columnClasses="column1,column2"> |
|||
|
|||
<h:outputText value="Id:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanMarca.marca.id}" title="Id"/> |
|||
<h:outputText value="Nombre:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanMarca.marca.nombre}" title="Nombre" /> |
|||
<h:outputText value="Status:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanMarca.marca.status==1?'Activo':'inactivo'}" title="Status" /> |
|||
</p:panelGrid> |
|||
<div> |
|||
<p:commandButton action="marcaLista.xhtml" actionListener="#{demoBeanMarca.eliminarmarca()}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="marcaLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red;"/> |
|||
</div> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,153 @@ |
|||
<?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" |
|||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> |
|||
|
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>M A R C A S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px; " > |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
|
|||
|
|||
|
|||
<ui:define name="content" > |
|||
|
|||
|
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form id="formtabla"> |
|||
<p:growl id="growl" showDetail="true" /> |
|||
|
|||
|
|||
<p:dataTable id="tabla" value="#{demoBeanMarca.marcas}" var="item" |
|||
widgetVar="marcas" emptyMessage="No se han encontrado marcas" |
|||
filteredValue="#{demoBeanMarca.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanMarca.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="480" > |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="height: 30px;" > |
|||
<div> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanMarca.prepararnuevo()}" update=":dialog" value="Nuevo" icon="pi pi-plus" /> |
|||
|
|||
<i class="pi pi-search" style="margin-left: 765px; margin-top: 10px;"></i> |
|||
<p:inputText id="globalFilter" onkeyup="PF('marcas').filter()" style="width:300px; margin-left: 10px; margin-top: -40px; float: right;" |
|||
placeholder="Buscar marca" /> |
|||
|
|||
</div> |
|||
</div> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:column styleClass="columnaId"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id" style="font-weight:bolder" /> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}" /> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre" style="font-weight:bolder"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}" style="margin-left: 170px"/> |
|||
</p:column> |
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Proveedor" style="font-weight:bolder"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.proveedorId.nombre} " style="margin-left: 170px"/> |
|||
</p:column> |
|||
|
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header" > |
|||
<h:outputText value="Opciones" style="font-weight:bolder; margin-right: 90px"/> |
|||
</f:facet> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanMarca.preparareditar(item)}" update=":dialog" style="margin-right: 10px; " icon="pi pi-file-edit" /> |
|||
<p:commandButton action="marcaEliminar.xhtml" actionListener="#{demoBeanMarca.preparareliminar(item)}" style="background-color: red; color:white; border-color: red; " icon="pi pi-trash"/></p:column> |
|||
|
|||
</p:dataTable> |
|||
</h:form> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
<p:dialog id="dialog" widgetVar="dlg" width="400" height="300" modal="true" > |
|||
|
|||
<h:form class="form-container" > |
|||
<h1><h:outputText value="#{demoBeanMarca.titulo}"/></h1> |
|||
<h:panelGrid id="grid" columns="3" style="width: 100%" > |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" /> |
|||
<p:inputText id="nombre" value="#{demoBeanMarca.marca.nombre}" title="Nombre" required="true" requiredMessage="Falta el campo Nombre." styleClass="formulario-elemento; " /> |
|||
<p:message for="nombre"/> |
|||
|
|||
|
|||
<p:outputLabel style="font-weight:bolder;" value="Proveedor:" for="proveedorId" /> |
|||
<p:selectOneMenu id="proveedorId" value="#{demoBeanMarca.marca.proveedorId}" converter="selectOneMenuConverter" > |
|||
<f:selectItems value="#{demoBeanProveedor.all}" var="item" itemLabel="#{item.nombre}" itemValue="#{item}" /> |
|||
</p:selectOneMenu> |
|||
|
|||
</h:panelGrid> |
|||
<div> |
|||
|
|||
<p:commandButton style="margin-left: 10px; background-color:green; border-color:green; " icon="pi pi-check" action="#{demoBeanMarca.agregarMarca()}" update="formtabla:tabla" ajax="false" rendered="#{demoBeanMarca.nuevo}"/> |
|||
|
|||
<p:commandButton action="marcaLista.xhtml" ajax="false" actionListener="#{demoBeanMarca.editarmarca()}" icon="pi pi-check" style="margin-left: 10px; background-color:green; border-color:green;" update="formtabla:tabla" immediate="true" rendered="#{!demoBeanMarca.nuevo}"/> |
|||
|
|||
<p:commandButton action="marcaLista.xhtml" ajax="false" icon="pi pi-times" immediate="true" style="background-color: red; border-color:red;"/> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</div> |
|||
|
|||
</h:form> |
|||
|
|||
|
|||
</p:dialog> |
|||
</f:view> |
|||
|
|||
|
|||
|
|||
</ui:define > |
|||
|
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,49 @@ |
|||
<?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: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/menu1.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <h2> M E N Ú </h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view > |
|||
<h:form style="text-align: center;"> |
|||
<p:commandButton action="ProductoLista.xhtml" value="Productos" ajax="false" style="width: 350px; height: 150px;margin-left:-8px; margin-right: 10px; margin-top: 60px;"/> |
|||
<p:commandButton action="proveedorLista.xhtml" value="Proveedores" ajax="false" style="width: 350px; height: 150px;" /> |
|||
<br/> |
|||
<br/> |
|||
|
|||
<p:commandButton action="marcaLista.xhtml" value="Marcas" ajax="false" style="width: 350px; height: 150px; margin-right: 10px;" /> |
|||
<p:commandButton action="categoriaLista.xhtml" value="Categorias" ajax="false" style="width: 350px; height: 150px; margin-right: 10px; "/> |
|||
<br/> |
|||
<br/> |
|||
|
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" style="width: 350px; height: 150px; margin-right: 10px;"/> |
|||
<p:commandButton action="usuariosLista.xhtml" value="Usuarios" ajax="false" style="width: 350px; height: 150px; margin-right: 10px;"/> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
|
|||
</ui:define > |
|||
|
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,99 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <h2>P R O V E E D O R</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
<h:form style="height: 600px;" class="form-container" > |
|||
<h1><h:outputText value="#{demoBeanProveedor.titulo}"/></h1> |
|||
<h:panelGrid id="grid" columns="3" > |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" style=" font-weight:bolder" /> |
|||
<p:inputText id="nombre" value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="nombre"/> |
|||
|
|||
<p:outputLabel value="Correo:" for="correo" style="font-weight: bolder"/> |
|||
<p:inputText id="correo" value="#{demoBeanProveedor.proveedor.correo}" title="Correo" required="true" validatorMessage="Correo electronico invalido" requiredMessage="Campo requerido" styleClass="formulario-elemento"> |
|||
<f:validateRegex pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" for="correo"/> |
|||
</p:inputText> |
|||
<p:message for="correo"/> |
|||
|
|||
|
|||
<p:outputLabel value="Telefono:" for="telefono" style=" font-weight:bolder" /> |
|||
<p:inputText id="telefono" value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono" required="true" validatorMessage="Solo se aceptan numeros" requiredMessage="Campo requerido" styleClass="formulario-elemento" > |
|||
<f:validateRegex pattern="^[0-9]{7,}" for="telefono"/> |
|||
</p:inputText> |
|||
<p:message for="telefono"/> |
|||
|
|||
<p:outputLabel value="Calle:" for="calle" style=" font-weight:bolder" /> |
|||
<p:inputText id="calle" value="#{demoBeanProveedor.proveedor.calle}" title="Calle" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="calle"/> |
|||
|
|||
<p:outputLabel value="Numero:" for="numero" style=" font-weight:bolder" /> |
|||
<p:inputText id="numero" value="#{demoBeanProveedor.proveedor.numero}" title="Numero" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="numero"/> |
|||
|
|||
<p:outputLabel value="CP:" for="cp" style=" font-weight:bolder" /> |
|||
<p:inputText id="cp" value="#{demoBeanProveedor.proveedor.cp}" title="Cp" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="cp"/> |
|||
|
|||
<p:outputLabel value="Municipio:" for="municipio" style=" font-weight:bolder" /> |
|||
<p:inputText id="municipio" value="#{demoBeanProveedor.proveedor.municipio}" title="Municipio" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="municipio"/> |
|||
|
|||
<p:outputLabel value="Estado:" for="estado" style=" font-weight:bolder" /> |
|||
<p:inputText id="estado" value="#{demoBeanProveedor.proveedor.estado}" title="Estado" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="estado"/> |
|||
|
|||
<p:outputLabel value="Pais:" for="pais" style=" font-weight:bolder" /> |
|||
<p:inputText id="pais" value="#{demoBeanProveedor.proveedor.pais}" title="Pais" required="true" requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="pais"/> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<div> |
|||
<p:commandButton action="#{demoBeanProveedor.agregarProveedor()}" update="grid" rendered="#{demoBeanProveedor.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="proveedorLista.xhtml" actionListener="#{demoBeanProveedor.editarProveedor()}" update="grid" rendered="#{!demoBeanProveedor.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="proveedorLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red; margin-right: 15px;"/> |
|||
</div> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,80 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <h2>P R O V E E D O R</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
<h:form style="height: 600px;"> |
|||
<h1><h:outputText value="Eliminar"/></h1> |
|||
<p:panelGrid columns="2" style="width: 100%" columnClasses="column1,column2" > |
|||
<h:outputText value="Id:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.id}" title="Id"/> |
|||
<h:outputText value="Nombre:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre"/> |
|||
<h:outputText value="Correo:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.correo}" title="Correo"/> |
|||
<h:outputText value="Telefono:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono"/> |
|||
|
|||
<h:outputText value="Direccion:" style=" font-weight:bolder"/> |
|||
<h:outputText value=" #{demoBeanProveedor.proveedor.calle} ##{demoBeanProveedor.proveedor.numero} " title="Direccion"/> |
|||
|
|||
<h:outputText value="CP:" style="font-weight: bolder" /> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.cp}" title="Cp"/> |
|||
<h:outputText value="Municipio:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.municipio}" title="Municipio"/> |
|||
<h:outputText value="Estado:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.estado}" title="Estado"/> |
|||
<h:outputText value="Pais:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.pais}" title="Pais"/> |
|||
|
|||
<h:outputText value="Status:" style="font-weight: bolder" title="Status"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.status==1?'Activo':'inactivo'}" title="Status" /> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
<div> |
|||
<p:commandButton action="proveedorLista.xhtml" actionListener="#{demoBeanProveedor.eliminarProveedor()}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="proveedorLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red;"/> |
|||
</div> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,299 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <h2>P R O V E E D O R E S</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
<h:form id="formtabla"> |
|||
<p:growl id="growl" showDetail="true" /> |
|||
|
|||
<p:dataTable id="tabla" value="#{demoBeanProveedor.all}" var="item" |
|||
widgetVar="proveedores" emptyMessage="No se han encontrado proveedores" |
|||
filteredValue="#{demoBeanProveedor.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanProveedor.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="480" > |
|||
|
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="height: 30px;" > |
|||
<div> |
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanProveedor.prepararNuevo()}" |
|||
update=":dialog" value="Nuevo" icon="pi pi-plus" /> |
|||
|
|||
<i class="pi pi-search" style="margin-left: 765px; margin-top: 10px;"></i> |
|||
<p:inputText id="globalFilter" onkeyup="PF('proveedores').filter()" placeholder="Buscar proveedor" |
|||
style="width:300px; margin-left: 10px; float: right; margin-top: -40px;" /> |
|||
|
|||
</div> |
|||
</div> |
|||
</f:facet> |
|||
|
|||
<p:column styleClass="columnaId"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Id" style=" font-weight:bolder;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.id}" /> |
|||
</p:column> |
|||
|
|||
<p:column style="text-align: center"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Nombre" style="font-weight:bolder; "/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.nombre}"/> |
|||
</p:column> |
|||
|
|||
<p:column style="text-align: center"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Correo" style=" font-weight:bolder;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.correo}"/> |
|||
</p:column> |
|||
|
|||
<p:column styleClass="columnaTel"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Telefono" style=" font-weight:bolder;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.telefono}"/> |
|||
</p:column> |
|||
|
|||
|
|||
|
|||
<p:column styleClass="columnas" > |
|||
<f:facet name="header"> |
|||
<h:outputText value="Estado" style=" font-weight:bolder;"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.estado}"/> |
|||
</p:column> |
|||
|
|||
<p:column styleClass="columnas" > |
|||
<f:facet name="header"> |
|||
<h:outputText value="Pais" style=" font-weight:bolder; "/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.pais}"/> |
|||
</p:column> |
|||
|
|||
|
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones" style=" font-weight:bolder;"/> |
|||
</f:facet> |
|||
|
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg').show();" actionListener="#{demoBeanProveedor.prepararEditar(item)}" |
|||
icon="pi pi-file-edit" update=":dialog" style="margin-right: 10px "/> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg2').show();" actionListener="#{demoBeanProveedor.prepararEliminar(item)}" |
|||
icon="pi pi-trash" update=":dialog2" style="background-color: red; border-color: red; color:white; "/> |
|||
|
|||
<p:commandButton ajax="true" oncomplete="PF('dlg3').show();" actionListener="#{demoBeanProveedor.prepararEditar(item)}" |
|||
icon="pi pi-eye" update=":dialog3" |
|||
style="background-color: #88DC65;border-color:#88DC65; color:black; margin-right: 10px; width: 85px; margin-top: 10px" /> |
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
|
|||
|
|||
<!-- CREAR/EDITAR --> |
|||
<p:dialog id="dialog" widgetVar="dlg" width="700" height="490" modal="true" appendTo="@(body)" > |
|||
|
|||
<h:form > |
|||
<p:growl id="growl" for="proveedorMsj" showDetail="true" /> |
|||
|
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; "> |
|||
<h:outputText value="#{demoBeanProveedor.titulo}"/></h3> |
|||
|
|||
<h:panelGrid id="grid" columns="3" style="width: 100%"> |
|||
|
|||
<p:outputLabel value="Nombre:" for="nombre" style=" font-weight:bolder" /> |
|||
<p:inputText id="nombre" value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="nombre"/> |
|||
|
|||
<p:outputLabel value="Correo:" for="correo" style="font-weight: bolder"/> |
|||
<p:inputText id="correo" value="#{demoBeanProveedor.proveedor.correo}" title="Correo" required="true" |
|||
validatorMessage="Correo electronico invalido" requiredMessage="Campo requerido" styleClass="formulario-elemento" > |
|||
<f:validateRegex pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" for="correo"/> |
|||
</p:inputText> |
|||
<p:message for="correo"/> |
|||
|
|||
|
|||
<p:outputLabel value="Teléfono:" for="telefono" style="font-weight: bolder" /> |
|||
<p:inputText id="telefono" value="#{demoBeanProveedor.proveedor.telefono}" title="Teléfono" required="true" |
|||
validatorMessage="Solo se aceptan números y el numero ser de 7 a 10 dígitos" requiredMessage="Campo requerido" styleClass="formulario-elemento"> |
|||
<f:validateRegex pattern="^\d{7,10}$" for="telefono" /> |
|||
</p:inputText> |
|||
<p:message for="telefono"/> |
|||
|
|||
<p:outputLabel value="Pais:" for="pais" style=" font-weight:bolder" /> |
|||
<p:inputText id="pais" value="#{demoBeanProveedor.proveedor.pais}" title="Pais" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="pais"/> |
|||
|
|||
<p:outputLabel value="Estado:" for="estado" style=" font-weight:bolder" /> |
|||
<p:inputText id="estado" value="#{demoBeanProveedor.proveedor.estado}" title="Estado" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="estado"/> |
|||
|
|||
<p:outputLabel value="Municipio:" for="municipio" style="font-weight: bolder" /> |
|||
<p:inputText id="municipio" value="#{demoBeanProveedor.proveedor.municipio}" title="Municipio" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="municipio"/> |
|||
|
|||
<p:outputLabel value="CP:" for="cp" style=" font-weight:bolder" /> |
|||
<p:inputText id="cp" value="#{demoBeanProveedor.proveedor.cp}" title="Cp" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="cp"/> |
|||
|
|||
|
|||
<p:outputLabel value="Calle:" for="calle" style=" font-weight:bolder" /> |
|||
<p:inputText id="calle" value="#{demoBeanProveedor.proveedor.calle}" title="Calle" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="calle"/> |
|||
|
|||
<p:outputLabel value="Numero:" for="numero" style=" font-weight:bolder" /> |
|||
<p:inputText id="numero" value="#{demoBeanProveedor.proveedor.numero}" title="Numero" required="true" |
|||
requiredMessage="Campo requerido" styleClass="formulario-elemento" /> |
|||
<p:message for="numero"/> |
|||
|
|||
</h:panelGrid> |
|||
|
|||
<div style="margin-top: 30px;"> |
|||
<p:commandButton action="proveedorLista.xhtml" ajax="false" icon="pi pi-times" immediate="true" update="grid, formtabla:tabla, growl" |
|||
style="background-color: red; border-color:red; float: right;"/> |
|||
|
|||
<p:commandButton action="#{demoBeanProveedor.agregarProveedor()}" update="grid, formtabla:tabla, growl" ajax="true" |
|||
rendered="#{demoBeanProveedor.nuevo}" icon="pi pi-check" |
|||
style="margin-right: 10px; background-color:green; border-color:green; float: right; " /> |
|||
|
|||
<p:commandButton action="#{demoBeanProveedor.editarProveedor()}" |
|||
update="grid, formtabla:tabla, growl" ajax="true" rendered="#{!demoBeanProveedor.nuevo}" icon="pi pi-check" |
|||
style="margin-right: 10px; background-color:green; border-color:green; float: right;" /> |
|||
</div> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
|
|||
<!-- ELIMINAR --> |
|||
<p:dialog id="dialog2" widgetVar="dlg2" width="700" height="490" modal="true" > |
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; "> |
|||
<h:outputText value="E L I M I N A R"/></h3> |
|||
|
|||
<h:form> |
|||
|
|||
|
|||
<div> |
|||
<h:panelGrid id="grid" columns="2" style="width: 100%;" cellpadding="10" > |
|||
|
|||
<h:outputText value="Id:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.id}" title="Id"/> |
|||
<h:outputText value="Nombre:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre"/> |
|||
<h:outputText value="Telefono" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono"/> |
|||
<h:outputText value="Correo:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.correo}" title="Correo"/> |
|||
<h:outputText value="Direccion:" style=" font-weight:bolder"/> |
|||
<h:outputText value=" #{demoBeanProveedor.proveedor.calle} ##{demoBeanProveedor.proveedor.numero} " title="Direccion"/> |
|||
<h:outputText value="Municipio" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.municipio}" title="Municipio"/> |
|||
<h:outputText value="CP:" style="font-weight: bolder" /> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.cp}" title="Cp"/> |
|||
<h:outputText value="Estado:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.estado}" title="Estado"/> |
|||
<h:outputText value="Pais:" style="font-weight: bolder" title="Pais"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.pais}" title="Pais"/> |
|||
|
|||
|
|||
|
|||
</h:panelGrid> |
|||
</div> |
|||
|
|||
<div style="margin-top: 5px;"> |
|||
<p:commandButton action="proveedorLista.xhtml" icon="pi pi-times" ajax="false" immediate="true" |
|||
style="margin-left: 10px; background-color:red; border-color:red; float: right;" /> |
|||
|
|||
<p:commandButton action="proveedorLista.xhtml" actionListener="#{demoBeanProveedor.eliminarProveedor()}" |
|||
ajax="false" icon="pi pi-check" |
|||
style=" background-color:green; border-color:green; float: right;"/> |
|||
</div> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
<!-- DETALLES --> |
|||
<p:dialog id="dialog3" widgetVar="dlg3" width="700" height="490" modal="true"> |
|||
<h:form> |
|||
<h3 style="text-align: center; background-color: #036FAB; padding: 30px; color: #FFFFFF; margin-bottom: 20px;"> |
|||
<h:outputText value="D E T A L L E S"/></h3> |
|||
|
|||
<div> |
|||
<h:panelGrid id="grid" columns="2" style="width: 100%;" cellpadding="10" > |
|||
|
|||
<h:outputText value="Id:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.id}" title="Id"/> |
|||
<h:outputText value="Nombre:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.nombre}" title="Nombre"/> |
|||
<h:outputText value="Telefono" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.telefono}" title="Telefono"/> |
|||
<h:outputText value="Correo:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.correo}" title="Correo"/> |
|||
<h:outputText value="Direccion:" style=" font-weight:bolder"/> |
|||
<h:outputText value=" #{demoBeanProveedor.proveedor.calle} ##{demoBeanProveedor.proveedor.numero} " title="Direccion"/> |
|||
<h:outputText value="Municipio" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.municipio}" title="Municipio"/> |
|||
<h:outputText value="CP:" style="font-weight: bolder" /> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.cp}" title="Cp"/> |
|||
<h:outputText value="Estado:" style=" font-weight:bolder"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.estado}" title="Estado"/> |
|||
<h:outputText value="Pais:" style="font-weight: bolder" title="Pais"/> |
|||
<h:outputText value="#{demoBeanProveedor.proveedor.pais}" title="Pais"/> |
|||
|
|||
|
|||
</h:panelGrid> |
|||
</div> |
|||
|
|||
<!-- comment |
|||
<div style="margin-top: 20px;"> |
|||
<p:commandButton action="proveedorLista.xhtml" icon="pi pi-arrow-left" |
|||
style="margin-left: 10px; float: right; width: 100px; " ajax="false" immediate="true"/> |
|||
|
|||
</div> --> |
|||
</h:form> |
|||
</p:dialog> |
|||
|
|||
|
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
|||
|
@ -0,0 +1,146 @@ |
|||
|
|||
#top { |
|||
position: relative; |
|||
background-color: #036fab; |
|||
color: white; |
|||
padding: 10px; |
|||
margin: 0px 0px 10px 0px; |
|||
} |
|||
|
|||
|
|||
|
|||
#left { |
|||
float: left; |
|||
padding: 5px; |
|||
width: 175px; |
|||
height:100%; |
|||
background-color: whitesmoke; |
|||
} |
|||
|
|||
#right { |
|||
float: right; |
|||
background-color: #ece3a5; |
|||
padding: 5px; |
|||
width: 150px; |
|||
} |
|||
|
|||
.center_content { |
|||
position: relative; |
|||
background-color: #dddddd; |
|||
padding: 10px; |
|||
margin-left: 180px; |
|||
|
|||
|
|||
} |
|||
|
|||
.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; |
|||
|
|||
} |
|||
|
|||
#topM { |
|||
position: relative; |
|||
background-color: #036fab; |
|||
color: white; |
|||
padding: 10px; |
|||
margin: 0px 0px 10px 0px; |
|||
} |
|||
.center_contentM { |
|||
position: relative; |
|||
background-color: #dddddd; |
|||
padding: 10px; |
|||
margin: 0px 0px 0px 0px; |
|||
height: 85vh; |
|||
|
|||
} |
|||
|
|||
.formulario-elemento { |
|||
width: 350px; |
|||
|
|||
} |
|||
.selectM{ |
|||
width: 900px; |
|||
} |
|||
|
|||
.form-container { |
|||
|
|||
margin-bottom: 30px; |
|||
} |
|||
|
|||
.column1{ |
|||
width: 20%; |
|||
} |
|||
.column2{ |
|||
width: 80%; |
|||
|
|||
} |
|||
|
|||
.botonMenu{ |
|||
align-content: center; |
|||
align-items: center; |
|||
color:black; |
|||
width: 160px; |
|||
height: 98px; |
|||
margin-right: 2px; |
|||
margin-right: -1px; |
|||
} |
|||
|
|||
.columnaOpc { |
|||
width: 130px; |
|||
text-align: center; |
|||
|
|||
} |
|||
|
|||
.columnaId { |
|||
width: 80px; |
|||
text-align: center; |
|||
|
|||
} |
|||
|
|||
.columnas{ |
|||
width: 98px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.columnaTel{ |
|||
width: 120px; |
|||
text-align: center; |
|||
} |
|||
|
|||
|
|||
|
|||
th.ui-state-default { |
|||
text-align: center !important; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
@ -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; |
|||
} |
@ -0,0 +1,26 @@ |
|||
<?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" class="topM"> |
|||
<ui:insert name="top">Top</ui:insert> |
|||
</div> |
|||
|
|||
<div id="content" class="center_contentM"> |
|||
<ui:insert name="content">Content</ui:insert> |
|||
</div> |
|||
|
|||
</h:body> |
|||
|
|||
</html> |
@ -0,0 +1,48 @@ |
|||
<?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>Inventario</title> |
|||
<style> |
|||
|
|||
</style> |
|||
</h:head> |
|||
|
|||
<h:body> |
|||
|
|||
<div id="top"> |
|||
<ui:insert name="top">Top</ui:insert> |
|||
</div> |
|||
|
|||
<div id="left"> |
|||
<ui:insert name="left" >Left</ui:insert> |
|||
</div> |
|||
|
|||
|
|||
<div> |
|||
<div> |
|||
|
|||
|
|||
<div id="content" class="center_content"> |
|||
<ui:insert name="content">Content</ui:insert> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<div id="bottom"> |
|||
|
|||
</div> |
|||
|
|||
</h:body> |
|||
|
|||
</html> |
@ -0,0 +1,72 @@ |
|||
<?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" |
|||
xmlns:f="http://xmlns.jcp.org/jsf/core"> |
|||
|
|||
<body> |
|||
|
|||
<ui:composition template="./template/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>U B I C A C I O N</h2></center> |
|||
</ui:define> |
|||
<ui:define name="left" > |
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
|
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
|
|||
<h:panelGrid id="grid" columns="3" > |
|||
<p:outputLabel style="font-weight:bolder" value="Bodega:" for="bodega"/> |
|||
<p:inputText id="bodega" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.bodega}" title="Bodega" required="true" requiredMessage="CAMPO REQUERIDO."/> |
|||
|
|||
<p:message for="bodega"/> |
|||
<p:outputLabel style="font-weight:bolder" value="Pasillo:" for="pasillo"/> |
|||
<p:inputText id="pasillo" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.pasillo}" title="Pasillo" required="true" requiredMessage="CAMPO REQUERIDO."/> |
|||
<p:message for="pasillo"/> |
|||
<p:outputLabel style="font-weight:bolder" value="Estante:" for="estante"/> |
|||
<p:inputText id="estante" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.estante}" title="Estante" required="true" requiredMessage="CAMPO REQUERIDO."/> |
|||
<p:message for="estante"/> |
|||
<p:outputLabel style="font-weight:bolder" value="Seccion:" for="seccion"/> |
|||
<p:inputText id="seccion" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.seccion}" title="Seccion" required="true" requiredMessage="CAMPO REQUERIDO."/> |
|||
<p:message for="seccion"/> |
|||
|
|||
</h:panelGrid> |
|||
<p:commandButton style="margin-left: 10px; background-color:green; border-color: green" action="#{demoBeanUbicacionalmacen.agregarUbicacion()}" icon="pi pi-check" ajax="false" update="grid" rendered="#{demoBeanUbicacionalmacen.nuevo}"/> |
|||
<label> </label> |
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" ajax="false" actionListener="#{demoBeanUbicacionalmacen.editarUbicacion()}" icon="pi pi-check" style="background-color:green; border-color: green" update="grid" rendered="#{!demoBeanUbicacionalmacen.nuevo}"/> |
|||
<label> </label> |
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" icon="pi pi-times" style="background-color: red; border-color: red" ajax="false" immediate="true"/> |
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,77 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>U B I C A C I O N</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
|
|||
</ui:define> |
|||
|
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form> |
|||
|
|||
<h1><h:outputText value="Eliminar"/></h1> |
|||
<p:panelGrid columns="2" style="width: 100%"> |
|||
<h:outputLabel style="font-weight:bolder" value="Id:" for="id" /> |
|||
<h:outputText id="id" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.id}" title="Id" /> |
|||
<h:outputLabel style="font-weight:bolder" value="Bodega:" for="bodega" /> |
|||
<h:outputText id="bodega" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.bodega}" title="Bodega"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Pasillo:" for="pasillo" /> |
|||
<h:outputText id="pasillo" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.pasillo}" title="Pasillo"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Estante:" for="estante" /> |
|||
<h:outputText id="estante" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.estante}" title="Estante"/> |
|||
<h:outputLabel style="font-weight:bolder" value="Seccion:" for="seccion" /> |
|||
<h:outputText id="seccion" value="#{demoBeanUbicacionalmacen.ubicacionalmacen.seccion}" title="Seccion" /> |
|||
|
|||
</p:panelGrid> |
|||
|
|||
|
|||
|
|||
<p:commandButton style="margin-left: 10px; background-color:green; border-color: green" action="UbicacionAlmacenLista.xhtml" actionListener="#{demoBeanUbicacionalmacen.eliminarUbicacion()}" ajax="false" icon="pi pi-check" /> |
|||
<label> </label> |
|||
<p:commandButton action="UbicacionAlmacenLista.xhtml" icon="pi pi-times" style="background-color: red; border-color: red" ajax="false" immediate="true"/> |
|||
|
|||
|
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,66 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <H2> U S U A R I O S </H2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-database" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="height: 600px;"> |
|||
<h1><h:outputText value="Eliminar Usuario" style="left:806px;"/></h1> |
|||
|
|||
<p:panelGrid columns="3" style="width: 100%"> |
|||
<h:outputText value="Id:" style="font-weight:bolder; margin-right: 240px"/> |
|||
<h:outputText value="#{demoBeanUsuarios.usuarios.id}" title="Id" style="width: 350px; height: 150px; margin-right: 1000px;"/>/> |
|||
<h:outputText value="Usuario:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanUsuarios.usuarios.usuario}" title="Usuario" style="width: 350px; height: 150px; margin-right: 1000px;"/>/> |
|||
<h:outputText value="Contrasenia:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanUsuarios.usuarios.contrasenia}" title="Contraseña" style="width: 350px; height: 150px; margin-right: 1000px;"/>/> |
|||
<h:outputText value="Status:" style="font-weight:bolder" /> |
|||
<h:outputText value="#{demoBeanUsuarios.usuarios.status==1?'Activo':'Inactivo'}" title="Status"/> |
|||
</p:panelGrid> |
|||
<div> |
|||
<p:commandButton action="usuariosLista.xhtml" actionListener="#{demoBeanUsuarios.eliminar()}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;"/> |
|||
<p:commandButton action="usuariosLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red;"/> |
|||
|
|||
</div> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,70 @@ |
|||
<?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/menu1.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <H2> U S U A R I O S </H2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-database" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="right"> |
|||
|
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
|
|||
<h:form style="height: 600px; width:401px " class="form-container"> |
|||
<h1><h:outputText value="#{demoBeanUsuarios.titulo}"/></h1> |
|||
|
|||
<p:panelGrid id="grid" columns="3"> |
|||
<p:outputLabel value="Usuario:" for="usuario" /> |
|||
<p:inputText id="usuario" value="#{demoBeanUsuarios.usuarios.usuario}" title="Usuario" required="true" requiredMessage="campo obligatorio" validatorMessage="el usuario requiere la primera letra mayuscula y porlomenos 5 caracteres" styleClass="formulario-elemento"> |
|||
<f:validateRegex pattern="^[A-Z][a-z]{4,9}$" for="usuario"/> |
|||
</p:inputText> |
|||
<p:messages for="usuario"/> |
|||
<p:outputLabel value="Contraseña:" for="contrasenia" /> |
|||
<p:inputText id="contrasenia" value="#{demoBeanUsuarios.usuarios.contrasenia}" title="Contrasenia" required="true" requiredMessage="campo obligatorio" validatorMessage=" la contraseña requiere 8 caracteres entre letras y numeros" styleClass="formulario-elemento"> |
|||
<f:validateRegex pattern="^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{8}$" for="contrasenia"/> |
|||
</p:inputText> |
|||
<p:messages for="contrasenia"/> |
|||
</p:panelGrid> |
|||
<div> |
|||
<p:commandButton action="#{demoBeanUsuarios.agregar()}" update="grid" rendered="#{demoBeanUsuarios.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="usuariosLista.xhtml" actionListener="#{demoBeanUsuarios.editar()}" update="grid" rendered="#{!demoBeanUsuarios.nuevo}" ajax="false" icon="pi pi-check" style="margin-right: 10px; margin-top: 10px; background-color: green; color:white; border-color:green;" /> |
|||
<p:commandButton action="usuariosLista.xhtml" immediate="true" ajax="false" icon="pi pi-times" style="background-color: red; color:white; border-color: red; margin-right: 15px;"/> |
|||
</div> |
|||
|
|||
|
|||
</h:form> |
|||
</f:view> |
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,103 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center> <H2> U S U A R I O S </H2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left"> |
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-database" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
<f:view> |
|||
<h:form style="width: 100%"> |
|||
<p:growl id="growl" showDetail="true" /> |
|||
|
|||
<p:dataTable value="#{demoBeanUsuarios.all}" var="item" |
|||
widgetVar="Usuarios" emptyMessage="No se han encontrado el usuario" |
|||
filteredValue="#{demoBeanUsuarios.filteredCustomers3}" |
|||
globalFilterFunction="#{demoBeanUsuarios.globalFilterFunction}" |
|||
scrollable="true" scrollHeight="480" > |
|||
<f:facet name="header"> |
|||
<div class="flex justify-content-end" style="height: 30px;" > |
|||
<div> |
|||
<p:commandButton action="usuariosCrearEditar.xhtml" actionListener="#{demoBeanUsuarios.prepararNuevo()}" icon="pi pi-plus" value="Nuevo" ajax="false"/> |
|||
|
|||
<i class="pi pi-search" style="margin-left: 765px; margin-top: 10px;"></i> |
|||
<p:inputText id="globalFilter" onkeyup="PF('usuario').filter()" style="width:300px; margin-left: 10px; margin-top: -40px; float: right;" |
|||
placeholder="Buscar usuarios" /> |
|||
|
|||
</div> |
|||
</div> |
|||
</f:facet> |
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<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="Usuario" style=" font-weight:bolder; float: left"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.usuario}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Contraseña" style=" font-weight:bolder; float: left"/> |
|||
</f:facet> |
|||
<h:outputText value="#{item.contrasenia}"/> |
|||
</p:column> |
|||
|
|||
<p:column> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Status" style=" font-weight:bolder; float: left" /> |
|||
</f:facet> |
|||
<h:outputText value="#{item.status==1?'Activo':'inactivo'}"/> |
|||
</p:column> |
|||
|
|||
<p:column styleClass="columnaOpc"> |
|||
<f:facet name="header"> |
|||
<h:outputText value="Opciones" style=" font-weight:bolder;"/> |
|||
</f:facet> |
|||
|
|||
<p:commandButton action="usuariosCrearEditar.xhtml" actionListener="#{demoBeanUsuarios.prepararEditar(item)}" ajax="false" style="margin-right: 10px; " icon="pi pi-file-edit" /> |
|||
<p:commandButton action="usuarioEliminar.xhtml" actionListener="#{demoBeanUsuarios.prepararEliminar(item)}" ajax="false" style="background-color: red; color:white; border-color: red; " icon="pi pi-trash" /> |
|||
|
|||
</p:column> |
|||
</p:dataTable> |
|||
</h:form> |
|||
</f:view> |
|||
|
|||
|
|||
|
|||
|
|||
</ui:define> |
|||
|
|||
</ui:composition> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,86 @@ |
|||
<?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/principal.xhtml"> |
|||
|
|||
<ui:define name="top"> |
|||
<center><h2>P R O D U C T O</h2></center> |
|||
</ui:define> |
|||
|
|||
<ui:define name="left" > |
|||
|
|||
<h:form > |
|||
<p:menu style="border-color: gray; margin: 1px; width: 163px; height: 600px;"> |
|||
|
|||
<p:menuitem action="ProductoLista.xhtml" value="Productos" ajax="false" icon="pi pi-shopping-bag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="proveedorLista.xhtml" value="Proveedores" ajax="false" icon="pi pi-id-card" iconPos="left" style="background-color: white " styleClass="botonMenu"/> |
|||
<p:menuitem action="marcaLista.xhtml" value="Marcas" ajax="false" icon="pi pi-tag" iconPos="left" style="background-color: lightgray" styleClass="botonMenu" /> |
|||
<p:menuitem action="categoriaLista.xhtml" value="Categorias" ajax="false" icon="pi pi-star" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
<p:menuitem action="UbicacionAlmacenLista.xhtml" value="Almacen" ajax="false" icon="pi pi-map-marker" iconPos="left" style="background-color: lightgray" styleClass="botonMenu"/> |
|||
<p:menuitem action="usuariosLista.xhtml" value="Usuarios" ajax="false" icon="pi pi-users" iconPos="left" style="background-color: white" styleClass="botonMenu" /> |
|||
</p:menu> |
|||
</h:form> |
|||
</ui:define> |
|||
|
|||
<ui:define name="content"> |
|||
|
|||
<f:view> |
|||
|
|||
<h:form style="height: 600px;" class="form-container"> |
|||
<center> |
|||
<h1><h:outputText value="DETALLES DE PRODUCTO"/></h1> |
|||
|
|||
|
|||
<div style="max-height: 550px; overflow-y: auto;"> |
|||
<p:panelGrid id="grid" columns="4" style="width: 100%" > |
|||
|
|||
<h:outputText style="font-weight:bolder; width: 80;height: 70px" value="Nombre:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.nombre}" title="Nombre"/> |
|||
<h:outputText style="font-weight:bolder" value="Codigo:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.codigo}" title="Codigo"/> |
|||
<h:outputText style="font-weight:bolder" value="Precio:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.precio}" title="Precio"/> |
|||
<h:outputText style="font-weight:bolder" value="Descripcion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.descripcion}" title="Descripcion"/> |
|||
<h:outputText style="font-weight:bolder" value="Stock:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.stock}" title="Stock"/> |
|||
<h:outputText style="font-weight:bolder" value="Fecha de dquisicion:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.fechaadquisicion}" title="Fechaadquisicion"> |
|||
<f:convertDateTime pattern="MM/dd/yyyy" /> |
|||
</h:outputText> |
|||
<h:outputText style="font-weight:bolder" value="Estado del producto:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.estadoproducto}" title="Estadoproducto"/> |
|||
<h:outputText style="font-weight:bolder" value="Submarca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.submarca}" title="Submarca"/> |
|||
|
|||
<h:outputText style="font-weight:bolder" value="Categoria:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.categoriaId.nombre}" title="CategoriaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Marca:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.marcaId.nombre}" title="MarcaId"/> |
|||
<h:outputText style="font-weight:bolder" value="Proveedor:"/> |
|||
<h:outputText value="#{demoBeanProductos.producto.proveedorId.nombre}" title="ProveedorId"/> |
|||
<h:outputText style="font-weight:bolder" value="Ubicacion en el almacen:"/> |
|||
<h:outputText value="Bodega: #{demoBeanProductos.producto.ubicacionalmacenId.bodega} , Pasillo: #{demoBeanProductos.producto.ubicacionalmacenId.pasillo} , Estante #{demoBeanProductos.producto.ubicacionalmacenId.estante} , Sección:#{demoBeanProductos.producto.ubicacionalmacenId.seccion}" title="UbicacionalmacenId" /> |
|||
</p:panelGrid> |
|||
</div> |
|||
|
|||
<p:commandButton action="ProductoLista.xhtml" icon="pi pi-arrow-left" style=" width:100px;margin-right: 1150px; margin-top: 20px " ajax="false"/> |
|||
|
|||
</center> |
|||
</h:form> |
|||
|
|||
</f:view> |
|||
|
|||
</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="Inventario" default="default" basedir="." xmlns:ear="http://www.netbeans.org/ns/j2ee-earproject/2"> |
|||
<description>Builds, tests, and runs the project Inventario.</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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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