public ActionResult Create(Guid QuestionInfoId, Guid QuestionType)
        {
            QuestionnaireAnswerModel model = new QuestionnaireAnswerModel()
            {
                QuestionInfoId = QuestionInfoId, QuestionType = QuestionType
            };

            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
        public ActionResult Edit(Guid id, Guid QuestionInfoId)
        {
            QuestionnaireAnswerModel model = new QuestionnaireAnswerModel();
            var info = QuestionnaireAnswerService.GetById(id);

            info.QuestionInfoId  = QuestionInfoId;
            model.Title          = info.Title;
            model.QuestionType   = info.QuestionType;
            model.QuestionInfoId = info.QuestionInfoId;
            model.Id             = info.Id;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
 public ActionResult Create(QuestionnaireAnswerModel model)
 {
     if (ModelState.IsValid)
     {
         QuestionnaireAnswer info = new QuestionnaireAnswer();
         info.Id             = Guid.NewGuid();
         info.Title          = model.Title;
         info.QuestionType   = model.QuestionType;
         info.QuestionInfoId = model.QuestionInfoId;
         QuestionnaireAnswerService.Add(info);
         return(Json(new AjaxResult()
         {
             Result = Result.Success
         }));
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
 public ActionResult Edit(QuestionnaireAnswerModel model)
 {
     if (ModelState.IsValid)
     {
         var info = QuestionnaireAnswerService.GetById(model.Id);
         if (info != null)
         {
             info.Id             = model.Id;
             info.Title          = model.Title;
             info.QuestionType   = model.QuestionType;
             info.QuestionInfoId = model.QuestionInfoId;
             QuestionnaireAnswerService.Update(info);
         }
         return(Json(new AjaxResult()
         {
             Result = Result.Success
         }));
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
 }