// make Reserve instance private Reserve makeReserve(string _checkin, string _checkout, Room _room) { Reserve reserve = new Reserve( DateTime.Parse(_checkin), DateTime.Parse(_checkout), _room ); return reserve; }
// constructor public Reserve(DateTime _checkIn, DateTime _checkOut, Room _room) { this.CheckIn = _checkIn; this.CheckOut = _checkOut; this.Room = _room; }
// check available room (current day) public bool checkAvailableRoomCurrentDay(DateTime _currentDay, Room _room) { bool available = true; foreach (DailyReserve dailyReserve in DailyReserveList) { if (_currentDay.ToString("dd/MM/yyyy").Equals( dailyReserve.ReserveDay.ToString("dd/MM/yyyy"))) { foreach (Room room in dailyReserve.ReserveDayRoomList) { if (room.RoomID.Equals(_room.RoomID)) { available = false; break; } } } } return available; }