public static menuIDs assignmentMenu() { //menuID = "140"; Console.WriteLine("Assignment menu\n"); Console.WriteLine("Please choose what you want to do:\n" + "1. back\n" + "2. add a new assignment\n" + "3. add an assignment to a course\n" + "4. see all assignments\n" + "5. see the students who need to submit assignments in a date\n" + "6. see all the assignments per course per student\n" + "7. see all the connections of all assignments\n" + "EXIT to exit program\n"); int selection = Helper.menuSelectionChecker(7, true); menuIDs IDselect = menuIDs.assignmentMenu; switch (selection) { case 1: IDselect = menuIDs.centralMenu; break; case 2: ProjectHelper.addNew(availableTypes.Assignment); break; case 3: ProjectHelper.addToCourse(availableTypes.Assignment); break; case 4: IndividualPartBModel db = new IndividualPartBModel(); HelperDB.showDbByType(db.Assignments.ToList()); break; case 5: ProjectHelper.showAssignmentDates(); break; case 6: HelperDB.showAssignmentPerCoursePerStudentt(); break; case 7: ProjectHelper.showAllConnections(availableTypes.Assignment); break; default: IDselect = menuIDs.exit; break; } if (selection == 4 || selection == 6 || selection == 7) { Console.WriteLine("Please press any key to continue."); Console.ReadKey(); } return(IDselect); }
public static Assignments chooseAssignment() { IndividualPartBModel db = new IndividualPartBModel(); List <Assignments> assignmentList = db.Assignments.ToList(); HelperDB.showDbByType(assignmentList); int listPosition = Helper.menuSelectionChecker(assignmentList.Count, false) - 1; Assignments assignment = assignmentList[listPosition]; return(assignment); }
public static Students chooseStudent() { IndividualPartBModel db = new IndividualPartBModel(); List <Students> studentList = db.Students.OrderBy(x => x.lastName).ToList(); HelperDB.showDbByType(studentList); int listPosition = Helper.menuSelectionChecker(studentList.Count, false) - 1; Students student = studentList[listPosition]; return(student); }
public static Trainers chooseTrainer() { IndividualPartBModel db = new IndividualPartBModel(); List <Trainers> trainerList = db.Trainers.OrderBy(x => x.lastName).ToList(); HelperDB.showDbByType(trainerList); int listPosition = Helper.menuSelectionChecker(trainerList.Count, false) - 1; Trainers trainer = trainerList[listPosition]; return(trainer); }
public static Courses chooseCourse() { IndividualPartBModel db = new IndividualPartBModel(); List <Courses> courseList = db.Courses.ToList(); HelperDB.showDbByType(courseList); int listPosition = Helper.menuSelectionChecker(courseList.Count, false) - 1; Courses course = courseList[listPosition]; return(course); }
public static menuIDs trainertMenu() { //menuID = "130"; Console.WriteLine("Trainer menu\n"); Console.WriteLine("Please choose what you want to do:\n" + "1. back\n" + "2. add a new trainer\n" + "3. see all trainers\n" + "4. assign a trainer to a course\n" + "5. see all the connections of all trainers\n" + "EXIT to exit program\n"); int selection = Helper.menuSelectionChecker(5, true); menuIDs IDselect = menuIDs.trainertMenu; switch (selection) { case 1: IDselect = menuIDs.centralMenu; break; case 2: ProjectHelper.addNew(availableTypes.Trainer); break; case 3: IndividualPartBModel db = new IndividualPartBModel(); HelperDB.showDbByType(db.Trainers.ToList()); break; case 4: ProjectHelper.addToCourse(availableTypes.Trainer); break; case 5: ProjectHelper.showAllConnections(availableTypes.Trainer); break; default: IDselect = menuIDs.exit; break; } if (selection == 3 || selection == 5) { Console.WriteLine("Please press any key to continue."); Console.ReadKey(); } return(IDselect); }
public static menuIDs studentMenu() { //menuID = "120"; Console.WriteLine("Student menu\n"); Console.WriteLine("Please choose what you want to do:\n" + "1. back\n" + "2. add a new student\n" + "3. see all students\n" + "4. see infos about students\n" + "5. add a course to a student\n" + "EXIT to exit program\n"); int selection = Helper.menuSelectionChecker(5, true); menuIDs IDselect = menuIDs.studentMenu; switch (selection) { case 1: IDselect = menuIDs.centralMenu; break; case 2: ProjectHelper.addNew(availableTypes.Student); break; case 3: IndividualPartBModel db = new IndividualPartBModel(); HelperDB.showDbByType(db.Students.ToList()); break; case 4: IDselect = menuIDs.infoStudentMenu; break; case 5: ProjectHelper.addToCourse(availableTypes.Student); break; default: IDselect = menuIDs.exit; break; } if (selection == 3) { Console.WriteLine("Please press any key to continue."); Console.ReadKey(); } return(IDselect); }