Exemple #1
0
        /// <summary>
        /// 查找所有的可用的菜单
        /// </summary>
        /// <returns></returns>
        public IList <SystemMenuEntity> GetAllAviableMenu()
        {
            NHibernateDynamicQueryGenerator <SystemMenuEntity> dynamicQueryGenerator = this.GetNewQueryBuilder();

            dynamicQueryGenerator.AddWhereClause(PROPERTY_MENUISENABLE.Eq(true));

            dynamicQueryGenerator.AddOrderBy(PROPERTY_MENUORDER.Asc());

            return(this.FindListByQueryBuilder(dynamicQueryGenerator));
        }
Exemple #2
0
        /// <summary>
        /// 对Menu进行排序处理,按照父菜单
        /// </summary>
        /// <param name="menuIDs"></param>
        /// <returns></returns>
        public List <SystemMenuEntity> SortMenu(List <int> menuIDs)
        {
            NHibernateDynamicQueryGenerator <SystemMenuEntity> dynamicQueryGenerator = this.GetNewQueryBuilder();

            dynamicQueryGenerator.AddWhereClause(PROPERTY_MENUID.In(menuIDs));

            dynamicQueryGenerator.AddOrderBy(PROPERTY_PARENTMENUID.Asc());

            dynamicQueryGenerator.AddOrderBy(PROPERTY_MENUORDER.Asc());

            return(this.FindListByQueryBuilder(dynamicQueryGenerator));
        }