public static Profesor buscarProfesor(int numeroLegajo) {
   Profesor prof = null;
   if (profesores.isEmpty()) {
     for (Iterator<Profesor> it = (Iterator<Profesor>) profesores.iterator();
         it.hasNext();
         prof = it.next()) {
       if (prof.getNumeroLegajo() == numeroLegajo) return prof;
     }
   }
   return prof;
 }
 public boolean modificar() {
   return Conexion.getInstancia()
       .ejecutarSentencia(
           "UPDATE alumno SET nombreAlumno='"
               + this.getNombreAlumno()
               + "',apellidoAlumno='"
               + this.getApellidoAlumno()
               + "',"
               + "telefono1='"
               + this.getTelefono1()
               + "',telefono2='"
               + this.getTelefono2()
               + "',descripcion='"
               + this.getDescripcion()
               + "',"
               + "foto='"
               + this.getFoto()
               + "',sexo='"
               + this.getSexo()
               + "',idUsuario="
               + usuario.getIdUsuario()
               + ",idProfesor="
               + profesor.getIdProfesor()
               + " WHERE idAlumno ="
               + this.getIdAlumno());
 }
Ejemplo n.º 3
0
 @Override
 public int hashCode() {
   int result = codigo != null ? codigo.hashCode() : 0;
   result = 31 * result + (nombre != null ? nombre.hashCode() : 0);
   result = 31 * result + (duracion != null ? duracion.hashCode() : 0);
   result = 31 * result + (especialidad != null ? especialidad.hashCode() : 0);
   result = 31 * result + (profesor != null ? profesor.hashCode() : 0);
   return result;
 }
 public int agregarConRetorno() {
   System.out.println(
       "INSERT INTO alumno(idUsuario, idProfesor, nombreAlumno, apellidoAlumno, telefono1, telefono2, descripcion, foto, sexo) VALUES ("
           + usuario.getIdUsuario()
           + ", "
           + profesor.getIdProfesor()
           + ", '"
           + nombreAlumno
           + "','"
           + apellidoAlumno
           + "','"
           + telefono1
           + "','"
           + telefono2
           + "','"
           + descripcion
           + "','"
           + foto
           + "','"
           + sexo
           + "')");
   return Conexion.getInstancia()
       .ejecutarSentenciaConRetorno(
           "INSERT INTO alumno(idUsuario, idProfesor, nombreAlumno, apellidoAlumno, telefono1, telefono2, descripcion, foto, sexo) VALUES ("
               + usuario.getIdUsuario()
               + ", "
               + profesor.getIdProfesor()
               + ", '"
               + nombreAlumno
               + "','"
               + apellidoAlumno
               + "','"
               + telefono1
               + "','"
               + telefono2
               + "','"
               + descripcion
               + "','"
               + foto
               + "','"
               + sexo
               + "')");
 }
Ejemplo n.º 5
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Asignatura that = (Asignatura) o;

    if (codigo != null ? !codigo.equals(that.codigo) : that.codigo != null) return false;
    if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false;
    if (duracion != null ? !duracion.equals(that.duracion) : that.duracion != null) return false;
    if (especialidad != that.especialidad) return false;
    return !(profesor != null ? !profesor.equals(that.profesor) : that.profesor != null);
  }
Ejemplo n.º 6
0
  /**
   * This is the action called from the Struts framework.
   *
   * @param mapping The ActionMapping used to select this instance.
   * @param form The optional ActionForm bean for this request.
   * @param request The HTTP Request we are processing.
   * @param response The HTTP Response we are processing.
   * @throws java.lang.Exception
   * @return
   */
  @Override
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    HttpSession session = request.getSession(true);
    String id_departamento = (String) session.getAttribute("usbid");

    Profesor profesor = (Profesor) form;
    String id_profesor = profesor.getUsbid();
    profesor.setNombre(profesor.getApellido() + ", " + profesor.getNombre());

    /* Se obtiene el listado de las planillas llenas no evaluadas por la
     * coordinacion */
    ArrayList<Rendimiento> rendimiento =
        DBMS.getInstance().obtenerPlanillasLlenas(id_profesor, id_departamento);

    session.setAttribute("profesor", profesor);
    request.setAttribute("rendimiento", rendimiento);
    return mapping.findForward(SUCCESS);
  }
Ejemplo n.º 7
0
 public void addMaterie(Profesor profesor) {
   Materie materie = profesor.getMaterie();
   materii.add(materie);
   if (materie.getTeza()) {
     Iterator<Elev> it = Catalog.keySet().iterator();
     while (it.hasNext()) {
       Elev crr_elev = it.next();
       HashMap<Materie, SituatieMaterieBaza> map =
           (HashMap<Materie, SituatieMaterieBaza>) Catalog.get(crr_elev);
       SituatieMaterieCuTeza sit = new SituatieMaterieCuTeza();
       map.put(materie, sit);
     }
   } else {
     Iterator<Elev> it = Catalog.keySet().iterator();
     while (it.hasNext()) {
       Elev crr_elev = it.next();
       HashMap<Materie, SituatieMaterieBaza> map =
           (HashMap<Materie, SituatieMaterieBaza>) Catalog.get(crr_elev);
       SituatieMaterieBaza sit = new SituatieMaterieBaza();
       map.put(materie, sit);
     }
   }
   Centralizator.getCentralizator().addMaterietoClasa(this, profesor);
 }