コード例 #1
0
  @Override
  public void actionRowEdit(boolean showSystemRegistries) {
    SDbBankLayout bankLayout = null;

    if (jbRowEdit.isEnabled()) {
      if (jtTable.getSelectedRowCount() != 1) {
        miClient.showMsgBoxInformation(SGridConsts.MSG_SELECT_ROW);
      } else {
        SGridRowView gridRow = (SGridRowView) getSelectedGridRow();
        SGuiParams params = null;

        if (gridRow.getRowType() != SGridConsts.ROW_TYPE_DATA) {
          miClient.showMsgBoxWarning(SGridConsts.ERR_MSG_ROW_TYPE_DATA);
        } else if (!showSystemRegistries && gridRow.isRowSystem()) {
          miClient.showMsgBoxWarning(
              SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_IS_SYSTEM);
        } else if (!gridRow.isUpdatable()) {
          miClient.showMsgBoxWarning(
              SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_NON_UPDATABLE);
        } else if (moPaneSettings.isUserInsertApplying()
            && mnUserLevelAccess == SUtilConsts.LEV_AUTHOR
            && gridRow.getFkUserInsertId() != miClient.getSession().getUser().getPkUserId()) {
          miClient.showMsgBoxWarning(SDbConsts.MSG_REG_DENIED_RIGHT);
        } else {
          bankLayout =
              (SDbBankLayout)
                  miClient
                      .getSession()
                      .readRegistry(
                          SModConsts.FIN_LAY_BANK,
                          gridRow.getRowPrimaryKey(),
                          SDbConsts.MODE_VERBOSE);

          if (bankLayout.getLayoutStatus() == SFinConsts.LAY_BANK_APPROVED_ST) {
            miClient.showMsgBoxWarning(
                "El layout no puede ser modificado en estatus "
                    + SFinConsts.LAY_BANK_APPROVED_TEXT_ST);
          } else if (bankLayout.getDocsPayed() > 0) {
            miClient.showMsgBoxWarning(
                SDbConsts.MSG_REG_DENIED_UPDATE + "\n¡Existen documentos con pagos aplicados!");
          } else if (bankLayout.getTransfersPayed() > 0) {
            miClient.showMsgBoxWarning(
                SDbConsts.MSG_REG_DENIED_UPDATE + "\n¡Existen transferencias con pagos aplicados!");
          } else {
            params = moFormParams != null ? moFormParams : new SGuiParams();
            params.setKey(gridRow.getRowPrimaryKey());

            miClient
                .getSession()
                .getModule(mnModuleType, mnModuleSubtype)
                .showForm(mnGridType, mnGridSubtype, params);
            moFormParams = null;
          }
        }
      }
    }
  }
コード例 #2
0
 private void actionApplyPayments() {
   if (jbPayment.isEnabled()) {
     if (validateRow()) {
       SGridRowView gridRow = (SGridRowView) getSelectedGridRow();
       if (!gridRow.isUpdatable()) {
         miClient.showMsgBoxWarning(
             SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_NON_UPDATABLE);
       } else {
         miClient
             .getSession()
             .getModule(mnModuleType, mnModuleSubtype)
             .showForm(mnGridType, SModConsts.FIN_REC, new SGuiParams(gridRow.getRowPrimaryKey()));
       }
     }
   }
 }