Пример #1
0
        private async void uiAddQuestionButton_Click(object sender, EventArgs e)
        {
            if (CreateQuestionValidation())
            {
                uiAddQuestionButton.Enabled = false;
                int questionId = await teacherController.SQLConnector().AddQuestionAsync(mAllExams[uiExamComboBox.SelectedIndex].ExamId, uiQuestionTextTextBox.Text);

                await teacherController.AddChoice(questionId, mChoiceTextBoxes, mChoiceRadioButtons);

                MessageBox.Show("Question Added!");
                ClearQuestion();
                uiAddQuestionButton.Enabled = true;;
            }
            else
            {
                MessageBox.Show("Make sure all fields are filled");
            }
        }