Ejemplo n.º 1
0
        public static void Where_materias()
        {
            Console.WriteLine("\n\n WHERE FROM TABLE");
            Console.WriteLine(" Materias que imparte el maestro Rolando:");

            Maestro maestro = new MaestroSC().GetMaestroWithName("Rolando Valdemar Domínguez Lozano");

            List <string> materias = new GrupoSC()
                                     .GetAllGrupos()
                                     .Where(g => g.Maestro.matricula_maestro == maestro.matricula_maestro)
                                     .Select(g => g.Materia.nombre_materia)
                                     .Distinct()
                                     .ToList();

            materias.ForEach(m =>
            {
                Console.WriteLine(" - " + m);
            });
        }
Ejemplo n.º 2
0
        public static void Where_equipo()
        {
            Grupo grupoLMP = new GrupoSC().GetGroup("Lenguajes Modernos de Programación", 11);

            List <AlumnoDTO> integrantes = grupoLMP
                                           .Alumno
                                           .Select(a => new AlumnoDTO
            {
                Matricula       = a.matricula_alumno,
                Nombre          = a.nombre_alumno,
                ApellidoPaterno = a.apellido_paterno_alumno,
                ApellidoMaterno = a.apellido_materno_alumno
            }).ToList();

            Console.WriteLine("\n\n Integrantes del equipo: ");
            integrantes.ForEach(a =>
            {
                Console.WriteLine(" - " + a.Nombre + " " + a.ApellidoPaterno + " " + a.ApellidoMaterno);
            });
        }