Exemple #1
0
        private void NewAssignment()
        {
            Assignment       assignment;
            AskDetailsUtils  d = new AskDetailsUtils();
            InsertQueryUtils i = new InsertQueryUtils();

            assignment = d.GetAssignmentDetails();
            i.InsertAssignment(assignment.Title, assignment.Description, assignment.SubDateTime, assignment.OralMark, assignment.TotalMark);
        }
Exemple #2
0
        private void NewCourse()
        {
            Course           course;
            AskDetailsUtils  d = new AskDetailsUtils();
            InsertQueryUtils i = new InsertQueryUtils();

            course = d.GetCourseDetails();
            i.InsertCourse(course.Title, course.StartDate, course.EndDate, course.Type, course.Stream);
        }
Exemple #3
0
        private void NewTrainer()
        {
            Trainer          trainer = new Trainer();
            AskDetailsUtils  d       = new AskDetailsUtils();
            InsertQueryUtils i       = new InsertQueryUtils();

            trainer = d.GetTrainerDetails();
            i.InsertTrainer(trainer.FirstName, trainer.LastName, trainer.Subject);
        }
Exemple #4
0
        private void NewStudent()
        {
            AskDetailsUtils adu = new AskDetailsUtils();
            Student         s   = new Student();

            s = adu.GetStudentDetails();
            InsertQueryUtils iq = new InsertQueryUtils();

            iq.InsertStudent(s.FirstName, s.LastName, s.DateOfBirth, s.TuitionFees);
        }
Exemple #5
0
        private void NewTrainerAndCourse()
        {
            InsertQueryUtils iq = new InsertQueryUtils();

            NewCourse();
            int courseID = iq.LastCourseID();
            int trainerID;

            bool repeat = true;

            while (repeat)
            {
                NewTrainer();
                trainerID = iq.LastTrainerID();
                iq.InsertTrainerCourseRelation(courseID, trainerID);

                repeat = SameChoiceQuestion("Do you want to add another trainer in the same course? If so type YES , otherwise press enter (or give any other input). ");
            }
        }
Exemple #6
0
        private void NewAssignmentsPerStudentPerCourse()
        {
            //edw den to ekana oso poluploko tha mporousa gt otan rwtisa sto breafing mas eipate apla nea assignment, students kai courses.
            //opws to exw ftiaxei egw to assignment table exei apla tin ekfwnisi kai ta oral/total marks einai ousiastika ta max
            //για αυτο και έφτιαξα ένα έξτρα πίνακα που κρατάει τις βαθμολογίες αλλά πλέον πάω πολύ μακρυά απο την αρχική υλοποίηση
            // Δεν είμαι σίγουρος τι ακριβώς θέλουμε σε αυτο το ερώτημα οπότε θα το κάνω όπως είπαμε στο briefing
            // και απλα θα περάσω στον StudentSubmittedAssignments τους συνδυασμούς χωρις βαθμολογίες
            InsertQueryUtils iq = new InsertQueryUtils();

            NewCourse();
            int        courseID  = iq.LastCourseID();
            List <int> studentID = new List <int>(); // for multiple students

            bool repeat = true;

            while (repeat)
            {
                NewStudent();
                studentID.Add(iq.LastStudentID());
                iq.InsertStudentCourseRelation(courseID, studentID.Last());

                repeat = SameChoiceQuestion("Do you want to add another student in the same course? If so type YES , otherwise press enter (or give any other input). ");
            }

            List <int> assignmentID = new List <int>();

            repeat = true;

            while (repeat)
            {
                NewAssignment();
                assignmentID.Add(iq.LastAssignmentID());
                iq.InsertAssignmentCourseRelation(courseID, assignmentID.Last());

                repeat = SameChoiceQuestion("Do you want to add another assignment in the same course? If so type YES , otherwise press enter (or give any other input). ");
            }

            // Μέχρι εδω έχω ένα course + students kai course + assignments
            // Η επόμενη Method θα κάνει όλους τους συσχετισμούς στον πινακα StudentSubmittedAssignments

            iq.InsertMultipleStudentSumbittedAssignments(courseID, studentID, assignmentID);
        }