Beispiel #1
0
        private void View_OnItinerariesGetItem(object sender, ItineraryEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(ItineraryEventArgs));
            }

            this.View.Model.Booking = this.bookingsServices.GetAll()
                                      .FirstOrDefault(b => b.UserId == e.UserId && b.ConfirmationCode.Trim().ToLower() == e.Number.ToLower() &&
                                                      b.User.UserSettings.LastName.Trim().ToLower() == e.Passenger.ToLower());
        }
Beispiel #2
0
        private void View_OnCabinBagsInfoShow(object sender, ItineraryEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(ItineraryEventArgs));
            }

            var cabinBags = this.GetBaggages(e.BookingId, BaggageType.Cabin);

            if (cabinBags.Count == 1)
            {
                this.View.Model.CabinBagsInfo = cabinBags.Count + " x cabin bag " + cabinBags[0].Size;
            }
            else
            {
                this.View.Model.CabinBagsInfo = cabinBags.Count + " x cabin bags " + cabinBags[0].Size;
            }
        }
Beispiel #3
0
        private void View_OnTravelClassInfoShow(object sender, ItineraryEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(ItineraryEventArgs));
            }

            var booking = this.bookingsServices.GetBooking(e.BookingId);

            if (booking == null)
            {
                throw new ArgumentNullException(ErrorMessages.ENTITY_CANNOT_BE_NULL);
            }

            var travelClass = this.travelClassesServices.GetTravelClass(booking.TravelClassId);

            this.View.Model.TravelClassInfo = travelClass.Type.ToString() + " Class ";
        }
Beispiel #4
0
        private void View_OnEquipmentBagsInfoShow(object sender, ItineraryEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(ItineraryEventArgs));
            }

            var equiptment   = this.GetBaggages(e.BookingId, e.BaggageType);
            var typeAsString = this.GetEqyipmentTypeAsString(e.BaggageType);

            if (equiptment == null || equiptment.Count == 0)
            {
                this.View.Model.EquipmentBagsInfo = "NO " + typeAsString.ToUpper() + "!";
            }
            else
            {
                this.View.Model.EquipmentBagsInfo = equiptment.Count + " x " + typeAsString + " allowed";
            }
        }
Beispiel #5
0
        private void View_OnCheckedInBagsInfoShow(object sender, ItineraryEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(ItineraryEventArgs));
            }

            var checkedInBags = this.GetBaggages(e.BookingId, BaggageType.CheckedIn);

            if (checkedInBags == null || checkedInBags.Count == 0)
            {
                this.View.Model.CheckedInBagsInfo = "NO CHECKED-IN BAGS!";
            }
            else if (checkedInBags.Count == 1)
            {
                this.View.Model.CheckedInBagsInfo = checkedInBags.Count + " x checked-in bag " + checkedInBags[0].MaxKilograms + " KG";
            }
            else
            {
                this.View.Model.CheckedInBagsInfo = checkedInBags.Count + " x checked-in bags " + checkedInBags[0].MaxKilograms + " KG";
            }
        }