/** * Set the date field to the current time. * Also make sure the time is not the same as it is currently. */ public void setTheDate() { boolean[] rgbEnabled = m_field.setEnableListeners(false); Calendar calAfter = m_field.getCalendar(); Calendar calBefore = m_field.getCalendar(); m_field.setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // File written or updated, set the update date calAfter = m_field.getCalendar(); if (calBefore != null) if (calAfter.before(calBefore)) calAfter = calBefore; // If this was set with a different computer (clock), make sure it always increases! if (calAfter != null) if (calAfter.equals(calBefore)) { calAfter.add(Calendar.SECOND, 1); // Can't be the same as last time. m_field.setCalendar(calAfter, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } Utility.getLogger().info("Set date: " + m_field.toString()); m_field.setEnableListeners(rgbEnabled); } /**
/** * Set the date field to the current time. * Also make sure the time is not the same as it is currently. */ public void setTheDate() { boolean[] rgbEnabled = m_field.setEnableListeners(false); Calendar calAfter = m_field.getCalendar(); Calendar calBefore = m_field.getCalendar(); m_field.setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // File written or updated, set the update date calAfter = m_field.getCalendar(); if (calBefore != null) if (calAfter.before(calBefore)) calAfter = calBefore; // If this was set with a different computer (clock), make sure it always increases! if (calAfter != null) if (calAfter.equals(calBefore)) { calAfter.add(Calendar.SECOND, 1); // Can't be the same as last time. m_field.setCalendar(calAfter, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } Utility.getLogger().info("Set date: " + m_field.toString()); m_field.setEnableListeners(rgbEnabled); } /**
/** * Set the date field to the current time. * Also make sure the time is not the same as it is currently. */ public void setTheDate() { boolean[] rgbEnabled = m_field.setEnableListeners(false); Calendar calAfter = m_field.getCalendar(); Calendar calBefore = m_field.getCalendar(); m_field.setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // File written or updated, set the update date calAfter = m_field.getCalendar(); if (calBefore != null) if (calAfter.before(calBefore)) calAfter = calBefore; // If this was set with a different computer (clock), make sure it always increases! if (calAfter != null) if (calAfter.equals(calBefore)) { calAfter.add(Calendar.SECOND, 1); // Can't be the same as last time. m_field.setCalendar(calAfter, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } Utility.getLogger().info("Set date: " + m_field.toString()); m_field.setEnableListeners(rgbEnabled); } /**
/** * 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 } }
/** * 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 } }
/** * 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 } }
((DateField)this.getField(ApTrx.END_SERVICE_DATE)).setDate(dateEnd, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getField(ApTrx.FINALIZATION_DATE).setValue(DateTimeField.currentTime());
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); SubFileFilter listener = null; this.getMainRecord().addListener(listener = new SubFileFilter(this.getScreenRecord().getField(ProductScreenRecord.START_DATE), BookingDetail.DETAIL_DATE, null, null, null, null)); listener.setEndKey(false); if (this.getScreenRecord().getField(ProductScreenRecord.START_DATE).isNull()) this.getScreenRecord().getField(ProductScreenRecord.START_DATE).setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.INIT_MOVE); this.getScreenRecord().getField(ProductScreenRecord.START_DATE).addListener(new FieldReSelectHandler(this)); this.setAppending(false); this.setEditing(false); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); SubFileFilter listener = null; this.getMainRecord().addListener(listener = new SubFileFilter(this.getScreenRecord().getField(ProductScreenRecord.START_DATE), BookingDetail.DETAIL_DATE, null, null, null, null)); listener.setEndKey(false); if (this.getScreenRecord().getField(ProductScreenRecord.START_DATE).isNull()) this.getScreenRecord().getField(ProductScreenRecord.START_DATE).setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.INIT_MOVE); this.getScreenRecord().getField(ProductScreenRecord.START_DATE).addListener(new FieldReSelectHandler(this)); this.setAppending(false); this.setEditing(false); } /**
if (strMessageDescription != null) recMessageLog.getField(MessageLog.kDescription).setString(strMessageDescription); recMessageLog.getField(MessageLog.kMessageTime).setValue(DateTimeField.currentTime()); if (iMessageProcessInfoID != -1) recMessageLog.getField(MessageLog.kMessageProcessInfoID).setValue(iMessageProcessInfoID);
if (fldTrxDescID != null) this.getField(PaymentHistory.LINKED_TRX_DESC_ID).moveFieldToThis(fldTrxDescID); this.getField(PaymentHistory.TRX_ENTRY).setValue(DateTimeField.currentTime()); this.add(); Object bookmark = this.getLastModified(DBConstants.DATA_SOURCE_HANDLE);
int iRefundPendingTrxStatus = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.REFUND_SUBMITTED); int iCancelTrxStatus = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.CANCELLATION_CHARGE); double dDate = DateTimeField.currentTime();
int iRefundPendingTrxStatus = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.REFUND_SUBMITTED); int iCancelTrxStatus = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.CANCELLATION_CHARGE); double dDate = DateTimeField.currentTime();