void loadOperation_Completed(object sender, EventArgs e)
        {
            UserList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.user user in loadOperation.Entities)
            {
                if (user.user_name == "admin")
                {
                    continue;
                }
                UserEntity userEntity = new UserEntity();
                userEntity.User = user;
                userEntity.Update();
                DepartmentEntity departmentEntity;
                if (DepartmentDictionary.TryGetValue(userEntity.UserDepartmentID, out departmentEntity))
                {
                    userEntity.UserDepartment = departmentEntity.DepartmentName;
                    UserList.Add(userEntity);
                }
            }

            PagedCollectionView lPagedCollectionView = new PagedCollectionView(UserList);

            lPagedCollectionView.GroupDescriptions.Add(new PropertyGroupDescription("UserDepartment"));
            UserDataView = lPagedCollectionView;
            UserDataView.Refresh();
            UpdateChanged("UserList");
            IsBusy = false;
            finishLoaded();
        }
Пример #2
0
        void loadOperation_Completed(LoadOperation <ProductManager.Web.Model.user> sender)
        {
            UserList.Clear();
            //LoadOperation loadOperation = sender as LoadOperation;
            this.userSource.Source = sender.Entities;
            foreach (ProductManager.Web.Model.user user in sender.Entities)
            {
                if (user.user_name == "admin")
                {
                    continue;
                }
                UserEntity userEntity = new UserEntity();
                userEntity.User = user;
                userEntity.UserNameDictionary = UserEntityDictionary;
                userEntity.Update();
                UserList.Add(userEntity);
                DepartmentEntity departmentEntity;
                if (DepartmentDictionary.TryGetValue(userEntity.UserDepartmentID, out departmentEntity))
                {
                    userEntity.UserDepartment = departmentEntity.DepartmentName;
                }
            }

            if (sender.TotalEntityCount != -1)
            {
                this.userView.SetTotalItemCount(sender.TotalEntityCount);
            }

            UpdateChanged("UserList");
            UpdateChanged("CollectionView");
            IsBusy = false;
        }
Пример #3
0
 private void LoadOperationProjectCompleted(LoadOperation <ProductManager.Web.Model.project_files> aLoadOperation)
 {
     ProjectFilesEntityList.Clear();
     foreach (ProductManager.Web.Model.project_files project_files in aLoadOperation.Entities)
     {
         ProjectFilesEntity projectFilesEntity = new ProjectFilesEntity();
         projectFilesEntity.ProjectFiles = project_files;
         projectFilesEntity.Update();
         DepartmentEntity lDepartmentEntity;
         if (DepartmentDictionary.TryGetValue(projectFilesEntity.DepartmentID, out lDepartmentEntity))
         {
             projectFilesEntity.DepartmentName = lDepartmentEntity.DepartmentName;
         }
         UserEntity lUserEntity;
         if (UserEntityDictionary.TryGetValue(projectFilesEntity.UserID, out lUserEntity))
         {
             projectFilesEntity.UserName = lUserEntity.CUserName;
         }
         if (UserEntityDictionary.TryGetValue(projectFilesEntity.FileDeletePersionID, out lUserEntity))
         {
             projectFilesEntity.FileDeletePersionName = lUserEntity.CUserName;
         }
         FileTypeEntity lFileTypeEntity;
         if (FileTypeEntityDictionary.TryGetValue(projectFilesEntity.FileTypeID, out lFileTypeEntity))
         {
             projectFilesEntity.FileTypeName = lFileTypeEntity.FileTypeName;
         }
         ProjectFilesEntityList.Add(projectFilesEntity);
     }
     UpdateChanged("ProjectFilesEntityList");
     canConfirm = isLinkProject ? (ProjectFilesEntityList.Count > 0) : (null != SelectProjectFilesEntity);
     UpdateChanged("CanConfirm");
     IsBusy = false;
 }
Пример #4
0
        void loadOperationDepartment_Completed(object sender, EventArgs e)
        {
            DepartmemtList.Clear();
            DepartmentDictionary.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.department department in loadOperation.Entities)
            {
                DepartmentEntity departmentEntity = new DepartmentEntity();
                departmentEntity.Department = department;
                departmentEntity.Update();
                DepartmemtList.Add(departmentEntity);
                DepartmentDictionary.Add(departmentEntity.DepartmentID, departmentEntity);
            }
            DepartmentEntity departmentEntityZero = new DepartmentEntity();

            departmentEntityZero.DepartmentID   = 0;
            departmentEntityZero.DepartmentName = "请选择部门";
            DepartmemtList.Add(departmentEntityZero);
            UpdateChanged("DepartmemtList");

            LoadOperation <ProductManager.Web.Model.user> loadOperationDepartment =
                systemManageDomainContext.Load <ProductManager.Web.Model.user>(systemManageDomainContext.GetUserQuery());

            loadOperationDepartment.Completed += loadOperationUser_Completed;
        }