Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avaliação Estágio NTI - Fábio Cesar Polinski #9

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build.xml
Original file line number Diff line number Diff line change
@@ -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="Algoritmo1" default="default" basedir=".">
<description>Builds, tests, and runs the project Algoritmo1.</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/Algoritmo1"/>
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.
32 changes: 32 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<servlet>
<servlet-name>SvCliente</servlet-name>
<servlet-class>controle.SvCliente</servlet-class>
</servlet>
<servlet>
<servlet-name>SvProduto</servlet-name>
<servlet-class>controle.SvProduto</servlet-class>
</servlet>
<servlet>
<servlet-name>SvVenda</servlet-name>
<servlet-class>controle.SvVenda</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SvCliente</servlet-name>
<url-pattern>/SvCliente</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SvProduto</servlet-name>
<url-pattern>/SvProduto</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SvVenda</servlet-name>
<url-pattern>/SvVenda</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
28 changes: 28 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/alterarCliente.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="modelo.Cliente"%>

<jsp:useBean class="modelo.DAOCliente" id="dc" scope = "page"></jsp:useBean>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edição de Clientes</title>
</head>

<%
Cliente c = dc.getById(request.getParameter("id"));
%>

<body>
<h3>Edição de Clientes</h3>
<form action="/Algoritmo1/SvCliente" method="POST">
Nome : <br> <input type="text" name="nomeCliente" value="<%=c.getNomeCliente() %>"/> <br>

<input type="hidden" name="cod" value="<%=c.getIdCliente() %>"/> <br>
<input type="hidden" name="ACAO" value="ALTERAR"/>

<input type="submit" value="Alterar" />
<a href="index.html"> <button>Cancelar</button></a>
</form>
</body>
</html>
30 changes: 30 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/alterarProduto.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="modelo.Produto"%>

<jsp:useBean class="modelo.DAOProduto" id="dp" scope = "page"></jsp:useBean>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edição de Produtos</title>
</head>

<%
Produto p = dp.getById(request.getParameter("id"));
%>

<body>
<h3>Edição de Produtos</h3>
<form action="/Algoritmo1/SvProduto" method="POST">
Nome : <br> <input type="text" name="nomeProduto" value="<%=p.getNomeProduto() %>"/> <br>
Quantidade : <br> <input type="text" name="qtdeProduto" value="<%=p.getQtdeProduto() %>"/> <br>
Valor unitario : <br> <input type="text" name="valorProduto" value="<%=p.getValorProduto() %>"/> <br>

<input type="hidden" name="cod" value="<%=p.getIdProduto() %>"/> <br>
<input type="hidden" name="ACAO" value="ALTERAR"/>

<input type="submit" value="Alterar" />
<a href="index.html"> <button>Cancelar</button></a>
</form>
</body>
</html>
33 changes: 33 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/alterarVenda.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<%@page contentType="text/html" pageEncoding="UTF-8" import="modelo.Venda"%>

<jsp:useBean class="modelo.DAOVenda" id="dv" scope = "page"></jsp:useBean>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edição de Vendas </title>
</head>

<%
Venda v = dv.getById(request.getParameter("id"));
%>

<body>
<h3>Edição de Vendas</h3>
<form action="/Algoritmo1/SvVenda" method="POST">
Data: <br> <input type="text" name="dataVenda" value="<%=v.getDataVenda() %>"/> <br>
Id Produto: <br> <input type="text" name="idProduto" value="<%=v.getIdProduto() %>"/> <br>
Quantidade: <br> <input type="text" name="qtdeVenda" value="<%=v.getQtdeVenda() %>"/> <br>
Desconto: <br> <input type="text" name="desconto" value="<%=v.getDesconto() %>"/> <br>
Total: <br> <input type="text" name="totalVenda" value="<%=v.getTotalVenda() %>"/> <br>
Id Cliente <br> <input type="text" name="idCliente" value="<%=v.getIdCliente() %>"/> <br>

<input type="hidden" name="cod" value="<%=v.getIdVenda() %>"/> <br>
<input type="hidden" name="ACAO" value="ALTERAR"/>

<input type="submit" value="Alterar" />
<a href="index.html"> <button>Cancelar</button></a>
</form>
</body>
</html>
27 changes: 27 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/cadCliente.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cadastro de Clientes</title>
</head>
<body>
<h3>Cadastro de Clientes</h3>
<form action="/Algoritmo1/SvCliente" method="POST">
Nome: <br><input type="text" name="nomeCliente" value=""/> <br>
<input type="hidden" name="ACAO" value="INSERIR"/> <br>

<input type="submit" value="Cadastrar" />

</form>
<br>
<a href="index.html"> <button>Cancelar</button></a>

<%
String id = request.getParameter("ins");

if (id != null)
out.println("Cliente inserido com sucesso! ID: "+id);
%>
</body>
</html>
30 changes: 30 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/cadProduto.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cadastro de Produtos</title>
</head>
<body>
<h3>Cadastro de Produtos</h3>
<form action="/Algoritmo1/SvProduto" method="POST">
Nome: <br><input type="text" name="nomeProduto" value=""/> <br>
Quantidade a adicionar: <br><input type="text" name="qtdeProduto" value=""/> <br>
Valor unitário: <br><input type="text" name="valorProduto" value=""/> <br>

<input type="hidden" name="ACAO" value="INSERIR"/> <br>

<input type="submit" value="Cadastrar" />

</form>
<br>
<a href="index.html"> <button>Cancelar</button></a>

<%
String id = request.getParameter("ins");

if (id != null)
out.println("Produto inserido com sucesso! ID: "+id);
%>
</body>
</html>
32 changes: 32 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/cadVenda.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cadastro de Vendas</title>
</head>
<body>
<h1>Cadastro de Vendas</h1>
<form action="/Algoritmo1/SvVenda" method="POST">
Data: <br><input type="text" name="dataVenda" value=""/> <br>
Id Produto: <br><input type="text" name="idProduto" value=""/> <br>
Quantidade: <br><input type="text" name="qtdeVenda" value=""/> <br>
Desconto: <br><input type="text" name="desconto" value=""/> <br>
Total: <br><input type="text" name="totalVenda" value=""/> <br>
Id Cliente <br><input type="text" name="idCliente" value=""/> <br>
<input type="hidden" name="ACAO" value="INSERIR"/> <br>

<input type="submit" value="Cadastrar" />

</form>
<br>
<a href="index.html"> <button>Cancelar</button></a>

<%
String id = request.getParameter("ins");

if (id != null)
out.println("Venda cadastrada com sucesso! ID: "+id);
%>
</body>
</html
30 changes: 30 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<html>
<head>
<title>Fulano Vendas</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h2>Sistema de Gerenciamento de Vendas</h2>
<h3>Cliente</h3>
<a href="cadCliente.jsp"> Cadastrar Cliente </a><br>
<a href="listarCliente.jsp"> Editar Cliente </a><br>
<a href="listarCliente.jsp"> Excluir Cliente </a><br>
<a href="listarCliente.jsp"> Listar Cliente </a><br>

<br>

<h3>Produto</h3>
<a href="cadProduto.jsp"> Cadastrar Produto </a><br>
<a href="listarProduto.jsp"> Editar Produto </a><br>
<a href="listarProduto.jsp"> Excluir Produto </a><br>
<a href="listarProduto.jsp"> Listar Produto </a><br>

<br>

<h3>Vendas</h3>
<a href="cadVenda.jsp"> Cadastrar Venda </a><br>
<a href="listarVenda.jsp"> Listar Venda </a><br>

</body>
</html>
47 changes: 47 additions & 0 deletions algoritmos/Algoritmo 1/Algoritmo1/build/web/listarCliente.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList" %>
<%@page import="modelo.Cliente" %>

<jsp:useBean class="modelo.DAOCliente" id="dc" scope="page"></jsp:useBean>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Lista de Clientes</title>
</head>
<body>
<h2>Clientes</h2>
<table border="1">
<thead>
<tr>
<th>Excluir</th>
<th>Alterar</th>
<th>Nome</th>
</tr>
</thead>
<tbody>

<%
ArrayList<Cliente> cc = dc.pesquisar("SELECT * FROM cliente");

for(Cliente c : cc){
%>

<tr>
<td> <a href="/Algoritmo1/SvCliente?ACAO=EXCLUIR&id=<%=c.getIdCliente()%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;&nbsp;&nbsp; </a> </td>
<td> <a href="alterarCliente.jsp?id=<%=c.getIdCliente()%>"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E&nbsp;&nbsp;&nbsp;&nbsp; </a> </td>
<td> <%=c.getNomeCliente() %> </td>
</tr>
<%
}
%>

</tbody>
</table>
</table>
<br>
<a href="cadCliente.jsp"> <button>Cadastrar Novo</button></a>
<a href="index.html"> <button>Voltar</button></a>
</body>
</html>
Loading