示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }