Esempio n. 1
0
        public ActionResult Edit(Guid id)
        {
            QuestionnaireModel model = new QuestionnaireModel();
            var info = service.GetById(id);

            model.Title = info.Title;
            model.Desc  = info.Desc;
            model.Id    = info.Id;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
Esempio n. 2
0
        public async Task <IActionResult> GetById(string id)
        {
            try
            {
                var model = await _questionnaireService.GetById(id);

                if (model == null)
                {
                    return(NotFound());
                }

                return(Ok(model));
            }
            catch (AppException ex)
            {
                _response         = new ServiceResponse();
                _response.message = ex.Message;
                return(StatusCode(StatusCodes.Status400BadRequest, _response));
            }
            catch (Exception ex)
            {
                _response         = new ServiceResponse();
                _response.message = "Something went wrong, " + ex.Message.ToString();
                return(StatusCode(StatusCodes.Status500InternalServerError, _response));
            }
        }
Esempio n. 3
0
        public ActionResult Index(Guid QuestionSurveyId, string Title)
        {
            service.GetQuestionSurveyId(QuestionSurveyId);

            QuestionnaireProblemCondition condition = new QuestionnaireProblemCondition()
            {
                QuestionSurveyId = QuestionSurveyId, Title = Title
            };
            var news   = service.SearchQuestionnaireProblem(condition);
            var models = new PagedList <QuestionnaireProblem>(news, news.Paging);

            ViewBag.QuestionSurveyId = QuestionSurveyId;
            ViewBag.QuestionTitle    = QuestionnaireService.GetById(QuestionSurveyId).Title;

            return(View(PluginHelper.GetViewPath(this.GetType(), "Index"), models));
        }