コード例 #1
0
        public ActionResult GetLeftMenu()
        {
            string userId = OperatorProvider.Instance.Current.UserId;

            List <LayNavbar> listNavbar = new List <LayNavbar>();
            var listModules             = permissionLogic.GetList(userId);

            foreach (var item in listModules.Where(c => c.Type == ModuleType.Menu && c.Layer == 0).ToList())
            {
                LayNavbar navbarEntity = new LayNavbar();
                var       listChildNav = listModules.Where(c => c.Type == ModuleType.Menu && c.Layer == 1 && c.ParentId == item.Id)
                                         .Select(c => new LayChildNavbar()
                {
                    href = c.Url, icon = c.Icon, title = c.Name
                }).ToList();
                navbarEntity.icon     = item.Icon;
                navbarEntity.spread   = false;
                navbarEntity.title    = item.Name;
                navbarEntity.children = listChildNav;
                listNavbar.Add(navbarEntity);
            }
            return(Content(listNavbar.ToJson()));
        }
コード例 #2
0
        public ActionResult Index(int pageIndex, int pageSize, string keyWord)
        {
            int totalCount = 0;
            var pageData   = permissionLogic.GetList(pageIndex, pageSize, keyWord, ref totalCount);
            var result     = new LayPadding <SysPermission>()
            {
                result = true,
                msg    = "success",
                list   = pageData,
                count  = totalCount//pageData.Count,
            };

            return(Content(result.ToJson()));
        }