org.jbundle.base.db.Record.set()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(11.8k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.jbundle.base.db.Record.set方法的一些代码示例,展示了Record.set的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.set方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:set

Record.set介绍

[英]Update this record. For updated records:

This record is updated in the table. It is sometimes in the correct order, sometimes at the same location in the table. The current position is unknown, but is usually pointing to this record.
[中]

代码示例

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Run Method.
 */
public void run()
{
  String strID = this.getProperty(DBParams.ID);
  if ((strID != null) && (strID.length() > 0))
  {
    Record recCalendarEntry = this.getMainRecord();
    recCalendarEntry.getCounterField().setString(strID);
    try {
      if (recCalendarEntry.seek(null))
      {
        recCalendarEntry.edit();
        boolean[] rgbEnabled = recCalendarEntry.setEnableListeners(false);  // I need to do this since a change in properties will reschedule the jobs.
        ((PropertiesField)recCalendarEntry.getField(CalendarEntry.kProperties)).setProperty(TASK_COMPLETED, DBConstants.TRUE);
        recCalendarEntry.setEnableListeners(rgbEnabled);
        recCalendarEntry.set();
      }
    } catch (DBException ex) {
      ex.printStackTrace();
    }
  }
}

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.assetdr.report

/**
 * Process the command.
 * <br />Step 1 - Process the command if possible and return true if processed.
 * <br />Step 2 - If I can't process, pass to all children (with me as the source).
 * <br />Step 3 - If children didn't process, pass to parent (with me as the source).
 * <br />Note: Never pass to a parent or child that matches the source (to avoid an endless loop).
 * @param strCommand The command to process.
 * @param sourceSField The source screen field (to avoid echos).
 * @param iCommandOptions If this command creates a new screen, create in a new window?
 * @return true if success.
 */
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
  if (strCommand.equalsIgnoreCase(MenuConstants.POST))
  {
    try {
      Record recAssetDrControl = this.getRecord(AssetDrControl.ASSET_DR_CONTROL_FILE);
      recAssetDrControl.edit();
      ((DateTimeField)recAssetDrControl.getField(AssetDrControl.DATE_RECONCILED)).setDateTime(new Date(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
      recAssetDrControl.set();
    } catch (DBException ex) {
      ex.printStackTrace();
    }
    strCommand = DBConstants.BACK;  // Go to previous screen
  }
  return super.doCommand(strCommand, sourceSField, iCommandOptions);
}

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Called when a change is the record status is about to happen/has happened.
 * @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)
{
  int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption);
  
  if (iChangeType == DBConstants.AFTER_REFRESH_TYPE)
      iErrorCode = this.moveIDToCodeField();
  else if ((iChangeType == DBConstants.AFTER_ADD_TYPE)
    && (this.getCodeField().isNull()))
  {
    try {
      Record record = this.getOwner();
      Object bookmark = record.getLastModified(DBConstants.BOOKMARK_HANDLE);
      record.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
      record.edit();
      iErrorCode = this.moveIDToCodeField();
      record.set();
    } catch (DBException ex) {
      ex.printStackTrace();
    }
  }
  return iErrorCode;
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * free this listener and update/add the target record.
 */
public int writeAndRefresh()
{
  try   {
    if (m_recordToUpdate != null)
      if (m_recordToUpdate.isModified(true))
    {
      if (m_bRefreshAfterUpdate)
        m_recordToUpdate.writeAndRefresh();
      else
      {
        if (m_recordToUpdate.getEditMode() == Constants.EDIT_IN_PROGRESS)
          m_recordToUpdate.set();
        else if (m_recordToUpdate.getEditMode() == Constants.EDIT_ADD)
          m_recordToUpdate.add();
      }
    }
  } catch(DBException ex)   {
    ex.printStackTrace();
  }
  return DBConstants.NORMAL_RETURN;   // For now
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * Called when a change is the record status is about to happen/has happened.
 * @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)
{
  int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption);
  
  if (iChangeType == DBConstants.AFTER_REFRESH_TYPE)
      iErrorCode = this.moveIDToCodeField();
  else if ((iChangeType == DBConstants.AFTER_ADD_TYPE)
    && (this.getCodeField().isNull()))
  {
    try {
      Record record = this.getOwner();
      Object bookmark = record.getLastModified(DBConstants.BOOKMARK_HANDLE);
      record.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
      record.edit();
      iErrorCode = this.moveIDToCodeField();
      record.set();
    } catch (DBException ex) {
      ex.printStackTrace();
    }
  }
  return iErrorCode;
}
/**

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.request.misc

/**
 * Same as onAdd, but don't clear the record, so I can redisplay it.
 */
public boolean onAdd()
{
  Record record = this.getMainRecord();
  try
  {
    if (record.isModified(false))
    {
      if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
        record.set();
      else if (record.getEditMode() == Constants.EDIT_ADD)
        record.add();
    }
  //x   record.addNew();
  }
  catch(DBException e)
  {
    this.displayError(e);
  }
  return true;
}
/**

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report

recRequestHistory.set();

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * free this listener and update/add the target record.
 */
public int writeAndRefresh()
{
  try   {
    if (m_recordToUpdate != null)
      if (m_recordToUpdate.isModified(true))
    {
      if (m_bRefreshAfterUpdate)
        m_recordToUpdate.writeAndRefresh();
      else
      {
        if (m_recordToUpdate.getEditMode() == Constants.EDIT_IN_PROGRESS)
          m_recordToUpdate.set();
        else if (m_recordToUpdate.getEditMode() == Constants.EDIT_ADD)
          m_recordToUpdate.add();
      }
    }
  } catch(DBException ex)   {
    ex.printStackTrace();
  }
  return DBConstants.NORMAL_RETURN;   // For now
}
/**

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.request.report

recRequestHistory.set();

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.request.report

/**
 * Run Method.
 */
public void run()
{
  Record recRequest = this.getMainRecord();
  try {
    recRequest.close();
    while (recRequest.hasNext())
    {
      recRequest.next();
      recRequest.edit();
      recRequest.getField(Request.PRINT_NOW).setState(true);
      recRequest.set();
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
}

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

this.getOwner().set();      // Update the record
} catch (DBException ex) {
  return ex.getErrorCode();

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.request.report

/**
 * Run Method.
 */
public void run()
{
  Record recRequest = this.getMainRecord();
  try {
    recRequest.close();
    while (recRequest.hasNext())
    {
      recRequest.next();
      recRequest.edit();
      recRequest.getField(Request.PRINT_NOW).setState(true);
      recRequest.set();
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
}

代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model

/**
 * Process the "Add" toolbar command.
 * @return  true    If command was handled
 */
public boolean onAdd()
{
  Record record = this.getMainRecord();
  if (record == null)
    return false;
  try {
    if (record.isModified(false))
    {
      if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
        record.set();
      else if (record.getEditMode() == Constants.EDIT_ADD)
        record.add();
    }
    record.addNew();
    this.clearStatusText();
  } catch(DBException ex) {
    this.displayError(ex);
    return false;
  }
  return true;
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Process the "Add" toolbar command.
 * @return  true    If command was handled
 */
public boolean onAdd()
{
  Record record = this.getMainRecord();
  if (record == null)
    return false;
  try {
    if (record.isModified(false))
    {
      if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
        record.set();
      else if (record.getEditMode() == Constants.EDIT_ADD)
        record.add();
    }
    record.addNew();
    this.clearStatusText();
  } catch(DBException ex) {
    this.displayError(ex);
    return false;
  }
  return true;
}
/**

代码示例来源:origin: org.jbundle.base.screen/org.jbundle.base.screen.model

/**
 * Add/update this summary record.
 * @param recSummary The destination summary record.
 * @param mxKeyFields The key fields map.
 * @param mxDataFields The data fields map.
 */
public void addSummary(Record recSummary, BaseField[][] mxKeyFields, BaseField[][] mxDataFields)
{
  try {
    recSummary.addNew();
    // First move the key to see if a record exists
    this.setupSummaryKey(mxKeyFields);
    boolean bSuccess = recSummary.seek("=");
    if (bSuccess)
      recSummary.edit();
    else
    {
      recSummary.addNew();
      this.setupSummaryKey(mxKeyFields);
    }
    this.addSummaryData(mxDataFields);
    if (bSuccess)
      recSummary.set();
    else
      recSummary.add();
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
}
/**

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.acctrec.screen

/**
 * Post all the transactions in this batch.
 * @return true if successful.
 */
public boolean onPost()
{
  try   {
    TrxStatus recTrxStatus = (TrxStatus)this.getRecord(TrxStatus.TRX_STATUS_FILE);
    Object bookmark = recTrxStatus.getHandle(DBConstants.DATA_SOURCE_HANDLE);
    int iTrxPaidClassID = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, ArTrx.AR_TRX_FILE, ArTrx.REFUND_PAID);
    recTrxStatus.setHandle(bookmark, DBConstants.DATA_SOURCE_HANDLE);
    Record recArTrx = this.getMainRecord();
    recArTrx.close();
    while (recArTrx.hasNext())
    {
      recArTrx.next();
      recArTrx.edit();
      recArTrx.getField(ArTrx.TRX_STATUS_ID).setValue(iTrxPaidClassID);
      recArTrx.set();
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
  }
  return true;
}

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.assetdr.process

/**
 * UpdateAllCurrencies Method.
 */
public void updateAllCurrencies()
{
  Record record = this.getMainRecord();
  record.close();
  try {
    while (record.hasNext())
    {
      record.next();
      if (record.getField(Currencys.DELETED).getState() == true)
        continue;
      record.edit();
      
      double dRate = this.getConversionRate(record.getField(Currencys.CURRENCY_CODE).toString());
      if (dRate != 0.0)
        record.getField(Currencys.LAST_RATE).setValue(1 / dRate);
      
      record.set();
    }
  } catch (DBException e) {
    e.printStackTrace();
  }
}
/**

代码示例来源:origin: com.tourapp.tour/com.tourapp.tour.booking.db

/**
 * Order all the components for this tour.
 */
public void orderAllComponents()
{
  if (this.getField(Tour.ORDER_COMPONENTS).getState() == false)
    return;
  BookingDetail recBookingDetail = new BookingDetail(this.findRecordOwner());
  try {
    recBookingDetail.addListener(new SubFileFilter(this));
    while (recBookingDetail.hasNext())
    {
      recBookingDetail.next();
      Record recBookingDetailCurrent = recBookingDetail.getTable().getCurrentTable().getRecord();
      recBookingDetailCurrent.edit();
      recBookingDetailCurrent.getField(BookingDetail.PRODUCT_STATUS_REQUEST).setData(Boolean.TRUE);
      if (recBookingDetailCurrent.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
        recBookingDetailCurrent.set();   // Possible that the listeners re-wrote this record already.
    }
  } catch (DBException ex) {
    recBookingDetail.free();
  }
}
/**

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.acctpay.air

/**
 * OnPost Method.
 */
public boolean onPost()
{
  try   {
    TrxStatus recTrxStatus = (TrxStatus)this.getRecord(TrxStatus.TRX_STATUS_FILE);
    Object bookmark = recTrxStatus.getHandle(DBConstants.DATA_SOURCE_HANDLE);
    int iNewTrxType = recTrxStatus.getTrxStatusID(TransactionType.AIR, TicketTrx.TICKET_TRX_FILE, TicketTrx.ARC_SUBMITTED);
    recTrxStatus.setHandle(bookmark, DBConstants.DATA_SOURCE_HANDLE);
    Record recTicketTrx = this.getMainRecord();
  
    recTicketTrx.close();
    while (recTicketTrx.hasNext())
    {
      recTicketTrx.next();
      recTicketTrx.edit();
      recTicketTrx.getField(TicketTrx.TRX_STATUS_ID).setValue(iNewTrxType);
      recTicketTrx.getField(TicketTrx.ARC_DATE).setValue(DateField.todaysDate());
      recTicketTrx.set();
    }
  } catch (DBException ex)    {
    ex.printStackTrace();
    return false;
  }
  
  return true;
}

代码示例来源:origin: com.tourgeek.tour/com.tourgeek.tour.booking.db

/**
 * Order all the components for this tour.
 */
public void orderAllComponents()
{
  if (this.getField(Tour.ORDER_COMPONENTS).getState() == false)
    return;
  BookingDetail recBookingDetail = new BookingDetail(this.findRecordOwner());
  try {
    recBookingDetail.addListener(new SubFileFilter(this));
    while (recBookingDetail.hasNext())
    {
      recBookingDetail.next();
      Record recBookingDetailCurrent = recBookingDetail.getTable().getCurrentTable().getRecord();
      recBookingDetailCurrent.edit();
      recBookingDetailCurrent.getField(BookingDetail.PRODUCT_STATUS_REQUEST).setData(Boolean.TRUE);
      if (recBookingDetailCurrent.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
        recBookingDetailCurrent.set();   // Possible that the listeners re-wrote this record already.
    }
  } catch (DBException ex) {
    recBookingDetail.free();
  }
}
/**

相关文章

微信公众号

最新文章

更多

Record类方法