Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
UyTube_obligatorio_PdA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Juan José Álvarez Pérez
UyTube_obligatorio_PdA
Commits
c020c7bf
Commit
c020c7bf
authored
5 years ago
by
JotaJota96
Browse files
Options
Downloads
Patches
Plain Diff
Ahora los usuarios que ya estaban eliminados, se desvinculan de los nuevos usuarios eliminados
parent
62c71975
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
UyTube_aplicacion/src/Logica/Controladores/CAdmin.java
+17
-0
17 additions, 0 deletions
UyTube_aplicacion/src/Logica/Controladores/CAdmin.java
with
17 additions
and
0 deletions
UyTube_aplicacion/src/Logica/Controladores/CAdmin.java
+
17
−
0
View file @
c020c7bf
...
...
@@ -374,6 +374,18 @@ public class CAdmin implements IAdmin{
// una manda a quitar todoslos videos del usuario a eliminar
this
.
seleccionarUsuario
(
elim
.
getNickname
());
ArrayList
<
DtVideo
>
videos
=
this
.
listarVideosDeUsuario
();
// Para facilitar el algoritmo, agrego a la coleccion (de manera provisoria) los usuarios eliminados
// ¡Recuerdo los nicknames para sacarlos despues!
ArrayList
<
String
>
nicksProvisorios
=
new
ArrayList
();
try
{
for
(
Usuario
u
:
new
UsuarioJpaController
().
findUsuarioEliminadoEntities
()){
nicksProvisorios
.
add
(
u
.
getNickname
());
this
.
usuarios
.
put
(
u
.
getNickname
(),
u
);
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
());
}
for
(
Map
.
Entry
<
String
,
Usuario
>
it
:
usuarios
.
entrySet
()){
if
(
it
.
getValue
().
getNickname
().
equals
(
elim
.
getNickname
()))
continue
;
...
...
@@ -395,6 +407,11 @@ public class CAdmin implements IAdmin{
}
}
// quito de la coleccion los usuarios que estaban eliminados y agregue provisoriamente antes del for
for
(
String
s
:
nicksProvisorios
){
this
.
usuarios
.
remove
(
s
);
}
// obtiene la fecha actual
java
.
util
.
Date
utilDate
=
new
java
.
util
.
Date
();
java
.
sql
.
Date
hoy
=
new
java
.
sql
.
Date
(
utilDate
.
getTime
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment