Ajout de nouvelles tables autour des formations et des demandes de formations

master
Yanaël GRETTE 4 years ago
parent 0846f4e1b2
commit d00d9798f2
  1. 41
      Context/EpContext.cs
  2. 1
      EPAServeur.csproj
  3. 5
      EPAServeur.sln
  4. 1
      Models/Formation/DemandeFormation.cs
  5. 5
      Models/Formation/Formation.cs
  6. 14
      Models/Formation/ModeFormation.cs
  7. 14
      Models/Formation/OrigineDemandeFormation.cs
  8. 14
      Models/Formation/OrigineFormation.cs
  9. 2
      Models/Formation/Theme.cs
  10. 14
      Models/Formation/TypeFormation.cs

@ -19,17 +19,21 @@ namespace EPAServeur.Context
public DbSet<Document> Document { get; set; }
public DbSet<Engagement> Engagement { get; set; }
public DbSet<Ep> Ep { get; set; }
public DbSet<Objectif> Objectifs { get; set; }
public DbSet<ObjectifPrecedent> ObjectifPrecedents { get; set; }
public DbSet<RdvEntretien> RdvEntretiens { get; set; }
public DbSet<Objectif> Objectif { get; set; }
public DbSet<ObjectifPrecedent> ObjectifPrecedent { get; set; }
public DbSet<RdvEntretien> RdvEntretien { get; set; }
public DbSet<TypeEntretien> TypeEntretien { get; set; }
//Formation
public DbSet<DemandeFormation> DemandeFormation { get; set; }
public DbSet<Formation> Formation { get; set; }
public DbSet<ModeFormation> ModeFormation { get; set; }
public DbSet<OrigineDemandeFormation> OrigineDemandeFormation { get; set; }
public DbSet<OrigineFormation> OrigineFormation { get; set; }
public DbSet<ParticipationFormation> ParticipationFormation { get; set; }
public DbSet<StatutFormation> StatutFormation { get; set; }
public DbSet<Theme> Theme { get; set; }
public DbSet<TypeFormation> TypeFormation { get; set; }
//Note
public DbSet<Note> Note { get; set; }
@ -110,6 +114,7 @@ namespace EPAServeur.Context
modelBuilder.Entity<TypeEntretien>(entity =>
{
entity.HasKey(e => e.Id);
entity.HasIndex(e => e.Libelle).IsUnique();
});
//Formation
@ -125,6 +130,27 @@ namespace EPAServeur.Context
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity<ModeFormation>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
entity.HasIndex(e => e.Libelle).IsUnique();
});
modelBuilder.Entity<OrigineDemandeFormation>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
entity.HasIndex(e => e.Libelle).IsUnique();
});
modelBuilder.Entity<OrigineFormation>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
entity.HasIndex(e => e.Libelle).IsUnique();
});
modelBuilder.Entity<ParticipationFormation>(entity =>
{
entity.HasKey(e => e.Id);
@ -135,12 +161,21 @@ namespace EPAServeur.Context
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
entity.HasIndex(e => e.Libelle).IsUnique();
});
modelBuilder.Entity<Theme>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
entity.HasIndex(e => e.Libelle).IsUnique();
});
modelBuilder.Entity<TypeFormation>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
entity.HasIndex(e => e.Libelle).IsUnique();
});
//Notes

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Configurations>Debug;Release;InitDB</Configurations>
</PropertyGroup>
<ItemGroup>

@ -3,16 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30128.74
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPAServeur", "EPAServeur.csproj", "{D19F441B-010F-481F-8A59-C5FA928B5077}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EPAServeur", "EPAServeur.csproj", "{D19F441B-010F-481F-8A59-C5FA928B5077}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
InitDB|Any CPU = InitDB|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D19F441B-010F-481F-8A59-C5FA928B5077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D19F441B-010F-481F-8A59-C5FA928B5077}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D19F441B-010F-481F-8A59-C5FA928B5077}.InitDB|Any CPU.ActiveCfg = InitDB|Any CPU
{D19F441B-010F-481F-8A59-C5FA928B5077}.InitDB|Any CPU.Build.0 = InitDB|Any CPU
{D19F441B-010F-481F-8A59-C5FA928B5077}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D19F441B-010F-481F-8A59-C5FA928B5077}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection

@ -17,5 +17,6 @@ namespace EPAServeur.Models.Formation
public DateTime DateDerniereReponse { get; set; }
public Ep Ep { get; set; }
public ParticipationFormation ParticipationFormation { get; set; }
public OrigineFormation OrigineFormation { get; set; }
}
}

@ -9,7 +9,7 @@ namespace EPAServeur.Models.Formation
{
public int Id { get; set; }
public string Intitule { get; set; }
public string Origine { get; set; }
public DateTime DateDebut { get; set; }
public DateTime DateFin { get; set; }
public int Jour { get; set; }
@ -17,5 +17,8 @@ namespace EPAServeur.Models.Formation
public string Organisme { get; set; }
public bool EstCertifiee { get; set; }
public StatutFormation Statut { get; set; }
public OrigineFormation Origine { get; set; }
public ModeFormation ModeFormation { get; set; }
public TypeFormation TypeFormation { get; set; }
}
}

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EPAServeur.Models.Formation
{
public class ModeFormation
{
public int Id { get; set; }
public string Libelle { get; set; }
public List<Formation> Formations { get; set; }
}
}

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EPAServeur.Models.Formation
{
public class OrigineDemandeFormation
{
public int Id { get; set; }
public string Libelle { get; set; }
public List<DemandeFormation> DemandeFormations { get; set; }
}
}

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EPAServeur.Models.Formation
{
public class OrigineFormation
{
public int Id { get; set; }
public string Libelle { get; set; }
public List<Formation> Formations { get; set; }
}
}

@ -8,6 +8,6 @@ namespace EPAServeur.Models.Formation
public class Theme
{
public int Id { get; set; }
public string Nom { get; set; }
public string Libelle { get; set; }
}
}

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EPAServeur.Models.Formation
{
public class TypeFormation
{
public int Id { get; set; }
public string Libelle { get; set; }
public List<Formation> Formations { get; set; }
}
}
Loading…
Cancel
Save