public void AssignFlight() { VmScheduledArrivingFlight sf = (VmScheduledArrivingFlight)_flightNumberCB.SelectedItem; VmArrivingFlight f = new VmArrivingFlight(); JwDate arrivalLocalDate = GetArrivalDate(); JwDate scheduledDepartureDate = sf.ComputeScheduledDepartureDateFromScheduledArrivalDate(arrivalLocalDate); f.ScheduledDepartureDate = scheduledDepartureDate; f.ScheduledFlight = sf; PickerEngine.AssignFlight(f); }
public void AssignFlight(VmArrivingFlight f) { VmArrivingFlight existingFlight = VmAirportData.Default.AirportOutputData.ArrivingFlightFile.GetFlight(f); if( existingFlight != null ) { f = existingFlight; } else { f.Id = VmAirportData.Default.AirportOutputData.IdentityFile.GetNextIdentity(); VmAirportData.Default.AirportOutputData.ArrivingFlightFile.Append(f); } Flight = f; DoExitEvent(); }
private void HandleOk() { if( ! _inputControlManager.ValidateControls() ) return; VmScheduledArrivingFlight sf = new VmScheduledArrivingFlight(); sf.Id = -1; sf.CarrierCode = _carrierCodeTB.Text.ToUpper(); sf.FlightNumber = _flightNumberTB.Text.ToUpper(); sf.OriginAirportCode = (String)_originAirportSearchableComboBox.GetSelectedValue(); sf.DestinationAirportCode = VmAirportData.Default.AirportCode; JwTimestamp scheduledDepartureTs = JwTimestamp.CreateTimestamp(_scheduledDepartureDT.Value); VmArrivingFlight f = new VmArrivingFlight(); f.ScheduledDepartureDate = scheduledDepartureTs.GetDate(); sf.DepartureTime = scheduledDepartureTs.GetTime(); f.ScheduledFlight = sf; PickerEngine.AssignFlight(f); }