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 {
...
@@ -11,7 +11,7 @@ public class DataBase {
Class
.
forName
(
"org.postgresql.Driver"
);
Class
.
forName
(
"org.postgresql.Driver"
);
con
=
DriverManager
con
=
DriverManager
.
getConnection
(
"jdbc:postgresql://localhost:5432/bootcamp_th"
,
.
getConnection
(
"jdbc:postgresql://localhost:5432/bootcamp_th"
,
"postgres"
,
"
postgres
"
);
"postgres"
,
"
Joserba84
"
);
if
(
con
!=
null
){
if
(
con
!=
null
){
System
.
out
.
println
(
"---> CONNECTED TO SERVER"
);
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 {
...
@@ -20,10 +20,11 @@ public class Filtros extends HttpServlet {
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
List
<
Postulante
>
postulantes
=
listarPostulante
();
List
<
Postulante
>
postulantes
=
listarPostulante
();
String
respuesta
=
req
.
getParameter
(
"id"
);
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"
);
String
nombre
=
req
.
getParameter
(
"nombreBuscar"
)==
null
?
"0"
:
req
.
getParameter
(
"nombreBuscar"
);
System
.
out
.
println
(
nombre
);
if
(
respuesta
!=
null
)
{
if
(
respuesta
!=
null
)
{
System
.
out
.
println
(
valor
);
System
.
out
.
println
(
respuesta
);
update
(
Integer
.
parseInt
(
req
.
getParameter
(
"id"
)),
valor
);
update
(
Integer
.
parseInt
(
req
.
getParameter
(
"id"
)),
valor
);
postulantes
=
listarPostulante
();
postulantes
=
listarPostulante
();
}
else
if
(
nombre
.
length
()
>
1
){
}
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;
...
@@ -72,23 +72,25 @@ import java.util.List;
return
postulante
;
return
postulante
;
}
}
public
static
void
update
(
int
id
,
Boolean
valor
)
{
public
static
void
update
(
int
id
,
String
valor
)
{
if
(
valor
==
true
)
{
String
v
=
valor
;
if
(
v
==
"1"
)
{
try
{
try
{
Connection
con
=
DataBase
.
getConnection
();
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=?"
);
"where id=?"
);
ps
.
setInt
(
1
,
id
);
ps
.
setInt
(
1
,
id
);
ps
.
executeUpdate
();
ps
.
executeUpdate
();
con
.
close
();
con
.
close
();
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ex
.
printStackTrace
();
}
}
}
else
{
}
else
{
try
{
try
{
Connection
con
=
DataBase
.
getConnection
();
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= true
\n
"
+
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= true
"
+
"where id=?"
);
"
where id=?"
);
ps
.
setInt
(
1
,
id
);
ps
.
setInt
(
1
,
id
);
ps
.
executeUpdate
();
ps
.
executeUpdate
();
con
.
close
();
con
.
close
();
...
@@ -97,6 +99,7 @@ import java.util.List;
...
@@ -97,6 +99,7 @@ import java.util.List;
}
}
}
}
}
}
public
static
List
<
Postulante
>
buscarPorNombre
(
String
nombre
)
{
public
static
List
<
Postulante
>
buscarPorNombre
(
String
nombre
)
{
...
...
src/main/webapp/postulante-consulta.jsp
View file @
4469438f
...
@@ -96,14 +96,22 @@
...
@@ -96,14 +96,22 @@
</c:if>
</c:if>
</td>
</td>
<td>
<td>
<c:if
test=
"${postulante.aceptado == true}"
>
<c:choose>
<input
type=
"hidden"
name=
"valor"
value=
"false"
>
<c:when
test=
"${postulante.aceptado == true}"
>
<button><a
href=
"filtros-postulante?id=${postulante.id}"
>
Rechazar
</a></button>
<form
action=
"filtros-postulante"
method=
"get"
>
</c:if>
<input
type=
"hidden"
name=
"valor"
value=
"0"
>
<c:if
test=
"${postulante.aceptado != true}"
>
<input
type=
"hidden"
name=
"id"
value=
"${postulante.id}"
>
<input
type=
"hidden"
name=
"valor"
value=
"true"
>
<button
type=
"submit"
>
Rechazar
</button>
<button><a
href=
"filtros-postulante?id=${postulante.id}"
>
Aceptar
</a></button>
</form>
</c:if>
</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>
</td>
</tr>
</tr>
</c:forEach>
</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