Exemplo n.º 1
0
 private void button_Ok_Click(object sender, RoutedEventArgs e)
 {
     if (_ui_logic.CheckAmountFormValid(textBoxAmountTransaction.Text) == false)
     {
         MessageBox.Show("The number is incorrect. (It should be greater that 0.) \nTry to press <Count> button.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         if (ComboBox_From.SelectedItem == null)
         {
             MessageBox.Show("You should choose a bill from a combobox.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             if (ComboBox_To.SelectedItem == null)
             {
                 MessageBox.Show("You should choose a bill from a combobox.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
             }
             else
             {
                 _repo.AddHisItem_SpecialForTransaction(Convert.ToDecimal(textBoxAmountTransaction.Text), ComboBox_From.SelectedItem as String, ComboBox_To.SelectedItem as String);
                 textBoxAmountTransaction.Clear();
                 ComboBox_From.SelectedItem = null;
                 ComboBox_To.SelectedItem   = null;
                 NavigationService.Navigate(new History());
                 HistoryInitialised3?.Invoke();
             }
         }
     }
 }