public ActionResult AddCommonOperations(List <int> navigationIds) { var userId = UserContext.CurrentUser.UserId; List <CommonOperation> commonOperations = new List <CommonOperation>(); if (navigationIds != null) { foreach (var navigationId in navigationIds) { CommonOperation commonOperation = new CommonOperation(); commonOperation.UserId = userId; commonOperation.NavigationId = navigationId; commonOperations.Add(commonOperation); } navigationService.AddCommonOperations(userId, commonOperations); } else { navigationService.ClearUserCommonOperations(userId); } TempData["StatusMessageData"] = new StatusMessageData(StatusMessageType.Success, "更新成功"); return(RedirectToAction("UpdateCommonOperations")); }