private void btnAdd_Click(object sender, EventArgs e)
        {
            Product         product         = new Product();
            EditProductForm editProductForm = new EditProductForm(categories, product);

            if (editProductForm.ShowDialog() == DialogResult.OK)
            {
                insertProduct(product);
                products.Add(product);
                displayProducts();
            }
        }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dgvProducts.SelectedRows.Count == 1)
     {
         Product         product         = (Product)dgvProducts.SelectedRows[0].Tag;
         EditProductForm editProductForm = new EditProductForm(categories, product);
         if (editProductForm.ShowDialog() == DialogResult.OK)
         {
             updateProduct(product);
             displayProducts();
         }
     }
 }