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
75bec4ee
Commit
75bec4ee
authored
May 17, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pruebax' into 'develop'
Pruebax See merge request
!32
parents
5c94329c
4bad4741
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
27 deletions
+26
-27
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
+3
-2
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
+7
-17
src/main/webapp/postulante-consulta.jsp
+16
-8
No files found.
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
View file @
75bec4ee
...
@@ -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 @
75bec4ee
...
@@ -72,30 +72,20 @@ import java.util.List;
...
@@ -72,30 +72,20 @@ 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
)
{
boolean
v
=
valor
.
equals
(
"0"
)
?
false
:
true
;
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=
? where id=?"
);
"where id=?"
);
ps
.
setBoolean
(
1
,
v
);
ps
.
setInt
(
1
,
id
);
ps
.
setInt
(
2
,
id
);
ps
.
executeUpdate
();
ps
.
executeUpdate
();
con
.
close
();
con
.
close
();
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
}
}
else
{
catch
(
Exception
ex
)
{
try
{
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
"update postulante set aceptado= true\n"
+
"where id=?"
);
ps
.
setInt
(
1
,
id
);
ps
.
executeUpdate
();
con
.
close
();
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ex
.
printStackTrace
();
}
}
}
}
}
...
...
src/main/webapp/postulante-consulta.jsp
View file @
75bec4ee
...
@@ -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