예제 #1
0
        private void AddQuestion()
        {
            if (QuestionDropDownList.SelectedValue == "single")
            {
                // Adds the new single question


                QuestionData newQuestion =
                    new Question().AddDefaultSingleQuestion(SurveyId, _displayOrder, _pageNumber,
                                                            Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToSingleQuestionEdit(getSurveyId(), newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else if (QuestionDropDownList.SelectedValue == "matrix")
            {
                // Adds the new parent matrix question H:\SurveyProject\SurveyWAP\Images\
                QuestionData newQuestion =
                    new Question().AddDefaultMatrixQuestion(SurveyId, _displayOrder, _pageNumber,
                                                            Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToMatrixQuestionEdit(SurveyId, newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else
            {
                new Question().AddStaticInformationText(SurveyId, _displayOrder, _pageNumber, QuestionFreeTextBox.Text, txtQuestionID.Text);
                UINavigator.NavigateToSurveyBuilder(SurveyId, MenuIndex);
            }
        }
 private void EditQuestionButton_Click(object sender, System.EventArgs e)
 {
     if (_questionId == -1)
     {
         return;
     }
     else
     {
         UINavigator.NavigateToSingleQuestionEdit(SurveyId, _questionId, (int)ViewState["LibraryId"], MenuIndex);
     }
 }
예제 #3
0
        private void AddQuestionToLibrary()
        {
            if (QuestionDropDownList.SelectedValue == "single")
            {
                // Adds the new single question to the library
                QuestionData newQuestion =
                    new Question().AddDefaultSingleQuestion(_libraryId, Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToSingleQuestionEdit(getSurveyId(), newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else if (QuestionDropDownList.SelectedValue == "matrix")
            {
                // Adds the new parent matrix question to the library
                QuestionData newQuestion =
                    new Question().AddDefaultMatrixQuestion(_libraryId, Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToMatrixQuestionEdit(getSurveyId(), newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else
            {
                new Question().AddStaticInformationText(_libraryId, Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);
                UINavigator.NavigateToLibraryTemplates(getSurveyId(), _libraryId, MenuIndex);
            }
        }