Package realcix20.utils

Examples of realcix20.utils.Resources


        }

        public void setCurrentUser(Row currentUser) {
           
                //will be modified
                DAO dao = DAO.getInstance();
                dao.update(Resources.UPDATE_GLOBALVAR_TABLE_SQL);
                Cell userCell = ObjectUtil.findNewCell(currentUser, "LOGINENTRY", "RUSER");               
                dao.setObject(1, userCell.getColumnValue());
                dao.setObject(2, "loginuser");
                dao.executeUpdate();

                this.currentUser = currentUser;
        }
View Full Code Here


       
    private LayoutManager() {
    }
   
    public static void deleteLayout(int clsId, int layoutId) {       
        DAO dao = DAO.getInstance();
        dao.setAutoCommit(true);
        dao.update(Resources.DELETE_LAYOUT_BY_CLSID_AND_LAYOUT_1);
        dao.setInt(1, clsId);
        dao.setInt(2, layoutId);
        dao.executeUpdate();
        dao.update(Resources.DELETE_LAYOUT_BY_CLSID_AND_LAYOUT_2);
        dao.setInt(1, clsId);
        dao.setInt(2, layoutId);
        dao.executeUpdate();
        dao.update(Resources.DELETE_LAYOUT_NAME);
        String txtId = "CL." + clsId + "." + layoutId;
        dao.setString(1, txtId);
        dao.executeUpdate();
    }
View Full Code Here

        dao.setString(1, txtId);
        dao.executeUpdate();
    }
   
    public static void updateReportIsFavorite(int clsId, int layoutId, boolean stat) {       
        DAO dao = DAO.getInstance();
        dao.update(Resources.UPDATE_CL_ISFAVORITE_SQL);
        dao.setBoolean(1, stat);
        dao.setInt(2, clsId);
        dao.setInt(3, layoutId);
        dao.executeUpdate();       
    }
View Full Code Here

                case 1:
                case 2:
                   
                    if ( (column.getPControls() == null) || (column.getPControls().equals("")) ) {
                       
                        DAO dao = DAO.getInstance();
                        dao.query(column.getInputPar());
                        ResultSet rs = dao.executeQuery();
                        try {

                            ResultSetMetaData rsmd = rs.getMetaData();
                            if (rsmd.getColumnCount() == 1) {
                                while (rs.next()) {
View Full Code Here

    protected void contactRelationship1_1(final Vector components, final JComponent childComponent, final String sql) {                          
       
        //set initial value
        ((JComboBox)childComponent).removeAllItems();

        DAO dao = DAO.getInstance();
        dao.query(sql);
        for (int i = 1; i <= components.size(); i++) {
            JComponent tempComponent = (JComponent)components.get(i - 1);
            dao.setObject(i, ComponentManager.getValue(tempComponent));
        }
        ResultSet rs = dao.executeQuery();
        try {

            ResultSetMetaData rsmd = rs.getMetaData();
            if (rsmd.getColumnCount() == 1) {
                while (rs.next()) {
                    Item item = new Item(rs.getObject(1), rs.getObject(1));
                    ((JComboBox)childComponent).addItem(item);
                }
            } else {
                while (rs.next()) {

                    StringBuffer sb = new StringBuffer();
                    for (int i = 2; i < rsmd.getColumnCount(); i++)
                        sb.append(rs.getObject(i) + " | ");
                    sb.append(rs.getObject(rsmd.getColumnCount()));

                    Item item = new Item(rs.getObject(1), sb.toString());
                    ((JComboBox)childComponent).addItem(item);
                }
            }
            rs.close();

        }
        catch (SQLException sqle) {

        }
       
        Iterator componentIter = components.iterator();
        while (componentIter.hasNext()) {
            JComponent component = (JComponent)componentIter.next();
            ((JComboBox)component).addActionListener(
                new ActionAdapter() {
           
                    public void actionPerformed(ActionEvent e) {
                       
                        ((JComboBox)childComponent).removeAllItems();
                       
                        DAO dao = DAO.getInstance();
                        dao.query(sql);
                        for (int i = 1; i <= components.size(); i++) {
                            JComponent tempComponent = (JComponent)components.get(i - 1);
                            dao.setObject(i, ComponentManager.getValue(tempComponent));
                        }
                        ResultSet rs = dao.executeQuery();
                        try {

                            ResultSetMetaData rsmd = rs.getMetaData();
                            if (rsmd.getColumnCount() == 1) {
                                while (rs.next()) {
View Full Code Here

       
    }
   
    protected void initialComponent7Value(JComponent component ,String columnName, String sql, Vector parameters) {
       
        DAO dao = DAO.getInstance();
        dao.query(sql);
        if (parameters != null) {
            for (int i = 1; i <= parameters.size(); i++) {
                dao.setObject(i, parameters.get(i - 1));
            }
        }
       
        ResultSet rs = dao.executeQuery();
        try {
            ResultSetMetaData rsmd = rs.getMetaData();
           
            while (rs.next()) {
                Object displayValue = rs.getObject(columnName);
View Full Code Here

        //update CL Table
        String sql = getSQL();
        int clsId = container.getObject().getClsId();
        int layout = container.getLayout_C();
        String csql= container.getCSQL();
        DAO dao = DAO.getInstance();
        dao.setAutoCommit(false);
       
        boolean flag = false;
       
        if (container.getCommand().equals("ADD")||container.getCommand().equals("COPY")) {
           
            dao.update(Resources.INSERT_CL_SQL);
            dao.setInt(1, clsId);
            dao.setInt(2, layout);
            dao.setString(3, sql);
            dao.setBoolean(4, false);
            dao.setString(5,csql);
            flag = dao.executeUpdate();
        } else if (container.getCommand().equals("EDIT")) {
            dao.update(Resources.UPDATE_CL_SQL);
            dao.setString(1, sql);
            dao.setString(2,csql);
            dao.setInt(3, clsId);
            dao.setInt(4, layout);
            flag = dao.executeUpdate();
        }

        //update CLFIELDS Table
       
        if (flag) {
           
            //delete old rows
            dao.update(Resources.DELETE_CLFIELDS_SQL);
            dao.setInt(1, clsId);
            dao.setInt(2, layout);
            dao.executeUpdate();
           
            //addDisplayColumns
            for (int i = 0; i < cdModel.getRowCount(); i++) {
               
                Column column = (Column)cdModel.getValueAt(i, 0);
               
                dao.update(Resources.INSERT_CLFIELDS_SQL);
                dao.setInt(1, clsId);
                dao.setInt(2, layout);
                dao.setString(3, column.getTableName());
                dao.setString(4, column.getColumnName());
                dao.setInt(5, i + 1);
                dao.setObject(6, cdModel.getValueAt(i, 2));
                dao.setObject(7, cdModel.getValueAt(i, 1));
               
                int tempRow = findRow(column, container.getColumnAllTable());
                String andorString = (String)caModel.getValueAt(tempRow, 0);
                if (andorString.equals("AND"))
                    dao.setObject(8, true);
                else
                    dao.setObject(8,false);
                dao.setObject(9, caModel.getValueAt(tempRow, 2));
               
                tempRow = findRow(column, container.getColumnOrderTable());
                if (tempRow == -1)
                    dao.setObject(10, null);
                else
                    dao.setInt(10, tempRow + 1);
               
                if (tempRow == -1)
                    dao.setObject(11, null);
                else
                    dao.setObject(11, coModel.getValueAt(tempRow, 1));
               
                flag = dao.executeUpdate();
               
                if (!flag) {
                    dao.rollback();
                    dao.setAutoCommit(true);
                    return false;
                }
               
            }
            //addFilterColumns
            for (int i = 0; i < caModel.getRowCount(); i++) {
                Column column = (Column)caModel.getValueAt(i, 1);
                String filterString = (String)caModel.getValueAt(i, 2);
                if ( (filterString != null) && (filterString.trim().length() > 0) ) {                
                    dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_AND_TABLENAME_AND_COLUMNNAME);
                    dao.setObject(1, clsId);
                    dao.setObject(2, layout);
                    dao.setObject(3, column.getTableName());
                    dao.setObject(4, column.getColumnName());
                    ResultSet rs = dao.executeQuery();
                    boolean displayed = false;
                    try {
                        if (rs.next()) {
                            displayed = true;
                        }
                        rs.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if (!displayed) {
                        dao.update(Resources.INSERT_CLFIELDS_SQL);
                        dao.setInt(1, clsId);
                        dao.setInt(2, layout);
                        dao.setString(3, column.getTableName());
                        dao.setString(4, column.getColumnName());
                        dao.setInt(5, 0);
                        dao.setObject(6, null);
                        dao.setObject(7, null);
                        int tempRow = findRow(column, container.getColumnAllTable());
                        String andorString = (String)caModel.getValueAt(tempRow, 0);
                        if (andorString.equals("AND"))
                            dao.setObject(8, true);
                        else
                            dao.setObject(8,false);
                        dao.setObject(9, caModel.getValueAt(tempRow, 2));
                        dao.setObject(10, null);
                        dao.setObject(11, null);
                        flag = dao.executeUpdate();               
                        if (!flag) {
                            dao.rollback();
                            dao.setAutoCommit(true);
                            return false;
                        }
                    }                   
                }               
            }
           
            if (flag) {               
                dao.commit();
                if (container.getCommand().equals("ADD")||container.getCommand().equals("COPY")){
                    setDefaultName();
                }
                dao.setAutoCommit(true);
                return true;
            }
            else{
                dao.rollback();
                dao.setAutoCommit(true);
                return false;
            }           
        } else {
            dao.rollback();
            dao.setAutoCommit(true);
            return false;
        }       
    }      
View Full Code Here

        public static boolean isCorrespondencePartnerBlocked(Row correspondenceRow) {
            boolean result = false;
            String ns = (String)ObjectUtil.findNewCell(correspondenceRow, "T", "NS").getColumnValue();
            String p = (String)ObjectUtil.findNewCell(correspondenceRow, "T", "P").getColumnValue();
            String pa = (String)ObjectUtil.findNewCell(correspondenceRow, "T", "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

        }       
    }      
   
    private void setDefaultName() {
       
        DAO dao = DAO.getInstance();
        String txtId = "CL." + container.getObject().getClsId() + "." + container.getLayout_C();
        String lang = Resources.getLanguage();
        String long_c = TxtManager.getTxt("CLS." + container.getObject().getClsId()) + " " +
                TxtManager.getTxt("CL") + " " + container.getLayout_C();
       
        dao.update(Resources.INSERT_TXT_SQL);
        dao.setString(1, txtId);
        dao.setString(2, lang);
        dao.setString(3, long_c);
        dao.executeUpdate();
       
    }
View Full Code Here

                    (ObjectUtil.findNewCell(regItemRow, "RI", "RI").getColumnValue() == null) ) {
                return false;
            }
            int r = Integer.parseInt(ObjectUtil.findNewCell(regItemRow, "RI", "R").getColumnValue().toString());
            int ri = Integer.parseInt(ObjectUtil.findNewCell(regItemRow, "RI", "RI").getColumnValue().toString());
            DAO dao = DAO.getInstance();
            dao.query(Resources.SELECT_FROM_TI_BY_R_RI_SQL);
            dao.setInt(1, r);
            dao.setInt(2, ri);
            ResultSet rs = dao.executeQuery();
            try {
                if (rs.next()) {
                    result = true;                   
                }
                rs.close();
View Full Code Here

TOP

Related Classes of realcix20.utils.Resources

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.