/// <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); }