Пример #1
0
        public IHttpActionResult Save([FromBody] string parameters)
        {
            AssessmentService assessmentService = new AssessmentService();
            var data = assessmentService.Save(parameters);

            return(Ok(data));
        }
Пример #2
0
 public ActionResult CreateAssessment(Assessment Assessment)
 {
     if (ModelState.IsValid)
     {
         string message = AssessmentService.Save(Assessment, User.Identity.Name);
         if (string.IsNullOrEmpty(message))
         {
             TempData["Success"] = Messages.Created;
             return(RedirectToAction("Index"));
         }
         else
         {
             ViewData["Warning"] = message;
         }
     }
     else
     {
         ViewData["Error"] = Messages.InvalidField;
     }
     return(View());
 }