private void OnWindowLoaded(object sender, RoutedEventArgs e) { if (UserInfo == null) { UserInfo = new SystemUser(); } EditUserInfoForm.CurrentItem = UserInfo; userContext.GetUserRoleRel(UserInfo.UserId, (obj) => { if (Utility.Utility.CheckInvokeOperation(obj)) { SelectedRoles = obj.Value; UserRolesList.ItemsSource = obj.Value; } }, null); userContext.GetUserOrgRel(UserInfo.UserId, (obj) => { if (Utility.Utility.CheckInvokeOperation(obj)) { SelectedOrganizations = obj.Value; UserOrgList.ItemsSource = obj.Value; } }, null); moduleContext.GetSystemModuleTree(OnGetSystemModuleCompleted, null); }
//获取用户角色 private void GetUserRoles() { if (AuthenticateStatus.HasLogin) //已登录 //通过用户ID,使用类DomainContext获取用户角色 { userContext.GetUserRoleRel(AuthenticateStatus.CurrentUser.UserId, obj => //new SystemUserDomainContext().GetUserRoleRel(AuthenticateStatus.CurrentUser.UserId, obj => { if (Utility.Utility.CheckInvokeOperation(obj)) //检查调用操作是否完成 { AuthenticateStatus.UserRoles = obj.Value; GetUserOrgs(); //获取用户组 } }, null); } }