Example #1
0
        /// <summary>
        ///     Triggered when the "Properties" button is clicked for the selected product
        /// </summary>
        /// <param name="sender">Control that initiated the event</param>
        /// <param name="eventArgs">Arguments associated with this event</param>
        private void OnProductPropertiesButtonClick(object sender, EventArgs eventArgs)
        {
            using (var dialog = new ProductPropertiesDialog(Price.Product))
                dialog.ShowDialog(this);

            PopulateProducts();
            UpdateControlState();
        }
Example #2
0
        /// <summary>
        ///     Triggered when the "Add" product button is clicked
        /// </summary>
        /// <param name="sender">Control that initiated the event</param>
        /// <param name="eventArgs">Arguments associated with this event</param>
        private void OnAddNewTypeButtonClick(object sender, EventArgs eventArgs)
        {
            using (var dialog = new ProductPropertiesDialog(new Product())) {
                if (dialog.ShowDialog(this) != DialogResult.Cancel)
                {
                    Price.Product = dialog.Product;
                }
            }

            PopulateProducts();
            UpdateControlState();
        }