public static void Update(LeFormateur formateur)
 {
     try
     {
         using (BDDContext context = new BDDContext())
         {
             LeFormateur f = context.Formateurs.FirstOrDefault(F => F.LeFormateurId == formateur.LeFormateurId);
             f.Nom                = formateur.Nom;
             f.Prenom             = formateur.Prenom;
             f.Mot_De_Passe       = formateur.Mot_De_Passe;
             f.SessionsFormations = formateur.SessionsFormations;
             f.E_mail             = formateur.E_mail;
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }
        public static void Edit(LesFormations formation)
        {
            try
            {
                using (BDDContext context = new BDDContext())
                {
                    LesFormations f = context.Formations.FirstOrDefault(s => s.LesFormationsId == formation.LesFormationsId);

                    f.titre           = formation.titre;
                    f.Description     = formation.Description;
                    f.LesCursus_suivi = formation.LesCursus_suivi;
                    //f.SessionFormations = formation.SessionFormations;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Cursus c = new Cursus();

            using (BDDContext context = new BDDContext())
            {
                c = new Cursus
                {
                    titre = "Concepteur Developpeur "
                };
                context.Cursuss.Add(c);
                context.SaveChanges();
            }

            Formation form = new Formation();

            using (BDDContext context = new BDDContext())
            {
                form = new Formation
                {
                    titre = "java "
                };
                context.Formations.Add(form);
                context.SaveChanges();
            }

            Stagiaire st = new Stagiaire();

            using (BDDContext context = new BDDContext())
            {
                st = new Stagiaire
                {
                    Nom = "Premier stagiaire"
                };
                context.Stagiaires.Add(st);
                context.SaveChanges();
            }

            Formateur f = new Formateur();

            using (BDDContext context = new BDDContext())
            {
                f = new Formateur
                {
                    Nom = "Christopher"
                };
                context.Formateurs.Add(f);
                context.SaveChanges();
            }

            Session_De_Cursus Sc = new Session_De_Cursus();

            using (BDDContext context = new BDDContext())
            {
                Sc = new Session_De_Cursus
                {
                    Description = "Ce cursus  consiste à travailler sur le profil de développeurs web  "
                };
                context.SessionCursus.Add(Sc);
                context.SaveChanges();
            }

            Session_De_Formation Sf = new Session_De_Formation();

            using (BDDContext context = new BDDContext())
            {
                Sf = new Session_De_Formation
                {
                    Description = "Cette formation consiste à former  "
                };
                context.SessionFormations.Add(Sf);
                context.SaveChanges();
            }
        }
Exemplo n.º 4
0
 public TaskService(BDDContext BDDContext)
 {
     _BDDContext = BDDContext;
 }
Exemplo n.º 5
0
 public UserService(BDDContext BDDContext)
 {
     _BDDContext = BDDContext;
 }
Exemplo n.º 6
0
 public TaskModelService(BDDContext demoContext, ILogger <UserService> logger)
 {
     _demoContext = demoContext;
     _logger      = logger;
 }
Exemplo n.º 7
0
 public TaskUserController(BDDContext BDDContext)
 {
     _BDDContext = BDDContext;
 }