Ejemplo n.º 1
0
        private void ButtonAddProductClick(object sender, EventArgs e)
        {
            var form = new ProductForm(new Product());

            if (form.ShowDialog() == DialogResult.OK)
            {
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
Ejemplo n.º 2
0
        private void ButtonAddClick(object sender, EventArgs e)
        {
            try
            {
                ProductForm form =
                    new ProductForm(new Product {Standart = _currentKit}, false);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    Product product = form.CurrentObject as Product;
                    if(product == null)
                        return;
                    dataGridViewProducts.AddItem(product);

                    comboBoxDefaultProduct.Items.Add(product);
                }
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while building new object", ex);
            }
        }