public JsonResult Move(int id, int?parentId, int position, bool copy) { try { var node = _Storage.GetNode(id); if (copy) { var newId = _Storage.CreateCopy(node, parentId, position); if (newId != null) { return(Json(new { status = true, id = newId })); } else { return(Json(new { status = false })); } } else { node.ParentId = parentId; node.Position = position; _Storage.UpdateNode(id, node); return(Json(new { status = true, id = id })); } } catch { return(Json(new { status = false })); } }