//user clicks the modify button in the product tab private void btnModifyProduct_Click(object sender, EventArgs e) { SelectedRowProduct(); // get the row selected AddModifyProduct modifyProduct = new AddModifyProduct(); //call for the new form modifyProduct.addProdcut = false; //set add product to false indicating its modify button not add button pressed modifyProduct.product = product; DialogResult result = modifyProduct.ShowDialog(); //show new form this.DisplayProducts(); this.DisplayPackages(); this.DisplayPackageProdSup(); }
/// <summary> /// Purpose: adds product to database when user clicks button /// then returns to the main form and reloads product data grid view /// </summary> private void btnAddProduct_Click(object sender, EventArgs e) { AddModifyProduct addModifyProducts = new AddModifyProduct(); // make new form addModifyProducts.addProdcut = true; //setting value to true to show add button was clicked DialogResult result = addModifyProducts.ShowDialog(); if (result == DialogResult.OK) //if accept button was clicked { product = addModifyProducts.product; // TODO: might not need this code this.DisplayProducts(); this.DisplayPackages(); this.DisplayPackageProdSup(); } }