Beispiel #1
0
        public HotelReservationDto EditHotelReservation(HotelReservationDto hotelReservationDto, int userId, int tenantId)
        {
            var hotelReservationObj = _hotelReservationService.Query(x => x.HotelReservationId == hotelReservationDto.HotelReservationId && x.TenantId == tenantId).Select().FirstOrDefault();

            if (hotelReservationObj == null)
            {
                throw new NotFoundException(ErrorCodes.ProductNotFound);
            }

            hotelReservationObj.SeenUserId = userId;
            hotelReservationObj.Status     = (int)hotelReservationDto.Status;
            hotelReservationObj.RoomCount  = hotelReservationDto.RoomCount;
            hotelReservationObj.Adult      = hotelReservationDto.Adult;
            hotelReservationObj.Child      = hotelReservationDto.Child;

            hotelReservationObj.LastModificationTime = Strings.CurrentDateTime;
            hotelReservationObj.LastModifierUserId   = userId;
            _hotelReservationService.Update(hotelReservationObj);
            SaveChanges();
            return(hotelReservationDto);
        }