Beispiel #1
0
 public ProfesorVM(usuarios usuarioLogueado)
 {
     if (usuarioLogueado.roles.Contains("ROLE_ADMIN"))
     {
         CursosImpartidos        = BBDDService.getCursos();
         ProfesorLogueado        = new profesores();
         ProfesorLogueado.nombre = usuarioLogueado.username;
     }
     else
     {
         ProfesorLogueado = BBDDService.getProfesorByUsername(usuarioLogueado.username);
         CursosImpartidos = BBDDService.getCursosByProfesor(ProfesorLogueado.id);
     }
 }
 public AlumnoVM(usuarios usuarioLogueado)
 {
     if (usuarioLogueado.roles.Contains("ROLE_ADMIN"))
     {
         CursosMatriculados    = BBDDService.getCursos();
         AlumnoLogueado        = new alumnos();
         AlumnoLogueado.nombre = usuarioLogueado.username;
         cursos c = new cursos();
     }
     else
     {
         AlumnoLogueado     = BBDDService.getAlumnoByUsername(usuarioLogueado.username);
         CursosMatriculados = new ObservableCollection <cursos>(AlumnoLogueado.cursos);
     }
 }