Ejemplo 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();
        }
Ejemplo n.º 2
0
 private void FilterResults()
 {
     BookingBase bb = new BookingBase();
     FullReservationList = bb.GetAllBookings().Where((b => b.FromDate >= FromDate && b.ToDate <= ToDate)).ToList();
 }
Ejemplo n.º 3
0
 private void SaveReservation()
 {
     BookingBase bookingBase = new BookingBase();
     NewReservation.Client = NewCustomer;
     bookingBase.CreateBooking(NewReservation);
     //this is called when the button is clicked
 }
Ejemplo n.º 4
0
 public void UpdateReservation()
 {
     BookingBase bookingBase = new BookingBase();
     bookingBase.UpdateBooking(reservation);
 }