/// <summary>
        /// 获取用户分配的所有菜单,如果是developmentAdmin直接获取所有的菜单。
        /// </summary>
        /// <param name="loginID">用户登陆ID</param>
        /// <returns></returns>
        public static List <SystemMenuWrapper> GetUserAssignedMenuByUserLoginID(string loginID)
        {
            List <SystemApplicationWrapper> applications = SystemApplicationWrapper.GetUserAvaiableApplications(SystemUserWrapper.FindByLoginID(loginID));

            List <SystemMenuWrapper> assignedMenus = new List <SystemMenuWrapper>();

            List <SystemMenuEntity> menus = businessProxy.GetUserAssignedMenuByLoginID(loginID);

            if (menus == null)
            {
                return(assignedMenus);
            }

            foreach (SystemMenuEntity systemMenuWrapper in menus)
            {
                if (applications.Exists(p => (p.SystemApplicationID == systemMenuWrapper.ApplicationID.SystemApplicationID)))
                {
                    assignedMenus.Add(ConvertEntityToWrapper(systemMenuWrapper));
                }
            }

            return(assignedMenus);
        }
示例#2
0
        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.entity, systemApplicationWrapper.entity));

            if (systemMenuWrapper == null)
            {
                return(1);
            }
            else
            {
                return(systemMenuWrapper.MenuOrder.Value + 1);
            }
        }
示例#3
0
 public static List <SystemPersonalizationSettingsWrapper> FindAllByApplicationID(SystemApplicationWrapper applicationID)
 {
     return(ConvertToWrapperList(businessProxy.FindAllByApplicationID(applicationID.Entity)));
 }
示例#4
0
 public static List <SystemPersonalizationSettingsWrapper> FindAllByOrderByAndFilterAndApplicationID(string orderByColumnName, bool isDesc, SystemApplicationWrapper applicationID, PageQueryParams pageQueryParams)
 {
     return(ConvertToWrapperList(businessProxy.FindAllByOrderByAndFilterAndApplicationID(orderByColumnName, isDesc, applicationID.Entity, pageQueryParams)));
 }
示例#5
0
 public static void Save(SystemApplicationWrapper obj)
 {
     businessProxy.Save(obj.entity);
 }
示例#6
0
 public static void Refresh(SystemApplicationWrapper instance)
 {
     businessProxy.Refresh(instance.entity);
 }
示例#7
0
 public static void Delete(SystemApplicationWrapper instance)
 {
     businessProxy.Delete(instance.entity);
 }
 public static List <SystemRoleApplicationWrapper> FindAllByApplicationID(SystemApplicationWrapper applicationID)
 {
     return(ConvertToWrapperList(businessProxy.FindAllByApplicationID(applicationID.entity)));
 }
示例#9
0
 public static void Refresh(SystemApplicationWrapper instance)
 {
     businessProxy.Refresh(instance.entity);
 }
示例#10
0
 public static void Delete(SystemApplicationWrapper instance)
 {
     businessProxy.Delete(instance.entity);
 }
示例#11
0
 public static void SaveOrUpdate(SystemApplicationWrapper obj)
 {
     businessProxy.SaveOrUpdate(obj.entity);
 }
 public static List <SystemMenuWrapper> GetSystemMenusByApplication(int appID)
 {
     return(ConvertToWrapperList(businessProxy.GetMenuByApplication(SystemApplicationWrapper.FindById(appID))));
 }
        public static List <NavMenu> GetNavMenuByApplication(SystemApplicationWrapper app)
        {
            List <SystemMenuWrapper> listmenu = ConvertToWrapperList(businessProxy.GetMenuByApplication(app));

            return(GetNavMenusFromSystemMenus(listmenu));
        }