Merge branch 'master' of https://codefirst.iut.uca.fr/git/hugo.livet/ConsEco
continuous-integration/drone/push Build is failing Details

pull/138/head
Lucas EVARD 2 years ago
commit ab33f28138

@ -1,7 +1,7 @@
# Cons'Eco # Cons'Eco
[![Build Status](https://codefirst.iut.uca.fr/api/badges/hugo.livet/ConsEco/status.svg)](https://codefirst.iut.uca.fr/hugo.livet/ConsEco) [![Build Status](https://codefirst.iut.uca.fr/api/badges/ConsEcoTeam/ConsEco/status.svg)](https://codefirst.iut.uca.fr/hugo.livet/ConsEco)
[![Csharp](https://img.shields.io/badge/-CSharp-50C878?style=for-the-badge&logo=csharp)](https://learn.microsoft.com/fr-fr/dotnet/csharp/) [![Xaml](https://img.shields.io/badge/-XAML-6495ED?style=for-the-badge&logo=xaml)](https://learn.microsoft.com/fr-fr/dotnet/desktop/wpf/xaml/?view=netdesktop-6.0) [![.NET/WPF](https://img.shields.io/badge/-.NET/WPF-B87333?style=for-the-badge&logo=dotnet)](https://learn.microsoft.com/fr-fr/dotnet/desktop/wpf/?view=netdesktop-6.0) [![Csharp](https://img.shields.io/badge/-CSharp-50C878?style=for-the-badge&logo=csharp)](https://learn.microsoft.com/fr-fr/dotnet/csharp/) [![Xaml](https://img.shields.io/badge/-XAML-6495ED?style=for-the-badge&logo=xaml)](https://learn.microsoft.com/fr-fr/dotnet/desktop/wpf/xaml/?view=netdesktop-6.0) [![.NET/WPF](https://img.shields.io/badge/-.NET/MAUI-B87333?style=for-the-badge&logo=dotnet)](https://learn.microsoft.com/fr-fr/dotnet/maui/what-is-maui?view=net-maui-6.0)
<br /> <br />
<div align="center"> <div align="center">

@ -33,18 +33,39 @@ namespace Data
} }
public void SupprimerBanqueBdd(Inscrit inscrit, Banque banque) public void SupprimerBanqueBdd(Inscrit inscrit, Banque banque)
{ {
throw new NotImplementedException(); foreach(Inscrit i in lesInscrits)
{
if (i == inscrit)
{
foreach(Banque b in i.LesBanques)
{
if(b == banque)
{
i.SupprimerBanque(b);
}
}
}
}
} }
public void SupprimerToutesBanquesBdd(Inscrit inscrit) public void SupprimerToutesBanquesBdd(Inscrit inscrit)
{ {
throw new NotImplementedException(); foreach(Inscrit i in lesInscrits)
{
if(i == inscrit)
{
foreach(Banque b in i.LesBanques)
{
i.SupprimerBanque(b);
}
}
}
} }
public void CreateInscrit(Inscrit inscrit){ public void CreateInscrit(Inscrit inscrit){
lesInscrits.Add(inscrit); lesInscrits.Add(inscrit);
} }
public string LastInscrit() public string LastInscrit()
{ {
return "1"; return lesInscrits[lesInscrits.Count - 1].Id;
} }
public bool ExistEmail(string mail) public bool ExistEmail(string mail)
{ {
@ -79,9 +100,20 @@ namespace Data
} }
return "inexistant"; return "inexistant";
} }
public int CalculTotalSoldeComtpe(Inscrit user) public int CalculTotalSoldeComtpe(Inscrit inscrit)
{
int totalSoldeComtpe = 0;
foreach(Inscrit i in lesInscrits)
{
if(i == inscrit)
{
foreach(Banque b in i.LesBanques)
{ {
return 0; totalSoldeComtpe = b.ListeDesComptes.Sum(x => Convert.ToInt32(x));
}
}
}
return totalSoldeComtpe;
} }
public List<Banque> LoadBanqueId(string id) public List<Banque> LoadBanqueId(string id)
{ {
@ -121,6 +153,11 @@ namespace Data
{ {
return LoadOperation.LoadOperationsFromOFX(ofx); return LoadOperation.LoadOperationsFromOFX(ofx);
} }
public string LoadInscrit(string id, string mdp)
{
throw new NotImplementedException();
}
} }
} }

@ -86,6 +86,7 @@ namespace Model
Prenom = prenom; Prenom = prenom;
Mdp = mdp; Mdp = mdp;
SoldeTotal = soldeTotal; SoldeTotal = soldeTotal;
lesBanques = new();
} }
public Inscrit(string id, string nom, string mail, string prenom, string mdp, double soldeTotal, List<Banque> lesbanques) public Inscrit(string id, string nom, string mail, string prenom, string mdp, double soldeTotal, List<Banque> lesbanques)
: this(id, nom, mail, prenom, mdp, soldeTotal) : this(id, nom, mail, prenom, mdp, soldeTotal)

@ -26,7 +26,7 @@ namespace TestsUnitaires
{ {
Banque bq = new Banque("Crédit Agricole", "https://creditagricole.fr", "https://yt3.ggpht.com/a/AGF-l7_mEfX2eQaGm8GefLOg5ZMRciNw-pESE3gUWg=s900-c-k-c0xffffffff-no-rj-mo"); Banque bq = new Banque("Crédit Agricole", "https://creditagricole.fr", "https://yt3.ggpht.com/a/AGF-l7_mEfX2eQaGm8GefLOg5ZMRciNw-pESE3gUWg=s900-c-k-c0xffffffff-no-rj-mo");
Inscrit i1 = new Inscrit("A1001", "Smith", "smith@gmail.com", "luke", "test20000aA", 500); Inscrit i1 = new Inscrit("A1001", "Smith", "smith@gmail.com", "luke", "test20000aA", 500);
Assert.NotNull(i1.LesBanques); //Assert.NotNull(i1.LesBanques);
i1.ajouterBanque(bq); i1.ajouterBanque(bq);
Assert.Contains(bq, i1.LesBanques); Assert.Contains(bq, i1.LesBanques);
i1.SupprimerBanque(bq); i1.SupprimerBanque(bq);

Loading…
Cancel
Save