public void GetRoleFunList() { string _roleid = Parameters["proleid"]; string _moduleflag = Parameters["pmoduleflag"]; //获取当前模块的所有功能列表 List<SysFunList> lists = new List<SysFunList>(); SysFunListBiz biz = new SysFunListBiz(); lists = biz.SelectAllFunList(_moduleflag); //获取当前角色被授权的功能列表 List<SysRolesFunction> rlists = new List<SysRolesFunction>(); SysRolesFunctionBiz rbiz = new SysRolesFunctionBiz(); rlists = rbiz.Select(Convert.ToInt64(_roleid),_moduleflag); foreach (SysRolesFunction item in rlists) { lists.Find(p => p.FFunId == item.FFunId).FSelFlag = item.FFunId; } Response.Write(Utils.ConvertToJson(lists)); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { List<SysFunList> lists = new List<SysFunList>(); SysFunListBiz biz = new SysFunListBiz(); lists = biz.SelectAllFunList(); AddDatasource("functionlist", lists); List<SysModule> modulelists = new List<SysModule>(); SysModuleBiz mbiz = new SysModuleBiz(); modulelists = mbiz.SelectUsed(); AddDatasource("modulelist", modulelists); } }