private async void Button_Clicked_AddAccount(object sender, EventArgs e) { BankAccount accountToAdd = new BankAccount(); accountToAdd.accountName = AccName.Text; accountToAdd.accountNumber = AccNum.Text; accountToAdd.accountOwner = sessionUser.phoneNo; accountToAdd.iban = iban.Text; accountToAdd.balance = 0.0; BankAccount.RunPost(accountToAdd); List <BankAccount> updatedAccounts = await BankAccount.getAllAccounts(sessionUser.phoneNo); Person.loginCredentials creds = new Person.loginCredentials(sessionUser.phoneNo, sessionUser.password); Person updatedUser = await Person.getUser(creds); List <BankAccount> useraccounts = await BankAccount.getAllAccounts(updatedUser.phoneNo); await Navigation.PushAsync(new MainPage(updatedUser, updatedAccounts)); }
private async void Button_Clicked_TransferFunds(object sender, EventArgs e) { string selectedaccName = accountPicker.Items[accountPicker.SelectedIndex]; BankAccount ibanFromAcc = accounts.FirstOrDefault(a => a.accountName == selectedaccName); string ibanFROM = ibanFromAcc.iban; string ibanToSendTo = ibanInput.Text; double amountToSend = Convert.ToDouble(transferAmount.Text); BankAccount.BankPutDetails detailsToPass = new BankAccount.BankPutDetails(ibanFROM, ibanToSendTo, amountToSend); BankAccount.RunBankPut(detailsToPass); List <BankAccount> updatedAccounts = await BankAccount.getAllAccounts(sessionUser.phoneNo); Person.loginCredentials creds = new Person.loginCredentials(sessionUser.phoneNo, sessionUser.password); Person updatedUser = await Person.getUser(creds); List <BankAccount> useraccounts = await BankAccount.getAllAccounts(updatedUser.phoneNo); await Navigation.PushAsync(new MainPage(updatedUser, updatedAccounts)); }