/** * Get (or make) the current record for this reference. */ public Record makeReferenceRecord(RecordOwner recordOwner) { return new BookingPax(recordOwner); } /**
/** * Free Method. */ public void free() { if (m_fldModuleStart != null) m_fldModuleStart.free(); m_fldModuleStart = null; if (m_recBookingPax != null) if (m_recBookingPax.getRecordOwner() != this) { m_recBookingPax.free(); m_recBookingPax = null; } super.free(); } /**
/** * MovePaPaxDetail Method. */ public void movePaPaxDetail(Record recProfile) { this.getField(BookingPax.PROFILE_ID).moveFieldToThis(recProfile.getField(Profile.ID), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getField(BookingPax.NAME_PREFIX).moveFieldToThis(recProfile.getField(Profile.NAME_PREFIX), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getField(BookingPax.FIRST_NAME).moveFieldToThis(recProfile.getField(Profile.NAME_FIRST), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getField(BookingPax.MIDDLE_NAME).moveFieldToThis(recProfile.getField(Profile.NAME_MIDDLE), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getField(BookingPax.SUR_NAME).moveFieldToThis(recProfile.getField(Profile.NAME_SUR), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getField(BookingPax.SMOKER).moveFieldToThis(recProfile.getField(Profile.SMOKER), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } /**
BookingPax recBookingPax = new BookingPax(this.findRecordOwner()); try { recBookingPax.addListener(new SubFileFilter(this)); if (recBookingPax.next() != null) strDesc = recBookingPax.getField(BookingPax.SUR_NAME).toString(); } catch (DBException ex) { ex.printStackTrace(); } finally { recBookingPax.free();
m_recBookingPax = new BookingPax(this); if (m_recBookingPax.getField(BookingPax.ID).isNull()) m_recBookingPax.getField(BookingPax.ID).setValue(0); if (this.getProperty(BookingAnswerGridScreen.TOUR_OR_OPTION) != null) m_strTourOrOption = this.getProperty(BookingAnswerGridScreen.TOUR_OR_OPTION);
BaseField fldProfileID = this.getField(BookingPax.PROFILE_ID); boolean[] rgbEnabled = fldProfileID.setEnableListeners(false); FileListener subFileBeh = new SubFileFilter(recProfile.getField(Profile.ID), Profile.MAIN_PROFILE_ID, null, null, null, null); if (recProfileDetail.getHandle(DBConstants.BOOKMARK_HANDLE).equals(recProfile.getHandle(DBConstants.BOOKMARK_HANDLE))) bMainRecordAdded = true; // Good the main record was part of the detail this.addNew(); this.movePaPaxDetail(recProfileDetail); this.add(); this.addNew(); this.movePaPaxDetail(recProfile); this.add(); this.addNew(); } catch (DBException ex) { ex.printStackTrace();
m_recBookingPax.addPaPax(m_recProfile, m_recProfileDetail); RecordOwner screen = m_recBookingPax.getRecordOwner(); if (screen instanceof GridScreen) Booking recBooking = (Booking)((ReferenceField)m_recBookingPax.getField(BookingPax.BOOKING_ID)).getReferenceRecord(); if (recBooking != null) if (recBooking.getEditMode() != DBConstants.EDIT_NONE)
if (recBookingPax == null) recBookingPax = new BookingPax(this.findRecordOwner()); recBookingPaxNew = (BookingPax)recBookingPax; recBookingAnswer = null; if (recBookingPaxNew != null) recBookingPaxNew.free(); recBookingPaxNew = null;
/** * User clicked to button to add the booking passengers to the profile. */ public int doCommand(boolean bDisplayOption, int iMoveMode) { BookingPax recBookingPax = (BookingPax)m_screenParent.getRecord(BookingPax.BOOKING_PAX_FILE); Profile recProfile = (Profile)m_screenParent.getRecord(Profile.PROFILE_FILE); Profile recProfileDetail = (Profile)((ReferenceField)recBookingPax.getField(BookingPax.PROFILE_ID)).getReferenceRecord(); recBookingPax.addPaxDetail(recBookingPax, recProfileDetail); // Now create the maint screen for this new record if (recProfileDetail.getEditMode() == DBConstants.EDIT_CURRENT) { BasePanel parentScreen = Screen.makeWindow(m_screenParent.getTask().getApplication()); ScreenParent screen = recProfileDetail.makeScreen(null, parentScreen, ScreenConstants.MAINT_MODE, true, true, true, true, null); } return DBConstants.NORMAL_RETURN; }
BaseField fldPaxClass = null; if (recBookingPax != null) if ((recBookingPax.getEditMode() == DBConstants.EDIT_CURRENT) || (recBookingPax.getEditMode() == DBConstants.EDIT_IN_PROGRESS)) fldPaxClass = recBookingPax.getField(BookingPax.PAX_CATEGORY_ID); if (recTourHeaderOption.isValid(recBooking, fldPaxClass, dateStart)) this.getField(BookingAnswer.BOOKING_ID).moveFieldToThis(recBooking.getField(Booking.ID)); if (recBookingPax != null) this.getField(BookingAnswer.BOOKING_PAX_ID).moveFieldToThis(recBookingPax.getField(BookingPax.ID)); if (this.getField(BookingAnswer.BOOKING_PAX_ID).isNull()) this.getField(BookingAnswer.BOOKING_PAX_ID).setValue(0);
Profile recProfileDetail = (Profile)((ReferenceField)this.getField(BookingPax.PROFILE_ID)).getReferenceRecord(); FileListener selectListener = new PaxDetailSelectHandler((BookingPax)recordOwner.getRecord(BookingPax.BOOKING_PAX_FILE), recProfileDetail); recProfileDetail.addListener(selectListener); this.addListener(new FileRemoveBOnCloseHandler(reSelect));
if (m_recBookingPax.getRecordOwner() == this) this.removeRecord(m_recBookingPax); if ((iCommandOptions & ScreenConstants.USE_NEW_WINDOW) == ScreenConstants.USE_SAME_WINDOW) // Use same window
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); BookingPax recBookingPax = (BookingPax)this.getRecord(BookingPax.BOOKING_PAX_FILE); recBookingPax.addBookingBehaviors(this); } /**
recBookingAnswer = new BookingAnswer(this.findRecordOwner()); TourHeader recTourHeader = (TourHeader)((ReferenceField)recTour.getField(Tour.TOUR_HEADER_ID)).getReference(); BookingPax recBookingPax = new BookingPax(this.findRecordOwner()); recBookingPax.getField(BookingPax.ID).setValue(0); recTourHeaderPricing = new TourHeaderLine(this.findRecordOwner()); Date dateDeparture = ((DateField)recTour.getField(Tour.DEPARTURE_DATE)).getDateTime(); iErrorCode = recBookingLine.setupAllDetail(recTourHeaderPricing, this, recTour, recBookingPax.getField(BookingPax.ID), recBookingAnswer.getField(BookingAnswer.TOUR_HEADER_OPTION_ID), fldDetailModuleID, dateDetailStart); if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode;
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); BookingPax recBookingPax = (BookingPax)this.getRecord(BookingPax.BOOKING_PAX_FILE); recBookingPax.addBookingBehaviors(this); } /**
/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new BookingPax(this); } /**
/** * Get the command string to restore screen. */ public String getScreenURL() { String strURL = super.getScreenURL(); strURL = Utility.addURLParam(strURL, BookingAnswerGridScreen.MODULE_ID, m_strModuleID, false); strURL = Utility.addURLParam(strURL, BookingAnswerGridScreen.MODULE_START_DATE, m_strModuleStartDate, false); strURL = Utility.addURLParam(strURL, BookingAnswerGridScreen.TOUR_OR_OPTION, m_strTourOrOption, false); strURL = Utility.addURLParam(strURL, BookingAnswerGridScreen.TOUR_OR_OPTION_ID, m_strTourOrOptionID, false); strURL = Utility.addURLParam(strURL, BookingAnswerGridScreen.BOOKING_PAX_ID, m_recBookingPax.getField(BookingPax.ID).toString(), false); return strURL; } /**
/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new BookingPax(this); } /**
Tour recTour = (Tour)recordOwner.getRecord(Tour.TOUR_FILE); BookingPax recBookingPax = (BookingPax)((ReferenceField)recBookingAnswer.getField(BookingAnswer.BOOKING_PAX_ID)).getReference(); if (recBookingPax.getField(BookingPax.ID).isNull()) recBookingPax.getField(BookingPax.ID).moveFieldToThis(recBookingAnswer.getField(BookingAnswer.BOOKING_PAX_ID)); BaseField fldTourModuleID = recBookingAnswer.getField(BookingAnswer.MODULE_ID); Date dateStart = ((DateTimeField)recBookingAnswer.getField(BookingAnswer.MODULE_START_DATE)).getDateTime();
/** * Override this to open the main file. * <p />You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)). * @return The new record. */ public Record openMainRecord() { return new BookingPax(this); } /**