Esempio n. 1
0
        // Menu Strip ---------------------------------------------------------------------

        // # Adding items from menu

        // ## Add course from menu

        /// <summary>
        /// The classToolStripMenuItem method is used to instantiate the CourseAdd
        /// Form and handle some other functionality.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void classToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //suspend current window, load new course add window
            this.SuspendLayout();
            CourseAdd newClass = new CourseAdd(ref courseList);

            newClass.ShowDialog();

            //check if action was canceled ie.is getCourse null?
            if (newClass.NewCourse == null)
            {
                return;
            }

            //Add course from course add form to object
            Course newCourse = newClass.NewCourse;

            //add new course object to course list
            courseList.Add(newCourse);

            //update viewer
            updateCourseViewer();

            //update prefixes
            updatePrefixes();
        }
Esempio n. 2
0
        /// <summary>
        /// This function is triggered while adding course button is clicked.
        /// </summary>
        /// <param name="a_sender">It holds the sender.</param>
        /// <param name="a_event">It holds the event.</param>
        private void AddCourse_Click(object a_sender, EventArgs a_event)
        {
            // Open the new form to get the info of the course.
            // The info would be the courseID.
            CourseAdd courseAdd = new CourseAdd(m_parentProfile.m_userEmail);

            courseAdd.ShowDialog();

            ExecuteGetRequest();
        }
        /// <summary>
        /// This function is triggered when enrolling in a course.
        /// </summary>
        /// <param name="a_sender">It holds the sender.</param>
        /// <param name="a_event">It holds the event.</param>
        private void EnrollCourseTile_Click(object a_sender, EventArgs a_event)
        {
            CourseAdd addCourse = new CourseAdd(m_parent.m_userEmail);

            addCourse.ShowDialog();
        }