//------------- Get All Assignments per Course
        public static List <AssignmentPerCourse> GetAssignmentPerCourses()
        {
            List <AssignmentPerCourse> assignmentPerCourses = new List <AssignmentPerCourse>();
            string query = "select c.Title, c.Stream, a.Title, a.Description from Assignment a " +
                           "inner join Course c on c.CourseId = a.CourseId " +
                           "order by c.Title";

            using (SqlConnection con = new SqlConnection(ConString))
            {
                con.Open();
                SqlCommand    sqlCommand = new SqlCommand(query, con);
                SqlDataReader reader     = sqlCommand.ExecuteReader();
                int           count      = 0;
                while (reader.Read())
                {
                    count++;
                    string titleCourse = reader[0].ToString();
                    string stream      = reader[1].ToString();
                    string titleAssign = reader[2].ToString();
                    string description = reader[3].ToString();

                    AssignmentPerCourse APC = new AssignmentPerCourse(count, titleCourse, stream, titleAssign, description);
                    assignmentPerCourses.Add(APC);
                }
            }
            return(assignmentPerCourses);
        }
Example #2
0
        public static void ExportData()
        {
            ShowExportData();
            string input = CheckCorrectValueExporttMenu();

            if (input == "1")
            {
                //Students List
                Student.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "2")
            {
                //Trainers List
                Trainer.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "3")
            {
                //Assignmgents List
                Assignment.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "4")
            {
                //Courses List
                Course.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "5")
            {
                //Students Per Course
                StudentPerCourse.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "6")
            {
                //Trainers Per Course
                TrainerPerCourse.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "7")
            {
                //Assignments Per Course
                AssignmentPerCourse.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "8")
            {
                //Assignments Per Course Per Student
                AssignmentPerCoursePerStudent.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "9")
            {
                //Students than belong to more than one Courses
                StudentCourses.Output();
                Exit.CheckToExitFolderSyntetic();
            }
            else if (input == "10")
            {
                //Exit
                Exit.CheckToExitFolderSyntetic();
            }
        }