Ejemplo n.º 1
0
        private async void myDeposit_Click(object sender, RoutedEventArgs e)
        {
            bool    success = false;
            decimal amount  = 0;

            if (accountList.SelectedIndex != -1)
            {
                decimal.TryParse(amountBox.Text, out amount);
                success = AccountLogic.Deposit(customer.Accounts[accountList.SelectedIndex], amount);
            }
            MessageDialog deposit;

            if (success)
            {
                deposit = new MessageDialog($"{amount} SEK Deposited", "Deposit Successful!");
                Frame.Navigate(typeof(AccountPage), customer);
                Frame.GoBack();
            }
            else
            {
                deposit = new MessageDialog("Deposit failed...");
            }
            await deposit.ShowAsync();
        }
 private void myDeposit_Click(object sender, RoutedEventArgs e)
 {
     decimal.TryParse(depositBox.Text, out decimal amount);
     AccountLogic.Deposit(customer.Accounts[accountList.SelectedIndex], amount);
 }