private void Edit(Inventory item) { using (InventoryForm form = new InventoryForm(item, false)) { if (form.ShowDialog() != DialogResult.OK) item.RejectChanges(); } }
private void _btnAdd_Click(object sender, EventArgs e) { Inventory item = _model.InventoryCreateInstance(); using (InventoryForm form = new InventoryForm(item, true)) { if (form.ShowDialog() == DialogResult.OK) { item.AcceptChanges(); objectBinder.List.Add(item); } } }