Ejemplo n.º 1
0
        public List <Assignments_Student> DatabaseAssignmentsStudent(List <Assignment> assignments, List <Student> students)
        {
            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]);

            List <Student> StudentsListCFT = new List <Student>();

            StudentsListCFT.Add(students[0]); StudentsListCFT.Add(students[2]);
            List <Student> StudentsListCPT = new List <Student>();

            StudentsListCPT.Add(students[1]); StudentsListCPT.Add(students[3]);
            List <Student> StudentsListJFT = new List <Student>();

            StudentsListJFT.Add(students[4]);
            List <Student> StudentsListJPT = new List <Student>();

            StudentsListJPT.Add(students[5]); StudentsListJPT.Add(students[6]);

            Assignments_Student AS1 = new Assignments_Student(AssignmentsListFT, StudentsListCFT);
            Assignments_Student AS2 = new Assignments_Student(AssignmentsListFT, StudentsListJFT);
            Assignments_Student AS3 = new Assignments_Student(AssignmentsListPT, StudentsListCPT);
            Assignments_Student AS4 = new Assignments_Student(AssignmentsListPT, StudentsListJPT);
            Assignments_Student AS5 = new Assignments_Student(DatabaseAssignments(), DatabaseStudents());

            List <Assignments_Student> listofAssignments_Students = new List <Assignments_Student>();

            listofAssignments_Students.Add(AS1); listofAssignments_Students.Add(AS2); listofAssignments_Students.Add(AS3);
            listofAssignments_Students.Add(AS4); listofAssignments_Students.Add(AS5);

            return(listofAssignments_Students);
        }
Ejemplo n.º 2
0
        public static Assignments_Student StudentAssignments(List <Assignment> assignments, List <Student> students)
        {
            Console.WriteLine("Continue with Assignments and students.");
            Console.WriteLine("Choose student/students from the list below by typing it's number");
            StudentTitles(students);
            Console.WriteLine();
            Console.Write("Enter the numbers of the students: ");
            string StudentsChosen = Console.ReadLine();

            int[] StudentsArrayChosen = new int[StudentsChosen.Length];
            for (int i = 0; i < StudentsChosen.Length; i++)
            {
                StudentsArrayChosen[i] = Convert.ToInt32(StudentsChosen[i] - '0');
            }

            List <Student> listofstudents_Chosen = new List <Student>();

            foreach (var item in StudentsArrayChosen)
            {
                listofstudents_Chosen.Add(students[item - 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_Student AS1 = new Assignments_Student(listofassignments_Chosen, listofstudents_Chosen);

            return(AS1);
        }