//modify button pressed in products supplier tab private void btnModifyProductSupplier_Click(object sender, EventArgs e) { Product_Supplier productSupplier = productSuppliers[product_SupplierDataGridView.CurrentCell.RowIndex]; //SelectRowProducts_Suppliers(); //delete later AddModifyProductsSupplier modifyProductsSupplier = new AddModifyProductsSupplier(); modifyProductsSupplier.addProductSupplier = false; modifyProductsSupplier.productSupplier = productSupplier; //making productSupplier in add modify form equal to the productSupplier in main form DialogResult result = modifyProductsSupplier.ShowDialog(); //show add modify products supplier form this.DisplayProductSupplier(); this.DisplayPackages(); this.DisplayPackageProdSup(); }
//add button clicked in prodcuts supplier tab private void btnAddProductSupplier_Click(object sender, EventArgs e) { AddModifyProductsSupplier addProductsSupplier = new AddModifyProductsSupplier(); addProductsSupplier.addProductSupplier = true; DialogResult result = addProductsSupplier.ShowDialog(); //showing add modify from for product supplier if (result == DialogResult.OK) // if user clicks accept { productSupplier = addProductsSupplier.productSupplier; this.DisplayProductSupplier(); this.DisplayPackages(); this.DisplayPackageProdSup(); } }