From c10dfd5069a7a8ca36b8afd916b2cdce2b55d147 Mon Sep 17 00:00:00 2001 From: jboinembalome Date: Tue, 8 Dec 2020 16:46:24 +0100 Subject: [PATCH] =?UTF-8?q?MAJ=20du=20mod=C3=A8le=20pour=20la=20partie=20S?= =?UTF-8?q?aisieChamp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EPAServeur/Context/EpContext.cs | 12 ++++++--- EPAServeur/Models/SaisieChamp/Champ.cs | 34 +++++++++++++++++++++++-- EPAServeur/Models/SaisieChamp/Saisie.cs | 30 ++++++++++++++++++---- 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/EPAServeur/Context/EpContext.cs b/EPAServeur/Context/EpContext.cs index 4e9d3fc..ef8dc63 100644 --- a/EPAServeur/Context/EpContext.cs +++ b/EPAServeur/Context/EpContext.cs @@ -62,6 +62,8 @@ namespace EPAServeur.Context { entity.HasKey(e => e.IdDocument); entity.Property(e => e.IdDocument).ValueGeneratedOnAdd(); + entity.HasMany(e => e.Saisies).WithOne(e => e.Document); + }); modelBuilder.Entity(entity => @@ -162,6 +164,7 @@ namespace EPAServeur.Context { entity.HasKey(e => e.Id); entity.Property(e => e.Id).ValueGeneratedOnAdd(); + entity.HasMany(e => e.Evaluation).WithOne(e => e.ParticipationFormation); }); modelBuilder.Entity(entity => @@ -195,14 +198,15 @@ namespace EPAServeur.Context //SaisieChamp modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id); - entity.Property(e => e.Id).ValueGeneratedOnAdd(); + entity.HasKey(e => e.IdChamp); + entity.Property(e => e.IdChamp).ValueGeneratedOnAdd(); + entity.HasMany(e => e.Saisies).WithOne(e => e.Champ); }); modelBuilder.Entity(entity => { - entity.HasKey(e => e.Id); - entity.Property(e => e.Id).ValueGeneratedOnAdd(); + entity.HasKey(e => e.IdSaisie); + entity.Property(e => e.IdSaisie).ValueGeneratedOnAdd(); }); } } diff --git a/EPAServeur/Models/SaisieChamp/Champ.cs b/EPAServeur/Models/SaisieChamp/Champ.cs index 4c2d427..5f0b422 100644 --- a/EPAServeur/Models/SaisieChamp/Champ.cs +++ b/EPAServeur/Models/SaisieChamp/Champ.cs @@ -6,16 +6,46 @@ using System.Threading.Tasks; namespace EPAServeur.Models.SaisieChamp { - + /// + /// Champs correspondant à aux saisies EP ou aux évaluations. + /// public class Champ { - public long Id { get; set; } + /// + /// Id du champ du document + /// + public long IdChamp { get; set; } + + /// + /// Texte du champ + /// public string Texte { get; set; } + + /// + /// Section à laquelle appartient le champ + /// public string Section { get; set; } + + /// + /// Sous-section à laquelle appartient le champ + /// public string SousSection { get; set; } + + /// + /// Ordre du champ dans sa section ou sa sous-section + /// public long Ordre { get; set; } + + /// + /// Type du champ correspondant au Type du document si c’est un champ un EP ou à l’évaluation sinon + /// public TypeChamps TypeChamp { get; set; } + + /// + /// Type de la saisie du champ + /// public TypeSaisie TypeSaisie { get; set; } + public List Saisies { get; set; } } } diff --git a/EPAServeur/Models/SaisieChamp/Saisie.cs b/EPAServeur/Models/SaisieChamp/Saisie.cs index c0150f5..f347da2 100644 --- a/EPAServeur/Models/SaisieChamp/Saisie.cs +++ b/EPAServeur/Models/SaisieChamp/Saisie.cs @@ -8,14 +8,34 @@ using System.Threading.Tasks; namespace EPAServeur.Models.SaisieChamp { + /// + /// Saisie du collaborateur ou du référent sur un champ du document. + /// public class Saisie { - public long Id { get; set; } - public Champ Champ { get; set; } - public long? Note { get; set; } + /// + /// Id du document EP + /// + public long IdSaisie { get; set; } + + /// + /// Note saisie + /// + public int? Note { get; set; } + + /// + /// Texte saisi + /// public string Texte { get; set; } - public string Texte2 { get; set; } - public long? Niveau { get; set; } + + /// + /// Type de la saisie permettant d’indiquer les attributs à utiliser + /// public TypeSaisie TypeSaisie { get; set; } + + public Champ Champ { get; set; } + public Document Document { get; set; } + public ParticipationFormation ParticipationFormation { get; set; } + } }