// Implement functions and properties of IBL /// <summary> /// add a room to the collection /// </summary> /// <param name="room">room</param> /// <returns>true if success, false else</returns> public bool AddRoom(Room room) { if (room.RoomID < nextRoomNumber) return false; if (!myDal.AddRoom(room)) return false; nextRoomNumber = room.RoomID + 1; return true; }
/// <summary> /// updating a reservation by parameters /// </summary> /// <param name="ReservationID">ReservationID</param> /// <param name="room">room - optional</param> /// <param name="ArrivalDate">Arrival Date - optional</param> /// <param name="Days">Days - optional</param> /// <returns>true if success, false else</returns> public bool UpdateReservation(uint ReservationID, Room room, DateTime? ArrivalDate = null, uint Days = 1) { if (Days < 1) return false; return myDal.UpdateReservation(ReservationID, room, ArrivalDate, Days); }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="room">The room</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, uint days = 1, DateTime? reservationDate = null) : base(ID, agency, arrivalDate, days, reservationDate) { Room = room; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="room">The room</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, DateTime leavingDate, DateTime? reservationDate = null) : base(ID, agency, arrivalDate, (uint)((leavingDate - arrivalDate).Days), reservationDate) { Room = room; }
//Constructor public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, uint days = 1) : base(ID, agency, arrivalDate, days, room.Beds) { this.room = room; }