Esempio n. 1
0
        public ICollection<HotelRoom> GetAvailableRooms(DateTime fromDate,DateTime toDate)
        {
            BookingBase bookingBase = new BookingBase();
            var bookings = bookingBase.GetBookingByDates(fromDate, toDate);
            List<HotelRoom> bookedRooms = bookings.SelectMany(b => b.Rooms).ToList();

            List<HotelRoom> toReturn = new List<HotelRoom>();
            foreach (HotelRoom ro in roomRep.All())
            {
                if (!bookedRooms.Contains(ro))
                    toReturn.Add(ro);
            }

            return toReturn;
               // return roomRep.All().Where(r=>!bookedRooms.Contains(r)).ToList();
        }
 private void FilterResults()
 {
     BookingBase bb = new BookingBase();
     FullReservationList = bb.GetAllBookings().Where((b => b.FromDate >= FromDate && b.ToDate <= ToDate)).ToList();
 }
 private void SaveReservation()
 {
     BookingBase bookingBase = new BookingBase();
     NewReservation.Client = NewCustomer;
     bookingBase.CreateBooking(NewReservation);
     //this is called when the button is clicked
 }
Esempio n. 4
0
 public void UpdateReservation()
 {
     BookingBase bookingBase = new BookingBase();
     bookingBase.UpdateBooking(reservation);
 }