private JsonResult CRUD(Forums entity, int actionType) { int identity = 0; if (actionType == 2) { _IForum.Commit(entity, actionType); return(Json(new { success = true, responseText = "Your message has been deleted!" })); } else { try { identity = _IForum.Commit(entity, actionType == 3 ? 0 : actionType); var model = _IForum.GetCommentsByID(identity); return(Json(model)); } catch (Exception) { return(Json(new { success = false, responseText = "Your message couldn't be sent!" })); } } }