public static IEnumerable <Entities.Core.Menu> GetRootMenuCollection(string path) { int userId = CurrentSession.GetUserId(); int officeId = CurrentSession.GetOfficeId(); string culture = CurrentSession.GetCulture().TwoLetterISOLanguageName; return(Factory.Get <Entities.Core.Menu>("SELECT * FROM policy.get_menu(@0, @1, @2) WHERE parent_menu_id=core.get_root_parent_menu_id(@3) ORDER BY menu_id;", userId, officeId, culture, path)); }
public static IEnumerable <Entities.Core.Menu> GetMenuCollection(string path, short level) { string relativePath = path; int userId = CurrentSession.GetUserId(); int officeId = CurrentSession.GetOfficeId(); string culture = CurrentSession.GetCulture().TwoLetterISOLanguageName; return(Factory.Get <Entities.Core.Menu>("SELECT * FROM policy.get_menu(@0, @1, @2) WHERE parent_menu_id=(SELECT menu_id FROM core.menus WHERE url=@3) AND level=@4 ORDER BY menu_id;", userId, officeId, culture, relativePath, level)); }
public static IEnumerable <Entities.Core.Menu> GetMenuCollection(int parentMenuId, short level) { int userId = CurrentSession.GetUserId(); int officeId = CurrentSession.GetOfficeId(); string culture = CurrentSession.GetCulture().TwoLetterISOLanguageName; if (parentMenuId > 0) { return(Factory.Get <Entities.Core.Menu>("SELECT * FROM policy.get_menu(@0, @1, @2) WHERE parent_menu_id=@3 AND level=@4 ORDER BY menu_id;", userId, officeId, culture, parentMenuId, level)); } return(Factory.Get <Entities.Core.Menu>("SELECT * FROM policy.get_menu(@0, @1, @2) WHERE parent_menu_id is null ORDER BY menu_id;", userId, officeId, culture)); }