예제 #1
0
        private void AddOpenQuestion()
        {
            OpenQuestion     openQuestion = _subSection.Questions.AddOpenQuestion();
            OpenQuestionForm form         = new OpenQuestionForm();

            form.PickValues(openQuestion);
            form.ShowDialog();
            RefreshQuestions();
        }
예제 #2
0
        private void AddOpenQuestion()
        {
            OpenQuestion     openQuestion = _section.Questions.AddOpenQuestion();
            OpenQuestionForm form         = new OpenQuestionForm();

            form.PickValues(openQuestion);
            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshQuestions();
            }
        }
예제 #3
0
파일: Main.cs 프로젝트: lulzzz/DCAnalytics
        private void EditQuestion(MouseEventArgs e)
        {
            TreeNode treeNode = Tree.GetNodeAt(e.X, e.Y);

            if (!(treeNode.Tag is Question))
            {
                return;
            }
            Question question = treeNode.Tag as Question;

            switch (question.QuestionType)
            {
            case QuestionTypes.Closed:
                ChoiceQuestionForm form = new ChoiceQuestionForm();
                form.PickValues(question as ClosedQuestion);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    treeNode.Text = question.Name;
                }
                break;

            case QuestionTypes.MultipleChoice:
                ChoiceQuestionForm formM = new ChoiceQuestionForm();
                formM.PickValues(question as MultipleChoiceQuestion);
                if (formM.ShowDialog() == DialogResult.OK)
                {
                    treeNode.Text = question.Name;
                }
                break;

            case QuestionTypes.Open:
                OpenQuestionForm formOpen = new OpenQuestionForm();
                formOpen.PickValues(question as OpenQuestion);
                if (formOpen.ShowDialog() == DialogResult.OK)
                {
                    treeNode.Text = question.Name;
                }
                break;
            }
        }
예제 #4
0
파일: Main.cs 프로젝트: lulzzz/DCAnalytics
        private void AddOpenQuestion()
        {
            if (!(Tree.SelectedNode.Tag is Questions))
            {
                return;
            }
            Questions        questions    = Tree.SelectedNode.Tag as Questions;
            OpenQuestion     openQuestion = (OpenQuestion)questions.Add(QuestionTypes.Open);
            OpenQuestionForm openQnFrm    = new OpenQuestionForm();

            openQnFrm.PickValues(openQuestion);
            if (openQnFrm.ShowDialog() == DialogResult.OK)
            {
                TreeNode questionsNode = Tree.SelectedNode;
                if (questionsNode != null)
                {
                    var questionNode = AddToParentNode(questionsNode, openQuestion, openQuestion.Name);
                    questionNode.ImageIndex         = 3;
                    questionNode.SelectedImageIndex = 3;
                }
            }
        }