// GET: Candidate/Details/5
        public ActionResult Details(int id)
        {
            Candidate cl = candidateService.GetById(id);

            if (cl == null)
            {
                return(HttpNotFound());
            }

            return(View(cl));
        }
예제 #2
0
        // GET: Formation/Details/5
        public ActionResult Details(int id, int idCandidat)
        {
            Formation f = FS.GetById(id);

            if (f.NbParticipants > 0)
            {
                ViewBag.confirmed = true;
                f.NbParticipants -= 1;
                FS.Update(f);
                FS.Commit();
            }
            else
            {
                ViewBag.confirmed = false;
            }

            FormationViewModel formation = new FormationViewModel()
            {
                CodeFormateur  = f.CodeFormateur,
                Date           = f.Date,
                Description    = f.Description,
                Duree          = f.Duree,
                IdFormation    = f.IdFormation,
                NbParticipants = f.NbParticipants,
                NomFormation   = f.NomFormation,
                Prix           = f.Prix,
                TypeFormation  = f.TypeFormation
            };

            Candidat c = CS.GetById(idCandidat);

            ViewBag.nomCandidat    = c.Nom;
            ViewBag.prenomCandidat = c.Prenom;

            return(View(formation));
        }