Beispiel #1
0
        void loadOperationDepartment_Completed(object sender, EventArgs e)
        {
            DepartmentEntityDictionary.Clear();
            DepartmentEntityList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

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

            DepartmentEntity departmentEntityZero = new DepartmentEntity();

            departmentEntityZero.DepartmentID   = 0;
            departmentEntityZero.DepartmentName = "所有部门";
            DepartmentEntityList.Add(departmentEntityZero);

            LoadOperation <ProductManager.Web.Model.user> loadOperationUser =
                SystemManageDomainContext.Load <ProductManager.Web.Model.user>(SystemManageDomainContext.GetUserQuery());

            loadOperationUser.Completed += loadOperationUser_Completed;
        }
Beispiel #2
0
        private void loadOperationDepartment_Completed(object sender, EventArgs e)
        {
            DepartmentEntityList.Clear();
            LoadOperation loadOperation = sender as LoadOperation;

            foreach (ProductManager.Web.Model.department department in loadOperation.Entities)
            {
                DepartmentEntity departmentEntity = new DepartmentEntity();
                departmentEntity.Department = department;
                departmentEntity.Update();
                DepartmentEntityList.Add(departmentEntity);
            }
            UpdateChanged("DepartmentEntityList");
            IsBusy = false;
        }