示例#1
0
 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 GetUserOrgs()
 {
     if (AuthenticateStatus.HasLogin)  //已登录
     //通过用户ID,使用类DomainContext获取用户组织
     {
         userContext.GetUserOrgRel(AuthenticateStatus.CurrentUser.UserId, obj =>
         {
             if (Utility.Utility.CheckInvokeOperation(obj))  //检查调用操作是否完成
             {
                 AuthenticateStatus.UserOrgs = obj.Value;
                 Content = new MainPage();       //创建主页!!!!!!!!!!!!!!!!
                 KeyUp  -= OnPageKeyUp;          //去掉按键离开事件
             }
         }, null);
     }
 }