Esempio n. 1
0
        /// <summary>
        /// 新建实体时使用
        /// </summary>
        public static CommonOperation New()
        {
            CommonOperation commonOperation = new CommonOperation()
            {

            };
            return commonOperation;
        }
        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");
        }