public ActionResult CreateReservation(ReservationSelection resSelection)
        {
            if (User.Identity.IsAuthenticated)
            {
                //on vérifie la cohérence des dates + présence de chambres
                if (resSelection.FirstNight.Date > resSelection.LastNight.Date ||
                    resSelection.RoomsId.Count == 0 ||
                    resSelection.FirstNight.Date < DateTime.Now.Date
                    )
                {
                    TempData["error"] = "Incohérence détectée dans les données";
                    return(RedirectToAction("_ReservationFailed"));
                }

                List <Room> selectedRoom = new List <Room>();

                //on vérifie si les chambres sont toujours libre
                List <Room> emptyRooms = RoomManager.GetAllEmptyRoomsAtDateRange(resSelection.FirstNight, resSelection.LastNight);
                foreach (int selRoomId in resSelection.RoomsId)
                {
                    bool isFree = emptyRooms
                                  .Where(r => r.IdRoom == selRoomId)
                                  .Count() > 0;
                    if (!isFree)
                    {
                        TempData["error"] = "Une des chambres choisies n'est plus disponible.";
                        return(RedirectToAction("_ReservationFailed"));
                    }

                    //on peuple déjà la liste des chambres choisies pour la future insertion
                    selectedRoom.Add(
                        emptyRooms
                        .Where(r => r.IdRoom == selRoomId)
                        .ToList()
                        .FirstOrDefault()
                        );
                }


                Reservation reservation = new Reservation {
                    FirstNight = resSelection.FirstNight,
                    LastNight  = resSelection.LastNight,
                    IdUser     = ((UserData)Session["UserData"]).IdUser,
                    Rooms      = selectedRoom
                };

                //on re-calcule le prix actuel, hack javascript...
                reservation.Price = ReservationManager.GetInstantPriceFromReservation(reservation);

                //insertion de la réservation dans la base et récupération de l'id
                reservation.IdReservation = ReservationManager.SaveReservation(reservation);

                TempData["reservation"] = reservation;
                return(Redirect("/Reservation/_ConfirmedReservation"));
            }
            else
            {
                return(RedirectToAction("_Login", "ModalLogin"));
            }
        }