public void IntitData() { tb_Sys_Menu menuInfo = appCacheService.GetItem("ParentMenu") as tb_Sys_Menu; tb_Sys_Roles role = appCacheService.GetItem("roles") as tb_Sys_Roles; //Guid MenuId = gridControl1.DataSource = menuService.GetMenusByRoleId(role.Id).Where(i => i.ParentMenuId == menuInfo.Id).OrderBy(i => i.SeqNo); }
//角色表行改变事件 void GvRoles_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { tb_Sys_Roles role = GvRoles.GetFocusedRow() as tb_Sys_Roles; if (role != null) { //查出该权限下所有菜单 //List<string> listmenuID = ServiceHelper.Current.DbSession.Itb_Sys_RoleModuleDAL.GetListBy(r => r.RoleID == role.RoleID).Select(r => r.ModuleID).ToList(); treeMenu.DataSource = menuService.GetMenusByRoleId(role.Id); //ServiceHelper.Current.DbSession.Itb_Sys_ModuleDAL.GetListBy(m => listmenuID.Contains(m.ModuleID)); //List<string> listUserID = ServiceHelper.Current.DbSession.Itb_Sys_UserRoleDAL.GetListBy(r => r.RoleID == role.RoleID).Select(r => r.UserID).ToList(); gridcontrolUser.DataSource = userService.GetUserByRoleId(role.Id);//ServiceHelper.Current.DbSession.Itb_Sys_UserDAL.GetListBy(r => listUserID.Contains(r.UserID)); gridControlControl.DataSource = controlService.GetlistByRolesId(role.Id); } }