Exemplo n.º 1
0
        public ActionResult DynamicLoadMenus()
        {
            var id     = Request["id"];
            int parent = 0;

            int.TryParse(id, out parent);

            var appkey = ConstValue.ApplicationID;

            var result = menu_service.DynamicLoadMenus(parent, appkey);

            return(Json(
                       from s in result
                       select new
            {
                id = s.SysNo,
                text = s.MenuName,
                parent = s.ParentSysNo == 0 ? "#" : s.ParentSysNo.ToString(),
                children = s.ChildrenCount > 0,
                icon = s.ChildrenCount > 0 ? "fa fa-sitemap" : "fa fa-leaf",
                data = s
            }
                       , JsonRequestBehavior.AllowGet));
        }