Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ProyectoFinal-Bootcamp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Baez
ProyectoFinal-Bootcamp
Commits
4469438f
Commit
4469438f
authored
May 17, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cambios en filtro postulante
parent
37137d0f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
17 deletions
+29
-17
src/main/java/com/roshka/proyectofinal/DataBase.java
+1
-1
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
+3
-2
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
+9
-6
src/main/webapp/postulante-consulta.jsp
+16
-8
No files found.
src/main/java/com/roshka/proyectofinal/DataBase.java
View file @
4469438f
...
...
@@ -11,7 +11,7 @@ public class DataBase {
Class
.
forName
(
"org.postgresql.Driver"
);
con
=
DriverManager
.
getConnection
(
"jdbc:postgresql://localhost:5432/bootcamp_th"
,
"postgres"
,
"
postgres
"
);
"postgres"
,
"
Joserba84
"
);
if
(
con
!=
null
){
System
.
out
.
println
(
"---> CONNECTED TO SERVER"
);
...
...
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
View file @
4469438f
...
...
@@ -20,10 +20,11 @@ public class Filtros extends HttpServlet {
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
List
<
Postulante
>
postulantes
=
listarPostulante
();
String
respuesta
=
req
.
getParameter
(
"id"
);
boolean
valor
=
Boolean
.
parseBoolean
(
req
.
getParameter
(
"valor"
)
);
String
valor
=
req
.
getParameter
(
"valor"
);
String
nombre
=
req
.
getParameter
(
"nombreBuscar"
)==
null
?
"0"
:
req
.
getParameter
(
"nombreBuscar"
);
System
.
out
.
println
(
nombre
);
if
(
respuesta
!=
null
)
{
System
.
out
.
println
(
valor
);
System
.
out
.
println
(
respuesta
);
update
(
Integer
.
parseInt
(
req
.
getParameter
(
"id"
)),
valor
);
postulantes
=
listarPostulante
();
}
else
if
(
nombre
.
length
()
>
1
){
...
...
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
View file @
4469438f
...
...
@@ -72,23 +72,25 @@ import java.util.List;
return
postulante
;
}
public
static
void
update
(
int
id
,
Boolean
valor
)
{
if
(
valor
==
true
)
{
public
static
void
update
(
int
id
,
String
valor
)
{
String
v
=
valor
;
if
(
v
==
"1"
)
{
try
{
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= false
\n
"
+
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= false
"
+
"where id=?"
);
ps
.
setInt
(
1
,
id
);
ps
.
executeUpdate
();
con
.
close
();
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
}
else
{
try
{
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= true
\n
"
+
"where id=?"
);
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= true
"
+
"
where id=?"
);
ps
.
setInt
(
1
,
id
);
ps
.
executeUpdate
();
con
.
close
();
...
...
@@ -97,6 +99,7 @@ import java.util.List;
}
}
}
public
static
List
<
Postulante
>
buscarPorNombre
(
String
nombre
)
{
...
...
src/main/webapp/postulante-consulta.jsp
View file @
4469438f
...
...
@@ -96,14 +96,22 @@
</c:if>
</td>
<td>
<c:if
test=
"${postulante.aceptado == true}"
>
<input
type=
"hidden"
name=
"valor"
value=
"false"
>
<button><a
href=
"filtros-postulante?id=${postulante.id}"
>
Rechazar
</a></button>
</c:if>
<c:if
test=
"${postulante.aceptado != true}"
>
<input
type=
"hidden"
name=
"valor"
value=
"true"
>
<button><a
href=
"filtros-postulante?id=${postulante.id}"
>
Aceptar
</a></button>
</c:if>
<c:choose>
<c:when
test=
"${postulante.aceptado == true}"
>
<form
action=
"filtros-postulante"
method=
"get"
>
<input
type=
"hidden"
name=
"valor"
value=
"0"
>
<input
type=
"hidden"
name=
"id"
value=
"${postulante.id}"
>
<button
type=
"submit"
>
Rechazar
</button>
</form>
</c:when>
<c:otherwise>
<form
action=
"filtros-postulante"
method=
"get"
>
<input
type=
"hidden"
name=
"valor"
value=
"1"
>
<input
type=
"hidden"
name=
"id"
value=
"${postulante.id}"
>
<button
type=
"submit"
>
Aceptado
</button>
</form>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment