zoukankan      html  css  js  c++  java
  • list 集合

    1、Model

    public class ROLE_FUNCTION
    {

      //角色集合
      public List< ROLE> ROLES { get; set; }

      //角色权限集合
      public List<ROLEFUNCTION> ROLEFUNCTIONS { get; set; }
    }

    2、controller

      ROLE_FUNCTION R_F = new ROLE_FUNCTION();

        //角色
      R_F.ROLES = db.ROLE.Where(p => p.ROLETYPE != "超级管理员").ToList();

      //角色权限
      R_F.ROLEFUNCTIONS = db.ROLEFUNCTION.ToList();

    3、 视图

    @model TRSLMS.Data.Models.ViewModel.ROLE_FUNCTION

    @foreach (var role in Model.ROLES)
    {
      <tr>
      <td class="font_left" width="15%">
      <div align="center">@role.ROLENAME</div>
      </td>
    @{string s = null;}
      @foreach (var func in Model.ROLEFUNCTIONS)
    {
      if (role.ID == func.ROLEID)
      {
      s += func.FUNCTIONNAME + " ";
      }
    }

    <td class="font_left width="70%" onclick="ShowRole('@role.ID','@role.ROLENAME')">
    <div align="center">@s</div>
    </td>
    <td class="font_left" width="15%">
    <div align="center">
    <input type="button" onclick ="fun(@role.ID);" value =" 菜单授权"/>
    |
    <input type="button" onclick ="FunButton('@role.ID ','@role.ROLENAME ');" value =" 页面授权"/>
    </div>
    </td>
    </tr>
    }

  • 相关阅读:
    linux c++ 实现http请求
    pip 换源
    Web API接口
    DRF框架知识总览
    jq+bs插件
    element-ui插件
    axios插件
    前端存储数据汇总
    Vuex插件
    全局配置css和js
  • 原文地址:https://www.cnblogs.com/louby/p/4894518.html
Copyright © 2011-2022 走看看