/// <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);
        }
Exemplo n.º 2
0
        public int AddClient(Client client)
        {
            ClientDB clientDb = new ClientDB();

            return(clientDb.AddClient(client));
        }