| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | |
| | | } |
| | | |
| | | |
| | | public List<Sys_Menu> GetUserMenuList(int roleId) |
| | | public List<MenuDTO> GetUserMenuList(int roleId) |
| | | { |
| | | if (App.User.IsRoleIdSuperAdmin(roleId)) |
| | | { |
| | |
| | | return BaseDal.GetAllMenu().Where(x => menuIds.Contains(x.MenuId)).ToList(); |
| | | } |
| | | |
| | | public List<Sys_Actions> GetActions(int menuId, List<Sys_Actions> menuActions, List<Permissions> permissions, int roleId) |
| | | public List<ActionDTO> GetActions(int menuId, List<ActionDTO> menuActions, List<Permissions> permissions, int roleId) |
| | | { |
| | | if (App.User.IsRoleIdSuperAdmin(roleId)) |
| | | { |
| | |
| | | bool _changed = false; |
| | | if (menu.MenuId <= 0) |
| | | { |
| | | BaseDal.AddData(menu); |
| | | int id = BaseDal.AddData(menu); |
| | | menu.MenuId = id; |
| | | } |
| | | else |
| | | { |
| | |
| | | return webResponse; |
| | | |
| | | } |
| | | |
| | | public WebResponseContent DelMenu(int menuId) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | if(BaseDal.QueryFirst(x=>x.ParentId == menuId) != null) |
| | | { |
| | | return webResponse = WebResponseContent.Instance.Error("当前菜单存在子菜单,请先删除子菜单!"); |
| | | } |
| | | BaseDal.DeleteDataById(menuId); |
| | | |
| | | return webResponse = WebResponseContent.Instance.OK("删除成功"); |
| | | } |
| | | } |
| | | } |