private void loadOperationProjectFiles_Completed(object sender, EventArgs e) { ProjectFilesEntityList.Clear(); LoadOperation <ProductManager.Web.Model.project_files> loadOperation = sender as LoadOperation <ProductManager.Web.Model.project_files>; foreach (ProductManager.Web.Model.project_files project_files in loadOperation.Entities) { ProjectFilesEntity projectFilesEntity = new ProjectFilesEntity(); projectFilesEntity.ProjectFiles = project_files; projectFilesEntity.Update(); DepartmentEntity lDepartmentEntity; if (DepartmentEntityDictionary.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); } IsBusy = false; }
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; }
void updateFileWindow_Closed(object sender, EventArgs e) { UpdateFileWindow updateFileWindow = sender as UpdateFileWindow; if (updateFileWindow.DialogResult == true) { ProjectFilesEntityList.Add(AddProjectFilesEntity); AddProjectFilesEntity.DUpdate(); ProductDomainContext.project_files.Add(AddProjectFilesEntity.ProjectFiles); IsBusy = true; SubmitOperation subOperation = ProductDomainContext.SubmitChanges(); subOperation.Completed += SubOperationCommpleted; } }