void productTypeWindow_Closed(object sender, EventArgs e) { ProductTypeWindow productTypeWindow = sender as ProductTypeWindow; if (productTypeWindow.DialogResult == true) { ProductTypeEntityList.Add(AddProductTypeEntity); systemManageDomainContext.product_types.Add(AddProductTypeEntity.ProductType); OnSaveCommand(); } }
public void LoadData() { IsBusy = true; systemManageDomainContext = new SystemManageDomainContext(); systemManageDomainContext.PropertyChanged -= systemManageDomainContext_PropertyChanged; systemManageDomainContext.PropertyChanged += systemManageDomainContext_PropertyChanged; ProductTypeEntityList.Clear(); LoadOperation <ProductManager.Web.Model.product_type> loadOperationDepartment = systemManageDomainContext.Load <ProductManager.Web.Model.product_type>(systemManageDomainContext.GetProduct_typeQuery()); loadOperationDepartment.Completed += loadOperationProductType_Completed; }
private void loadOperationProductType_Completed(object sender, EventArgs e) { ProductTypeEntityList.Clear(); LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.product_type product_type in loadOperation.Entities) { ProductTypeEntity productTypeEntity = new ProductTypeEntity(); productTypeEntity.ProductType = product_type; productTypeEntity.Update(); ProductTypeEntityList.Add(productTypeEntity); } UpdateChanged("ProductTypeEntityList"); IsBusy = false; }