private void editCountryToolStripMenuItem_Click(object sender, EventArgs e) { if (objectListViewCountries.SelectedObject != null) { var country = (Country)objectListViewCountries.SelectedObject; var editCountry = new AddCountry(country); if (editCountry.ShowDialog() == DialogResult.OK) { objectListViewCountries.RefreshObject(country); dateTimePicker_ValueChanged(sender, e); } } }
private void toolStripButtonAdd_Click(object sender, EventArgs e) { if (tabControl.SelectedTab.Equals(tabPageTransactions)) { var account = (Account)comboBoxAccounts.SelectedItem; var addTransaction = new AddTransaction(account); if (addTransaction.ShowDialog() == DialogResult.OK) { dateTimePicker_ValueChanged(sender, e); } } else if (tabControl.SelectedTab.Equals(tabPageCountries)) { var addCountry = new AddCountry(); if (addCountry.ShowDialog() == DialogResult.OK) { GetCountriesList(); dateTimePicker_ValueChanged(sender, e); } } else if (tabControl.SelectedTab.Equals(tabPageProducts)) { var account = (Account)comboBoxAccounts.SelectedItem; var addProduct = new AddProduct(account); if (addProduct.ShowDialog() == DialogResult.OK) { RefreshProductsComboBox(); GetProductsList(); dateTimePicker_ValueChanged(sender, e); } } else if (tabControl.SelectedTab.Equals(tabPageAccounts)) { AddNewAccount(); dateTimePicker_ValueChanged(sender, e); } }