Exemplo n.º 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();
        }
Exemplo n.º 2
0
        public static Reunion create(MySqlDataReader reader, int codigoAlumno, int codigoProfesor)
        {
            Alumno   alumno   = AlumnoPersistance.getAlumnoByCodigo(codigoAlumno);
            Profesor profesor = ProfesorPersistance.getProfesorByCodigo(codigoProfesor);
            string   fecha    = reader["fecha"].ToString().Split(' ')[0];
            string   tem      = reader["tema"].ToString();
            string   sug      = reader["sugerencias"].ToString();

            return(new Reunion(alumno, profesor, fecha, tem, sug));
        }