public ActionResult DeleteCustomField(int customFieldTableId) { var acResponse = new ActivityResponse(); try { if (customFieldTableId < 1) { acResponse.Code = -1; acResponse.Message = "Invalid selection."; return(Json(acResponse, JsonRequestBehavior.AllowGet)); } _customFieldService.Delete(customFieldTableId); _unitOfWork.SaveChanges(); acResponse.Code = 5; acResponse.Message = "Custom Field was successfully deleted."; return(Json(acResponse, JsonRequestBehavior.AllowGet)); } catch (Exception e) { acResponse.Code = -1; acResponse.Message = "An unknown error was encountered. Please try again."; return(Json(acResponse, JsonRequestBehavior.AllowGet)); } }