新增菜单/导航条排序功能

This commit is contained in:
Argo-Lenovo 2016-11-06 00:32:55 +08:00
parent ce142d0adb
commit 95e39a1e2c
1 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ namespace Bootstrap.DataAccess
public static IEnumerable<Menu> RetrieveNavigationsByUserId(int userId)
{
var navs = (userId == 0 ? RetrieveMenus() : RetrieveMenusByUserId(userId)).Where(m => m.Category == "0");
var root = navs.Where(m => m.ParentId == 0);
var root = navs.Where(m => m.ParentId == 0).OrderBy(m => m.Order);
CascadeMenu(navs, root);
return root;
}
@ -105,7 +105,7 @@ namespace Bootstrap.DataAccess
{
level.ToList().ForEach(m =>
{
m.Menus = navs.Where(sub => sub.ParentId == m.ID);
m.Menus = navs.Where(sub => sub.ParentId == m.ID).OrderBy(sub => sub.Order);
CascadeMenu(navs, m.Menus);
});
}
@ -117,7 +117,7 @@ namespace Bootstrap.DataAccess
public static IEnumerable<Menu> RetrieveLinksByUserId(int userId)
{
var navs = (userId == 0 ? RetrieveMenus() : RetrieveMenusByUserId(userId)).Where(m => m.Category == "1");
var root = navs.Where(m => m.ParentId == 0);
var root = navs.Where(m => m.ParentId == 0).OrderBy(m => m.Order);
CascadeMenu(navs, root);
return root;
}