示例#1
0
        private static Booking BuildTestBooking(string route, string agent, int price)
        {
            var newBooking = new Booking
            {
                SalesAgent    = agent,
                RecordLocator = Guid.NewGuid().ToString()
            };

            var journey = new Journey
            {
                Arrival       = route.Substring(3, 3),
                ArrivalDate   = DateTime.Now.AddDays(10),
                Departure     = route.Substring(0, 3),
                DepartureDate = DateTime.Today.AddDays(9),
                Price         = price
            };

            var passenger = new Passenger
            {
                FullName = "Full Pax Name",
                PaxType  = Passenger.PassengerType.ADU
            };

            newBooking.AddJourney(journey);
            newBooking.AddPassenger(passenger);
            return(newBooking);
        }
        private static void DeleteCreateJourneys(Booking firstBooking)
        {
            if (firstBooking.Journeys.Any())
            {
                firstBooking.Journeys.Clear();
            }

            //if (!_BookingValidationDomainServices.IsEnabledToAddNewJourneys(firstBooking)) { return; }

            var journey = new Journey
            {
                Arrival       = "AGP",
                ArrivalDate   = DateTime.Now.AddDays(10),
                BookingId     = firstBooking.Id,
                Departure     = "MAD",
                Price         = 99.99M,
                DepartureDate = DateTime.Now.AddDays(9)
            };

            firstBooking.AddJourney(journey);
        }