Exemplo n.º 1
0
        public async Task <string> GetMenu()
        {
            ApplicationUser user = await _userManager.FindByNameAsync(User.Identity.Name);

            var superId = _setting.GetSuperId();
            var obj     = new MenuLogic(_context);
            var obj1    = new SubMenuLogic(_context);

            string data = "";

            if (User.Identity.Name == superId)
            {
                data = await obj.SelectVisibleData();
            }
            else
            {
                var role = await _userManager.GetRolesAsync(user);

                data = obj.SelectVisibleData(role[0]);
            }

            var data1 = obj1.SelectVisibleData();

            var format = new { top = data, left = data1 };

            return(Tools.ConvertToJSON(format));
        }
Exemplo n.º 2
0
        public string GetSubMenuDisplay()
        {
            var obj  = new SubMenuLogic(_context);
            var data = obj.SelectVisibleData();

            return(data);
        }