/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() { // The listener is cloned along with any cloned files return new SubCountHandler(m_fldMain, m_fsToCount, m_bRecountOnSelect, m_bVerifyOnEOF); // Init this field override for other value } /**
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() { // The listener is cloned along with any cloned files SubCountHandler handler = new SubCountHandler(); handler.init(null, null, null, m_fldMain, fsToCount, m_bRecountOnSelect, m_bVerifyOnEOF, m_bResetOnBreak); // Init this field override for other value return handler; } /**
/** * Called when a valid record is read from the table/query. * Grab the old value of the field in case there is a change. * @param bDisplayOption If true, display any changes. */ public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); m_dOldValue = this.getFieldValue(); // Old value (in case of change) } /**
/** * Constructor for counting the sub-records in this file. * @param fieldMain The field to receive the count. * @param bVerifyOnEOF Verify the total on End of File (true default). * @param bRecountOnSelect Recount the total each time a file select is called (False default). */ public SubCountHandler(BaseField fieldMain, boolean bRecountOnSelect, boolean bVerifyOnEOF) { this(); this.init(null, null, -1, fieldMain, -1, bRecountOnSelect, bVerifyOnEOF, false); } /**
iErrorCode = this.resetCount(); // Set in main file's field break; case DBConstants.AFTER_REQUERY_TYPE: bResetCount = false; // Don't reset a field on a current record (since that would cause the record to be re-written for no reason AND may trigger unnecessary changes) if (bResetCount) iErrorCode = this.resetCount(); // Set in main file's field if (m_fldBreak != null) m_bEOFHit = true; if (m_bVerifyOnEOF) iErrorCode = this.setCount(m_dTotalToVerify, false, DBConstants.INIT_MOVE); // Set in main file's field break; case DBConstants.MOVE_NEXT_TYPE: dMainValue = this.getCount(); // Set in main file's field dCurrentValue = this.getFieldValue(); // New(current) value dMainValue += dCurrentValue; m_dTotalToVerify += dCurrentValue; iErrorCode = this.setCount(dMainValue, true, DBConstants.INIT_MOVE); // Set in main file's field break; case DBConstants.AFTER_REFRESH_TYPE: // New blank record created m_dOldValue = this.getFieldValue(); // Old value (in case of change) break; case DBConstants.AFTER_ADD_TYPE: dMainValue = this.getCount(); // Set in main file's field dCurrentValue = this.getFieldValue(); // New(current) value iErrorCode = this.setCount(dMainValue, false, DBConstants.SCREEN_MOVE); // Set in main file's field
/** * Reset the field count. */ public int resetCount() { if (iInvoiceTrxStatus == -1) this.firstTime(); iTrxStatus = iInvoiceTrxStatus; return super.resetCount(); } /**
int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode;
/** * Constructor for counting the sub-records in this file. * @param fieldMain The field to receive the count. * @param bVerifyOnEOF Verify the total on End of File (true default). * @param bRecountOnSelect Recount the total each time a file select is called (False default). */ public SubCountHandler(BaseField fieldMain, boolean bRecountOnSelect, boolean bVerifyOnEOF) { this(); this.init(null, null, -1, fieldMain, -1, bRecountOnSelect, bVerifyOnEOF, false); } /**
iErrorCode = this.resetCount(); // Set in main file's field break; case DBConstants.AFTER_REQUERY_TYPE: bResetCount = false; // Don't reset a field on a current record (since that would cause the record to be re-written for no reason AND may trigger unnecessary changes) if (bResetCount) iErrorCode = this.resetCount(); // Set in main file's field if (m_fldBreak != null) m_bEOFHit = true; if (m_bVerifyOnEOF) iErrorCode = this.setCount(m_dTotalToVerify, false, DBConstants.INIT_MOVE); // Set in main file's field break; case DBConstants.MOVE_NEXT_TYPE: dMainValue = this.getCount(); // Set in main file's field dCurrentValue = this.getFieldValue(); // New(current) value dMainValue += dCurrentValue; m_dTotalToVerify += dCurrentValue; iErrorCode = this.setCount(dMainValue, true, DBConstants.INIT_MOVE); // Set in main file's field break; case DBConstants.AFTER_REFRESH_TYPE: // New blank record created m_dOldValue = this.getFieldValue(); // Old value (in case of change) break; case DBConstants.AFTER_ADD_TYPE: dMainValue = this.getCount(); // Set in main file's field dCurrentValue = this.getFieldValue(); // New(current) value iErrorCode = this.setCount(dMainValue, false, DBConstants.SCREEN_MOVE); // Set in main file's field
/** * Reset the field count. */ public int resetCount() { if (iInvoiceTrxStatus == -1) this.firstTime(); iTrxStatus = iInvoiceTrxStatus; return super.resetCount(); } /**
int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode;
/** * Creates a new object of the same class as this object. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone() { // The listener is cloned along with any cloned files return new SubCountHandler(m_fldMain, m_fsToCount, m_bRecountOnSelect, m_bVerifyOnEOF); // Init this field override for other value } /**
/** * Initialize class fields. */ public void init(BaseField fieldMain, String ifsToCount, boolean bRecountOnSelect, boolean bVerifyOnEOF) { m_iEndMcoClass = 0; m_iStartMcoClass = 0; m_recTrxStatus = null; super.init(null, null, null, fieldMain, ifsToCount, bRecountOnSelect, bVerifyOnEOF, false); } /**
iErrorCode = this.resetCount(); // Set in main file's field break; case DBConstants.AFTER_REQUERY_TYPE: bResetCount = false; // Don't reset a field on a current record (since that would cause the record to be re-written for no reason AND may trigger unnecessary changes) if (bResetCount) iErrorCode = this.resetCount(); // Set in main file's field if (m_fldBreak != null) m_bEOFHit = true; if (m_bVerifyOnEOF) iErrorCode = this.setCount(m_dTotalToVerify, false, DBConstants.INIT_MOVE); // Set in main file's field break; case DBConstants.MOVE_NEXT_TYPE: dMainValue = this.getCount(); // Set in main file's field dCurrentValue = this.getFieldValue(); // New(current) value dMainValue += dCurrentValue; m_dTotalToVerify += dCurrentValue; iErrorCode = this.setCount(dMainValue, true, DBConstants.INIT_MOVE); // Set in main file's field break; case DBConstants.AFTER_REFRESH_TYPE: // New blank record created m_dOldValue = this.getFieldValue(); // Old value (in case of change) break; case DBConstants.AFTER_ADD_TYPE: dMainValue = this.getCount(); // Set in main file's field dCurrentValue = this.getFieldValue(); // New(current) value iErrorCode = this.setCount(dMainValue, false, DBConstants.SCREEN_MOVE); // Set in main file's field
/** * Called when a valid record is read from the table/query. * Grab the old value of the field in case there is a change. * @param bDisplayOption If true, display any changes. */ public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); m_dOldValue = this.getFieldValue(); // Old value (in case of change) } /**
/** * Reset the field count. */ public int resetCount() { int iErrorCode = super.resetCount(); Record booking = m_fldMain.getRecord(); for (int iFieldSeq = booking.getFieldSeq(Booking.SINGLE_PAX); iFieldSeq <= booking.getFieldSeq(Booking.QUAD_PAX); iFieldSeq++) { // Zero all the other fields iErrorCode = this.setFieldCount(iFieldSeq, 0, true); } return iErrorCode; } /**
int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode;
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); String iFieldSeq = TourHeaderOption.DETAIL_TOUR_DETAIL_COUNT; if (TourHeaderLine.TOUR_HEADER_LINE_FILE.equals(this.getMainRecord().getTableNames(false))) iFieldSeq = TourHeaderOption.DETAIL_PRICE_COUNT; if (TourHeaderAirHeader.TOUR_HEADER_AIR_HEADER_FILE.equals(this.getMainRecord().getTableNames(false))) iFieldSeq = TourHeaderOption.DETAIL_AIR_HEADER_COUNT; this.getMainRecord().addListener(new SubCountHandler(this.getHeaderRecord().getField(iFieldSeq), false, true)); } /**
/** * Initialize class fields. */ public void init(Record record, Record recPaxCategory) { m_recPaxCategory = null; m_sOldPaxType = 0; m_recPaxCategory = recPaxCategory; super.init(null, record, Booking.PAX, null, null, true, true, false); } /**
/** * Called when a valid record is read from the table/query. * Grab the old value of the field in case there is a change. * @param bDisplayOption If true, display any changes. */ public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); m_dOldValue = this.getFieldValue(); // Old value (in case of change) } /**