Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public PublicResult UpdateAdminMenu(UpdateAdminMenuDto dto)
        {
            AdminMenu adminMenu;

            using (var client = DbFactory.CreateClient())
            {
                adminMenu = client.Queryable <AdminMenu>().InSingle(dto.Id);
                if (adminMenu == null)
                {
                    return(Error("找不到该条信息"));
                }

                if (adminMenu.IsSystem)
                {
                    return(Error("不能编辑内置菜单"));
                }

                adminMenu.Name     = dto.Name;
                adminMenu.ParentId = dto.ParentId;
                adminMenu.Link     = dto.Link;
                adminMenu.Icon     = dto.Icon;

                client.Updateable(adminMenu).ExecuteCommand();
            }
            UpdatePathByMenuId(adminMenu.Id);
            _eventPublisher.EntityUpdated(adminMenu);
            return(Ok());
        }
Example #2
0
        public IActionResult Update(UpdateAdminMenuDto dto)
        {
            var result = _adminMenuService.UpdateAdminMenu(dto);

            return(Json(result));
        }