Exemplo n.º 1
0
        /// <summary>
        /// Gets the passangers.
        /// </summary>
        /// <returns></returns>
        private VolarisPassangers GetPassangers()
        {
            var table = GetTable();

            if (table != null)
            {
                var passangers = new VolarisPassangers();
                var controls   = table.Controls.OfType <ucVolarisPassangerCaptureForm>().ToList();
                if (controls.Any())
                {
                    foreach (var passangerControl in controls)
                    {
                        passangers.Add(passangerControl.Passanger);
                    }
                }
                return(passangers);
            }
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the passanger.
        /// </summary>
        /// <param name="itinerary">The itinerary.</param>
        /// <returns></returns>
        private VolarisPassangers GetPassanger(Itinerary itinerary)
        {
            var flight     = itinerary.Departure as VolarisFlight;
            var passangers = new VolarisPassangers();

            if (flight != null)
            {
                var passangerFares = flight.PassangerFares.GetPassangerFares();
                foreach (var passangerFare in passangerFares)
                {
                    if (PassangerCreator.ContainsKey(passangerFare.PassangerType))
                    {
                        for (var passangerCount = 0; passangerCount < passangerFare.Count; passangerCount++)
                        {
                            var passanger = PassangerCreator[passangerFare.PassangerType]();
                            passangers.Add(passanger);
                        }
                    }
                }
            }
            return(passangers);
        }