if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; // Never! if (!this.getFieldCopy().equals(this.getOwner()))
/** * FieldChanged Method. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { int iErrorCode = super.fieldChanged(bDisplayOption, iMoveMode); Record recVendor = ((ReferenceField)this.getOwner()).getReference(); if (recVendor != null) { if (!recVendor.getField(m_fsVendorCurrency).equals(m_fldBankCurrency)) { Task task = this.getOwner().getRecord().getRecordOwner().getTask(); BaseApplication app = (BaseApplication)task.getApplication(); String strError = app.getResources(ResourceConstants.ACCTPAY_RESOURCE, true).getString("Vendor currency must match bank currency"); iErrorCode = task.setLastError(strError); this.getOwner().setData(null); } } return iErrorCode; }
/** * FieldChanged Method. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { int iErrorCode = super.fieldChanged(bDisplayOption, iMoveMode); Record recVendor = ((ReferenceField)this.getOwner()).getReference(); if (recVendor != null) { if (!recVendor.getField(m_fsVendorCurrency).equals(m_fldBankCurrency)) { Task task = this.getOwner().getRecord().getRecordOwner().getTask(); BaseApplication app = (BaseApplication)task.getApplication(); String strError = app.getResources(ResourceConstants.ACCTPAY_RESOURCE, true).getString("Vendor currency must match bank currency"); iErrorCode = task.setLastError(strError); this.getOwner().setData(null); } } return iErrorCode; }
/** * Does this option apply to this booking/pax/date?. */ public boolean isValid(BookingModel recBooking, BaseField fldPaxCategory, Date dateStart) { if (!this.getField(TourHeaderOption.START_DATE).isNull()) if (this.getField(TourHeaderOption.START_DATE).compareTo(dateStart) > 0) return false; // departure date is before start date. if (!this.getField(TourHeaderOption.END_DATE).isNull()) if (this.getField(TourHeaderOption.END_DATE).compareTo(dateStart) < 0) return false; // departure date is after end date. if (!((DaysOfWeekField)this.getField(TourHeaderOption.DAYS_OF_WEEK)).isValidDate(dateStart)) return false; if (!this.getField(TourHeaderOption.GATEWAY).isNull()) { if (recBooking != null) if (!this.getField(TourHeaderOption.GATEWAY).equals(recBooking.getField(BookingModel.GATEWAY))) return false; } if (!this.getField(TourHeaderOption.PAX_CATEGORY_ID).isNull()) { if (fldPaxCategory != null) if (!this.getField(TourHeaderOption.PAX_CATEGORY_ID).equals(fldPaxCategory)) return false; } return true; } /**
/** * Does this option apply to this booking/pax/date?. */ public boolean isValid(BookingModel recBooking, BaseField fldPaxCategory, Date dateStart) { if (!this.getField(TourHeaderOption.START_DATE).isNull()) if (this.getField(TourHeaderOption.START_DATE).compareTo(dateStart) > 0) return false; // departure date is before start date. if (!this.getField(TourHeaderOption.END_DATE).isNull()) if (this.getField(TourHeaderOption.END_DATE).compareTo(dateStart) < 0) return false; // departure date is after end date. if (!((DaysOfWeekField)this.getField(TourHeaderOption.DAYS_OF_WEEK)).isValidDate(dateStart)) return false; if (!this.getField(TourHeaderOption.GATEWAY).isNull()) { if (recBooking != null) if (!this.getField(TourHeaderOption.GATEWAY).equals(recBooking.getField(BookingModel.GATEWAY))) return false; } if (!this.getField(TourHeaderOption.PAX_CATEGORY_ID).isNull()) { if (fldPaxCategory != null) if (!this.getField(TourHeaderOption.PAX_CATEGORY_ID).equals(fldPaxCategory)) return false; } return true; } /**
if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; // Never! if (!this.getFieldCopy().equals(this.getOwner()))
if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; // Never! if (!this.getFieldCopy().equals(this.getOwner()))
/** * Get the default message transport for this target/process. */ public MessageTransport getDefaultMessageTransport(MessageDetailTarget recMessageDetailTarget, MessageProcessInfo recMessageProcessInfo) { try { ContactType recContactType = (ContactType)((ReferenceField)this.getField(MessageDetail.kContactTypeID)).getReferenceRecord(null); recContactType = recContactType.getContactType((Record)recMessageDetailTarget); if (recContactType == null) return null; // Just being careful this.setKeyArea(MessageDetail.kContactTypeIDKey); this.getField(MessageDetail.kContactTypeID).moveFieldToThis((BaseField)recContactType.getCounterField()); this.getField(MessageDetail.kPersonID).moveFieldToThis((BaseField)((Record)recMessageDetailTarget).getCounterField()); this.getField(MessageDetail.kMessageProcessInfoID).moveFieldToThis((BaseField)recMessageProcessInfo.getCounterField()); this.getField(MessageDetail.kMessageTransportID).setValue(0); if (this.seek(">=")) { if (this.getField(MessageDetail.kContactTypeID).equals((BaseField)recContactType.getCounterField())) if (this.getField(MessageDetail.kPersonID).equals((BaseField)((Record)recMessageDetailTarget).getCounterField())) if (this.getField(MessageDetail.kMessageProcessInfoID).equals((BaseField)recMessageProcessInfo.getCounterField())) if (!this.getField(MessageDetail.kDefaultMessageTransportID).isNull()) return (MessageTransport)((ReferenceField)this.getField(MessageDetail.kDefaultMessageTransportID)).getReference(); } } catch (DBException ex) { ex.printStackTrace(); } return null; }
if (!recMessageInfoScreenRecord.getField(MessageInfoScreenRecord.kMessageInfoTypeID).equals(recMessageInfo.getField(MessageInfo.kMessageInfoTypeID))) return false; if (!recMessageInfoScreenRecord.getField(MessageInfoScreenRecord.kContactTypeID).isNull()) if (!recMessageInfoScreenRecord.getField(MessageInfoScreenRecord.kContactTypeID).equals(recMessageInfo.getField(MessageInfo.kContactTypeID))) return false; if (!recMessageInfoScreenRecord.getField(MessageInfoScreenRecord.kRequestTypeID).isNull()) if (!recMessageInfoScreenRecord.getField(MessageInfoScreenRecord.kRequestTypeID).equals(recMessageInfo.getField(MessageInfo.kRequestTypeID))) return false;
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { BaseField fldVendorID = this.getOwner().getField(ApTrx.VENDOR_ID); BaseField fldLastVendorID = m_screenRecord.getField(InvoiceScreenRecord.LAST_VENDOR_ID); if (fldVendorID.equals(fldLastVendorID)) // if (trxStatus = departure est) { this.getOwner().getField(ApTrx.INVOICE_NO).moveFieldToThis(m_screenRecord.getField(InvoiceScreenRecord.LAST_INVOICE_NO), DBConstants.DISPLAY, DBConstants.INIT_MOVE); this.getOwner().getField(ApTrx.INVOICE_DATE).moveFieldToThis(m_screenRecord.getField(InvoiceScreenRecord.LAST_INVOICE_DATE), DBConstants.DISPLAY, DBConstants.INIT_MOVE); } super.doValidRecord(bDisplayOption); }
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { BaseField fldVendorID = this.getOwner().getField(ApTrx.VENDOR_ID); BaseField fldLastVendorID = m_screenRecord.getField(InvoiceScreenRecord.LAST_VENDOR_ID); if (fldVendorID.equals(fldLastVendorID)) // if (trxStatus = departure est) { this.getOwner().getField(ApTrx.INVOICE_NO).moveFieldToThis(m_screenRecord.getField(InvoiceScreenRecord.LAST_INVOICE_NO), DBConstants.DISPLAY, DBConstants.INIT_MOVE); this.getOwner().getField(ApTrx.INVOICE_DATE).moveFieldToThis(m_screenRecord.getField(InvoiceScreenRecord.LAST_INVOICE_DATE), DBConstants.DISPLAY, DBConstants.INIT_MOVE); } super.doValidRecord(bDisplayOption); }
if ((m_recBooking.getEditMode() == DBConstants.EDIT_CURRENT) ||(m_recBooking.getEditMode() == DBConstants.EDIT_CURRENT)) if (m_recBooking.getField(Booking.TOUR_ID).equals(this.getOwner().getField(Tour.ID))) bBookingOkay = true;
if ((m_recBooking.getEditMode() == DBConstants.EDIT_CURRENT) ||(m_recBooking.getEditMode() == DBConstants.EDIT_CURRENT)) if (m_recBooking.getField(Booking.TOUR_ID).equals(this.getOwner().getField(Tour.ID))) bBookingOkay = true;
if (fieldMain.equals(fieldAlt)) if ((fieldAlt.isNullable()) && (fieldAlt != recAlt.getCounterField())) fieldAlt.setData(null);
dateDetailStart = ((DateTimeField)this.getField(BookingDetail.DETAIL_DATE)).getDateTime(); if ((fldTourModuleID != null) && (!fldTourModuleID.equals(fldDetailModuleID))) continue; if ((dateStart != null) && (!dateStart.equals(dateDetailStart)))
dateDetailStart = ((DateTimeField)this.getField(BookingDetail.DETAIL_DATE)).getDateTime(); if ((fldTourModuleID != null) && (!fldTourModuleID.equals(fldDetailModuleID))) continue; if ((dateStart != null) && (!dateStart.equals(dateDetailStart)))
/** * FieldChanged Method. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { Record recTour = this.getOwner().getRecord(); if (m_recBooking != null) if (m_recBooking.getField(BookingModel.TOUR_ID).equals(recTour.getCounterField())) if ((m_recBooking.getEditMode() == DBConstants.EDIT_CURRENT) || (m_recBooking.getEditMode() == DBConstants.EDIT_IN_PROGRESS)) { Record recTourHeader = ((ReferenceField)recTour.getField(TourModel.TOUR_HEADER_ID)).getReference(); if (recTourHeader != null) if (recTourHeader.getField(TourHeaderModel.TOUR_SERIES).getState() == false) { boolean[] rgbEnabled = m_recBooking.getField(m_iBookingFieldSeq).setEnableListeners(false); m_recBooking.getField(m_iBookingFieldSeq).moveFieldToThis(this.getOwner()); m_recBooking.getField(m_iBookingFieldSeq).setEnableListeners(rgbEnabled); } } return super.fieldChanged(bDisplayOption, iMoveMode); }
if (keyField.getField(DBConstants.END_SELECT_KEY).equals(keyField.getField(DBConstants.START_SELECT_KEY)))
if (keyField.getField(DBConstants.END_SELECT_KEY).equals(keyField.getField(DBConstants.START_SELECT_KEY)))
if (!this.getField(Inventory.PRODUCT_ID).equals(recProduct.getCounterField())) break; if (((DateField)this.getField(Inventory.INV_DATE)).compareTo(dateTarget) > 0)