private void Button_Click(object sender, RoutedEventArgs e)
        {
            decimal startBalance;
            var     chosenClient = clientCombo.SelectedItem as Client;

            if (decimal.TryParse(balanceBox.Text, out startBalance) && chosenClient != null)
            {
                IAccount acc = Factory.Instance.GAccount();
                acc.AddAccount(chosenClient.Id, startBalance);
                UpdateAccount?.Invoke();
                balanceBox.Text          = null;
                clientCombo.SelectedItem = null;
                MessageBox.Show("You've successfully added a new account");
            }
            else
            {
                MessageBox.Show("Invalid input data");
            }
        }
Beispiel #2
0
 public void OnUpdateAccount(DateTime time, IEnumerable <AccountInfo> newAccounts, IEnumerable <AccountInfo> oldAccounts)
 {
     Task.Run(() =>
              UpdateAccount?.Invoke(this, new Tuple <DateTime, IEnumerable <AccountInfo>, IEnumerable <AccountInfo> >(time, newAccounts, oldAccounts)));
 }
Beispiel #3
0
 public void OnUpdateAccount(DateTime time, AccountInfo newAccount, AccountInfo oldAccount)
 {
     Task.Run(() =>
              UpdateAccount?.Invoke(this, new Tuple <DateTime, IEnumerable <AccountInfo>, IEnumerable <AccountInfo> >(time, new[] { newAccount }, new[] { oldAccount })));
 }