modif stub. Ajout de la possibilité de créer des comptes et de changer le mot de passe depuis le stub
continuous-integration/drone/push Build is failing Details

GestionBanques
Vincent ASTOLFI 2 years ago
parent 9526b62b69
commit 1565ff6d0e

@ -4,9 +4,28 @@ namespace Data
{ {
public class Stub : IPersistanceManager public class Stub : IPersistanceManager
{ {
private List<Inscrit> lesInscrits = new List<Inscrit>();
public Stub()
{
lesInscrits.Add(new Inscrit(
"1",
"LIVET",
"livet.hugo2003@gmail.com",
"Hugo",
"Bonjour63."
));
}
public string GetId(string mail) public string GetId(string mail)
{ {
return "1"; foreach(Inscrit i in lesInscrits)
{
if(i.Mail == mail)
{
return i.Id;
}
}
return null;
} }
public void SupprimerInscritBdd(Inscrit inscrit) public void SupprimerInscritBdd(Inscrit inscrit)
{ {
@ -20,22 +39,45 @@ namespace Data
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void CreateInscrit(Inscrit inscrit){} public void CreateInscrit(Inscrit inscrit){
lesInscrits.Add(inscrit);
}
public string LastInscrit() public string LastInscrit()
{ {
return "1"; return "1";
} }
public bool ExistEmail(string mail) public bool ExistEmail(string mail)
{ {
return true; foreach(Inscrit i in lesInscrits)
{
if(i.Mail == mail)
{
return true;
}
}
return false;
} }
public void ChangePasswordBdd(string mail, string newMdp) public void ChangePasswordBdd(string mail, string newMdp)
{ {
throw new NotImplementedException(); foreach(Inscrit i in lesInscrits)
{
if(i.Mail == mail)
{
i.Mdp = newMdp;
}
}
} }
public string RecupMdpBdd(string mail) public string RecupMdpBdd(string mail)
{ {
return "61202106183104184172149183829180134166241997147151111351903525172892257223616564213999421532841808077145252175106506275806214514321147161111472321892055913517616241"; Hash hash = new Hash();
foreach(Inscrit i in lesInscrits)
{
if(i.Mail == mail)
{
return hash.CreateHashCode(i.Mdp);
}
}
return "inexistant";
} }
public int CalculTotalSoldeComtpe(Inscrit user) public int CalculTotalSoldeComtpe(Inscrit user)
{ {
@ -65,10 +107,14 @@ namespace Data
public Inscrit GetInscrit(string mail) public Inscrit GetInscrit(string mail)
{ {
string mdp = "Azerty12345678!"; foreach(Inscrit i in lesInscrits)
Inscrit i = new Inscrit("1", "LIVET", "livet.hugo2003@gmail.com", "Hugo", mdp); {
if(i.Mail == mail)
return i; {
return i;
}
}
return null;
} }
public IList<Compte> GetCompteFromOFX(string ofx) public IList<Compte> GetCompteFromOFX(string ofx)

@ -28,6 +28,10 @@ public partial class ForgetPassword : ContentPage
ConnexionButton.IsEnabled = false; ConnexionButton.IsEnabled = false;
UpdateArc(); UpdateArc();
} }
else
{
AffichError("Mail inexistant", "Aucun compte possédant cette adresse email trouvé", "OK");
}
} }
private async void AffichError(string s, string s1, string s2) private async void AffichError(string s, string s1, string s2)
{ {

@ -28,10 +28,7 @@ namespace Model
private int solde; private int solde;
private Inscrit user; private Inscrit user;
public Inscrit User public Inscrit User
{ {
get get

Loading…
Cancel
Save