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; }
private void departmentWindow_Closed(object sender, EventArgs e) { DepartmentWindow departmentWindow = sender as DepartmentWindow; if (departmentWindow.DialogResult == true) { DepartmentEntityList.Add(AddDepartmentEntity); systemManageDomainContext.departments.Add(AddDepartmentEntity.Department); IsBusy = true; SubmitOperation submitOperation = systemManageDomainContext.SubmitChanges(); submitOperation.Completed += submitOperation_Completed; } }
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; }