public void DoReservation(ReservationModel reservationModel) { DataAccess.Entities.Reservation reservation = reservationModel.ToDto(); reservation.Status = (int)ReservationStatus.New; _reservationDao.Insert(reservation); }
public void RescheduleReservation(int reservationId, DateTime reservationStartDate, DateTime reservationEndDate) { DataAccess.Entities.Reservation reservation = _reservationDao.GetReservationById(reservationId); reservation.StartDate = reservationStartDate; reservation.EndDate = reservationEndDate; _reservationDao.UpdateReservation(reservation); }
/// <summary> /// Setups the manager. /// </summary> private void SetTravelData() { var reservation = new DataAccess.Entities.Reservation(); var reservationGuest = new DataAccess.Entities.ReservationGuest { BeaconId = "43", GuestId = "600001" }; var guest = new Guest { CruiseDetail = new GuestCruiseDetail { ////IsVip = false, IsPrimary = false, Stateroom = "xyz", StateroomCategoryTypeId = "A", ReservationStatusId = "1001", ReservationNumber = "111", ReservationId = "3", LoyaltyLevelTypeId = "8", BeaconId = "212", HasRecovery = true, CanDebarkAlone = false }, PersonalDetail = new PersonalDetail { FirstName = "Robert", Gender = Gender.Male, }, GuestId = "600001", SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23" }; var portDebarkAuthorization = new PortDebarkAuthorization(); var alert = new Collection<Alert> { new Alert { AlertId = "12", AlertType = "2", Message = new Message { Description = "Test", ImageAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23", Subject = "Test" } } }; var debarkAuthorizedPersonCollection = new DebarkAuthorizedPersonCollection { new DebarkAuthorizedPerson { PersonId = "22", PersonTypeId = "323" } }; portDebarkAuthorization.AssignDebarkAuthorizedPersons(debarkAuthorizedPersonCollection); var portDebarkAuthorizations = new PortDebarkAuthorizationCollection { new PortDebarkAuthorization { CanDebarkAlone = true } }; guest.AssignAlerts(alert); guest.AssignPortAuthorizations(portDebarkAuthorizations); this.guests.Add(guest); var guestList = new ListResult<Guest>(); guestList.AssignItems(this.guests); reservation.TravelPartyReservationIds.Add("600001"); reservation.TravelPartyReservationIds.Add("xyz"); reservation.ReservationGuests.Add(reservationGuest); this.reservationList.Items.Add(reservation); this.guestRepository.Setup(data => data.GetTravelWithPartyAsync(It.IsAny<GuestSearchParameters>())).Returns(Task.FromResult(this.reservationList)); this.personRepository.Setup(data => data.RetrieveGuest(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(guestList)); }