private void ButtonAddInventoryCode_Click(object sender, EventArgs e) { using (InventoryCodeControlForm inventoryCodeControl = new InventoryCodeControlForm()) { inventoryCodeControl.AddNewBookExample += AddNewCodeToList; inventoryCodeControl.ShowDialog(); Activate(); } }
private void ButtonEditInventoryCode_Click(object sender, EventArgs e) { if (listBoxInventoryCodeNotAvailable.SelectedItem != null) { int currentCode = Convert.ToInt32(listBoxInventoryCodeNotAvailable.SelectedItem, CultureInfo.CurrentCulture); using (InventoryCodeControlForm inventoryCodeControl = new InventoryCodeControlForm(currentCode)) { inventoryCodeControl.AddNewBookExample += AddNewCodeToList; inventoryCodeControl.EditNewBookExample += RemoveCodeFromList; inventoryCodeControl.ShowDialog(); Activate(); } } }