public ActionResult NewStudySubject(NewStudySubjectViewModel model) { try { if (ModelState.IsValid) { _adminBusinessLogic.CreateStudySubject(model); ViewData.Add("LastActionResult", "Study subject created"); return(RedirectToActionPermanent("StudySubjects")); } return(View(model)); } catch (Exception e) { return(Json(new { result = "ERROR", message = e.Message }, JsonRequestBehavior.AllowGet)); } }