Example #1
0
        public JsonResult Tree(string orgId)
        {
            var module = new RoleModule(CurrentUser);
            var items  = module.FeatchAll(orgId);
            var data   = items.Select(t => new ComboTreeModel {
                children = new ComboTreeModel[0], id = t.Id, text = t.Name
            }).ToArray();

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public JObject GetData()
        {
            var module = new RoleModule(CurrentUser);
            var list   = new List <RoleMenuFeatureModel>();
            var items  = module.FeatchAll().ToList();

            items.ForEach(
                t =>
            {
                list.Add(new RoleMenuFeatureModel
                {
                    role     = t.role,
                    features = new FeatureModel[0],
                    menu     = null
                });
                list.AddRange(t.menus.Where(x => !string.IsNullOrWhiteSpace(x.menu.Title)));
            });
            var data = TableRoleDataModel.Model.GetJson(list, TableRoleHeaderModel.Header);

            return(data);
        }