diff --git a/Context/EpContext.cs b/Context/EpContext.cs index 669715a..a04449c 100644 --- a/Context/EpContext.cs +++ b/Context/EpContext.cs @@ -198,5 +198,94 @@ namespace EPAServeur.Context entity.Property(e => e.Id).ValueGeneratedOnAdd(); }); } + + + public void AjoutTheme() //Les thèmes pourront être ajoutés et conservés + { + Theme management, securite, developpement, gestionprojet; + management = new Theme { Libelle = "Management" }; + this.Theme.Add(management); + securite = new Theme { Libelle = "Sécurité" }; + this.Theme.Add(securite); + developpement = new Theme { Libelle = "Développement" }; + this.Theme.Add(developpement); + gestionprojet = new Theme { Libelle = "Gestion de projet" }; + this.Theme.Add(gestionprojet); + this.SaveChanges(); + } + + /*Les informations ajou + * */ + public void AjoutInformationsDeBase() //Les statuts pourront être ajoutés et conservés + { + //StatutFormation + StatutFormation s; + s = new StatutFormation { Libelle = "Planifiée" }; + this.StatutFormation.Add(s); + s = new StatutFormation { Libelle = "Replanifié" }; + this.StatutFormation.Add(s); + s = new StatutFormation { Libelle = "Réalisée" }; + this.StatutFormation.Add(s); + s = new StatutFormation { Libelle = "Annulée" }; + this.StatutFormation.Add(s); + + //ModeFormation + ModeFormation m; + m = new ModeFormation { Libelle = "Externe" }; + this.ModeFormation.Add(m); + m = new ModeFormation { Libelle = "Interne" }; + this.ModeFormation.Add(m); + m = new ModeFormation { Libelle = "Présentiel" }; + this.ModeFormation.Add(m); + m = new ModeFormation { Libelle = "E-learning" }; + this.ModeFormation.Add(m); + + //TypeFormation + TypeFormation type; + type = new TypeFormation { Libelle = "Externe" }; + this.TypeFormation.Add(type); + type = new TypeFormation { Libelle = "Interne" }; + this.TypeFormation.Add(type); + type = new TypeFormation { Libelle = "E-learning" }; + this.TypeFormation.Add(type); + type = new TypeFormation { Libelle = "Academy by Apside" }; + this.TypeFormation.Add(type); + + //OrigineFormation + OrigineFormation of; + of = new OrigineFormation { Libelle = "Demande collaborateur" }; + this.OrigineFormation.Add(of); + of = new OrigineFormation { Libelle = "Exigence client" }; + this.OrigineFormation.Add(of); + of = new OrigineFormation { Libelle = "Exigence Apside" }; + this.OrigineFormation.Add(of); + of = new OrigineFormation { Libelle = "Formation réglementaire" }; + this.OrigineFormation.Add(of); + + //OrigineDemandeFormation + OrigineDemandeFormation o; + o = new OrigineDemandeFormation { Libelle = "Demande collaborateur" }; + this.OrigineDemandeFormation.Add(o); + o = new OrigineDemandeFormation { Libelle = "Demande EP" }; + this.OrigineDemandeFormation.Add(o); + o = new OrigineDemandeFormation { Libelle = "Exigence Client" }; + this.OrigineDemandeFormation.Add(o); + o = new OrigineDemandeFormation { Libelle = "Formation réglementaire" }; + this.OrigineDemandeFormation.Add(o); + o = new OrigineDemandeFormation { Libelle = "Demande Apside" }; + this.OrigineDemandeFormation.Add(o); + + //TypeEntretien + TypeEntretien t; + t = new TypeEntretien { Libelle = "Sur site" }; + this.TypeEntretien.Add(t); + t = new TypeEntretien { Libelle = "Chez le client" }; + this.TypeEntretien.Add(t); + t = new TypeEntretien { Libelle = "Visioconférence" }; + this.TypeEntretien.Add(t); + t = new TypeEntretien { Libelle = "Téléphonique" }; + this.TypeEntretien.Add(t); + this.SaveChanges(); + } } } diff --git a/Program.cs b/Program.cs index e7661f3..1c1abac 100644 --- a/Program.cs +++ b/Program.cs @@ -30,9 +30,10 @@ namespace EPAServeur private static void SetupDatabase() { EpContext context = new EpContext(); - context.Database.EnsureDeleted(); + context.Database.EnsureDeleted(); //PENSEZ A ENLEVER CETTE LIGNE ET A NE JAMAIS LA REMETTRE QUAND LE SERVEUR SERA MIS EN PRODUCTION ^^ context.Database.EnsureCreated(); context.SaveChanges(); + context.AjoutInformationsDeBase(); } } }