public static IList <MenuInfo> GetMenus() { IList <MenuInfo> menuInfos; IList <MenuInfo> menuInfos1 = new List <MenuInfo>(); MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(); if (topMenus != null) { foreach (MenuInfo topMenu in topMenus) { menuInfos1.Add(topMenu); IList <MenuInfo> menusByParentId = menuDao.GetMenusByParentId(topMenu.MenuId); if (menusByParentId != null) { foreach (MenuInfo menuInfo in menusByParentId) { menuInfos1.Add(menuInfo); } } } menuInfos = menuInfos1; } else { menuInfos = menuInfos1; } return(menuInfos); }
public static IList <MenuInfo> GetMenus(ClientType clientType) { IList <MenuInfo> list = new List <MenuInfo>(); MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(clientType); IList <MenuInfo> result; if (topMenus == null) { result = list; } else { foreach (MenuInfo current in topMenus) { list.Add(current); IList <MenuInfo> menusByParentId = menuDao.GetMenusByParentId(current.MenuId, clientType); if (menusByParentId != null) { foreach (MenuInfo current2 in menusByParentId) { list.Add(current2); } } } result = list; } return(result); }
public static IList <MenuInfo> GetMenus(string shopMenuStyle) { IList <MenuInfo> menuInfos; IList <MenuInfo> menuInfos1 = new List <MenuInfo>(); MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(); if (topMenus != null) { foreach (MenuInfo topMenu in topMenus) { IList <MenuInfo> menusByParentId = menuDao.GetMenusByParentId(topMenu.MenuId); if (shopMenuStyle != "1") { topMenu.ShopMenuPic = ""; } topMenu.SubMenus = menusByParentId; menuInfos1.Add(topMenu); } menuInfos = menuInfos1; } else { menuInfos = menuInfos1; } return(menuInfos); }
public static IList <MenuInfo> GetMenus(string shopMenuStyle) { IList <MenuInfo> list = new List <MenuInfo>(); MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(); IList <MenuInfo> result; if (topMenus == null) { result = list; } else { foreach (MenuInfo current in topMenus) { IList <MenuInfo> menusByParentId = menuDao.GetMenusByParentId(current.MenuId); if (shopMenuStyle != "1") { current.ShopMenuPic = ""; } current.SubMenus = menusByParentId; list.Add(current); } result = list; } return(result); }
public static IList <MenuInfo> GetInitMenus(string wid) { MenuDao dao = new MenuDao(); IList <MenuInfo> topMenus = dao.GetTopMenus(wid); foreach (MenuInfo info in topMenus) { info.Chilren = dao.GetMenusByParentId(info.MenuId, wid); if (info.Chilren == null) { info.Chilren = new List <MenuInfo>(); } } return(topMenus); }
public static IList <MenuInfo> GetInitMenus(ClientType clientType) { MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(clientType); foreach (MenuInfo current in topMenus) { current.Chilren = menuDao.GetMenusByParentId(current.MenuId, clientType); if (current.Chilren == null) { current.Chilren = new List <MenuInfo>(); } } return(topMenus); }
public static IList <MenuInfo> GetInitMenus() { MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(); foreach (MenuInfo topMenu in topMenus) { topMenu.Chilren = menuDao.GetMenusByParentId(topMenu.MenuId); if (topMenu.Chilren == null) { topMenu.Chilren = new List <MenuInfo>(); } } return(topMenus); }
public static IList <MenuInfo> GetMenus(string wid) { IList <MenuInfo> list = new List <MenuInfo>(); MenuDao dao = new MenuDao(); IList <MenuInfo> topMenus = dao.GetTopMenus(wid); if (topMenus != null) { foreach (MenuInfo info in topMenus) { IList <MenuInfo> menusByParentId = dao.GetMenusByParentId(wid, info.MenuId); info.SubMenus = menusByParentId; list.Add(info); } } return(list); }
public static IList <MenuInfo> GetMenus(string shopMenuStyle) { MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(); IList <MenuInfo> result = new List <MenuInfo>(); if (topMenus != null && topMenus.Count > 0) { foreach (MenuInfo current in topMenus) { IList <MenuInfo> menusByParentId = menuDao.GetMenusByParentId(current.MenuId); if (shopMenuStyle != "1") { current.ShopMenuPic = ""; } current.SubMenus = menusByParentId; result.Add(current); } } return(result); }
public static IList <MenuInfo> GetMenus(string shopMenuStyle) { IList <MenuInfo> list = new List <MenuInfo>(); MenuDao dao = new MenuDao(); IList <MenuInfo> topMenus = dao.GetTopMenus(); if (topMenus != null) { foreach (MenuInfo info in topMenus) { IList <MenuInfo> menusByParentId = dao.GetMenusByParentId(info.MenuId); if (shopMenuStyle != "1") { info.ShopMenuPic = ""; } info.SubMenus = menusByParentId; list.Add(info); } } return(list); }
public static IList <MenuInfo> GetMenus() { IList <MenuInfo> list = new List <MenuInfo>(); MenuDao dao = new MenuDao(); IList <MenuInfo> topMenus = dao.GetTopMenus(); if (topMenus != null) { foreach (MenuInfo info in topMenus) { list.Add(info); IList <MenuInfo> menusByParentId = dao.GetMenusByParentId(info.MenuId); if (menusByParentId != null) { foreach (MenuInfo info2 in menusByParentId) { list.Add(info2); } } } } return(list); }
public static IList <MenuInfo> GetMenus(ClientType clientType) { IList <MenuInfo> list = new List <MenuInfo>(); MenuDao menuDao = new MenuDao(); IList <MenuInfo> topMenus = menuDao.GetTopMenus(clientType); if (topMenus == null) { return(list); } foreach (MenuInfo item in topMenus) { list.Add(item); IList <MenuInfo> menusByParentId = menuDao.GetMenusByParentId(item.MenuId, clientType); if (menusByParentId != null) { foreach (MenuInfo item2 in menusByParentId) { list.Add(item2); } } } return(list); }