Package realcix20.classes.basic

Examples of realcix20.classes.basic.Row


               
                for (int i = 0; i < rows.length; i++) {
                    int selectedRowNumber = getContainer().getObjectTable().convertRowIndexToModel(rows[i]);
                    Vector dataVector = model.getDataVector();
                    Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                    Row row = (Row)rowDatas.get(rowDatas.size() - 1);         
                    selectedRows.add(row);
                }
               
                RegClass regObject = (RegClass)getContainer().getCurrentObject();           
                result = regObject.setUnCleared(selectedRows);
View Full Code Here


        if ( (!tm.isNoRow()) && (rows.length>0) ) {
            boolean isLedgerTypeEqualsXVC = false;
            boolean isTAmtEqualsZero = false;
            Vector needRemoveRows = new Vector();

            Row newRow=null;
          for (int i = 0; i < rows.length; i++) {
                Vector values = new Vector();
                for (int j = 1; j < tm.getColumnCount(); j++) {
                    String tableName = tm.getColumn(j).getTableName();
                    String columnName = tm.getColumn(j).getColumnName();
                    Item item = (Item)tm.getValueAt(rows[i], j);
                    Cell cell = new Cell(tableName, columnName, item.getFactValue());
                    values.add(cell);
                }
                Row row = new Row(values, container.getCurrentObject().getRowType());             
              int newR = 0;
             
//              make selectedRow 1 as templateRow
                if(i==0){
                  newRow = ObjectUtil.cloneRow(getContainer().getCurrentObject(),row);                 
                    //set child row need added & set new primary key to childRows
                    //get new PrimaryKey R.R , RI.R                   
                    DAO dao = DAO.getInstance();
                    dao.query(Resources.SELECT_MAX_R_FROM_R_SQL);
                    ResultSet rs = dao.executeQuery();
                    try {
                        if (rs.next())
                            newR = rs.getInt(1) + 1;
                        rs.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    //remove all
                    newRow.getRowSet().getRows().removeAllElements();                               
                   
                    Cell oldPrimaryKey1Cell = ObjectUtil.findOldCell(newRow, "R", "R");
                    oldPrimaryKey1Cell.setColumnValue(newR);
                    Cell newPrimaryKey1Cell = ObjectUtil.findNewCell(newRow, "R", "R");
                    newPrimaryKey1Cell.setColumnValue(newR);
                    Cell oldPrimaryKey2Cell = ObjectUtil.findOldCell(newRow, "RI", "R");
                    oldPrimaryKey2Cell.setColumnValue(newR);
                    Cell newPrimaryKey2Cell = ObjectUtil.findNewCell(newRow, "RI", "R");
                    newPrimaryKey2Cell.setColumnValue(newR);
                    Cell oldPrimaryKey3Cell = ObjectUtil.findOldCell(newRow, "RI", "RI");
                    oldPrimaryKey3Cell.setColumnValue(1);
                    Cell newPrimaryKey3Cell = ObjectUtil.findNewCell(newRow, "RI", "RI");
                    newPrimaryKey3Cell.setColumnValue(1);

                    //set a new childRow equals to newRow
                    Row newChildRow = ObjectUtil.cloneRow(getContainer().getCurrentObject(), newRow);
                    newRow.getRowSet().getRows().add(newChildRow);                   
                    String ld = (String)ObjectUtil.findNewCell(newChildRow, "RI", "LD").getColumnValue();                   
                    if (ld != null) {
                        String lt = LedgerClass.getLTByLD(ld);
                          if (lt.equals("XVC")) {
                              needRemoveRows.add(newChildRow);
                              isLedgerTypeEqualsXVC = true;
                         } else {
                            Double tamt = (Double)ObjectUtil.findNewCell(newChildRow, "RI", "TAMT").getColumnValue();
                            if (tamt == 0.0) {
                               needRemoveRows.add(newChildRow);
                               isTAmtEqualsZero = true;
                           }
                       }
                     } else {
                        needRemoveRows.add(newChildRow);
                     }
                }else{
                  Row newChildRow = ObjectUtil.cloneRow(getContainer().getCurrentObject(), row);
                    Cell oldPrimaryKey1Cell = ObjectUtil.findOldCell(newChildRow, "R", "R");
                    oldPrimaryKey1Cell.setColumnValue(newR);
                    Cell newPrimaryKey1Cell = ObjectUtil.findNewCell(newChildRow, "R", "R");
                    newPrimaryKey1Cell.setColumnValue(newR);
                    Cell oldPrimaryKey2Cell = ObjectUtil.findOldCell(newChildRow, "RI", "R");
                    oldPrimaryKey2Cell.setColumnValue(newR);
                    Cell newPrimaryKey2Cell = ObjectUtil.findNewCell(newChildRow, "RI", "R");
                    newPrimaryKey2Cell.setColumnValue(newR);
                    Cell oldPrimaryKey3Cell = ObjectUtil.findOldCell(newChildRow, "RI", "RI");
                    oldPrimaryKey3Cell.setColumnValue(i+1);
                    Cell newPrimaryKey3Cell = ObjectUtil.findNewCell(newChildRow, "RI", "RI");
                    newPrimaryKey3Cell.setColumnValue(i+1);                       
                    newRow.getRowSet().getRows().add(newChildRow);
                    needRemoveRows = new Vector();                   
                    String ld = (String)ObjectUtil.findNewCell(newChildRow, "RI", "LD").getColumnValue();                   
                    if (ld != null) {
                        String lt = LedgerClass.getLTByLD(ld);
                          if (lt.equals("XVC")) {
                              needRemoveRows.add(newChildRow);
                              isLedgerTypeEqualsXVC = true;
                         } else {
                            Double tamt = (Double)ObjectUtil.findNewCell(newChildRow, "RI", "TAMT").getColumnValue();
                            if (tamt == 0.0) {
                               needRemoveRows.add(newChildRow);
                               isTAmtEqualsZero = true;
                           }
                       }
                     } else {
                        needRemoveRows.add(newChildRow);
                     }                 
                }
      }
            if (isLedgerTypeEqualsXVC) {
                DialogManager.showMessageDialog(container, TxtManager.getTxt("INFORMATION.LEDGEREQUALSXVC"));
            }
            if (isTAmtEqualsZero) {
                DialogManager.showMessageDialog(container, TxtManager.getTxt("INFORMATION.TAMTEQUALSZERO"));
            }
            Iterator removedRowsIter = needRemoveRows.iterator();
            while (removedRowsIter.hasNext()) {
                Row removedRow = (Row)removedRowsIter.next();
                newRow.getRowSet().getRows().remove(removedRow);
            }
           
            getContainer().getCurrentObject().getRows().add(newRow);
            new ObjectEdit(getContainer(), getContainer().getCurrentObject(), newRow, "Add");
View Full Code Here

                String columnName = tm.getColumn(i).getColumnName();
                Item item = (Item)tm.getValueAt(selectedRowNumber, i);
                Cell cell = new Cell(tableName, columnName, item.getFactValue());
                values.add(cell);
            }
            Row selectedRow = new Row(values, container.getCurrentObject().getRowType());
            container.getCurrentObject().loadChilds(selectedRow);           
            Row newRow = ObjectUtil.cloneRow(container.getCurrentObject(), selectedRow);
            //set child row need added & set new primary key to childRows
            //get new PrimaryKey R.R , RI.R
            int newR = 0;
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_MAX_R_FROM_R_SQL);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next())
                    newR = rs.getInt(1) + 1;
                rs.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
            Cell oldPrimaryKey1Cell = ObjectUtil.findOldCell(newRow, "R", "R");
            oldPrimaryKey1Cell.setColumnValue(newR);
            Cell newPrimaryKey1Cell = ObjectUtil.findNewCell(newRow, "R", "R");
            newPrimaryKey1Cell.setColumnValue(newR);
            Cell oldPrimaryKey2Cell = ObjectUtil.findOldCell(newRow, "RI", "R");
            oldPrimaryKey2Cell.setColumnValue(newR);
            Cell newPrimaryKey2Cell = ObjectUtil.findNewCell(newRow, "RI", "R");
            newPrimaryKey2Cell.setColumnValue(newR);               
            //set a new childRow equals to newRow
            Row newChildRow = null;
            Iterator rowIter = newRow.getRowSet().getRows().iterator();
            while (rowIter.hasNext()) {
                newChildRow = (Row)rowIter.next();
                if (newChildRow == newRow) {
                    break;                       
                }
                newChildRow = null;
            }

            if (newChildRow != null) {             
                newChildRow = ObjectUtil.cloneRow(getContainer().getCurrentObject(), newRow);
                newRow.getRowSet().getRows().add(newChildRow);
            }           
            newRow.getRowSet().getRows().remove(newRow);
            Vector needRemoveRows = new Vector();
            rowIter = newRow.getRowSet().getRows().iterator();
            boolean isLedgerTypeEqualsXVC = false;
            boolean isTAmtEqualsZero = false;
            while (rowIter.hasNext()) {                   
                Row childRow = (Row)rowIter.next();
                String ld = (String)ObjectUtil.findNewCell(childRow, "RI", "LD").getColumnValue();                   
                if (ld != null) {
                    String lt = LedgerClass.getLTByLD(ld);
                    if (lt.equals("XVC")) {
                        needRemoveRows.add(childRow);
                        isLedgerTypeEqualsXVC = true;
                    } else {
                        Double tamt = (Double)ObjectUtil.findNewCell(childRow, "RI", "TAMT").getColumnValue();
                        if ( (tamt == null) || (tamt == 0.0) ) {
                            needRemoveRows.add(childRow);
                            isTAmtEqualsZero = true;
                        }
                    }
                } else {
                    needRemoveRows.add(childRow);
                }
            }
            Iterator removedRowsIter = needRemoveRows.iterator();
            while (removedRowsIter.hasNext()) {
                Row removedRow = (Row)removedRowsIter.next();
                newRow.getRowSet().getRows().remove(removedRow);
            }
            if (isLedgerTypeEqualsXVC) {
                DialogManager.showMessageDialog(container, TxtManager.getTxt("INFORMATION.LEDGEREQUALSXVC"));
            }
            if (isTAmtEqualsZero) {
                DialogManager.showMessageDialog(container, TxtManager.getTxt("INFORMATION.TAMTEQUALSZERO"));
            }
            int i = 1;
            rowIter = newRow.getRowSet().getRows().iterator();
            while (rowIter.hasNext()) {
                Row childRow = (Row)rowIter.next();
                oldPrimaryKey1Cell = ObjectUtil.findOldCell(childRow, "R", "R");
                oldPrimaryKey1Cell.setColumnValue(newR);
                oldPrimaryKey2Cell = ObjectUtil.findOldCell(childRow, "RI", "R");
                oldPrimaryKey2Cell.setColumnValue(newR);
                Cell oldPrimaryKey3Cell = ObjectUtil.findOldCell(childRow, "RI", "RI");
View Full Code Here

    }       
   
    //specify, Used by partner
    public void initialObjectAdd(ObjectPlugin op, String action) {
           
            Row row = op.getCixFile().getData().getRow(op.getCixFile().getPublicKey());
            Row newRow = new Row(getContainer().getCurrentObject().getRowType());
            //if (container.getCurrentObject().isSlayerMaster())
                newRow.getRowSet().getRows().add(newRow);
                getContainer().getCurrentObject().getRows().add(newRow);
           
            if (action.equals("Confirm Add Account Request")) {
                Cell tCell1 = findNewCell(row, "P", "NS");
                Cell tCell2 = findNewCell(row, "P", "P");               
View Full Code Here

               
                Iterator componentExtIter = getComponentExts().iterator();
                while (componentExtIter.hasNext()) {                   
                    ComponentExt componentExt = (ComponentExt)componentExtIter.next();
                    Column column = componentExt.getColumn();                   
                    Row row = componentExt.getRow();
                    JComponent component = componentExt.getComponent();
                    if ( (action.equals("Edit")) || (getStat().equals("Add")) || (getStat().equals("PartnerAdd")) ) {
//                        System.out.println(column.getTableName() + "." + column.getColumnName());
                        ComponentManager.setValue(getValue(column, row), component);
                    } else if (action.equals("Add")) {
View Full Code Here

           
                double sum = 0.0;
               
                Iterator rowIter = currentRow.getRowSet().getRows().iterator();
                while (rowIter.hasNext()) {
                    Row row = (Row)rowIter.next();
                    if (!row.isDelete()) {
                        Cell cell = ObjectUtil.findNewCell(row, "RI", "LAMT");
                        if (cell.getColumnValue() != null) {
                            Number lamt = (Number)cell.getColumnValue();
                            sum += lamt.doubleValue();
                        }
View Full Code Here

                sb.append(TxtManager.getTxt("VIEW.OBJECTEDIT.BUDGET.ACTURALLABEL"));
                sb.append(" : ");               
                Double actural = 0.0;
                Iterator rowIter = currentRow.getRowSet().getRows().iterator();
                while (rowIter.hasNext()) {
                    Row row = (Row)rowIter.next();
                    cell = ObjectUtil.findNewCell(row, "BI", "LAMT");
                    if (cell.getColumnValue() != null) {
                        Number oneCost  = (Number)cell.getColumnValue();
                        actural += oneCost.doubleValue();
                    }
View Full Code Here

                String columnName = tm.getColumn(i).getColumnName();
                Item item = (Item)tm.getValueAt(selectedRowNumber, i);
                Cell cell = new Cell(tableName, columnName, item.getFactValue());
                values.add(cell);
            }
            Row selectedRow = new Row(values, container.getCurrentObject().getRowType());
            getContainer().getCurrentObject().loadChilds(selectedRow);
            new ObjectEdit(getContainer(), getContainer().getCurrentObject(), selectedRow, "Edit");
            getContainer().setEnabled(false);
        }       
    }
View Full Code Here

                String columnName = tm.getColumn(i).getColumnName();
                Item item = (Item)tm.getValueAt(selectedRowNumber, i);
                Cell cell = new Cell(tableName, columnName, item.getFactValue());
                values.add(cell);
            }
            Row selectedRow = new Row(values, container.getCurrentObject().getRowType());
            getContainer().getCurrentObject().loadChilds(selectedRow);
            new ObjectEdit(getContainer(), getContainer().getCurrentObject(), selectedRow, "Edit");
            getContainer().setEnabled(false);
        }                
    }
View Full Code Here

                    String columnName = model.getColumn(i).getColumnName();
                    Item item = (Item)model.getValueAt(selectedRowNumber, i);
                    Cell cell = new Cell(tableName, columnName, item.getFactValue());
                    values.add(cell);
                }
                Row row = new Row(values, container.getCurrentObject().getRowType());
                //specify,used by BudgetSettingClass
                if (getContainer().getCurrentObject() instanceof BudgetSettingClass) {
                    if ((DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("BUDGETSETTING.DELETEALERT"))) == 0) {
                        container.getCurrentObject().classDelete_WholeObject(row);
                        ((BudgetSettingClass)getContainer().getCurrentObject()).deleteAllRelateItems(row);
                        container.updateObjectViewTable();
                    }
                }
                //specify,used by TaxTypeClass
                else if (getContainer().getCurrentObject() instanceof TaxTypeClass) {
                    if ( ((TaxTypeClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by UserClass
                else if (getContainer().getCurrentObject() instanceof UserClass) {
                    if ( ((UserClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            ((UserClass)getContainer().getCurrentObject()).deleteDependThings(row);
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by AnaTypeClass
                else if (getContainer().getCurrentObject() instanceof AnaTypeClass) {
                    if ( ((AnaTypeClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            ((AnaTypeClass)getContainer().getCurrentObject()).deleteDependThings(row);
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by UomClass
                else if (getContainer().getCurrentObject() instanceof UomClass) {
                    if ( ((UomClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by LedgerClass
                else if (getContainer().getCurrentObject() instanceof LedgerClass) {
                    if ( ((LedgerClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by FixedAssetClass
                else if (getContainer().getCurrentObject() instanceof FixedAssetClass) {
                    if ( ((FixedAssetClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by NameSpaceClass
                else if (getContainer().getCurrentObject() instanceof NameSpaceClass) {
                    if ( ((NameSpaceClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by PartnerClass
                else if (getContainer().getCurrentObject() instanceof PartnerClass) {
                    if ( ((PartnerClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            ((PartnerClass)getContainer().getCurrentObject()).deleteDependThings(row);
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by TaxDepClass
                else if (getContainer().getCurrentObject() instanceof TaxDepClass) {
                    if ( ((TaxDepClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            ((TaxDepClass)getContainer().getCurrentObject()).deleteDependThings(row);
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by InvestMarketClass
                else if (getContainer().getCurrentObject() instanceof InvestMarketClass) {
                    if ( ((InvestMarketClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by InvestProductClass
                else if (getContainer().getCurrentObject() instanceof InvestProductClass) {
                    if ( ((InvestProductClass)getContainer().getCurrentObject()).validateDelete(row, getContainer()) ) {
                        if ( (DialogManager.showYesNoDialog(getContainer(), TxtManager.getTxt("MAINFRAME.DELETE.CONFIRM"))) == 0) {
                            getContainer().getCurrentObject().classDelete_WholeObject(row);
                            container.updateObjectViewTable();
                        }
                    }
                }
                //specify,used by RegClass
                //fix add batch delete
                else if (getContainer().getCurrentObject() instanceof RegClass) {
                    if ((!model.isNoRow())&&(selectedRowNumbers.length>0)) {
                      Vector tablerows=new Vector();
                      deleteSelectSet.clear();
                      for (int j = 0; j < selectedRowNumbers.length; j++) {
                        Vector tablerow=new Vector();
                            Vector cells = new Vector();
                            for (int i = 1; i < model.getColumnCount(); i++) {
                                String tableName = model.getColumn(i).getTableName();
                                String columnName = model.getColumn(i).getColumnName();
                                Item item = (Item)model.getValueAt(selectedRowNumbers[j], i);
                                Cell cell = new Cell(tableName, columnName, item.getFactValue());
                                cells.add(cell);
                            }
                            Row regrow = new Row(cells, container.getCurrentObject().getRowType());
                            //TODO !!
                            container.getCurrentObject().loadChilds(regrow);
                            int r = Integer.parseInt(ObjectUtil.findNewCell(regrow, "R", "R").getColumnValue().toString());                           
                            if(deleteSelectSet.contains(r)){
                              continue;
View Full Code Here

TOP

Related Classes of realcix20.classes.basic.Row

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.