Esempio n. 1
0
        //return categories
        public List <string> loadcategories(String user, String lesson)
        {
            List <string> categories = new List <string>();

            categories = db.qUnits(user, lesson);

            return(categories);
        }
Esempio n. 2
0
        //load form
        private void EditQuestionForm_Load(object sender, EventArgs e)
        {
            //values to textboxes
            this.setTitle();
            this.questionTextbox.Text = this.question;
            this.lessonTextbox.Text   = this.lesson;

            //diff level set
            if (this.diff.Equals("Εύκολη"))
            {
                this.diffRadioButton1.Select();
            }
            else if (this.diff.Equals("Μέτρια"))
            {
                this.diffRadioButton2.Select();
            }
            else
            {
                this.diffRadioButton3.Select();
            }

            //get units
            List <string> units = db.qUnits(user, lesson);

            foreach (String unit in units)
            {
                this.unitsComboBox.Items.Add(unit);

                if (unit.Equals(this.unit))
                {
                    this.unitsComboBox.SelectedIndex = this.unitsComboBox.Items.Count - 1;
                }
            }



            //load answers
            answers = db.qAnswers(question, unit, user, lesson);

            this.editQuestionsDataGridView.Rows.Clear();

            foreach (String answer in answers)
            {
                this.editQuestionsDataGridView.Rows.Add(answer);
            }

            //load rows
            rows = this.answers.Count;

            if (rows == 6)
            {
                this.editQuestionsDataGridView.AllowUserToAddRows = false;
            }
        }
Esempio n. 3
0
        //load
        private void EditLessonForm_Load(object sender, EventArgs e)
        {
            this.lessonTextbox.Text = this.lesson;                //set title of lesson to textbox
            this.Text = "Επεξεργασία μαθήματος - " + this.lesson; //set title

            this.desc = db.qLessonDesc(user, lesson);
            this.descriptionTextbox.Text = this.desc;   //set desc to texbox


            this.units = db.qUnits(user, lesson); //get units
            this.fillUnitsDataGridView();         //fill datagridview

            this.unitsDataGridView.ReadOnly = false;
        }