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(); }
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(); }
public ProfesorTutor buscarTutor(int codigo) { ProfesorTutor p = tutores.Find(delegate(ProfesorTutor p2) { return(p2.Codigo == codigo); }); return(p); }
public Profesor buscarProfesor(int codigo) { ProfesorTutor p = buscarTutor(codigo); if (p == null) { return(null); } return(p.Profesor); }
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"); }
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"); } }
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"; } }
public List <Reunion> getReuniones(Profesor profesor) { ProfesorTutor tutor = buscarTutor(profesor.Codigo); return(tutor.ListaReunion); }
public List <Alumno> getAlumnos(Profesor profesor) { ProfesorTutor tutor = buscarTutor(profesor.Codigo); return(tutor.ListaAlumno); }