From 95e39a1e2c8d199e04d3d0fbae705af9e5f2107f Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Sun, 6 Nov 2016 00:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8F=9C=E5=8D=95/=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=9D=A1=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.DataAccess/MenuHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bootstrap.DataAccess/MenuHelper.cs b/Bootstrap.DataAccess/MenuHelper.cs index ab0ffc80..d6d41622 100644 --- a/Bootstrap.DataAccess/MenuHelper.cs +++ b/Bootstrap.DataAccess/MenuHelper.cs @@ -97,7 +97,7 @@ namespace Bootstrap.DataAccess public static IEnumerable 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 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; }