Beispiel #1
0
        public static List <BookedDates> AvailabilityForSpecifiedRoom(int roomID)
        {
            List <BookedDates> bookedDates = DBMethods.GetDatesReserved();
            var selectedRoomBookedDates    = (from d in bookedDates
                                              where d.RoomID == roomID
                                              select d).ToList();

            return(selectedRoomBookedDates);
        }
Beispiel #2
0
        public static void AddAvailabilityToBookingElements(ref List <BookingElement> bookingElements)
        {
            List <BookedDates> booked = DBMethods.GetDatesReserved();            //calls Database

            foreach (BookingElement be in bookingElements)
            {
                for (int i = 0; i < booked.Count; i++)
                {
                    if (be.UserDate == booked[i].BookedDate && be.RoomID == booked[i].RoomID)
                    {
                        be.RoomAvailable = false;
                    }
                }
            }
        }
Beispiel #3
0
        //returns all the data from the room table in the DB
        public static List <Room> RoomData()
        {
            List <Room> roomData = DBMethods.GetRoomTableData();

            return(roomData);
        }
Beispiel #4
0
        public static List <BookingElement> RetrieveBookingDetails(string email, string bookingID)
        {
            List <BookingElement> existingBooking = DBMethods.RetrieveExistingBooking(email, Convert.ToInt32(bookingID));

            return(existingBooking);
        }