public List <Assignments_Course> DatabaseAssignmentsCourse(List <Assignment> assignments, List <Course> courses) { List <Assignment> AssignmentsListFT = new List <Assignment>(); AssignmentsListFT.Add(assignments[0]); AssignmentsListFT.Add(assignments[2]); List <Assignment> AssignmentsListPT = new List <Assignment>(); AssignmentsListPT.Add(assignments[1]); AssignmentsListPT.Add(assignments[3]); Assignments_Course AC1 = new Assignments_Course(AssignmentsListFT, courses[0]); Assignments_Course AC2 = new Assignments_Course(AssignmentsListFT, courses[2]); Assignments_Course AC3 = new Assignments_Course(AssignmentsListPT, courses[1]); Assignments_Course AC4 = new Assignments_Course(AssignmentsListPT, courses[3]); Assignments_Course AC5 = new Assignments_Course(DatabaseAssignments(), courses[4]); List <Assignments_Course> listofassignments_courses = new List <Assignments_Course>(); listofassignments_courses.Add(AC1); listofassignments_courses.Add(AC2); listofassignments_courses.Add(AC3); listofassignments_courses.Add(AC4); listofassignments_courses.Add(AC5); return(listofassignments_courses); }
public static Assignments_Course CourseAssignments(List <Course> courses, List <Assignment> assignments) { Console.WriteLine("Continue with Assignments and courses."); Console.WriteLine("Choose a course from the list below by typing it's number"); CourseTitles(courses); Console.WriteLine(); Console.Write("Enter the number of the course: "); Course courseselected = courses[Convert.ToInt32(Console.ReadLine()) - 1]; Console.WriteLine(); Console.WriteLine("Choose assignments from the list below by typing it's number"); AssignmentTitles(assignments); Console.WriteLine(); Console.Write("Enter the number of the assignment/assignments with a comma (,) between: "); string Choice = Console.ReadLine(); Choice = Choice.Replace(",", ""); int[] Choices = new int[Choice.Length]; for (int i = 0; i < Choice.Length; i++) { Choices[i] = Convert.ToInt32(Choice[i] - '0'); } List <Assignment> listofassignments_Chosen = new List <Assignment>(); foreach (var item in Choices) { listofassignments_Chosen.Add(assignments[item - 1]); } Assignments_Course AC1 = new Assignments_Course(listofassignments_Chosen, courseselected); return(AC1); }