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(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();
        }