Exemple #1
0
        // handlers for when the add button is clicked
        private void AddProductButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            ProductEditor dialog = new ProductEditor();

            dialog.SetForAdd();
            dialog.Closed += new EventHandler(ProductEditorDialog_AddClosed);
            dialog.Show();
        }
Exemple #2
0
        // handers for when the update button is clicked
        private void UpdateProductButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            ProductEditor dialog = new ProductEditor();

            dialog.SetForUpdate();
            dialog.Closed += new EventHandler(ProductEditorDialog_UpdateClosed);

            // init fields
            dialog.InitFields(ProductNameTextBox.Text,
                              ProductNumberTextBox.Text,
                              ProductPriceTextBox.Text,
                              ProductCategortyTextBox.Text);

            dialog.Show();
        }