public void populateUldTypes()
        {
            String defaultValue = null;

            JwSet<String> vs = new JwSet<String>();
            vs.AddRange( VmProperties.Default.GetUldTemplateTypes());

            String uldTemplateTypeDefault = VmProperties.Default.GetUldTemplateTypeDefault();
            if( ! JwUtility.IsEmpty( uldTemplateTypeDefault ) )
            {
                vs.Add( uldTemplateTypeDefault);
                defaultValue = uldTemplateTypeDefault;
            }

            if( ! JwUtility.IsEmpty( Engine.DefaultUldType ) )
            {
                vs.Add( Engine.DefaultUldType );
                defaultValue = Engine.DefaultUldType;
            }

            vs.Add( GetUnknownOption());

            JwList<String> v = vs.GetSortedList();
            _uldTypeCB.Items.Clear();
            _uldTypeCB.AddRange(v);

            if( ! JwUtility.IsEmpty( defaultValue) )
                _uldTypeCB.SelectedItem = defaultValue;
        }
Exemplo n.º 2
0
        public void PopulateComboBoxes()
        {
            if( ! ShouldCollectDestinationAirportCode() ) return;

            JwSet<String> airportCodes = new JwSet<String>();
            _airports = airportCodes;
            airportCodes.AddRange( VmAccountData.Default.GetAirportCodes() );

            if( Engine.Cart != null && ! JwUtility.IsEmpty( Engine.Cart.DestinationAirportCode ) )
                airportCodes.Add(Engine.Cart.DestinationAirportCode);

            if( Engine.HasLocationCode() && VmProperties.Default.ShouldNestCartDefaultTagDestination() )
                airportCodes.Add(Engine.LocationCode);

            if( ! VmProperties.Default.IsCartDestinationAirportRequired() ) airportCodes.Add("");

            if( ShouldCollectFlightNumber() )
            {
                _scheduledFlights = VmAirportData.Default.GetScheduledFlights();
                _flightNumberCB.ClearValues();
            }

            _destinationAirportCodeCB.SetValues(airportCodes.GetSortedList());

            if( airportCodes.Count == 1 ) _destinationAirportCodeCB.SelectedItem = airportCodes.GetAny();

            if( Engine.HasLocationCode() && VmProperties.Default.ShouldNestCartDefaultTagDestination() )
                _destinationAirportCodeCB.SelectedItem = Engine.LocationCode;
        }
Exemplo n.º 3
0
        public void PopulateUldTypes()
        {
            JwSet<String> vs = new JwSet<String>();
            vs.AddRange( VmProperties.Default.GetUldDefaultTypes());
            if( Engine.HasDefaultType() ) vs.Add( Engine.DefaultType);
            vs.Add( GetUnknownOption());
            JwList<String> v = vs.GetSortedList();
            _uldTypeCB.Items.Clear();
            _uldTypeCB.AddRange(v);

            if( Engine.HasDefaultType() )
                _uldTypeCB.SelectedItem = Engine.DefaultType;
        }
        public void PopulateTruckNumberCB()
        {
            String originAirportCode = _originAirportSearchableComboBox.GetSelectedValue();
            String carrierCode = _carrierCodeSearchableComboBox.GetSelectedValue();

            JwSet<String> truckNumbers = new JwSet<String>();
            foreach( VmScheduledTruck st in _scheduledTrucks )
            {
                if( ! st.MatchesOriginAirportCode(originAirportCode) ) continue;
                if( ! st.MatchesCarrierCode(carrierCode) ) continue;
                truckNumbers.Add(st.FlightNumber);
            }
            _truckNumberCB.SetValues(truckNumbers.GetSortedList());
        }
 public void PopulateOriginAirportCB()
 {
     ObtainScheduledTrucks();
     JwSet<String> airportCodes = new JwSet<String>();
     foreach( VmScheduledTruck st in _scheduledTrucks )
     {
         airportCodes.Add(st.OriginAirportCode);
     }
     _originAirportSearchableComboBox.ActivatePanel(
         airportCodes.GetSortedList(),
         null);
 }
        public void PopulateCarrierCodeCB()
        {
            String originAirportCode = _originAirportSearchableComboBox.GetSelectedValue();

            JwSet<String> carrierCodes = new JwSet<String>();
            foreach( VmScheduledTruck st in _scheduledTrucks )
            {
                if( ! st.MatchesOriginAirportCode(originAirportCode) ) continue;
                carrierCodes.Add(st.CarrierCode);
            }
            _carrierCodeSearchableComboBox.ActivatePanel(
                carrierCodes.GetSortedList(),
                null);
        }
Exemplo n.º 7
0
        public void PopulateComboBoxes(IEnumerable valuesx, String defaultValue)
        {
            JwSet<String> valueSet = new JwSet<String>();
            valueSet.AddRange( valuesx );
            _values = valueSet.GetCopy();

            if( ! JwUtility.IsEmpty(defaultValue)  )
                valueSet.Add(defaultValue);

            _valuesCB.SetValues(valueSet.GetSortedList());

            if( valueSet.Count == 1 ) _valuesCB.SelectedItem = valueSet.GetAny();

            AssignDefaultValue(defaultValue);
        }