|
|
@ -26,12 +26,12 @@ namespace Model
|
|
|
|
{
|
|
|
|
{
|
|
|
|
user = value;
|
|
|
|
user = value;
|
|
|
|
OnPropertyChanged(nameof(User));
|
|
|
|
OnPropertyChanged(nameof(User));
|
|
|
|
|
|
|
|
LoadBanque();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Banque SelectedBanque
|
|
|
|
public BanqueInscrit SelectedBanque
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => selectedBanque;
|
|
|
|
get => selectedBanque;
|
|
|
|
set
|
|
|
|
set
|
|
|
@ -43,7 +43,7 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private Banque selectedBanque;
|
|
|
|
private BanqueInscrit selectedBanque;
|
|
|
|
public IList<Banque> BanquesDisponibleInApp
|
|
|
|
public IList<Banque> BanquesDisponibleInApp
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => banquesDisponibleInApp;
|
|
|
|
get => banquesDisponibleInApp;
|
|
|
@ -75,8 +75,8 @@ namespace Model
|
|
|
|
private Compte selectedCompte;
|
|
|
|
private Compte selectedCompte;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private IList<Banque> listeDesBanques = new List<Banque>();
|
|
|
|
private IList<BanqueInscrit> listeDesBanques = new List<BanqueInscrit>();
|
|
|
|
public ReadOnlyCollection<Banque> AllBanque { get; private set; }
|
|
|
|
public ReadOnlyCollection<BanqueInscrit> AllBanque { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<Compte> listeDesComptes = new List<Compte>();
|
|
|
|
private List<Compte> listeDesComptes = new List<Compte>();
|
|
|
@ -86,7 +86,7 @@ namespace Model
|
|
|
|
|
|
|
|
|
|
|
|
public Manager(IPersistanceManager persistance)
|
|
|
|
public Manager(IPersistanceManager persistance)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AllBanque = new ReadOnlyCollection<Banque>(listeDesBanques);
|
|
|
|
AllBanque = new ReadOnlyCollection<BanqueInscrit>(listeDesBanques);
|
|
|
|
AllCompte = new ReadOnlyCollection<Compte>(listeDesComptes);
|
|
|
|
AllCompte = new ReadOnlyCollection<Compte>(listeDesComptes);
|
|
|
|
Pers = persistance;
|
|
|
|
Pers = persistance;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -97,16 +97,17 @@ namespace Model
|
|
|
|
|
|
|
|
|
|
|
|
public async void LoadCompte()
|
|
|
|
public async void LoadCompte()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
listeDesComptes.Clear();
|
|
|
|
listeDesComptes.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
if(SelectedBanque == null || SelectedCompte == null)
|
|
|
|
if(SelectedBanque == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new ArgumentNullException("Vous n'avez pas de banque disponible");
|
|
|
|
throw new ArgumentNullException("Vous n'avez pas de banque disponible");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IList<Compte> comptes = await Pers.RecupererCompte(SelectedBanque, User);
|
|
|
|
IList<Compte> comptes = await Pers.RecupererCompte(SelectedBanque);
|
|
|
|
listeDesComptes.AddRange(comptes);
|
|
|
|
listeDesComptes.AddRange(comptes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(Exception exception)
|
|
|
|
catch(Exception exception)
|
|
|
@ -131,6 +132,8 @@ namespace Model
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SelectedCompte = listeDesComptes.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async void LoadBanque()
|
|
|
|
public async void LoadBanque()
|
|
|
@ -138,12 +141,14 @@ namespace Model
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
listeDesBanques = await Pers.RecupererBanques(User);
|
|
|
|
listeDesBanques = await Pers.RecupererBanques(User);
|
|
|
|
}catch(Exception exception)
|
|
|
|
SelectedBanque = listeDesBanques.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception exception)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Debug.WriteLine(exception.Message);
|
|
|
|
Debug.WriteLine(exception.Message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SelectedBanque = listeDesBanques.First();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async void LoadBanqueDispo()
|
|
|
|
public async void LoadBanqueDispo()
|
|
|
@ -173,11 +178,11 @@ namespace Model
|
|
|
|
User = null;
|
|
|
|
User = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async void LoadBanques()
|
|
|
|
/*public async void LoadBanques()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
User.LesBanques = await Pers.RecupererBanques(User);
|
|
|
|
User.LesBanques = await Pers.RecupererBanques(User);
|
|
|
|
BanquesDisponibleInApp = await Pers.RecupererBanquesDisponible();
|
|
|
|
BanquesDisponibleInApp = await Pers.RecupererBanquesDisponible();
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<string> getPassword(string email)
|
|
|
|
public async Task<string> getPassword(string email)
|
|
|
|
{
|
|
|
|
{
|
|
|
|