Esempio n. 1
0
        // GET: Role/Create
        public ActionResult Create()
        {
            ViewData["Controllers"] = _mvcControllerDiscovery.GetControllers();
            List <G_JSTree> G_JSTreeArray = new List <G_JSTree> ();
            int             i             = 1;

            foreach (var controller in _mvcControllerDiscovery.GetControllers())
            {
                G_JSTree _G_JSTree = new G_JSTree();
                _G_JSTree.text   = controller.Name;
                _G_JSTree.parent = "#";
                var ListChild = new List <G_Childern> ();
                foreach (var action in controller.Actions)
                {
                    i = i + 1;
                    ListChild.Add(new G_Childern {
                        id     = Guid.NewGuid().ToString(),
                        text   = action.DisplayName,
                        parent = controller.Name,
                        state  = new G_JsTreeAttribute {
                            selected = false
                        },
                        Icon = "fa fa-warning kt-font-danger"
                    });
                }
                i = i + 1;
                if (ListChild.Any())
                {
                    _G_JSTree.children = ListChild;
                    G_JSTreeArray.Add(_G_JSTree);
                }
            }
            ViewBag.Json = JsonConvert.SerializeObject(G_JSTreeArray);
            return(View());
        }
Esempio n. 2
0
        //api/CtlDiscovery
        public System.Object GetCtlvalue()
        {
            var result = _controllerDiscovery.GetControllers();

            return(result);
        }