private void buttonProductAdd_Click(object sender, EventArgs e) { Product theProduct = new Product(); FormProductNew theProductNew = new FormProductNew(theProduct); theProductNew.ShowDialog(); LoadProduct(); }
private void buttonEdit_Click(object sender, EventArgs e) { Product theProduct = listBoxProducts.SelectedItem as Product; if (theProduct == null) { return; } FormProductNew theProductNew = new FormProductNew(theProduct); theProductNew.ShowDialog(); LoadProduct(); }