Package realcix20.cixfiles

Examples of realcix20.cixfiles.KeyManager


            String ip = ObjectUtil.findNewCell(ipRow, "IP", "IP").getColumnValue().toString();
            CorrespondenceClass correspondence = (CorrespondenceClass)ClassManager.createClass(520);
            StringBuffer sb = new StringBuffer(correspondence.getBasicSQL());
            sb.append(" WHERE TI.IM=? AND TI.IP=?");
            String sql = sb.toString();
            DAO dao = DAO.getInstance();
            dao.query(sql);
//            System.out.println("im = " + im + "   ip = " + ip);
            dao.setObject(1, im);
            dao.setObject(2, ip);
            ResultSet rs = dao.executeQuery();
            try {
                if ( (rs.next()) && (im.equals(rs.getObject("IM"))) && (ip.equals(rs.getObject("IP"))) ) {
                    result = true;
                }
                rs.close();
View Full Code Here


   
    private boolean validate() {
            boolean result = true;
            String sql = getSQL();
//            System.err.println("sql = " + sql);
            DAO dao = DAO.getInstance();
            dao.update(sql);
            try {
                dao.executeUpdate();
            } catch (Exception e) {
                result = false;
            }
            return result;
    }
View Full Code Here

        //fix CSQL validate
    if ((sql!= null) && (!sql.trim().equals(""))) {
      // add CSQL
      sql=CSQLUtil.add(sql, csql);             
        }
        DAO dao = DAO.getInstance();
        dao.update(sql);
        try {
            dao.executeUpdate();
        } catch (Exception e) {
            result = false;
        }
        return result;   
    }
View Full Code Here

            String p = ObjectUtil.findNewCell(pRow, "P", "P").getColumnValue().toString();
            CorrespondenceClass correspondence = (CorrespondenceClass)ClassManager.createClass(520);
            StringBuffer sb = new StringBuffer(correspondence.getBasicSQL());
            sb.append(" WHERE T.NS=? AND T.P=?");
            String sql = sb.toString();
            DAO dao = DAO.getInstance();
            dao.query(sql);
            dao.setString(1, ns);
            dao.setString(2, p);
            ResultSet rs = dao.executeQuery();
            try {
                if ( (rs.next()) && (ns.equals(rs.getObject("NS"))) && (p.equals(rs.getObject("P"))) ) {
                    result = true;
                }
                rs.close();
View Full Code Here

           
                boolean result = true;               
                String ns = ObjectUtil.findNewCell(correspondenceRow, "T", "NS").getColumnValue().toString();
                String p = ObjectUtil.findNewCell(correspondenceRow, "T", "P").getColumnValue().toString();
                String pa = ObjectUtil.findNewCell(correspondenceRow, "T", "PA").getColumnValue().toString();
                DAO dao = DAO.getInstance();
                dao.query(Resources.SELECT_PA_SQL);
                dao.setString(1, ns);
                dao.setString(2, p);
                dao.setString(3, pa);
                ResultSet rs = dao.executeQuery();
                String urns = null;
                String urp = null;
                String urpa = null;
                PublicKey pubkey = null;
                try {
View Full Code Here

                String lastchanged = created;
                String lastchangedby = createdby;
                Cell txt256Cell = ObjectUtil.findNewCell(mainRow, "T", "TXT256");
                String txt256 = (String)txt256Cell.getColumnValue();
               
                DAO dao = DAO.getInstance();
                dao.update(Resources.INSERT_R_SQL);
                dao.setObject(1, r);
                dao.setObject(2, at);
                dao.setObject(3, rdate);
                dao.setObject(4, created);
                dao.setObject(5, createdby);
                dao.setObject(6, lastchanged);
                dao.setObject(7, lastchangedby);
                dao.setObject(8, txt256);
                dao.executeUpdate();
               
                int currentRi = 0;
                double amt = 0.0;
                Iterator rowsIter = mainRow.getRowSet().getRows().iterator();
                while (rowsIter.hasNext()) {
                    Row childRow = (Row)rowsIter.next();
                    if ( (childRow != null) && (childRow != mainRow) ) {                      
                        currentRi++;
                        txt256Cell = ObjectUtil.findNewCell(childRow, "TI", "TXT256");
                        txt256 = (String)txt256Cell.getColumnValue();
                       
                        Cell tcCell = ObjectUtil.findNewCell(childRow, "TI", "TC");
                        String tc = (String)tcCell.getColumnValue();
                        Cell tamtCell = ObjectUtil.findNewCell(childRow, "TI", "TAMT");
                        double tamt = 0.0;
                        if (tamtCell.getColumnValue() != null) {
                            tamt = ((Number)tamtCell.getColumnValue()).doubleValue();
                        }
                        String lc = FamilyClass.getLocalCurrency();
                        double xr = XRClass.getExchangeRate(lc, tc, rdate);
                        double lamt = tamt * xr;
                        amt+= lamt;
                        Cell nsCell = ObjectUtil.findNewCell(mainRow, "T", "NS");
                        String ns = (String)nsCell.getColumnValue();
                        Cell pCell = ObjectUtil.findNewCell(mainRow, "T", "P");
                        String p = (String)pCell.getColumnValue();
                        Cell paCell = ObjectUtil.findNewCell(mainRow, "T", "PA");
                        String pa = (String)paCell.getColumnValue();
                        Cell mCell = ObjectUtil.findNewCell(childRow, "TI", "M");
                        String m = (String)mCell.getColumnValue();
                        Cell muomCell = ObjectUtil.findNewCell(childRow, "TI", "MUOM");
                        String muom = (String)muomCell.getColumnValue();
                        Cell mquanCell = ObjectUtil.findNewCell(childRow, "TI", "MQUAN");
                        double mquan = 0.0;
                        if (mquanCell.getColumnValue() != null) {
                            mquan = ((Number)mquanCell.getColumnValue()).doubleValue();
                        }
                        Cell mpriceCell = ObjectUtil.findNewCell(childRow, "TI", "MPRICE");
                        double mprice = 0.0;
                        if (mpriceCell.getColumnValue() != null) {
                            mprice = ((Number)mpriceCell.getColumnValue()).doubleValue();
                        }
                        Cell imCell = ObjectUtil.findNewCell(childRow, "TI", "IM");
                        String im = (String)imCell.getColumnValue();
                        Cell ipCell = ObjectUtil.findNewCell(childRow, "TI", "IP");
                        String ip = (String)ipCell.getColumnValue();
                        Cell ipuomCell = ObjectUtil.findNewCell(childRow, "TI", "IPUOM");
                        String ipuom = (String)ipuomCell.getColumnValue();
                        Cell ipquanCell = ObjectUtil.findNewCell(childRow, "TI", "IPQUAN");
                        double ipquan = 0.0;
                        if (ipquanCell.getColumnValue() != null) {
                            ipquan = ((Number)ipquanCell.getColumnValue()).doubleValue();
                        }
                        Cell ippriceCell = ObjectUtil.findNewCell(childRow, "TI", "IPPRICE");
                        double ipprice = 0.0;
                        if (ippriceCell.getColumnValue() != null) {
                            ipprice = ((Number)ippriceCell.getColumnValue()).doubleValue();
                        }
                       
                        dao.update(Resources.INSERT_RI_SQL);
                        dao.setObject(1, r);
                        dao.setObject(2, currentRi);
                        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, ns);
                        dao.setObject(11, p);
                        dao.setObject(12, pa);
                        dao.setObject(13, m);
                        dao.setObject(14, muom);
                        dao.setObject(15, mquan);
                        dao.setObject(16, mprice);
                        dao.setObject(17, null);
                        dao.setObject(18, im);
                        dao.setObject(19, ip);
                        dao.setObject(20, ipuom);
                        dao.setObject(21, ipquan);
                        dao.setObject(22, ipprice);
                        dao.executeUpdate();
                       
                    }
                }
               
                //At this point, setld zhanghu to add ouy.
                txt256Cell = ObjectUtil.findNewCell(mainRow, "TI", "TXT256");
                txt256 = (String)txt256Cell.getColumnValue();

                Cell tcCell = ObjectUtil.findNewCell(mainRow, "TI", "TC");
                String tc = (String)tcCell.getColumnValue();
                Cell tamtCell = ObjectUtil.findNewCell(mainRow, "TI", "TAMT");
                double tamt = 0.0;
                if (tamtCell.getColumnValue() != null) {
                    tamt = amt;
                }
                String lc = FamilyClass.getLocalCurrency();
                double xr = XRClass.getExchangeRate(lc, tc, rdate);
                double lamt = tamt * xr;
                amt+= lamt;
                Cell nsCell = ObjectUtil.findNewCell(mainRow, "T", "NS");
                String ns = (String)nsCell.getColumnValue();
                Cell pCell = ObjectUtil.findNewCell(mainRow, "T", "P");
                String p = (String)pCell.getColumnValue();
                Cell paCell = ObjectUtil.findNewCell(mainRow, "T", "PA");
                String pa = (String)paCell.getColumnValue();
                Cell mCell = ObjectUtil.findNewCell(mainRow, "TI", "M");
                String m = (String)mCell.getColumnValue();
                Cell muomCell = ObjectUtil.findNewCell(mainRow, "TI", "MUOM");
                String muom = (String)muomCell.getColumnValue();
                Cell mquanCell = ObjectUtil.findNewCell(mainRow, "TI", "MQUAN");
                double mquan = 0.0;
                if (mquanCell.getColumnValue() != null) {
                    mquan = ((Number)mquanCell.getColumnValue()).doubleValue();
                }
                Cell mpriceCell = ObjectUtil.findNewCell(mainRow, "TI", "MPRICE");
                double mprice = 0.0;
                if (mpriceCell.getColumnValue() != null) {
                    mprice = ((Number)mpriceCell.getColumnValue()).doubleValue();
                }
                Cell imCell = ObjectUtil.findNewCell(mainRow, "TI", "IM");
                String im = (String)imCell.getColumnValue();
                Cell ipCell = ObjectUtil.findNewCell(mainRow, "TI", "IP");
                String ip = (String)ipCell.getColumnValue();
                Cell ipuomCell = ObjectUtil.findNewCell(mainRow, "TI", "IPUOM");
                String ipuom = (String)ipuomCell.getColumnValue();
                Cell ipquanCell = ObjectUtil.findNewCell(mainRow, "TI", "IPQUAN");
                double ipquan = 0.0;
                if (ipquanCell.getColumnValue() != null) {
                    ipquan = ((Number)ipquanCell.getColumnValue()).doubleValue();
                }
                Cell ippriceCell = ObjectUtil.findNewCell(mainRow, "TI", "IPPRICE");
                double ipprice = 0.0;
                if (ippriceCell.getColumnValue() != null) {
                    ipprice = ((Number)ippriceCell.getColumnValue()).doubleValue();
                }
                currentRi++;
                dao.update(Resources.INSERT_RI_SQL);
                dao.setObject(1, r);
                dao.setObject(2, currentRi);
                dao.setObject(3, txt256);
                dao.setObject(4, ld);
                dao.setObject(5, tc);
                dao.setObject(6, amt);
                dao.setObject(7, lc);
                dao.setObject(8, xr);
                dao.setObject(9, amt);
                dao.setObject(10, ns);
                dao.setObject(11, p);
                dao.setObject(12, pa);
                dao.setObject(13, m);
                dao.setObject(14, muom);
                dao.setObject(15, mquan);
                dao.setObject(16, mprice);
                dao.setObject(17, null);
                dao.setObject(18, im);
                dao.setObject(19, ip);
                dao.setObject(20, ipuom);
                dao.setObject(21, ipquan);
                dao.setObject(22, ipprice);
                dao.executeUpdate();
               
                return result;
           
        }
View Full Code Here

public class MenuManager {            
        
    //��ڳ��򣬸�ݱ�ZMENUR�в˵����ϵ��b��Ӧ�˵������ָ����������м��ᅣ1�7
    public static JMenuBar createMenu(ActionListener listener) {           
        JMenuBar menuBar = new JMenuBar();
        DAO dao = DAO.getInstance();
        dao.query(Resources.SELECT_FROM_ZMENUR_SQL);
        dao.setString(1, "ROOT");
        ResultSet rs = dao.executeQuery();
        Vector childNames = new Vector();
        try {
            while (rs.next()) {
                childNames.add(rs.getString("MENU2"));
            }
View Full Code Here

    }
       
    //��bmenuName�ӱ�ZMENU���ҵ�ָ��JMenu������װ��
    private static JMenu createMenu(String menuName, ActionListener listener) {
        JMenu menu = new JMenu();
        DAO dao = DAO.getInstance();
        dao.query(Resources.SELECT_FROM_ZMENU_SQL);
        dao.setString(1, menuName);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                int mnemonic = rs.getInt("MNEMONIC");
                if (mnemonic != 0) {
                    menu.setText(MnemonicGenerator.generateMnemonicString(getMenuTxt(menuName), mnemonic));
                    menu.setMnemonic(mnemonic);
                } else
                    menu.setText(getMenuTxt(menuName));
                String command = rs.getString("COMMAND");
                if (command != null) {
                    menu.setActionCommand(command);
                    menu.addActionListener(listener);
                }                       
                String icon = rs.getString("ICON");
                if (icon != null)
                    menu.setIcon(ImageManager.getImage(icon));
            } else {
                return null;
            }
            rs.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        dao = DAO.getInstance();
        dao.query(Resources.SELECT_FROM_ZMENUR_SQL);
        dao.setString(1, menuName);
        rs = dao.executeQuery();
        Vector childMenuNames = new Vector();
        try {                   
            while (rs.next()) {
                childMenuNames.add(rs.getString("MENU2"));                           
            }
View Full Code Here

    }
       
    //��bmenuName�ӱ�ZMENU���ҵ�ָ��JMenuItem������װ��
    private static JMenuItem createMenuItem(String menuName, ActionListener listener) {
        JMenuItem menuItem = new JMenuItem();
        DAO dao = DAO.getInstance();
        dao.query(Resources.SELECT_FROM_ZMENU_SQL);
        dao.setString(1, menuName);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                int mnemonic = rs.getInt("MNEMONIC");
                if (mnemonic != 0) {
                    menuItem.setText(MnemonicGenerator.generateMnemonicString(getMenuTxt(menuName), mnemonic));
View Full Code Here

    }
       
    //�ж�һ��˵����Ƿ����Ӳ˵��1�7
    private static boolean isMenu(String menuName) {
        boolean result = false;
        DAO dao = DAO.getInstance();
        dao.query(Resources.SELECT_FROM_ZMENUR_SQL);
        dao.setString(1, menuName);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next())
                result = true;
            rs.close();
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of realcix20.cixfiles.KeyManager

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.