public void GetAllStudents(IRepository repository) { try { var students = repository.GetAll(); PrintInConsole.PrintAllStudents(students); MenusController.MenuCrud(repository); } catch (CustomException e) { System.Console.WriteLine(Console_Resources.ErrorControl, e); } }
public void UpdateStudent(IRepository repository) { //Obtain all the Students to choose what Student Modify Student student = new Student(); var students = repository.GetAll(); PrintInConsole.PrintAllStudents(students); //Obtain the Id of the student to choose what Student Modify System.Console.WriteLine(Console_Resources.IntroduceTheStudentToModify); var studentIntroduced = Convert.ToInt32(System.Console.ReadLine()); //Obtain the student chose modified. ObtainData(student); //Update the student repository.UpdateStudent(studentIntroduced, student); //Print the Student Modified PrintInConsole.PrintStudentModified(student); //Return to menu MenusController.MenuCrud(repository); }