private void uxProductNew_Click(object sender, RoutedEventArgs e) { var window = new ProductWindow(); if (true == window.ShowDialog()) { var uiModel = window.Product; var repositoryModel = uiModel.ToRepositoryModel(); App.InventoryRepository.Add(repositoryModel); LoadProducts(); } }
private void uxProductChange_Click(object sender, RoutedEventArgs e) { var window = new ProductWindow(); window.Product = selectedProduct.Clone(); if (true == window.ShowDialog()) { App.InventoryRepository.Update(window.Product.ToRepositoryModel()); LoadProducts(); } }