private void buttonAddProvider_Click(object sender, EventArgs e) { FormAddItem formAddItem = new FormAddItem() { Text = "Add new Provider" }; if (formAddItem.ShowDialog() == DialogResult.OK) { _dm.Providers.Add(new Provider() { Name = formAddItem.ItemName }); _dm.SaveChanges(); UpdateComboBoxProviders(); UpdateListViewGoods(); } }
private void ButtonAddCategory_Click(object sender, EventArgs e) { FormAddItem formAddItem = new FormAddItem() { Text = "Add new Category" }; if (formAddItem.ShowDialog() == DialogResult.OK) { _dm.Categories.Add(new Category() { Name = formAddItem.ItemName }); _dm.SaveChanges(); UpdateComboBoxCategories(); UpdateListViewGoods(); } }