private void Create()
        {
            CategoryReference.Category category = new CategoryReference.Category();
            category.name = nameTextBox.Text;
            MessageBoxResult result = MessageBox.Show("Do you want to create more users?", "Success", MessageBoxButton.YesNo, MessageBoxImage.Information);

            if (result == MessageBoxResult.Yes)
            {
                ClearTextboxes(this);
            }
            else if (result == MessageBoxResult.No)
            {
                Close();
            }
        }
Ejemplo n.º 2
0
        public void CreateQuiz()
        {
            CategoryReference.Category category = new CategoryReference.Category();
            CategoryReference.Question question = new CategoryReference.Question();
            CategoryReference.Answer   answer   = new CategoryReference.Answer();

            category.name        = txtCategoryName.Text;
            question.description = txtQuestionDescription.Text;
            answer.description   = txtAnswerDescription.Text;
            answer.isCorrect     = Convert.ToBoolean(txtIsAnswerCorrect.Text);
            answer.pointAmount   = Convert.ToInt32(txtAnswerPointAmount.Text);

            quizClient.AddCategoryWithQuestionsAndAnswers(category, question, answer);
            ClearTextboxes(this);
            MessageBox.Show("The quiz has been created !");
        }