Fix bug on request and SwitchAccountPage

pull/69/head
Titouan LOUVET 2 years ago
parent ef8fe5b614
commit 42452e2898

@ -14,6 +14,13 @@ public partial class SwitchAccountPage : ContentPage
BindingContext = Mgr.SelectedCustomer; BindingContext = Mgr.SelectedCustomer;
} }
protected override void OnAppearing()
{
base.OnAppearing();
RefreshData();
}
public async void Transfer_Clicked(object sender, EventArgs e) public async void Transfer_Clicked(object sender, EventArgs e)
{ {
var selectedItem = (sender as Button)?.BindingContext as Account; var selectedItem = (sender as Button)?.BindingContext as Account;
@ -47,4 +54,9 @@ public partial class SwitchAccountPage : ContentPage
} }
} }
private void RefreshData()
{
BindingContext = Mgr.SelectedCustomer;
}
} }

@ -40,7 +40,7 @@ public partial class RequestPage : ContentPage
await DisplayAlert("Erreur", "Le compte ne possède assez d'argent sur son compte pour aboutir à la transaction", "OK"); await DisplayAlert("Erreur", "Le compte ne possède assez d'argent sur son compte pour aboutir à la transaction", "OK");
return; return;
} }
acc.DoTransactions(acc, Convert.ToDouble(Sum.Text), true); // Type true car c'est un virement que le SelectedAccount reçoit acc.DoTransactions(Mgr.SelectedAccount, Convert.ToDouble(Sum.Text), true); // Type true car c'est un virement que le SelectedAccount reçoit
Mgr.Persistence.DataSave(Mgr.CustomersList, Mgr.Consultant); Mgr.Persistence.DataSave(Mgr.CustomersList, Mgr.Consultant);
await Shell.Current.Navigation.PopAsync(); await Shell.Current.Navigation.PopAsync();
return; return;

Loading…
Cancel
Save