private void buttonAdd_Click(object sender, EventArgs e) { Globals.IDNo = -1; AddEditDiscount addedit = new AddEditDiscount(); addedit.ShowDialog(); fillbox(); }
private void buttonEdit_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { Globals.IDNo = int.Parse(listBox1.SelectedValue.ToString()); AddEditDiscount addedit = new AddEditDiscount(); addedit.ShowDialog(); fillbox(); } else { MessageBox.Show("Please select a discount from the list"); } }