示例#1
0
        public ActionResult CreerExemplaire(FilmViewModel pFilmViewModel)
        {
            if (Request.IsAuthenticated)
            {
                try
                {
                    GestionnaireFilms gestionnaireFilms = new GestionnaireFilms();

                    gestionnaireFilms.AjouterExemplaire(pFilmViewModel.LeFilm.Code, pFilmViewModel.LeSupport.Code, pFilmViewModel.LeProprietaire.Code);

                    //On affiche la page du film
                    return RedirectToAction("Details", "Film", new { codeFilm = pFilmViewModel.LeFilm.Code });

                }
                catch (Exception ex)
                {
                    HandleErrorInfo error = new HandleErrorInfo(ex, "Film", "CreerExemplaire");
                    return View("Error", error);
                }
            }
            else
            {
                return RedirectToAction("LogOn", "Account");
            }
        }