Ejemplo n.º 1
0
        private void View_CourseClick(object sender, RoutedEventArgs e)
        {
            ViewCourses viewCourse = new ViewCourses(student);

            this.Close();
            viewCourse.Show();
        }
Ejemplo n.º 2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            ViewCourses vs = new ViewCourses(student);

            this.Close();
            vs.Show();
        }
Ejemplo n.º 3
0
        private void Add_Course_Button(object sender, RoutedEventArgs e)
        {
            if (CourseNumberTB.Text == "" || courseNameTB.Text == "" ||
                MeetingTimeTB.Text == "" || DateOfCourse.SelectedDate == null)
            {
                MessageBox.Show("Please enter all information");
            }
            else
            {
                FileReadWrite file        = new FileReadWrite();
                int           courseNum   = Convert.ToInt32(CourseNumberTB.Text);
                string        courseName  = courseNameTB.Text;
                string        meetingTime = MeetingTimeTB.Text;
                DateTime      courseDate  = (DateTime)DateOfCourse.SelectedDate;


                Course course = new Course(courseNum, courseName, meetingTime, courseDate);
                student.AddCourse(course);
                file.AddCourseToFile(student, course);
                ViewCourses viewCourse = new ViewCourses(student);

                this.Close();
                viewCourse.Show();
            }
        }
        private void delete_button_Click(object sender, RoutedEventArgs e)
        {
            if (deleteCB.SelectedItem == null)
            {
                MessageBox.Show("Please select an item to delete.");
            }
            else
            {
                oldCourse = student.CourseList[deleteCB.SelectedIndex];
                student.DeleteCourse(deleteCB.SelectedIndex);
                FileReadWrite file = new FileReadWrite();


                file.DeleteCourseToFile(student, oldCourse);
                ViewCourses vc = new ViewCourses(student);
                this.Close();
                vc.Show();
            }
        }
Ejemplo n.º 5
0
        private void Edit_Button_Click(object sender, RoutedEventArgs e)
        {
            if (courseNumberTB.Text == "" || courseNumberTB.Text == "" ||
                courseMeetingTimeTB.Text == "" || datepicker.SelectedDate == null)
            {
                MessageBox.Show("Please enter all information.");
            }
            else
            {
                FileReadWrite file       = new FileReadWrite();
                Course        EditCourse = new Course(Convert.ToInt32(courseNumberTB.Text),
                                                      courseNameTb.Text, courseMeetingTimeTB.Text, (DateTime)datepicker.SelectedDate);

                student.CourseList[index] = EditCourse;
                file.EditCourseToFile(student, oldCourse, EditCourse);

                ViewCourses vc = new ViewCourses(student);
                this.Close();
                vc.Show();
            }
        }