Exemple #1
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     using (var context = new EverythingContext())
     {
         var userList = context.Users;
         //获取所有权限管理系统的用户,并在下拉列表中展示
         this.cboUser.Items.Clear();
         foreach (User info in userList)
         {
             this.cboUser.Items.Add(info.Name);
         }
     }
 }
Exemple #2
0
        private void UserManage_Load(object sender, EventArgs e)
        {
            using (var context = new EverythingContext())
            {
                var result = from user in context.Users
                             join userRole in context.UserRoles on user.UserID equals userRole.UserID
                             join role in context.Roles on userRole.RoleID equals role.RoleID


                             select new
                {
                    UserID = user.UserID,
                    Name   = user.Name,
                    role.RoleName
                };
                //var result2=from re in result group re by re.UserID into RoleNameList select new {
                //    UserID=RoleNameList.Key,
                //    Name=re.Name,
                //    RoleNameList= RoleNameList
                //}

                //this.treeUser.DataSource
            }
        }