Package realcix20.utils

Examples of realcix20.utils.DAO


    public static void createTaxDepPartner(Row taxDepRow) {
        String ns = "TAX";
        String co = ObjectUtil.findNewCell(taxDepRow, "TAXDEP", "CO").getColumnValue().toString();
        String taxDep = ObjectUtil.findNewCell(taxDepRow, "TAXDEP", "TAXDEP").getColumnValue().toString();
        String p = co + "." + taxDep;
        DAO dao = DAO.getInstance();
        dao.update(Resources.INSERT_P_SQL);
        dao.setString(1, ns);
        dao.setString(2, p);
        dao.setObject(3, null);
        dao.setObject(4, null);
        dao.setObject(5, null);
        dao.setObject(6, null);
        dao.setString(7, co);
        dao.executeUpdate();
        String defpa = "1";
        String ownername = p;                               
        String apLD = UserClass.getDEFLD("AP");
        String txt256 = TxtManager.getTxt("VIEW.OBJECTEDIT.RUSER.DEFAULTACCOUNT");               
        PrivateKey prikey = null;
        PublicKey pubkey = null;
        try {
            KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
            keyGen.initialize(1024);
            KeyPair key = keyGen.generateKeyPair();
            prikey = key.getPrivate();
            pubkey = key.getPublic();
        } catch (Exception e) {
            e.printStackTrace();
        }               
        boolean block = false;
        dao.update(Resources.INSERT_PA_SQL);
        dao.setObject(1, ns);
        dao.setObject(2, p);
        dao.setObject(3, defpa);
        dao.setObject(4, ownername);
        dao.setObject(5, null);
        dao.setObject(6, apLD);
        dao.setObject(7, txt256);
        dao.setObject(8, prikey);
        dao.setObject(9, pubkey);
        dao.setObject(10, block);               
        dao.executeUpdate();
    }
View Full Code Here


        String taxDep = ObjectUtil.findNewCell(taxDepRow, "TAXDEP", "TAXDEP").getColumnValue().toString();       
        String p = co + "." + taxDep;       
        PartnerClass partner = (PartnerClass)ClassManager.createClass(250);
        StringBuffer sb = new StringBuffer("DELETE FROM " + partner.getMainTableName() + " WHERE NS='TAX' AND P=?");
        String sql = sb.toString();
        DAO dao = DAO.getInstance();
        dao.setAutoCommit(false);
        dao.update(sql);
        dao.setObject(1, p);
        dao.executeUpdate();

        sb = new StringBuffer("DELETE FROM " + partner.getChildTableName() + " WHERE NS='TAX' AND P=?");
        sql = sb.toString();
        dao.update(sql);
        dao.setObject(1, p);
        dao.executeUpdate();
        dao.commit();
        dao.setAutoCommit(true);
    }
View Full Code Here

        String ld = ObjectUtil.findNewCell(ldRow, "LD", "LD").getColumnValue().toString();
        FixedAssetClass fixedAsset = (FixedAssetClass)ClassManager.createClass(220);
        StringBuffer sb = new StringBuffer(fixedAsset.getBasicSQL());
        sb.append(" WHERE FA.LD=?");
        String sql = sb.toString();
        DAO dao = DAO.getInstance();
        dao.query(sql);
        dao.setObject(1, ld);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                result = true;
            }
            rs.close();
View Full Code Here

           
        }
       
        private void setCurrentLt() {
           
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_LT_FROM_LD);
                String ld = ObjectUtil.findNewCell(selectedRow, "RI", "LD").getColumnValue().toString();
                dao.setString(1, ld);
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next()) {
                        currentLt = rs.getString("LT");
                    }
                    rs.close();
View Full Code Here

                if (cell.getColumnValue() instanceof Number)
                    r_lamt = ((Number)cell.getColumnValue()).doubleValue();
                else
                    r_lamt = Double.parseDouble((String)cell.getColumnValue());
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_ALL_B_SQL);
                ResultSet rs = dao.executeQuery();
                try {
                    while (rs.next()) {
                        Vector rowData = new Vector();
                        String b = rs.getString("B");
                        String ruser = rs.getString("RUSER");
View Full Code Here

                if (cell.getColumnValue() instanceof Number)
                    ri = ((Number)cell.getColumnValue()).intValue();
                else
                    ri = Integer.parseInt((String)cell.getColumnValue());
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_BI_BY_ALLPK_SQL);
                dao.setObject(1, r);
                dao.setObject(2, ri);
                dao.setObject(3, budget.b);
                dao.setObject(4, budget.ruser);
                dao.setObject(5, budget.rmonth);
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next())
                        result = true;
                    else
                        result = false;
View Full Code Here

                if (cell.getColumnValue() instanceof Number)
                    ri = ((Number)cell.getColumnValue()).intValue();
                else
                    ri = Integer.parseInt((String)cell.getColumnValue());
               
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_BI_BY_ALLPK_SQL);
                dao.setObject(1, r);
                dao.setObject(2, ri);
                dao.setObject(3, rowData.get(0));
                dao.setObject(4, rowData.get(1));
                dao.setObject(5, rowData.get(2));
                ResultSet rs = dao.executeQuery();
                try {
                    if (rs.next())
                        rowData.set(4, rs.getDouble("LAMT"));
                    rs.close();
                } catch (Exception e) {
View Full Code Here

       
        public static Column getColumn(String tableName, String columnName) {
           
                Column column = null;
               
                DAO dao = DAO.getInstance();
                dao.query(SELECT_COLUMN_SQL);
                dao.setString(1, tableName);
                dao.setString(2, columnName);
                ResultSet rs = dao.executeQuery();
                try {                   
                    if (rs.next()) {
                        int clsId = rs.getInt("CLSID");
                        column = new Column(clsId, tableName, columnName);
                    }
View Full Code Here

       
            Vector values = new Vector();
           
            Cell cell = ObjectUtil.findNewCell(taxRow, "TAX", "TAXT");
//            System.err.println(cell.getColumnValue());
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_CO_TAXDEP_FROM_TAXT_SQL);
            dao.setObject(1, cell.getColumnValue());
            ResultSet rs = dao.executeQuery();
            String co = "";
            String taxdep = "";
            try {
                if (rs.next()) {
                    co = rs.getString("CO");
                    taxdep = rs.getString("TAXDEP");
                }
                rs.close();
            } catch (Exception e) {
                e.printStackTrace();
            }

            String p = co + "." + taxdep;
           
            dao.query(Resources.SELECT_NS_FROM_P_SQL);
            dao.setObject(1, p);
            rs = dao.executeQuery();
            String ns = "";
            String defpa = "";
            try {
                if (rs.next()) {
                    ns = rs.getString("NS");
View Full Code Here

    public static boolean isTaxPartnerBlocked(Row taxRow) {
        boolean result = true;
        String ns = (String)ObjectUtil.findNewCell(taxRow, "TAX", "NS").getColumnValue();
        String p = (String)ObjectUtil.findNewCell(taxRow, "TAX", "P").getColumnValue();
        String pa = (String)ObjectUtil.findNewCell(taxRow, "TAX", "PA").getColumnValue();
        DAO dao = DAO.getInstance();
        dao.query(Resources.GET_PA_SQL);
        dao.setString(1, ns);
        dao.setString(2, p);
        dao.setString(3, pa);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                result = rs.getBoolean("BLOCK");
            }
            rs.close();
View Full Code Here

TOP

Related Classes of realcix20.utils.DAO

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.