Пример #1
0
        public ExamGeneration()
        {
            InitializeComponent();

            course = new Course();
            adm    = new Admin();
            adm.Id = 1;
            exam   = new Exam(false, adm);

            courses = CourseDAL.SelectAll();

            for (int i = 0; i < courses.Count; i++)
            {
                ComboboxItem item = new ComboboxItem();
                item.Text  = courses[i].Name;
                item.Value = courses[i].Id;
                CourseNameComboBox.Items.Add(item);
                CourseNameComboBox.SelectedIndex = 0;
            }
            updateCourse();

            exams = ExamDAL.getAll(adm);
            for (int i = 0; i < exams.Count; i++)
            {
                ComboboxItem item = new ComboboxItem();
                item.Text  = exams[i].Id.ToString();
                item.Value = exams[i].Id;
                ExamsComboBox.Items.Add(item);
                ExamsComboBox.SelectedIndex = 0;
            }

            QuestionCollection col = QuestionDAL.GetByType(1);

            MCQnumLabel.Text = col.Count.ToString();
            QuestionCollection col2 = QuestionDAL.GetByType(2);

            TFnumLabel.Text = col2.Count.ToString();
            QuestionCollection col3 = QuestionDAL.GetByType(3);

            EssaynumLabel.Text = col3.Count.ToString();

            updateExamSessions();
        }