Exemple #1
0
        private void OnGetProductButtonClick(object sender, RoutedEventArgs e)
        {
            string productIdStr = ProductId.Text;

            if (productIdStr != "")
            {
                int productId = int.Parse(productIdStr);
                var product   = Persister.GetProductById(productId);
                if (product == null)
                {
                    MessageBox.Show(String.Format("No product with Id {0} was found in the inventory`s database!", productId));
                }
                this.DataContext = product;
            }
            else
            {
                MessageBox.Show("No product id was entered!");
            }
        }