Esempio n. 1
0
        public static BookingRoom MapBookingRoomModelToBookingRoom(BookingRoomModel brmodel)
        {
            var bookingroom = new BookingRoom
            {
                RoomId    = brmodel.RoomId,
                BookingId = brmodel.BookingId,
            };

            return(bookingroom);
        }
Esempio n. 2
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();
        }
Esempio n. 3
0
        public static BookingRoomModel MapBookingRoomToBookingRoomModel(BookingRoom bookingRoom, BookingModel @ref, RoomModel room)
        {
            var BookingRoom = new BookingRoomModel
            {
                Id           = bookingRoom.Id,
                BookingId    = bookingRoom.BookingId,
                BookingModel = @ref,
                RoomId       = bookingRoom.RoomId,
                Room         = room
            };

            BookingRoom.ExtraFacilities = bookingRoom.ExtraFacilities?.Select(ef => FacilityMappings.MapExtraFacilityToEFModel(ef,
                                                                                                                               BookingRoom, FacilityMappings.MapFacilityToFacilityModel(ef.Facility))).ToList();
            return(BookingRoom);
        }
 public static ExtraFacilityModel MapExtraFacilityToEFModel(ExtraFacility extraFacility, BookingRoomModel BRmodel, FacilityModel Fmodel)
 {
     return(new ExtraFacilityModel
     {
         Id = extraFacility.Id,
         Price = extraFacility.Price,
         EFQuantity = extraFacility.Quantity,
         FacilityId = extraFacility.FacilityId,
         Facility = Fmodel,
         BookingRoomId = extraFacility.BookingRoomId,
         BookingRoom = BRmodel
     });
 }