Package realcix20.classes.basic

Examples of realcix20.classes.basic.Row


       
        private void rollback() {
           
                Iterator rowIter = selectedRows.iterator();
                while (rowIter.hasNext()) {
                    Row row = (Row)rowIter.next();
                    Cell newCell = ObjectUtil.findNewCell(row, "B", "RMONTH");
                    Cell oldCell = ObjectUtil.findOldCell(row, "B", "RMONTH");
                    newCell.setColumnValue(oldCell.getColumnValue());
                }
           
View Full Code Here


                    BankTableModel model = (BankTableModel)bankTable.getModel();
                    for (int i = 0; i < rows.length; i++) {
                        int selectedRowNumber = bankTable.convertRowIndexToModel(rows[i]);
                        Vector dataVector = model.getDataVector();
                        Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                        Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
                        banks.add(selectedRow);
                    }
                }
                rows = addressTable.getSelectedRows();
                if (rows.length > 0) {
                    AddressTableModel model = (AddressTableModel)addressTable.getModel();
                    for (int i = 0; i < rows.length; i++) {
                        int selectedRowNumber = addressTable.convertRowIndexToModel(rows[i]);
                        Vector dataVector = model.getDataVector();
                        Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                        Row selectedRow = (Row)rowDatas.get(rowDatas.size() - 1);
                        addresses.add(selectedRow);
                    }
                }
                container.setBanks(banks);
                container.address = addresses;
View Full Code Here

                                names.add(column);
                        }
                        names.add("row");
                        Iterator rowIter = object.getRows().iterator();
                        while (rowIter.hasNext()) {
                            Row row = (Row)rowIter.next();
                            String ns = ObjectUtil.findOldCell(row, "PB", "NS").getColumnValue().toString();
                            if (ns.equals("ME")) {
                                Vector rowDatas = new Vector();
                                columnIter = object.getColumns().iterator();
                                while (columnIter.hasNext()) {
View Full Code Here

                                names.add(column);
                        }
                        names.add("row");
                        Iterator rowIter = object.getRows().iterator();
                        while (rowIter.hasNext()) {
                            Row row = (Row)rowIter.next();
                            String ns = ObjectUtil.findOldCell(row, "ADDR", "NS").getColumnValue().toString();
                            if (ns.equals("ME")) {
                                Vector rowDatas = new Vector();
                                columnIter = object.getColumns().iterator();
                                while (columnIter.hasNext()) {
View Full Code Here

        TaxClass tax = (TaxClass)ClassManager.createClass(530);
        tax.loadChilds(taxRow);
       
        Iterator cItemRowsIter = taxRow.getRowSet().getRows().iterator();
        while (cItemRowsIter.hasNext()) {               
            Row cItemRow = (Row)cItemRowsIter.next();                                   
            boolean needDelete = true;
            if ( (ObjectUtil.findNewCell(cItemRow, "TAXI", "R").getColumnValue() == null) ||
                    (ObjectUtil.findNewCell(cItemRow, "TAXI", "RI").getColumnValue() == null) ) {
                needDelete = false;
            }
View Full Code Here

            String ns = ObjectUtil.findNewCell(pRow, "P", "NS").getColumnValue().toString();
            String p = ObjectUtil.findNewCell(pRow, "P", "P").getColumnValue().toString();           
            TaxClass tax = (TaxClass)ClassManager.createClass(530);
            Iterator taxRowsIter = tax.getRows().iterator();
            while (taxRowsIter.hasNext()) {
                Row taxRow = (Row)taxRowsIter.next();
                String taxNS = ObjectUtil.findNewCell(taxRow, "TAX", "NS").getColumnValue().toString();
                String taxP = ObjectUtil.findNewCell(taxRow, "TAX", "P").getColumnValue().toString();
                if ( (ns.equals(taxNS)) && (p.equals(taxP)) ) {
                    result = true;
                    break;
View Full Code Here

       
            boolean cleared = false;
            Iterator taxsIter = taxs.iterator();
            while (taxsIter.hasNext()) {
                Vector taxData = (Vector)taxsIter.next();
                Row taxRow = (Row)taxData.get(0);
                if (!cleared) {
                    int tax = -1;
                    String taxt = ObjectUtil.findNewCell(taxRow, "TAX", "TAXT").getColumnValue().toString();
                    if ( (ObjectUtil.findNewCell(taxRow, "TAX", "TAX").getColumnValue() != null) && (ObjectUtil.findNewCell(taxRow, "TAX", "TAX").getColumnValue().toString().trim().length() > 0) ) {
                        tax = Integer.parseInt(ObjectUtil.findNewCell(taxRow, "TAX", "TAX").getColumnValue().toString());                  
                    }
                    clearRITAXI(taxt, tax);
                    cleared = true;
                }
                Vector positiveRowData = (Vector)taxData.get(3);
                Vector nagativeRowData = (Vector)taxData.get(4);
               
                Iterator positiveRowDataIter = positiveRowData.iterator();
                while (positiveRowDataIter.hasNext()) {
                    Vector rowData = (Vector)positiveRowDataIter.next();
                    Row regRow = (Row)rowData.get(rowData.size() - 1);
                    updateRITAXI(taxRow, regRow, 1);
                }
               
                Iterator nagativeRowDataIter = nagativeRowData.iterator();
                while (nagativeRowDataIter.hasNext()) {
                    Vector rowData = (Vector)nagativeRowDataIter.next();
                    Row regRow = (Row)rowData.get(rowData.size() - 1);
                    updateRITAXI(taxRow, regRow, -1);
                }
               
            }
       
View Full Code Here

            boolean result = true;
       
            Iterator rowsIter = rows.iterator();
            Vector rAndRis = new Vector();
            while (rowsIter.hasNext()) {
                Row row = (Row)rowsIter.next();               
                Cell cell1 = ObjectUtil.findNewCell(row, "TAXI", "R");
                Cell cell2 = ObjectUtil.findNewCell(row, "TAXI", "RI");               
                if ( (cell1.getColumnValue() != null) && (cell2.getColumnValue() != null) ) {    
                    boolean flag = true;//used by some bug
                    int r = 0;
                    if (cell1.getColumnValue() instanceof Number)
                        r = ((Number)cell1.getColumnValue()).intValue();
                    else if (cell1.getColumnValue() instanceof String) {
                        if (((String)cell1.getColumnValue()).trim().equals("")) {
                            flag = false;
                        } else {
                            r = Integer.parseInt((String)cell1.getColumnValue());
                        }
                    }

                    int ri = 0;                   
                    if (cell2.getColumnValue() instanceof Number)
                        ri = ((Number)cell2.getColumnValue()).intValue();
                    else if (cell2.getColumnValue() instanceof String) {
                        if (((String)cell2.getColumnValue()).trim().equals("")) {
                            flag = false;
                        } else {
                            ri = Integer.parseInt((String)cell2.getColumnValue());
                        }
                    }
                   
                    if (flag) {
                        Vector data = new Vector();
                        data.add(r);
                        data.add(ri);
                        Iterator rAndRisIter = rAndRis.iterator();
                        while (rAndRisIter.hasNext()) {
                            Vector oldData = (Vector)rAndRisIter.next();
                            Integer oldR = (Integer)oldData.get(0);
                            Integer oldRi = (Integer)oldData.get(1);
                            if ( (r == oldR.intValue()) && (ri == oldRi.intValue()) ) {
                                result = false;
                                break;
                            }
                        }
                        if (result)
                            rAndRis.add(data);
                        }
                   
                }
               
            }                       
           
            if (result) {
               
                int newR = 0;
                int newRi = 1;

                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();
                }
                               
                boolean hasNewRow = false;
                boolean firstNewRow = true;
                rowsIter = rows.iterator();
                while (rowsIter.hasNext()) {
                    Row row = (Row)rowsIter.next();
                    Cell cell1 = ObjectUtil.findNewCell(row, "TAXI", "R");
                    Cell cell2 = ObjectUtil.findNewCell(row, "TAXI", "RI");
                    boolean isAdd = false;
                    if ( (cell1.getColumnValue() != null) && (cell2.getColumnValue() != null) ) {
                        try {
                            if ( (cell1.getColumnValue() instanceof Number) && (cell2.getColumnValue() instanceof Number) ) {
                                isAdd = false;
                            } else if ( (cell1.getColumnValue() instanceof String) && (cell2.getColumnValue() instanceof String) ) {
                                Integer.parseInt((String)cell1.getColumnValue());
                                Integer.parseInt((String)cell2.getColumnValue());
                                isAdd = false;
                            }                           
                        } catch (Exception e) {
                            isAdd = true;
                            e.printStackTrace();
                        }                       
                    } else {
                        isAdd = true;                                                                       
                    }
                   
//                    System.err.println("isAdd = " + isAdd);
                    //LD
                    String ld = "";
                    String user = GlobalValueManager.getValue("SESSION.LOGINUSER");
                    Cell taxtCell = ObjectUtil.findNewCell(row, "TAXI", "TAXT");
                    dao.query(Resources.SELECT_LD_BY_TAXTYPE_SQL);
                    dao.setObject(1, taxtCell.getColumnValue());
                    dao.setObject(2, user);
                    rs = dao.executeQuery();
                    try {
                        if (rs.next()) {
                            ld = rs.getString(1);                              
                        }
                        rs.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

                    //TC
                    String tc = "";
                    Cell tcCell = ObjectUtil.findNewCell(row, "TAXI", "TC");
                    tc = (String)tcCell.getColumnValue();

                    //TAMT
                    double tamt = 0.0;
                    Cell tamtCell = ObjectUtil.findNewCell(row, "TAXI", "TAMT");
                    tamt = getDouble(tamtCell.getColumnValue());

                    //R
                    int r = 0;
                    if (isAdd) {
                        r = newR;
                    } else {
                        if (cell1.getColumnValue() instanceof Number)
                            r = ((Number)cell1.getColumnValue()).intValue();
                        else
                            r = Integer.parseInt((String)cell1.getColumnValue());
                    }

                    //RI
                    int ri = 0;
                    if (isAdd) {
                        ri =newRi;
                        newRi++;
                    } else {
                        if (cell2.getColumnValue() instanceof Number)
                            ri = ((Number)cell2.getColumnValue()).intValue();
                        else
                            ri = Integer.parseInt((String)cell2.getColumnValue());
                    }          
                   
//                    System.err.println("R = " + r);
//                    System.err.println("RI = " + ri);

                    //LC
                    String lc = "";
                    dao.query(Resources.SELECT_LC_FROM_FAMILY_SQL);
                    rs = dao.executeQuery();
                    try {
                        if (rs.next()) {
                            lc = rs.getString("LC");
                        }
                        rs.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

                    //TDATE
                    Cell tdateCell = ObjectUtil.findNewCell(row, "TAX", "TDATE");
                    //some bugs
                    String tdate;
                    tdate = tdateCell.getColumnValue().toString();                                      

                    //XR
                    double xr = 1.0;
                    dao.query(Resources.SELECT_XR_SQL);
                    dao.setObject(1, lc);
                    dao.setObject(2, tc);
                    dao.setObject(3, lc);
                    dao.setObject(4, tc);
                    dao.setObject(5, tdate);
                    rs = dao.executeQuery();
                    try {
                        if (rs.next())
                            xr = rs.getDouble(1);
                        rs.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                   
                    //LAMT
                    double lamt = tamt * xr;

//                    System.err.println("r=" + r + " ri=" + ri + " ld=" + ld + " tc=" + tc + " tamt=" + tamt + " lc=" + lc + " lamt=" + lamt + " tdate=" + tdate + " xr=" + xr);
                   
                    //set new taxes
                    if (isAdd) {
                       
                        if (!row.isDelete()) {
                           
                            hasNewRow = true;
                            //insert r table
                            if (firstNewRow) {
                                firstNewRow = false;
View Full Code Here

            boolean result = true;
       
            Vector rAndRis = new Vector();
            Iterator rowsIter = taxRow.getRowSet().getRows().iterator();
            while (rowsIter.hasNext()) {
                Row row = (Row)rowsIter.next();
                int newR = -1;
                int newRI = -1;
                if ( (ObjectUtil.findNewCell(row, "TAXI", "R").getColumnValue() != null) && (ObjectUtil.findNewCell(row, "TAXI", "R").getColumnValue().toString().trim().length() > 0) ) {
                    newR = Integer.parseInt(ObjectUtil.findNewCell(row, "TAXI", "R").getColumnValue().toString());                  
                }
View Full Code Here

       
            boolean result = false;
           
            Iterator rowsIter = taxRow.getRowSet().getRows().iterator();
            while (rowsIter.hasNext()) {
                Row row = (Row)rowsIter.next();
                int newR = -1;
                if ( (ObjectUtil.findNewCell(row, "TAXI", "R").getColumnValue() != null) && (ObjectUtil.findNewCell(row, "TAXI", "R").getColumnValue().toString().trim().length() > 0) ) {
                    newR = Integer.parseInt(ObjectUtil.findNewCell(row, "TAXI", "R").getColumnValue().toString());                  
                }
                if (newR != -1) {
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.