예제 #1
0
        public ActionResult GetForm(string primaryKey)
        {
            SysRole entity = roleLogic.Get(primaryKey);

            entity.IsEnabled = entity.IsEnabled == "1" ? "true" : "false";
            return(Content(entity.ToJson()));
        }
예제 #2
0
        public ActionResult Index(string roleId)
        {
            var roleModel           = _sysRoleLogic.Get(roleId);
            var listPerIds          = roleAuthorizeLogic.GetList(roleId).Select(c => c.ModuleId).ToList();
            var listAllPers         = permissionLogic.GetShopPowersList(roleModel.ShopID);
            List <ZTreeNode> result = new List <ZTreeNode>();

            foreach (var item in listAllPers)
            {
                ZTreeNode model = new ZTreeNode();
                model.@checked = listPerIds.Contains(item.Id) ? model.@checked = true : model.@checked = false;
                model.id       = item.Id;
                model.pId      = item.ParentId;
                model.name     = item.Name;
                model.open     = true;
                result.Add(model);
            }
            return(Content(result.ToJson()));
        }