Skip to content

Commit

Permalink
Arreglando bug de "presiona enter para continuar"
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaignacioo committed Oct 26, 2021
1 parent fca6094 commit 04e4cd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/main/java/aplicacion/controllers/cli/MenuControllerCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ private void menuPrincipal(short opt) throws IOException {
// Todo: Gráficos
UtilsCLI.imprimirFuncionalidadNoImplementada();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
default:
UtilsCLI.mensajeErrIngresado();
Expand Down Expand Up @@ -117,12 +116,10 @@ private void menuReportes(short opt) throws IOException {
case 1:
this.reportesController.generarListaCurso(this.cursoController);
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 2:
this.reportesController.generarTablaCursos(this.cursoController);
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
default:
UtilsCLI.mensajeErrIngresado();
Expand All @@ -146,28 +143,23 @@ private void menuAsistencia(short opt) throws IOException {
case 1:
this.asistenciaController.alumnoMejorAsistencia();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 2:
// Todo: Registrar asistencia
UtilsCLI.imprimirFuncionalidadNoImplementada();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 3:
this.asistenciaController.alumnosEntrePorcentajesAsistencia();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 4:
this.asistenciaController.alumnoConMasRetiros();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 5:
this.asistenciaController.alumnoEntrePorcentajesRetiros();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
default:
UtilsCLI.mensajeErrIngresado();
Expand All @@ -191,27 +183,22 @@ private void menuAlumnos(short opt) throws IOException {
case 1:
this.alumnoController.agregarAlumno(this.cursoController);
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 2:
this.alumnoController.verAlumno();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 3:
this.alumnoController.verAlumnos(this.cursoController);
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 4:
this.alumnoController.editarAlumno();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 5:
this.alumnoController.eliminarAlumno();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
default:
UtilsCLI.mensajeErrIngresado();
Expand All @@ -235,27 +222,22 @@ private void menuCursos(short opt) throws IOException {
case 1:
this.cursoController.agregarCurso();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 2:
this.cursoController.verDatosCurso();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 3:
this.cursoController.mostrarCursos();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 4:
this.cursoController.asignarNuevoProfesorJefeACurso();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
case 5:
this.cursoController.eliminarCurso();
UtilsCLI.imprimirEsperaEnter();
this.menuCLI.getLector().readLine();
break;
default:
UtilsCLI.mensajeErrIngresado();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/aplicacion/views/cli/UtilsCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
* Clase con utilidades para la interfaz de consola de comandos (CLI).
Expand Down Expand Up @@ -281,6 +282,8 @@ public static void mensajeErrorNoEncontrado(String tipo, int g) {

public static void imprimirEsperaEnter() {
System.out.println("-> Presiona enter para continuar...");
Scanner scanner = new Scanner(System.in);
scanner.nextLine();
}

}

0 comments on commit 04e4cd2

Please sign in to comment.