コード例 #1
0
        private void btnViewRoster_Click(object sender, EventArgs e)
        {
            if (gbRoster.Visible == true)
            {
                gbRoster.Visible   = false;
                btnViewRoster.Text = "View Roster Info";
            }
            else
            {
                gbRoster.Visible   = true;
                btnViewRoster.Text = "Close Roster Info";
            }
            String course   = GetCourse();
            var    students = CourseDB.GetAllStudents(course);

            string studentsInClass = "";

            foreach (var student in students)
            {
                studentsInClass += student.FirstName + student.LastName + Environment.NewLine;
            }

            rtbStudents.Text    = studentsInClass;             //students.ToString();
            txtNumStudents.Text = students.Count().ToString(); // code for the student count in the class
        }
コード例 #2
0
        private void btnViewInstructor_Click(object sender, EventArgs e)
        {
            if (gbInstructor.Visible == true)
            {
                gbInstructor.Visible   = false;
                btnViewInstructor.Text = "View Instructor Info";
            }
            else
            {
                gbInstructor.Visible   = true;
                btnViewInstructor.Text = "Close Instructor Info";
            }
            String course = GetCourse();
            var    name   = CourseDB.GetTeacherName(course);

            txtName.Text = name.Name.ToString();

            var email = CourseDB.GetTeacherEmail(course);

            txtEmail.Text = email.Email.ToString();

            var office = CourseDB.GetTeacherOffice(course);

            txtOffice.Text = office.OfficeLocation.ToString();
        }
コード例 #3
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            List <Class> Classes = CourseDB.GetAllCourses();

            cbClasses.DataSource    = Classes;
            cbClasses.DisplayMember = nameof(Class.ClassNumber);
        }
コード例 #4
0
        private void btnCourseDetails_Click(object sender, EventArgs e)
        {
            if (pnlDetails.Visible == true)
            {
                pnlDetails.Visible    = false;
                btnCourseDetails.Text = "View Course Details";
            }
            else
            {
                pnlDetails.Visible    = true;
                btnCourseDetails.Text = "Close Course Details";
            }
            String course = GetCourse();

            var courseCredits = CourseDB.GetCourseCredits(course);

            txtCredits.Text = courseCredits.Credits.ToString();


            var courseDetails = CourseDB.GetCourseDetails(course);

            rtbDescription.Text = courseDetails.CLDescription.ToString();

            var courseTitle = CourseDB.GetCourseTitle(course);

            txtTitle.Text = courseTitle.Title.ToString();
        }
コード例 #5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // Show course list in list box
            List <Course> courseList = CourseDB.GetCourseList();

            PopulateCourseListBox(courseList);
        }