Пример #1
0
        public ActionResult EditExistingQuestion()
        {
            var questions = NodeStore.Ctx.GetQuestions();

            var model = new QuestionListModel
            {
                Questions = questions.Select(question => new QuestionModel(question)).ToList()
            };

            return View(model);
        }
Пример #2
0
        public ActionResult EditExistingQuestion(QuestionListModel model)
        {
            var que = NodeStore.Ctx.GetNode(int.Parse(model.SelectedQuestionId));
           // var que = new QuestionModel(int.Parse(model.SelectedQuestionId), model.SelectedQuestionData);

           // NodeStore.Ctx.InsertQuestion(que);

            var levelNode = new LevelTreeNode(new Question(que.Id,que.Data,que.ParentId));
            levelNode.Answers.AddRange(NodeStore.Ctx.GetAnswers(que.Id));
            NodeStore.Ctx.LevelTree.Push(levelNode);
            
            return RedirectToAction("AddAnswer");
        }