Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            GlobalVariables.selectedProductID = 0;
            frmProductsAdd editForm = new frmProductsAdd();

            editForm.ShowDialog();
            // repopulates list view with updated product details
            lvProducts.Items.Clear();
            DisplayProducts();
        }
Пример #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (lvProducts.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select a Product to update");
                return;
            }
            GlobalVariables.selectedProductID = int.Parse(lvProducts.SelectedItems[0].Text);
            frmProductsAdd editForm = new frmProductsAdd();

            editForm.ShowDialog();
            // repopulates list view with updated product details
            lvProducts.Items.Clear();
            DisplayProducts();
        }