private void loadOperationUser_Completed(object sender, EventArgs e)
        {
            UserEntityDictionary.Clear();
            LoadOperation loadOperation = sender as LoadOperation;
            foreach (Web.Model.user user in loadOperation.Entities)
            {
                UserEntity lUserEntity = new UserEntity();
                lUserEntity.User = user;
                lUserEntity.Update();
                UserEntityDictionary.Add(lUserEntity.UserId, lUserEntity);
            }
            DocumentViewModel.UserEntityDictionary = UserEntityDictionary;

            taxPayerSource = new EntityList<Web.Model.taxpayer>(documentManagerContext.taxpayers);
            taxPayerLoader = new DomainCollectionViewLoader<Web.Model.taxpayer>(
                LoadTaxPayerEntities,
                loadOperation_Completed);
            taxPayerView = new DomainCollectionView<Web.Model.taxpayer>(taxPayerLoader, taxPayerSource);

            using (this.taxPayerView.DeferRefresh())
            {
                this.taxPayerView.MoveToFirstPage();
            }
        }
 private void onAddUser()
 {
     AddUserEntity = new UserEntity();
     DocumentManager.Web.Model.user user = new DocumentManager.Web.Model.user();
     AddUserEntity.User = user;
     user.user_password = Cryptography.MD5CryptoServiceProvider.GetMd5String("123456");
     AddUserEntity.Update();
     UserWindow lUserWindow = new UserWindow(UserWindowType.MODIFY, AddUserEntity);
     lUserWindow.Closed += AddUser_Closed;
     lUserWindow.Show();
 }
        void loadOperation_Completed(object sender, EventArgs e)
        {
            UserList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;
            foreach (DocumentManager.Web.Model.user user in loadOperation.Entities)
            {
                if (user.user_name == "admin")
                {
                    continue;
                }
                UserEntity userEntity = new UserEntity();
                userEntity.User = user;
                userEntity.Update();
                UserList.Add(userEntity);
            }

            PagedCollectionView lPagedCollectionView = new PagedCollectionView(UserList);
            UserDataView = lPagedCollectionView;
            UserDataView.Refresh();
            UpdateChanged("UserList");
            IsBusy = false;
            //finishLoaded();
        }
 private void loadOperation_Completed(LoadOperation<DocumentManager.Web.Model.user> sender)
 {
     UserList.Clear();
     this.userSource.Source = sender.Entities;
     foreach (DocumentManager.Web.Model.user user in sender.Entities)
     {
         if (user.user_name == "admin")
         {
             continue;
         }
         UserEntity userEntity = new UserEntity();
         userEntity.User = user;
         userEntity.Update();
         UserList.Add(userEntity);
     }
     UpdateChanged("UserList");
     IsBusy = false;
 }