Package realcix20.utils

Examples of realcix20.utils.DAO


   
    public static double getSUMLamt(int r) {
       
            double sumLamt = -1;
       
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_SUM_LAMT_SQL);
            dao.setInt(1, r);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next()) {
                    sumLamt = rs.getDouble(1);
                }
                rs.close();
View Full Code Here


   
    public static int getMAXRIByR(int r) {
       
            int maxRI = -1;
           
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_MAXRI_BY_R_SQL);
            dao.setInt(1, r);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next()) {
                    maxRI = rs.getInt(1);
                }
                rs.close();
View Full Code Here

            JComponent component = componentExt.getComponent();
            if (action.equals("Add")) {
                Vector parameters = relationManager.getParameters_Defvalue(componentExt);
                if (parameters != null) {
                    String sql = relationManager.getSQL_Defvalue(componentExt, parameters);
                    DAO dao = DAO.getInstance();
                    dao.query(sql);
                    for (int i = 0; i < parameters.size(); i++) {
                        String parameter = (String)parameters.get(i);
                        StringTokenizer st = new StringTokenizer(parameter, ".");
                        String tableName = (String)st.nextElement();
                        String columnName = (String)st.nextElement();
                        ComponentExt tempComponentExt = relationManager.findComponentExt(tableName, columnName);
                        JComponent tempComponent = tempComponentExt.getComponent();                                   
                        dao.setObject(i+1, ComponentManager.getValue(tempComponent));
                    }
                    ResultSet rs = dao.executeQuery();
                    try {
                        if (rs.next()) {
                            ResultSetMetaData rsmd = rs.getMetaData();
                            for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                                ComponentExt tempComponentExt = relationManager.findComponentExt(column.getTableName(), rsmd.getColumnName(i));
View Full Code Here

    }

    private void exitApplication() {
        int n = DialogManager.showYesNoDialog(this, TxtManager.getTxt("alert.exit"));          
        if (n == 0) {
            DAO dao = DAO.getInstance();
            dao.commit();
            dao.deleteDAO();
            System.exit(0);               
        }
    }
View Full Code Here

   
    public static int getMAXR() {
       
            int maxR = -1;
           
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_MAX_R_FROM_R_SQL);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next())
                    maxR = rs.getInt(1);
                rs.close();
            } catch (Exception e) {
View Full Code Here

            GlobalValueManager.setApplicationLang(lang);
            String firstTime = String.valueOf(System.currentTimeMillis());
            GlobalValueManager.setValue("firsttimedate", firstTime);
            Resources.LANGUAGE = GlobalValueManager.getApplicationLang();
            //set LC to LC XR
            DAO dao = DAO.getInstance();
            dao.update(Resources.INSERT_XR_SQL);
            dao.setObject(1, ObjectUtil.findNewCell(currentRow, "FAMILY", "LC").getColumnValue());
            dao.setObject(2, ObjectUtil.findNewCell(currentRow, "FAMILY", "LC").getColumnValue());
            dao.setObject(3, 1);
            StringBuffer bb = new StringBuffer("1970-01-01 01:01:01");
            dao.setObject(4, bb.toString());
            dao.setObject(5, 1.0);
            dao.setObject(6, 1.0);
            dao.setObject(7, 1.0);
            dao.setObject(8, bb.toString());
            dao.setObject(9, ObjectUtil.findNewCell(currentRow, "FAMILY", "FAMILY").getColumnValue());
            dao.setObject(10, bb.toString());
            dao.setObject(11, ObjectUtil.findNewCell(currentRow, "FAMILY", "FAMILY").getColumnValue());
            dao.executeUpdate();                    
            DialogManager.showMessageDialog(this, sb.toString());
            DialogManager.showMessageDialog(this, TxtManager.getTxt("INFORMATION.PLEASELOGIN"));
            dispose();
            new LoginFrame();
        }
View Full Code Here

       
//            System.err.println("r = " + r + "  rDate = " + rDate + "  txt256  = " + txt256);
            String ruser = GlobalValueManager.getValue("SESSION.LOGINUSER");
            String at = GlobalValueManager.getValue("APPLICATION.AT");
       
            DAO dao = DAO.getInstance();
            dao.update(Resources.INSERT_R_SQL);
            dao.setObject(1, r);
            dao.setObject(2, at);
            dao.setObject(3, rDate);
            String now = TimeManager.getTime(System.currentTimeMillis());
            dao.setObject(4, now);
            dao.setObject(5, ruser);
            dao.setObject(6, now);
            dao.setObject(7, ruser);
            dao.setObject(8, txt256);
//            System.err.println("dao.getStatmt = " + dao.getPstmt());
            dao.executeUpdate();
       
    }
View Full Code Here

            dao.executeUpdate();
       
    }
   
    public static void insertri_balance(Row taxRow, int r, int ri, String ld, String txt256, String tc, double tamt, String rDate) {
            DAO dao = DAO.getInstance();
            String lc = FamilyClass.getLocalCurrency();
            double xr = TaxClass.getXR(lc, tc, rDate);
            double lamt = tamt * xr;
            dao.query(Resources.INSERT_RI_VALUE_SQL);
            dao.setObject(1, r);
            dao.setObject(2, ri);
            dao.setObject(3, txt256);
            dao.setObject(4, ld);
            dao.setObject(5, tc);
            dao.setObject(6, tamt);
            dao.setObject(7, lc);
            dao.setObject(8, xr);
            dao.setObject(9, lamt);
            dao.setObject(10, null);
            dao.setObject(11, null);
            dao.setObject(12, null);
            dao.executeUpdate();
    }
View Full Code Here

            dao.executeUpdate();
    }
   
    public static void insertri(Row taxRow, int r, int ri, String ld, String txt256, String tc, double tamt, String rDate) {
       
            DAO dao = DAO.getInstance();
            String lc = FamilyClass.getLocalCurrency();
            double xr = TaxClass.getXR(lc, tc, rDate);
            double lamt = tamt * xr;
            dao.query(Resources.INSERT_RI_VALUE_SQL);
            dao.setObject(1, r);
            dao.setObject(2, ri);
            dao.setObject(3, txt256);
            dao.setObject(4, ld);
            dao.setObject(5, tc);
            dao.setObject(6, tamt);
            dao.setObject(7, lc);
            dao.setObject(8, xr);
            dao.setObject(9, lamt);
            dao.setObject(10, ObjectUtil.findNewCell(taxRow, "TAX", "NS").getColumnValue().toString());
            dao.setObject(11, ObjectUtil.findNewCell(taxRow, "TAX", "P").getColumnValue().toString());
            dao.setObject(12, ObjectUtil.findNewCell(taxRow, "TAX", "PA").getColumnValue().toString());
            dao.executeUpdate();
       
    }
View Full Code Here

   
    public static double getXR(String lc, String tc, String rDate) {
       
            double xr = 1.0;
       
            DAO dao = DAO.getInstance();
            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, rDate);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next()) {
                    xr = rs.getDouble(1);
                }
                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.