private void addGoodToolStripMenuItem_Click(object sender, EventArgs e) { if (lvSuppliers.SelectedItems.Count > 0) { GoodForm goodForm = new GoodForm((Supplier)lvSuppliers.SelectedItems[0].Tag); goodForm.ShowDialog(); } }
private void btnAddGood_Click(object sender, EventArgs e) { if (lvSuppliers.SelectedItems.Count == 0) { MessageBox.Show("Choose a Supplier"); } else { var supplier = (Supplier)lvSuppliers.SelectedItems[0].Tag; GoodForm goodForm = new GoodForm(supplier); goodForm.ShowDialog(); } }