Package realcix20.classes.basic

Examples of realcix20.classes.basic.Row


       
            ItemTableModel model = (ItemTableModel)container.getTable().getModel();
            Vector dataVector = model.getDataVector();
            for (int i = 0; i < model.getRowCount(); i++) {
                Vector rowDatas = (Vector)dataVector.get(i);
                Row row = (Row)rowDatas.get(rowDatas.size() - 1);
                ((TaxClass)container.getObject()).calculatorTax(row);
                container.updateTable();
                row.setModify(true);
            }
       
    }
View Full Code Here


       
            ItemTableModel model = (ItemTableModel)container.getTable().getModel();
            Vector dataVector = model.getDataVector();
            for (int i = 0; i < model.getRowCount(); i++) {
                Vector rowDatas = (Vector)dataVector.get(i);
                Row row = (Row)rowDatas.get(rowDatas.size() - 1);
                Cell cell = ObjectUtil.findNewCell(row, "TAXI", "TAMT");
                if (cell.getColumnValue() == null)
                    ((TaxClass)container.getObject()).calculatorTax(row);
                row.setModify(true);
            }
       
    }   
View Full Code Here

            if (selectedRowNumber != -1) {
                ItemTableModel model = (ItemTableModel)container.getTable().getModel();
                selectedRowNumber = container.getTable().convertRowIndexToModel(selectedRowNumber);
                Vector dataVector = model.getDataVector();
                Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
                Cell newTAmtCell = ObjectUtil.findNewCell(selectedRow, "RI", "TAMT");
                Cell newLAmtCell = ObjectUtil.findNewCell(selectedRow, "RI", "LAMT");
                Cell newXrCell = ObjectUtil.findNewCell(selectedRow, "RI", "XR");
                double tAmt = 0.0;
                double lAmt = 0.0;
                double xr = 1.0;
                if (newTAmtCell.getColumnValue() != null)
                    tAmt = ((Number)newTAmtCell.getColumnValue()).doubleValue();
                if (newLAmtCell.getColumnValue() != null)
                    lAmt = ((Number)newLAmtCell.getColumnValue()).doubleValue();
                if (newXrCell.getColumnValue() != null)
                    xr = ((Number)newXrCell.getColumnValue()).doubleValue();
                double sum = container.setCurrentLAMTTotal();               
                lAmt = lAmt - container.setCurrentLAMTTotal();
                tAmt = lAmt / xr;
                newTAmtCell.setColumnValue(tAmt);
                newLAmtCell.setColumnValue(lAmt);
                selectedRow.setModify(true);
                container.updateTable();
            }
       
    }
View Full Code Here

                ItemTableModel model = (ItemTableModel)container.getTable().getModel();               
                for (int i = 0; i < rows.length; i++) {                   
                    int selectedRowNumber = container.getTable().convertRowIndexToModel(rows[i]);
                    Vector dataVector = model.getDataVector();
                    Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                    Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
                    Cell newTAmtCell = ObjectUtil.findNewCell(selectedRow, "RI", "TAMT");
                    Cell newLAmtCell = ObjectUtil.findNewCell(selectedRow, "RI", "LAMT");
                    if (newTAmtCell.getColumnValue() != null) {
                        Number tAmt = (Number)newTAmtCell.getColumnValue();
                        tAmt = 0 - tAmt.doubleValue();
                        newTAmtCell.setColumnValue(tAmt);
                    }
                    if (newLAmtCell.getColumnValue() != null) {
                        Number lAmt = (Number)newLAmtCell.getColumnValue();
                        lAmt = 0 - lAmt.doubleValue();
                        newLAmtCell.setColumnValue(lAmt);
                    }
                    selectedRow.setModify(true);
                }
                container.updateTable();
            }
       
    }
View Full Code Here

               
                //now, only set first selected reg to budget
                int selectedRowNumber = container.getTable().convertRowIndexToModel(rows[0]);
                Vector dataVector = model.getDataVector();
                Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
               
                new AssignBudgetDialog(container, container.getObject(), selectedRow, container.getCurrentRow());
                container.setEnabled(false);
               
            }
View Full Code Here

               
                //now, only set first selected reg to budget
                int selectedRowNumber = container.getTable().convertRowIndexToModel(rows[0]);
                Vector dataVector = model.getDataVector();
                Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
               
                new TaxRegsDialog(container, container.getObject(), selectedRow);
                container.setEnabled(false);
            }                       
    }
View Full Code Here

            }                       
    }
   
    private void saveObjectToDB() {
       
            Row mainRow = container.getCurrentRow();
            BaseClass object = container.getObject();
            String action = container.getAction();
           
            //make childRow primaryKey equals to mainRow primaryKey
            Iterator childRowIter = mainRow.getRowSet().getRows().iterator();
            while (childRowIter.hasNext()) {
                Row childRow = (Row)childRowIter.next();
                if (childRow != mainRow) {
                    Iterator childRowCellIter = childRow.getNewCells().iterator();                   
                    while (childRowCellIter.hasNext()) {
                        Cell childRowCell = (Cell)childRowCellIter.next();                     
                        Column tColumn = ObjectUtil.findColumn(container.getObject(), childRowCell.getTableName(), childRowCell.getColumnName());
                        if ( (tColumn.isPrimaryKey()) && (tColumn.getTableName().equals(container.getObject().getChildTableName())) ) {
                            Cell mainRowCell = ObjectUtil.findNewCell(mainRow, container.getObject().getMainTableName(), childRowCell.getColumnName());
View Full Code Here

    }
   
    private void cancel() {
            //remove not persistent rows
            Vector needRemovedRows = new Vector();
            Row mainRow = container.getCurrentRow();
            Iterator rowIter = mainRow.getRowSet().getRows().iterator();
            while (rowIter.hasNext()) {
                Row row = (Row)rowIter.next();
                if (row.isAdd()) {
                    needRemovedRows.add(row);
                } else if (row.isModify()) {
                    row.setNewCells(row.getOldCells());
                } else if (row.isDelete()) {
                    row.setDelete(false);
                }                                                                    
            }
            rowIter = needRemovedRows.iterator();
            while (rowIter.hasNext()) {
                Row row = (Row)rowIter.next();
                mainRow.getRowSet().getRows().remove(row);
                container.getObject().getRows().remove(row);
            }
            container.setVisible(false);
            container.dispose();
View Full Code Here

//                                System.err.println("====address.size = " + container.address.size());
                                PartnerClass.updateAddresses(container.address, ns, p);
//                                System.err.println("====bank.size = " + container.banks.size());
                                Iterator bankRowsIter = container.banks.iterator();
                                while (bankRowsIter.hasNext()) {
                                    Row bankRow = (Row)bankRowsIter.next();
                                    PartnerClass.updateBank(bankRow, ns, p);
                                }                           
                                saveObjectToDB();
                                container.getContainer().updateObjectViewTable();
                                container.getContainer().updateObjectLayoutTable();
View Full Code Here

        ItemTableModel model = (ItemTableModel)container.getTable().getModel();
        Vector dataVector = model.getDataVector();
        Iterator rowDatasIter = dataVector.iterator();
        while (rowDatasIter.hasNext()) {
            Vector rowDatas = (Vector)rowDatasIter.next();
            Row childRow = (Row)rowDatas.get(rowDatas.size() - 1);
            Iterator pkColumnIter = container.getObject().getPkColumns().iterator();
            String mainTableName = container.getObject().getMainTableName();
            String childTableName = container.getObject().getChildTableName();
            while (pkColumnIter.hasNext()) {
                Column pkColumn = (Column)pkColumnIter.next();
                if (pkColumn.getTableName().equals(mainTableName)) {
                    Cell childPkOldCell = ObjectUtil.findOldCell(childRow, childTableName, pkColumn.getColumnName());
                    //found
                    if (childPkOldCell != null) {
                        Cell childPkNewCell = ObjectUtil.findNewCell(childRow, childTableName, pkColumn.getColumnName());
                        Cell mainPkNewCell = ObjectUtil.findNewCell(container.getCurrentRow(), mainTableName, pkColumn.getColumnName());
                        childPkOldCell.setColumnValue(mainPkNewCell.getColumnValue());
                        childPkNewCell.setColumnValue(mainPkNewCell.getColumnValue());
                    }
                }
            }
            childRow.setModify(true);
            childRow.print();
        }
        //set childs' components
        rowDatasIter = dataVector.iterator();
        while (rowDatasIter.hasNext()) {
            Vector rowDatas = (Vector)rowDatasIter.next();
            Row childRow = (Row)rowDatas.get(rowDatas.size() - 1);
            Vector itemComponentExts = container.getItemComponentExts();
            Iterator itemComponentExtIter = itemComponentExts.iterator();
            while (itemComponentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                Column column = componentExt.getColumn();
                JComponent component = ComponentManager.getComponent(componentExt.getColumn());
                componentExt.setComponent(component);
            }
            container.setItemComponentExts(itemComponentExts);
            container.createRelation();
            itemComponentExtIter = itemComponentExts.iterator();
            while (itemComponentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                Column column = componentExt.getColumn();
                container.getRelationManager().init81Or82Or83ComponentAction(componentExt);
                ComponentManager.setValue(getValue(componentExt.getColumn(), childRow), componentExt.getComponent());
            }
            itemComponentExtIter = itemComponentExts.iterator();
            while (itemComponentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                if (componentExt.getComponent() instanceof DetailList) {
//                    System.err.println("dldldl");
                    DetailList dl = (DetailList)componentExt.getComponent();
                    dl.getNotVisibleTableButton().doClick();
                }
            }           
            Iterator componentExtIter = itemComponentExts.iterator();
            while (componentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)componentExtIter.next();
                JComponent component = componentExt.getComponent();
                Column column = componentExt.getColumn();
                if (column.isMandatory()) {
                    if ( (ComponentManager.getValue(component) == null) || (ComponentManager.getValue(component).toString().trim().equals("")) ) {
                        result = false;
                    }
                }               
            }
            if (result) {
                setItemCellValue(childRow);
                if (childRow.isAdd()) { 
                    result = container.getObject().classInsert_Child(childRow, true);
                } else if (childRow.isModify()) {
                    result = container.getObject().classUpdate_Child(childRow, true);
                }
            }
            if (result) {
                result = validate81Components_child(itemComponentExts, childRow);
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.