/** * Constructor. * @param field The date changed field in this record. */ public DateChangedHandler(DateTimeField field) { this(); this.init(null, field, -1); } /**
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.getField(ProductScreenRecord.DESCRIPTION).addListener(new FieldToUpperHandler(null)); this.getField(ProductScreenRecord.DESCRIPTION).addListener(new CheckForTheHandler(null)); this.addListener(new DateChangedHandler(ProductScreenRecord.LAST_CHANGED)); } /**
/** * Called when a change is the record status is about to happen/has happened. * This method sets the field to the current time on an add or update. * @param field If this file change is due to a field, this is the field. * @param iChangeType The type of change that occurred. * @param bDisplayOption If true, display any changes. * @return an error code. */ public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Write/Update a record switch (iChangeType) { case DBConstants.REFRESH_TYPE: case DBConstants.ADD_TYPE: case DBConstants.UPDATE_TYPE: DateTimeField thisField = m_field; if (m_field == null) thisField = (DateTimeField)this.getOwner().getField(m_iMainFilesFieldSeq); boolean[] rgbEnabled = thisField.setEnableListeners(false); thisField.setValue(DateTimeField.currentTime(), bDisplayOption, DBConstants.SCREEN_MOVE); // File written or updated, set the update date thisField.setEnableListeners(rgbEnabled); break; } return super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record } }
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.getField(ProductScreenRecord.DESCRIPTION).addListener(new FieldToUpperHandler(null)); this.getField(ProductScreenRecord.DESCRIPTION).addListener(new CheckForTheHandler(null)); this.addListener(new DateChangedHandler(ProductScreenRecord.LAST_CHANGED)); } /**
/** * Called when a change is the record status is about to happen/has happened. * This method sets the field to the current time on an add or update. * @param field If this file change is due to a field, this is the field. * @param iChangeType The type of change that occurred. * @param bDisplayOption If true, display any changes. * @return an error code. */ public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Write/Update a record switch (iChangeType) { case DBConstants.REFRESH_TYPE: case DBConstants.ADD_TYPE: case DBConstants.UPDATE_TYPE: DateTimeField thisField = m_field; if (m_field == null) thisField = (DateTimeField)this.getOwner().getField(m_iMainFilesFieldSeq); boolean[] rgbEnabled = thisField.setEnableListeners(false); thisField.setValue(DateTimeField.currentTime(), bDisplayOption, DBConstants.SCREEN_MOVE); // File written or updated, set the update date thisField.setEnableListeners(rgbEnabled); break; } return super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record } }
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.addListener(new DateChangedHandler(Person.kDateChanged)); this.addListener(new SetUserIDHandler(Person.kChangedID, false)); this.getField(Person.kName).addListener(new CopyLastHandler(Person.kNameSort)); // Only if dest is null (ie., company name is null) this.getField(Person.kNameSort).addListener(new FieldToUpperHandler(null)); this.getField(Person.kPostalCode).addListener(new CopyFieldHandler(Person.kPostalCodeSort)); } /**
/** * Constructor. * @param field The date changed field in this record. */ public DateChangedHandler(DateTimeField field) { this(); this.init(null, field, null); } /**
/** * Called when a change is the record status is about to happen/has happened. * This method sets the field to the current time on an add or update. * @param field If this file change is due to a field, this is the field. * @param iChangeType The type of change that occurred. * @param bDisplayOption If true, display any changes. * @return an error code. */ public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Write/Update a record switch (iChangeType) { case DBConstants.FIELD_CHANGED_TYPE: if (!onFieldChange) break; case DBConstants.REFRESH_TYPE: case DBConstants.ADD_TYPE: case DBConstants.UPDATE_TYPE: DateTimeField thisField = m_field; if (thisField == null) if (mainFilesFieldName != null) thisField = (DateTimeField)this.getOwner().getField(mainFilesFieldName); boolean[] rgbEnabled = thisField.setEnableListeners(false); thisField.setValue(DateTimeField.currentTime(), bDisplayOption, DBConstants.SCREEN_MOVE); // File written or updated, set the update date thisField.setEnableListeners(rgbEnabled); break; } return super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record } }
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.addListener(new DateChangedHandler((DateTimeField)this.getField(Person.DATE_CHANGED))); this.addListener(new SetUserIDHandler(Person.CHANGED_ID, false)); this.getField(Person.NAME).addListener(new CopyLastHandler(this.getField(Person.NAME_SORT))); // Only if dest is null (ie., company name is null) this.getField(Person.NAME_SORT).addListener(new FieldToUpperHandler(null)); this.getField(Person.POSTAL_CODE).addListener(new CopyFieldHandler(this.getField(Person.POSTAL_CODE_SORT))); } /**
/** * Constructor. * @param field The date changed field in this record. */ public DateChangedHandler(DateTimeField field) { this(); this.init(null, field, -1); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.setEnabled(false); this.getMainRecord().getField(TicketTrx.OVERRIDE_PAID).setEnabled(true); this.getMainRecord().setKeyArea(TicketTrx.VENDOR_ID_KEY); this.getMainRecord().addListener(new SubFileFilter(this.getScreenRecord().getField(OverrideScreenRecord.VENDOR_ID), TicketTrx.VENDOR_ID, null, null, null, null)); this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(TicketTrx.START_SERVICE_DATE), this.getScreenRecord().getField(OverrideScreenRecord.START_DEPARTURE), ">=")); this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(TicketTrx.START_SERVICE_DATE), this.getScreenRecord().getField(OverrideScreenRecord.END_DEPARTURE), "<=")); this.getMainRecord().addListener(new DateChangedHandler(TicketTrx.OVERRIDE_PAID_DATE)); this.getMainRecord().addListener(new UpdateOverrideAcctDetailHandler(null)); } /**
/** * Constructor. * @param iMainFilesField The sequence of the date changed field in this record. */ public DateChangedHandler(int iMainFilesField) { this(); this.init(null, null, iMainFilesField); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.getMainRecord().setKeyArea(TicketTrx.VENDOR_ID_KEY); this.getMainRecord().addListener(new SubFileFilter(this.getScreenRecord().getField(OverrideScreenRecord.VENDOR_ID), TicketTrx.VENDOR_ID, null, null, null, null, true)); this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(TicketTrx.START_SERVICE_DATE), this.getScreenRecord().getField(OverrideScreenRecord.START_DEPARTURE), ">=")); this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(TicketTrx.START_SERVICE_DATE), this.getScreenRecord().getField(OverrideScreenRecord.END_DEPARTURE), "<=")); this.getScreenRecord().getField(OverrideScreenRecord.VENDOR_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(OverrideScreenRecord.START_DEPARTURE).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(OverrideScreenRecord.END_DEPARTURE).addListener(new FieldReSelectHandler(this)); TrxStatus recTrxStatus = (TrxStatus)this.getRecord(TrxStatus.TRX_STATUS_FILE); int iOverrideStatus = recTrxStatus.getTrxStatusID(TransactionType.AIR, TicketTrx.TICKET_TRX_FILE, TicketTrx.OVER_RIDE_PAID); // Remember, TrxStatus may be used by UpdateOverrideAcctDetailHandler this.getMainRecord().getField(TicketTrx.OVERRIDE_PAID).addListener(new CopyDataHandler(this.getMainRecord().getField(TicketTrx.TRX_STATUS_ID), Integer.toString(iOverrideStatus), null)); this.getMainRecord().addListener(new DateChangedHandler(TicketTrx.OVERRIDE_PAID_DATE)); this.getMainRecord().addListener(new UpdateOverrideAcctDetailHandler(null)); this.setEnabled(false); this.getMainRecord().getField(TicketTrx.OVERRIDE_PAID).setEnabled(true); this.setAppending(false); } /**
/** * Constructor. * @param iMainFilesField The sequence of the date changed field in this record. */ public DateChangedHandler(String mainFilesFieldName) { this(); this.init(null, null, mainFilesFieldName); } /**
this.addListener(new DateChangedHandler(Booking.MOD_DATE));
/** * Constructor. * @param iMainFilesField The sequence of the date changed field in this record. */ public DateChangedHandler(int iMainFilesField) { this(); this.init(null, null, iMainFilesField); } /**
this.addListener(new DateChangedHandler(Booking.MOD_DATE));