/// <summary>
        /// Check data before inserting into database
        /// </summary>
        public static int AddReservation(string firstName, string lastName, DateTime arrival, DateTime departure, int[] roomIds)
        {
            //Insert the reservation
            int idClient = ClientDB.AddClient(firstName, lastName);

            int idReservation = ReservationDB.AddReservation(arrival, departure, idClient);

            foreach (int roomId in roomIds)
            {
                ReservationDB.AddRoomReservation(idReservation, roomId);
            }

            return(idReservation);
        }
Ejemplo n.º 2
0
 // Appelle la requête qui permet d'ajouter une réservation à la table
 public static int AddReservation(DateTime dateReservation, string clientFirstname, string clientLastname, DateTime dateStart, DateTime dateEnd, decimal totalPrice)
 {
     return(ReservationDB.AddReservation(dateReservation, clientFirstname, clientLastname, dateStart, dateEnd, totalPrice));
 }