예제 #1
0
        private void buttonSaveSimple_Click_1(object sender, EventArgs e)
        {
            QuestionModel question = new QuestionModel(this.richTextBoxSimpleQuestion.Text, "Simple", this.test, Convert.ToInt32(this.textBoxSimpleValue.Text));

            question.Answers.Add(new UserChoice(this.textBoxSimpleAnswer.Text));
            question.Choises.Add(new UserChoice(this.textBoxSimpleChoice1.Text));
            question.Choises.Add(new UserChoice(this.textBoxSimpleChoice3.Text));
            question.Choises.Add(new UserChoice(this.textBoxSimpleChoice2.Text));
            if (questionController.AddSimpleQuestion(question))
            {
                MessageBox.Show("Question Successfuly added");
            }
            else
            {
                MessageBox.Show("error");
            }
        }