Beispiel #1
0
        public static void loadTutores()
        {
            MySqlCommand command = conn.CreateCommand();

            command.CommandText = "select * from profesor where estutor ='1'";
            conn.Open();
            MySqlDataReader reader = command.ExecuteReader();

            tutores = new List <ProfesorTutor>();
            while (reader.Read())
            {
                int           esTutor     = Int32.Parse(reader["esTutor"].ToString());
                int           codigo      = Int32.Parse(reader["codigo"].ToString());
                Profesor      newProfesor = ProfesorFactory.create(reader);
                ProfesorTutor newTutor    = new ProfesorTutor(newProfesor);
                if (esTutor == 1)
                {
                    newTutor.ListaAlumno  = AlumnoPersistance.getAlumnosByProfesor(codigo);
                    newTutor.ListaReunion = ReunionPersistance.getReunionesByProfesor(codigo);
                }

                tutores.Add(newTutor);
            }
            conn.Close();
        }
Beispiel #2
0
        public static void loadTutores()
        {
            MySqlCommand command = conn.CreateCommand();

            command.CommandText = "select * from profesor where estutor ='1'";
            conn.Open();
            MySqlDataReader reader = command.ExecuteReader();
            tutores = new List<ProfesorTutor>();
            while (reader.Read())
            {

                int esTutor = Int32.Parse(reader["esTutor"].ToString());
                int codigo = Int32.Parse(reader["codigo"].ToString());
                Profesor newProfesor = ProfesorFactory.create(reader);
                ProfesorTutor newTutor = new ProfesorTutor(newProfesor);
                if (esTutor == 1)
                {

                    newTutor.ListaAlumno = AlumnoPersistance.getAlumnosByProfesor(codigo);
                    newTutor.ListaReunion = ReunionPersistance.getReunionesByProfesor(codigo);
                }

                tutores.Add(newTutor);
            }
            conn.Close();
        }
Beispiel #3
0
        public ProfesorTutor buscarTutor(int codigo)
        {
            ProfesorTutor p = tutores.Find(delegate(ProfesorTutor p2)
            {
                return(p2.Codigo == codigo);
            });

            return(p);
        }
Beispiel #4
0
        public Profesor buscarProfesor(int codigo)
        {
            ProfesorTutor p = buscarTutor(codigo);

            if (p == null)
            {
                return(null);
            }
            return(p.Profesor);
        }
Beispiel #5
0
        public string agregarReunion(Alumno alumno, Profesor profesor, string fecha, string tema, string sugerencia)
        {
            Reunion       reunion = new Reunion(alumno, profesor, fecha, tema, sugerencia);
            Alumno        al      = buscarAlumno(alumno.Codigo);
            ProfesorTutor prof    = buscarTutor(profesor.Codigo);

            ReunionRepository.insertReunion(fecha, tema, sugerencia, alumno.Codigo, profesor.Codigo);
            al.ListaReuniones.Add(reunion);
            prof.ListaReunion.Add(reunion);
            return("Reunión Agregada");
        }
Beispiel #6
0
 public string agregarProfesorTutor(Profesor profesor)
 {
     if (buscarTutor(profesor.Codigo) == null)
     {
         ProfesorTutor prof = new ProfesorTutor(profesor);
         ProfesorRepository.insertProfesor(profesor);
         tutores.Add(prof);
         return("Profesor agregado con éxito");
     }
     else
     {
         return("El profesor ya existe");
     }
 }
Beispiel #7
0
 public string agregarProfesorTutor(Profesor profesor)
 {
     if (buscarTutor(profesor.Codigo) == null)
     {
         ProfesorTutor prof = new ProfesorTutor(profesor);
         ProfesorRepository.insertProfesor(profesor);
         tutores.Add(prof);
         return "Profesor agregado con éxito";
     }
     else
     {
         return "El profesor ya existe";
     }
 }
Beispiel #8
0
        public List <Reunion> getReuniones(Profesor profesor)
        {
            ProfesorTutor tutor = buscarTutor(profesor.Codigo);

            return(tutor.ListaReunion);
        }
Beispiel #9
0
        public List <Alumno> getAlumnos(Profesor profesor)
        {
            ProfesorTutor tutor = buscarTutor(profesor.Codigo);

            return(tutor.ListaAlumno);
        }