private void btnAddProducts_Click(object sender, EventArgs e) { FrmAddModifyProducts addProductsForm = new FrmAddModifyProducts(); addProductsForm.AddProducts = true; DialogResult res = addProductsForm.ShowDialog(); if (res == DialogResult.OK) { Display(); } }
private void btnEditProd_Click(object sender, EventArgs e) { FrmAddModifyProducts editProdForm = new FrmAddModifyProducts(); editProdForm.AddProducts = false; editProdForm.product = currentAllProd; DialogResult res = editProdForm.ShowDialog(); if (res == DialogResult.OK) { currentProd = editProdForm.product; allProdList = ProductsSuppliersDB.GetProducts(); dataGridAllProd.DataSource = allProdList; Display(); } else { editProdForm.ClearControls(); } }