Esempio n. 1
0
        private void Menu_EditBank_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = dgExchangeRate.SelectedItem as ExchangeRateItem;

            if (!ReferenceEquals(selectedItem, null))
            {
                try
                {
                    var selectedID = BankID.Create(selectedItem.ID);

                    var addWindow = new AddEditWindow(exchangeRate.BanksInfo[selectedID]);

                    if (addWindow.ShowDialog() == true)
                    {
                        UpdateDataGrid();
                    }
                }
                catch (Exception except)
                {
                    MessageBox.Show(except.Message);
                }
            }
            else
            {
                MessageBox.Show("Click on item that needed to be edit");
            }
        }
Esempio n. 2
0
        private void Menu_AddBank_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var addWindow = new AddEditWindow();

                if (addWindow.ShowDialog() == true)
                {
                    UpdateDataGrid();
                }
            }
            catch (Exception excep)
            {
                MessageBox.Show(excep.Message);
            }
        }
Esempio n. 3
0
        private void dgExchangeRate_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            var selectedItem = dgExchangeRate.SelectedItem as ExchangeRateItem;

            if (!ReferenceEquals(selectedItem, null))
            {
                try
                {
                    var selectedID = BankID.Create(selectedItem.ID);

                    var editWindow = new AddEditWindow(exchangeRate.BanksInfo[selectedID]);

                    if (editWindow.ShowDialog() == true)
                    {
                        UpdateDataGrid();
                    }
                }
                catch (Exception excep)
                {
                    MessageBox.Show(excep.Message);
                }
            }
        }