public ActionResult Edit(Models.DisabilityCategoryModel disabilitycategory) { if (disabilitycategory.IsValid()) { Data.CRUD.UpdateDisabilityCategory(disabilitycategory, SessionItems.CurrentUser.UserId); return(Json(new Helpers.JsonAjaxResult.result { notFound = false, noAccess = false, errorList = new[] { "" }, success = true })); } return(Json(new Helpers.JsonAjaxResult.result { notFound = false, noAccess = false, errorList = disabilitycategory.ValidationErrors.ToArray(), success = false })); }
public ActionResult Create(Models.DisabilityCategoryModel disabilitycategory) { if (Data.Queries.DoesDisabilityCategoryAlreadyExists(disabilitycategory.Description)) { return(Json(new Helpers.JsonAjaxResult.result { notFound = false, noAccess = false, errorList = new[] { disabilitycategory.Description + " already exists" }, success = true })); } disabilitycategory.ID = 0; if (disabilitycategory.IsValid()) { Data.CRUD.InsertDisabilityCategory(disabilitycategory, SessionItems.CurrentUser.UserId); return(Json(new Helpers.JsonAjaxResult.result { notFound = false, noAccess = false, errorList = new[] { "" }, success = true })); } return(Json(new Helpers.JsonAjaxResult.result { notFound = false, noAccess = false, errorList = disabilitycategory.ValidationErrors.ToArray(), success = false })); }
public ActionResult Edit(int id) { Models.DisabilityCategoryModel disabilitycategory = Data.Objects.GetDisabilityCategory(id); return(View(disabilitycategory)); }