/// <summary> /// Katrina: Opens form for modifying product info and displays new modified data on main form /// </summary> private void btnModifyProducts_Click(object sender, EventArgs e) { frmAddModifyProducts addForm = new frmAddModifyProducts(); addForm.addProduct = false; addForm.currentProd = currentProd; DialogResult result = addForm.ShowDialog(); //display frmAddModifySupplier if (result == DialogResult.OK) { currentProd = addForm.currentProd; MessageBox.Show("Successfully modified product: " + currentProd.ProductId.ToString()); } this.DisplayCurrentProdData(); }
/// <summary> /// Katrina: Opens form for adding new product info and displays added product on main form /// </summary> private void btnAddProducts_Click(object sender, EventArgs e) { frmAddModifyProducts addForm = new frmAddModifyProducts(); addForm.addProduct = true; addForm.prodIds = productIds; DialogResult result = addForm.ShowDialog(); // displays new modal form if (result == DialogResult.OK) { currentProd = addForm.product; productIdComboBox.Text = currentProd.ProductId.ToString(); this.DisplayCurrentProdData(); RefreshProdComboBox(true); MessageBox.Show("New product has been added."); } }