public static int GetNewMaxMenuOrder(int parentMenuId, int applicationId)
        {
            SystemMenuWrapper parentMenu = null;

            if (parentMenuId != 0)
            {
                parentMenu = SystemMenuWrapper.FindById(parentMenuId);
            }

            SystemApplicationWrapper systemApplicationWrapper = SystemApplicationWrapper.FindById(applicationId);

            //获取当前应用下指定的父菜单下面的最大序号的菜单
            SystemMenuWrapper systemMenuWrapper = ConvertEntityToWrapper(businessProxy.GetNewMaxMenuByParentMenuAndApplication(parentMenu, systemApplicationWrapper));

            if (systemMenuWrapper == null)
            {
                return(1);
            }
            else
            {
                if (!systemMenuWrapper.MenuOrder.HasValue)
                {
                    return(1);
                }
                return(systemMenuWrapper.MenuOrder.Value + 1);
            }
        }
Beispiel #2
0
        public static void PatchAssignRoleMenusInApplication(SystemRoleWrapper role, int applicationID, string[] assignedMenuIDS)
        {
            SystemApplicationWrapper applicationWrapper = SystemApplicationWrapper.FindById(applicationID);

            if (role != null && applicationWrapper != null)
            {
                businessProxy.PatchAssignRoleMenusInApplication(role.entity, applicationWrapper.entity, assignedMenuIDS);
            }
        }
 public static List <SystemMenuWrapper> GetSystemMenusByApplication(int appID)
 {
     return(ConvertToWrapperList(businessProxy.GetMenuByApplication(SystemApplicationWrapper.FindById(appID))));
 }