Exemple #1
0
 private void editProductToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (objectListViewProducts.SelectedObject != null)
     {
         var product     = (Product)objectListViewProducts.SelectedObject;
         var account     = (Account)comboBoxAccounts.SelectedItem;
         var editProduct = new AddProduct(account, product);
         if (editProduct.ShowDialog() == DialogResult.OK)
         {
             objectListViewProducts.RefreshObject(product);
             RefreshProductsComboBox();
         }
     }
 }
Exemple #2
0
 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);
     }
 }