From d15c4a3a3b81a5064df07b8618d31f118c3e795e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Tue, 16 Mar 2021 14:05:42 +0100 Subject: [PATCH] =?UTF-8?q?Corrections=20de=20bugs=20pour=20la=20gestion?= =?UTF-8?q?=20des=20cl=C3=A9s=20=C3=A9trang=C3=A8res?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/EpInformationTests.cs | 20 +++++++++---------- EPAServeur/Context/EpContext.cs | 5 ++--- EPAServeur/Models/EP/DemandeEPI.cs | 2 +- EPAServeur/Models/EP/RdvEntretien.cs | 2 +- EPAServeur/Startup.cs | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/EPAServeur.Tests/Services/EpInformationTests.cs b/EPAServeur.Tests/Services/EpInformationTests.cs index 4d89e34..a052ba6 100644 --- a/EPAServeur.Tests/Services/EpInformationTests.cs +++ b/EPAServeur.Tests/Services/EpInformationTests.cs @@ -63,8 +63,8 @@ namespace EPAServeur.Tests.Services { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List{ idBUs }, true, 1, 15, "", true,"", null, null); - int count = await epInformationService.GetEPEnCoursCount(new List { idBUs }, "", true, null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List{ idBUs }, true, 1, 15, "", false,"", null, null); + int count = await epInformationService.GetEPEnCoursCount(new List { idBUs }, "", false, null, null); Assert.AreEqual(count, nbElements); Assert.AreEqual(count, epInformationDTOs.Count()); foreach(EpInformationDTO ep in epInformationDTOs) @@ -79,8 +79,8 @@ namespace EPAServeur.Tests.Services { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1,2 }, true, 1, 15, "", true, "", null, null); - int count = await epInformationService.GetEPEnCoursCount(new List { 1, 2 }, "", true, null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1,2 }, true, 1, 15, "", false, "", null, null); + int count = await epInformationService.GetEPEnCoursCount(new List { 1, 2 }, "", false, null, null); Assert.AreEqual(count, 6); Assert.AreEqual(count, epInformationDTOs.Count()); long? bu; @@ -104,7 +104,7 @@ namespace EPAServeur.Tests.Services public async Task GetEpEnCours_TriColonneASC(string tri) { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, tri, null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", false, tri, null, null); EpInformationDTO ep1, ep2; int compare = 0; for(int i = 0; i < epInformationDTOs.Count()-1; ++i) @@ -157,7 +157,7 @@ namespace EPAServeur.Tests.Services public async Task GetEpEnCours_TriColonneDESC(string tri) { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, false, 1, 15, "", true, tri, null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, false, 1, 15, "", false, tri, null, null); EpInformationDTO ep1, ep2; int compare = 0; for (int i = 0; i < epInformationDTOs.Count() - 1; ++i) @@ -206,7 +206,7 @@ namespace EPAServeur.Tests.Services DateTime date = new DateTime(a, m, j); IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, "", date, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", false, "", date, null); Assert.AreEqual(epInformationDTOs.Count(), count); foreach(EpInformationDTO ep in epInformationDTOs) { @@ -222,7 +222,7 @@ namespace EPAServeur.Tests.Services { DateTime date = new DateTime(a, m, j); IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, "", null, date); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", false, "", null, date); Assert.AreEqual(epInformationDTOs.Count(), count); foreach (EpInformationDTO ep in epInformationDTOs) { @@ -242,7 +242,7 @@ namespace EPAServeur.Tests.Services DateTime date2 = new DateTime(a2, m2, j2); IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", true, "", date1, date2); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, "", false, "", date1, date2); Assert.AreEqual(epInformationDTOs.Count(), count); foreach (EpInformationDTO ep in epInformationDTOs) { @@ -263,7 +263,7 @@ namespace EPAServeur.Tests.Services public async Task GetEpEnCours_texte(string texte, int count) { IEpInformationService epInformationService = new EpInformationService(context, collaborateurService, transformDTO); - IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, texte, true, "", null, null); + IEnumerable epInformationDTOs = await epInformationService.GetEPEnCours(new List { 1, 2 }, true, 1, 15, texte, false, "", null, null); Assert.AreEqual(count, epInformationDTOs.Count()); foreach (EpInformationDTO ep in epInformationDTOs) { diff --git a/EPAServeur/Context/EpContext.cs b/EPAServeur/Context/EpContext.cs index 80b0d11..7ca438f 100644 --- a/EPAServeur/Context/EpContext.cs +++ b/EPAServeur/Context/EpContext.cs @@ -85,12 +85,11 @@ namespace EPAServeur.Context entity.HasMany(e => e.Objectifs).WithOne(o => o.Ep); entity.HasMany(e => e.ObjectifsPrecedents).WithOne(o => o.Ep); entity.HasMany(e => e.Participants).WithOne(p => p.Ep); - entity.HasOne(e => e.RdvEntretien).WithOne(r => r.EpChoixRDV).HasForeignKey(r => r.IdEPChoixRDV); + entity.HasOne(e => e.RdvEntretien).WithOne(r => r.EpChoixRDV).HasForeignKey( r => r.IdEPChoixRDV); entity.HasMany(e => e.PropositionsRDV).WithOne(r => r.EpProposition); entity.HasOne(e => e.DemandeEPI).WithOne(a => a.Ep).HasForeignKey(a => a.IdEP); - + }); - modelBuilder.Entity(entity => { entity.HasKey(e => e.IdObjectif); diff --git a/EPAServeur/Models/EP/DemandeEPI.cs b/EPAServeur/Models/EP/DemandeEPI.cs index 58387a0..111eb7d 100644 --- a/EPAServeur/Models/EP/DemandeEPI.cs +++ b/EPAServeur/Models/EP/DemandeEPI.cs @@ -49,7 +49,7 @@ namespace EPAServeur.Models.EP /// /// Id de l'EP /// - public long IdEP { get; set; } + public long? IdEP { get; set; } /// /// EP qui est lié à la demande d'EPI diff --git a/EPAServeur/Models/EP/RdvEntretien.cs b/EPAServeur/Models/EP/RdvEntretien.cs index 51e35dc..6043bc9 100644 --- a/EPAServeur/Models/EP/RdvEntretien.cs +++ b/EPAServeur/Models/EP/RdvEntretien.cs @@ -18,7 +18,7 @@ namespace EPAServeur.Models.EP /// /// Id EP concernant le choix du rendez-vous /// - public long IdEPChoixRDV { get; set; } + public long? IdEPChoixRDV { get; set; } /// /// Date proposée/prévue pour l’entretien diff --git a/EPAServeur/Startup.cs b/EPAServeur/Startup.cs index 3c92099..02ec8d6 100644 --- a/EPAServeur/Startup.cs +++ b/EPAServeur/Startup.cs @@ -109,8 +109,8 @@ namespace EPAServeur DataSeeder.AddChamps(context); DataSeeder.AddNotes(context); DataSeeder.AddDemandeDelegationEP(context); - DataSeeder.AddEp(context); DataSeeder.AddEngagements(context); + DataSeeder.AddEp(context); DataSeeder.AddRereferentEP(context); } //faire using, check si kekchoz exkist puis appeler les m�thodes de cr�ation si il n'y a rien