public FileTypeWindowViewModel(ChildWindow aChildWindow, FileTypeEntity aFileTypeEntity) { childWindow = aChildWindow; FileTypeEntity = aFileTypeEntity; OnOK = new DelegateCommand(OnOKCommand); OnCancel = new DelegateCommand(OnCancelCommand); }
public FileTypeWindow(FileTypeEntity aFileTypeEntity) { InitializeComponent(); this.DataContext = new FileTypeWindowViewModel(this,aFileTypeEntity); }
void loadOperationFileType_Completed(object sender, EventArgs e) { FileTypeEntityDictionary.Clear(); FileTypeEntityList.Clear(); LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.filetype filetype in loadOperation.Entities) { FileTypeEntity fileTypeEntity = new FileTypeEntity(); fileTypeEntity.FileType = filetype; fileTypeEntity.Update(); FileTypeEntityDictionary.Add(fileTypeEntity.FileTypeID, fileTypeEntity); FileTypeEntityList.Add(fileTypeEntity); } this.prjectSource = new EntityList<ProductManager.Web.Model.project>(this.ProductDomainContext.projects); this.projectLoader = new DomainCollectionViewLoader<ProductManager.Web.Model.project>( this.LoadProjectEntities, this.LoadOperationProjectCompleted); this.projectView = new DomainCollectionView<ProductManager.Web.Model.project>(this.projectLoader, this.prjectSource); using (this.CollectionProjectView.DeferRefresh()) { this.projectView.MoveToFirstPage(); } this.IsBusy = false; }
void loadOperationFileType_Completed(object sender, EventArgs e) { FileTypeEntityDictionary.Clear(); FileTypeEntityList.Clear(); LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.filetype filetype in loadOperation.Entities) { FileTypeEntity fileTypeEntity = new FileTypeEntity(); fileTypeEntity.FileType = filetype; fileTypeEntity.Update(); FileTypeEntityDictionary.Add(fileTypeEntity.FileTypeID, fileTypeEntity); FileTypeEntityList.Add(fileTypeEntity); } LoadOperation<ProductManager.Web.Model.product_type> loadOperationProductType = SystemManageDomainContext.Load<ProductManager.Web.Model.product_type>(SystemManageDomainContext.GetProduct_typeQuery()); loadOperationProductType.Completed += loadOperationProductType_Completed; }
private void OnAddCommand() { AddFileTypeEntity = new FileTypeEntity(); AddFileTypeEntity.FileType = new ProductManager.Web.Model.filetype(); FileTypeWindow fileTypeWindow = new FileTypeWindow(AddFileTypeEntity); fileTypeWindow.Closed += fileTypeWindow_Closed; fileTypeWindow.Show(); }
void loadOperationFileType_Completed(object sender, EventArgs e) { FileTypeEntityList.Clear(); LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.filetype filetype in loadOperation.Entities) { FileTypeEntity fileTypeEntity = new FileTypeEntity(); fileTypeEntity.FileType = filetype; fileTypeEntity.Update(); FileTypeEntityList.Add(fileTypeEntity); } UpdateChanged("FileTypeEntityList"); IsBusy = false; }
public void LoadData() { IsBusy = true; systemManageDomainContext = new SystemManageDomainContext(); systemManageDomainContext.PropertyChanged -= systemManageDomainContext_PropertyChanged; systemManageDomainContext.PropertyChanged += systemManageDomainContext_PropertyChanged; FileTypeEntityList.Clear(); selectFileTypeEntity = null; LoadOperation<ProductManager.Web.Model.filetype> loadOperationDepartment = systemManageDomainContext.Load<ProductManager.Web.Model.filetype>(systemManageDomainContext.GetFiletypeQuery()); loadOperationDepartment.Completed += loadOperationFileType_Completed; }