Esempio n. 1
0
        /// <summary>
        /// The semesterViewer method will instantiate, generate, and open a ElementViewer
        /// Form to display the contents of a specified semester object.
        /// </summary>
        /// <param name="semester"></param>
        private void semesterViewer(Semester semester)
        {
            // elements list
            List <String> elements = new List <String>();

            //add all the semester elements to a list of strings
            elements.Add("Year: " + semester.Year);
            elements.Add("Term: " + semester.Term.ToString());
            elements.Add("Minimum Credits: " + semester.MinCredits);
            elements.Add("Maximum Credits: " + semester.MaxCredits);
            elements.Add("Overloadable: " + semester.IsOverloadable.ToString());

            //open a new elment viewer
            this.SuspendLayout();
            ElementViewer semesterDetails =
                new ElementViewer(ref elements, semester.SemesterReference);

            semesterDetails.ShowDialog();
        }
Esempio n. 2
0
        // Viewers --------------------------------------------------------------------------


        /// <summary>
        /// The courseViewer method will instantiate, generate, and open a ElementViewer
        /// Form to display the contents of a specified course object.
        /// </summary>
        /// <param name="course"></param>
        private void courseViewer(Course course)
        {
            // elements list
            List <String> elements = new List <string>();

            //get dependencies
            String dependencies = "";

            foreach (Course dependency in course.dependencies)
            {
                dependencies += dependency.courseReference + ", ";
            }
            dependencies = dependencies.Trim(' ', ',');

            //get copendencies
            String copendencies = "";

            foreach (Course copendency in course.copendencies)
            {
                copendencies += copendency.courseReference + ", ";
            }
            copendencies = copendencies.Trim(' ', ',');

            //get valid terms
            String terms = "";

            foreach (TermEnums term in course.validTerms)
            {
                terms += term.ToString() + ", ";
            }
            terms = terms.Trim(' ', ',');



            //add all the courses elements to a list of strings
            elements.Add("Course Name: " + course.courseName);
            elements.Add("Course Description: " + course.courseDescription);
            elements.Add("Course Prefix: " + course.coursePrefix);
            elements.Add("Course ID: " + course.courseID);
            elements.Add("Credit hours: " + course.credits);
            elements.Add("Dependencies: " + dependencies);
            elements.Add("Copendencies: " + copendencies);
            elements.Add("Valid Terms: " + terms);

            // print additional course details
            elements.Add("Additional details: ");

            if (course.courseDetails.UndergraduateLevel)
            {
                elements.Add("-Course Level: " + "Undergraduate");
            }
            else
            {
                elements.Add("-Course Level: " + "Graduate");
            }

            if (course.courseDetails.CreditsRequired.HasValue)
            {
                elements.Add("-Required taken Credits: " + course.courseDetails.CreditsRequired);
            }
            if (course.courseDetails.YearBase.HasValue)
            {
                elements.Add("-Year Rotation Base: " + course.courseDetails.YearBase);
                elements.Add("-Year Rotation Multiplier: " + course.courseDetails.YearMultiple);
            }
            if (!course.courseDetails.RequiredStanding.Equals(Objects.Standing.FRESHMAN))
            {
                elements.Add("-Required standing level: " + course.courseDetails.RequiredStanding.ToString());
            }
            if (course.courseDetails.GeneralElective)
            {
                elements.Add("-Fullfills general elective requirements");
            }
            if (course.courseDetails.DegreeElective)
            {
                elements.Add("-Fullfills degree elective requirements");
            }
            if (course.courseDetails.DualCredit)
            {
                elements.Add("-Fullfills dual credit");
            }

            //open a new element viewer
            this.SuspendLayout();
            ElementViewer courseDetails =
                new ElementViewer(ref elements, course.courseReference);

            courseDetails.ShowDialog();
        }