public ActionResult AllStudents() { Faculty faculty = new Faculty(); List <StudentDetails> details = faculty.AllStudents(); return(View(details)); }
private static char ChooseOptions() { Console.Write("\nYour option: "); var option = Console.ReadKey().KeyChar; Console.WriteLine(); try { switch (option) { case '1': AddSpeciality(); return('1'); case '2': if (faculty.SpecialityNum() == 0) { throw new ArgumentException("There aren't any specialities"); } else { AddFlow(); } return('2'); case '3': if (faculty.FlowsNum() == 0) { throw new ArgumentException("There aren't any flows"); } else { AddGroup(); } return('3'); case '4': if (faculty.GroupsNum() == 0) { throw new ArgumentException("There aren't any groups"); } else { AddStudent(); } return('4'); case '5': if (faculty.AllStudents() == 0) { throw new ArgumentException("There aren't any students"); } else { RemoveStudent(); } return('5'); case '6': if (faculty.GroupsNum() == 0) { throw new ArgumentException("There aren't any groups"); } else { SetSubjects(); } return('6'); case '7': AmountOfStudents(); return('7'); case '8': if (faculty.GroupsNum() == 0) { throw new ArgumentException("There aren't any groups"); } else { SetSchedule(); } return('8'); case '9': if (faculty.GroupsNum() == 0) { throw new ArgumentException("There aren't any groups"); } else { GetClassDetails(); } return('9'); case 'e': return('e'); default: Console.WriteLine("Please, choose the correct option!"); return('0'); } } catch (Exception e) { Console.WriteLine(e.Message); } return('0'); }