예제 #1
0
        // GET: Formation
        public ActionResult ToutesLesFormations()
        {
            List <Formation> listFormations = new List <Formation>();

            using (var context = new WebApEntities())
            {
                listFormations = context.Formation.ToList();
            }
            return(View(listFormations));
        }
예제 #2
0
        public ActionResult DetailFormation(string nomSeo)
        {
            var vm = new FormationAvisViewModel();

            using (var context = new WebApEntities())
            {
                var formationEntity = context.Formation.Where(f => f.NomSeo == nomSeo).FirstOrDefault();
                if (formationEntity == null)
                {
                    return(RedirectToAction("Accueil", "Home"));
                }
                vm.FormationNom         = formationEntity.Nom;
                vm.FormationDescription = formationEntity.Description;
                vm.FormationNomSeo      = nomSeo;
                vm.FormationUrl         = formationEntity.Url;
                vm.Note = formationEntity.Avis;
            }

            return(View());
        }