public void AddStudentToRegister(StudentList aStudentList) { if (aStudentList.getCount() == 0) { Console.WriteLine("\n *********************************************************"); Console.WriteLine("\t No hay datos de estudiante."); Console.WriteLine("\n *********************************************************"); } else if (this.SubjectRegisterHeaderAtributes()) { Console.Write("\n Escriba el ID del registro de asignatura que desea editar: "); int id = Convert.ToInt32("0" + Console.ReadLine()); foreach (var subjectRegister in subjectRegisters) { if (subjectRegister.Id == id) { Console.WriteLine("\n Agregar estudiante a registro de asignatura \n"); Console.WriteLine("\t Estudiantes disponibles para agregar a registro de asignatura: \n"); aStudentList.PrintListIdNameCareer(); Console.Write("\n Escriba el ID del estudiante que desea agregar al registro de asignatura: "); int idEst = Convert.ToInt32("0" + Console.ReadLine()); if (aStudentList.GetIdList().Contains(idEst)) { subjectRegister.AddStudentToSubjectRegister(aStudentList.SearchAndReturn(idEst)); } break; } } } }
public void ListStudentsFromSubjectRegister(StudentList aStudentList) { if (aStudentList.getCount() == 0) { Console.WriteLine("\n *********************************************************"); Console.WriteLine("\t No hay datos de estudiante."); Console.WriteLine("\n *********************************************************"); return; } else if (this.SubjectRegisterHeaderAtributes()) { Console.Write("\n Escriba el ID del registro de asignatura que desea editar: "); int id = Convert.ToInt32("0" + Console.ReadLine()); foreach (var subjectRegister in subjectRegisters) { if (subjectRegister.Id == id) { subjectRegister.ListStudentsFromRegister(); return; } } } }