Example #1
0
        private void addNewProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewProductForm newProductform = new NewProductForm(ref m_register);
            DialogResult   tempDR         = newProductform.ShowDialog();

            Product toAdd;

            if (tempDR != DialogResult.OK)
            {
                return;
            }

            toAdd = newProductform.ProductToAdd;

            m_register.Products.Add(toAdd);

            foreach (Control c in m_inventoryTab.Controls)
            {
                if (c is InventoryControl)
                {
                    InventoryControl inv = c as InventoryControl;
                    inv.UpdateInventory();
                }
            }
            m_register.Save();
        }