Esempio n. 1
0
        private void bt_study_Click(object sender, RoutedEventArgs e)
        {
            TopicSelector topicSelector = new TopicSelector();

            topicSelector.Show();
            this.Close();
        }
Esempio n. 2
0
        private void bt_next_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                next_topic_id = connect.returnconnection_string("SELECT min(topic_id) FROM Topics WHERE topic_fk_course =" + current_course_id + " AND topic_id > " + topic_id);
                if (next_topic_id.Equals(""))
                {
                    int check = Convert.ToInt32(connect.returnconnection_string("SELECT COUNT(1) FROM Student_Course WHERE student_course_fk_student_uid= " + StudentLogin.student_uid + " AND student_course_fk_course_id=" + current_course_id));
                    if (check == 0)
                    {
                        StudentCourseProvider studentCourseProvider = new StudentCourseProvider();
                        studentCourseProvider.student_course_fk_student_uid = StudentLogin.student_uid;
                        studentCourseProvider.student_course_fk_course_id   = current_course_id;
                        MessageBox.Show("provider");

                        StudentCourseHandler studentCourseHandler = new StudentCourseHandler();
                        string user_message = studentCourseHandler.enroll_student(studentCourseProvider);
                        MessageBox.Show(user_message);
                    }

                    TopicSelector topicSelector = new TopicSelector();
                    topicSelector.Show();
                }
                else
                {
                    load_page(current_course_id);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }