示例#1
0
 public ResResultModel GetMenusTreeGrid(MenusPermissionModel model)
 {
     try
     {
         var accessId         = Guid.Empty;
         var accessType       = "";
         var isAdministrators = false;
         if (!string.IsNullOrWhiteSpace(model.AllowRole))
         {
             accessType = "Roles";
             SiteRoles rBll     = new SiteRoles();
             var       roleInfo = rBll.GetAspnetModel(Membership.ApplicationName, model.AllowRole);
             accessId         = roleInfo.Id;
             isAdministrators = roleInfo.LowerName == "administrators";
         }
         if (!string.IsNullOrWhiteSpace(model.DenyUser))
         {
             accessType = "Users";
             accessId   = Guid.Parse(Membership.GetUser(model.DenyUser).ProviderUserKey.ToString());
         }
         var bll = new SiteMenus();
         return(ResResult.Response(true, "", bll.GetTreeGridJson(Membership.ApplicationName, accessId, accessType, isAdministrators)));
     }
     catch (Exception ex)
     {
         return(ResResult.Response(false, ex.Message, ""));
     }
 }
示例#2
0
 public ResResultModel GetMenusTreeGrid(MenusPermissionModel model)
 {
     try
     {
         object allowRoleId = null;
         object denyUserId  = null;
         if (!string.IsNullOrWhiteSpace(model.AllowRole))
         {
             Role rBll = new Role();
             allowRoleId = rBll.GetModel(model.AllowRole).RoleId;
         }
         if (!string.IsNullOrWhiteSpace(model.DenyUser))
         {
             denyUserId = Membership.GetUser(model.DenyUser).ProviderUserKey;
         }
         var bll = new Menus();
         return(ResResult.Response(true, "", bll.GetTreeGridJson(Membership.ApplicationName, allowRoleId, denyUserId)));
     }
     catch (Exception ex)
     {
         return(ResResult.Response(false, ex.Message, ""));
     }
 }