public int getPax() { return (int)m_recMain.getField(Booking.PAX).getValue(); } public int setPax(int iPax)
/** * Get the menu icon. */ public String getMenuIcon(FieldList record) { if (record.getField(Booking.ID).getValue() != 0) return "tour/buttons/Tour"; // For now else return Constants.FORM; } /**
public Object doGetData() { // Move raw data from this field double dPrice = this.getRecord().getField(BookingLine.PRICE).getValue(); double dQuantity = this.getRecord().getField(BookingLine.QUANTITY).getValue(); double dGross = Math.floor(dPrice * dQuantity * 100 + 0.5) / 100; return new Double(dGross); } };
/** * Retrieve (in string format) from this field. * @return The string. */ public String getString() { String string = super.getString(); // By default, get the data as-is if (this.getField() instanceof NumberField) { double dValue = this.getField().getValue(); if (m_bDebit) { if (dValue < 0) string = Constants.BLANK; // For debit/negative, return a null } else { // Credit if (dValue >= 0) string = Constants.BLANK; // For credit/positive, return a null else string = ((NumberField)this.getField()).binaryToString(new Double(-dValue)); // Positive representation } } return string; } /**
/** * Retrieve (in string format) from this field. * @return The string. */ public String getString() { String string = super.getString(); // By default, get the data as-is if (this.getField() instanceof NumberField) { double dValue = this.getField().getValue(); if (m_bDebit) { if (dValue < 0) string = Constants.BLANK; // For debit/negative, return a null } else { // Credit if (dValue >= 0) string = Constants.BLANK; // For credit/positive, return a null else string = ((NumberField)this.getField()).binaryToString(new Double(-dValue)); // Positive representation } } return string; } /**
/** * Retrieve (in string format) from this field. * @return The string. */ public String getString() { String string = super.getString(); // By default, get the data as-is if (this.getField() instanceof NumberField) { double dValue = this.getField().getValue(); if (m_bDebit) { if (dValue < 0) string = Constants.BLANK; // For debit/negative, return a null } else { // Credit if (dValue >= 0) string = Constants.BLANK; // For credit/positive, return a null else string = ((NumberField)this.getField()).binaryToString(new Double(-dValue)); // Positive representation } } return string; } /**
/** * Called when a valid record is read from the table/query. * Enables or disables the target field(s). * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) // Init this field override for other value { Record record = this.getOwner(); BaseDatabase database = record.getTable().getDatabase(); m_bEnableOnValid = true; int counter = (int)record.getCounterField().getValue(); String startingID = database.getProperty(BaseDatabase.STARTING_ID); String endingID = database.getProperty(BaseDatabase.ENDING_ID); if (startingID != null) if (counter < Integer.parseInt(Converter.stripNonNumber(startingID))) m_bEnableOnValid = false; if (endingID != null) if (counter > Integer.parseInt(Converter.stripNonNumber(endingID))) m_bEnableOnValid = false; // System.out.println("start, end: " + startingID + " " + endingID); super.doValidRecord(bDisplayOption); } }
/** * Called when a valid record is read from the table/query. * Enables or disables the target field(s). * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) // Init this field override for other value { Record record = this.getOwner(); BaseDatabase database = record.getTable().getDatabase(); m_bEnableOnValid = true; int counter = (int)record.getCounterField().getValue(); String startingID = database.getProperty(BaseDatabase.STARTING_ID); String endingID = database.getProperty(BaseDatabase.ENDING_ID); if (startingID != null) if (counter < Integer.parseInt(Converter.stripNonNumber(startingID))) m_bEnableOnValid = false; if (endingID != null) if (counter > Integer.parseInt(Converter.stripNonNumber(endingID))) m_bEnableOnValid = false; // System.out.println("start, end: " + startingID + " " + endingID); super.doValidRecord(bDisplayOption); } }
/** * Called when a valid record is read from the table/query. * Enables or disables the target field(s). * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) // Init this field override for other value { Record record = this.getOwner(); BaseDatabase database = record.getTable().getDatabase(); m_bEnableOnValid = true; int counter = (int)record.getCounterField().getValue(); String startingID = database.getProperty(BaseDatabase.STARTING_ID); String endingID = database.getProperty(BaseDatabase.ENDING_ID); if (startingID != null) if (counter < Integer.parseInt(Converter.stripNonNumber(startingID))) m_bEnableOnValid = false; if (endingID != null) if (counter > Integer.parseInt(Converter.stripNonNumber(endingID))) m_bEnableOnValid = false; // System.out.println("start, end: " + startingID + " " + endingID); super.doValidRecord(bDisplayOption); } }
/** * Mask of valid bits. */ public int getBitsToCheck() { if (m_iBitsToCheck == 0) { Record record = this.makeReferenceRecord(); try { record.close(); while (record.hasNext()) // 0 = First Day -> 6 = Last Day of Week { record.next(); int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; } } catch (DBException e) { e.printStackTrace(); } } return m_iBitsToCheck; } }
/** * Mask of valid bits. */ public int getBitsToCheck() { if (m_iBitsToCheck == 0) { Record record = this.makeReferenceRecord(); try { record.close(); while (record.hasNext()) // 0 = First Day -> 6 = Last Day of Week { record.next(); int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; } } catch (DBException e) { e.printStackTrace(); } } return m_iBitsToCheck; } }
/** * Mask of valid bits. */ public int getBitsToCheck() { if (m_iBitsToCheck == 0) { Record record = this.makeReferenceRecord(); try { record.close(); while (record.hasNext()) // 0 = First Day -> 6 = Last Day of Week { record.next(); int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; } } catch (DBException e) { e.printStackTrace(); } } return m_iBitsToCheck; } }
refs.put(referenceRecord.getTableNames(false), (int)referenceRecord.getCounterField().getValue()); String key = record.getTableNames(false) + "->" + referenceRecord.getTableNames(false); if (!checkMap.contains(key))
if (strWeek.length() > 0) dayConverter = new FieldDescConverter(dayConverter, strWeek); int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; dayConverter = new BitConverter(dayConverter, sBitPosition, true, true);
if (strWeek.length() > 0) dayConverter = new FieldDescConverter(dayConverter, strWeek); int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; dayConverter = new BitConverter(dayConverter, sBitPosition, true, true);
if (strWeek.length() > 0) dayConverter = new FieldDescConverter(dayConverter, strWeek); int sBitPosition = (int)record.getCounterField().getValue(); m_iBitsToCheck |= 1 << sBitPosition; dayConverter = new BitConverter(dayConverter, sBitPosition, true, true);
if (iBookingNo == recBooking.getField(Booking.ID).getValue()) return true; // Already read
if (!table.getRecord().isAutoSequence()) int iValue = (int)field.getValue(); if (iValue >= m_iCounter) m_iCounter = iValue + 1; // New next counter value