Esempio n. 1
0
        private void btnGetProduct_Click(object sender, RoutedEventArgs e)
        {
            int id;

            if (Int32.TryParse(productID.Text, out id))
            {
                try
                {
                    gridProductDetails.DataContext = StoreDB.GetProduct(id);
                }
                catch
                {
                    MessageBox.Show("Error contacting database.");
                }
            }
            else
            {
                MessageBox.Show("Invalid ID");
            }
        }