Beispiel #1
0
 public ActionResult Create(HealthAssessmentTemplateEditModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _healthAssessmentTemplateService.SaveTemplate(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
             model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Template is created successfully. You can create more templates or close this page.");
             return(View(model));
         }
         return(View(model));
     }
     catch (Exception ex)
     {
         model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + ex);
         return(View(model));
     }
 }
 public ActionResult QuestionTemplate(HealthAssessmentTemplateEditModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             ModelState.Clear();
             model = _healthAssessmentTemplateService.SaveTemplate(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
             model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Template is created successfully. You can create more templates or close this page.");
             return(PartialView("QuestionTemplateEditModel", model));
         }
         return(PartialView("QuestionTemplateEditModel", model));
     }
     catch (Exception ex)
     {
         _logger.Error(string.Format("System Error: exception- {0} \n stacktrace: {1} ", ex.Message, ex.StackTrace));
         model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage("System Error:" + ex);
         return(PartialView("QuestionTemplateEditModel", model));
     }
 }