Beispiel #1
0
        public List <BookingModel> FilterBookingsByEndDateValid(string searching2)
        {
            DateTime end = Convert.ToDateTime(searching2);
            DateTime enddateafteroneday = end.AddHours(24);

            return(_internalUnitOfWork.BookingsRepository.Get(b => b.EndDate >= end && b.EndDate <= enddateafteroneday && b.Valid == true)
                   .Select(b => BookingMappings.MapBookingToBModel(b)).ToList());
        }
Beispiel #2
0
        public List <BookingModel> FilterBookingsByStartDateValid(string searching)
        {
            DateTime start = Convert.ToDateTime(searching);
            DateTime startdateafteroneday = start.AddHours(24);

            return(_internalUnitOfWork.BookingsRepository.Get(b => b.StartDate >= start && b.StartDate <= startdateafteroneday && b.Valid == true)
                   .Select(b => BookingMappings.MapBookingToBModel(b)).ToList());
        }
Beispiel #3
0
        public List <BookingModel> FBookingByStartEndDateNonValid(string searching, string searching2)
        {
            DateTime end = Convert.ToDateTime(searching2);
            DateTime enddateafteroneday = end.AddHours(24);
            DateTime start = Convert.ToDateTime(searching);
            DateTime startdateafteroneday = start.AddHours(24);

            return(_internalUnitOfWork.BookingsRepository.Get(b => b.EndDate >= end && b.EndDate <= enddateafteroneday && b.StartDate >= start && b.StartDate <= startdateafteroneday && b.Valid == false)
                   .Select(b => BookingMappings.MapBookingToBModel(b)).ToList());
        }
Beispiel #4
0
        public void AddBookingRoom(int bookingid, int roomid)
        {
            var bookingroomModel = new BookingRoomModel
            {
                RoomId    = roomid,
                BookingId = bookingid,
            };
            var bookingroom = BookingMappings.MapBookingRoomModelToBookingRoom(bookingroomModel);

            _internalUnitOfWork.BookingRoomRepository.Insert(bookingroom);
            _internalUnitOfWork.Save();
        }
Beispiel #5
0
        public int AddBooking(DateTime StartDate, DateTime EndDate)
        {
            var bookingmodel = new BookingModel
            {
                Start    = StartDate,
                End      = EndDate,
                CheckIn  = StartDate,
                CheckOut = EndDate,
                BookTime = StartDate,
                Valid    = true,
                ClientId = 8,
            };
            var booking = BookingMappings.MapBModelToBooking(bookingmodel);

            _internalUnitOfWork.BookingsRepository.Insert(booking);
            _internalUnitOfWork.Save();
            return(booking.Id);
        }
Beispiel #6
0
 public List <BookingModel> GetAllBookings()
 {
     return(_internalUnitOfWork.BookingsRepository.Get().Select(b => BookingMappings.MapBookingToBModel(b)).ToList());
 }