示例#1
0
 private void editTransactionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (objectListViewTransactions.SelectedObject != null)
     {
         var transaction     = (Transaction)objectListViewTransactions.SelectedObject;
         var account         = (Account)comboBoxAccounts.SelectedItem;
         var editTransaction = new AddTransaction(account, transaction);
         if (!transaction.Product.ID.Equals(2))
         {
             if (editTransaction.ShowDialog().Equals(DialogResult.OK))
             {
                 dateTimePicker_ValueChanged(sender, e);
             }
         }
     }
 }
示例#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);
     }
 }