Package realcix20.utils

Examples of realcix20.utils.DAO


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

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

public class TxtManager {  
   
    //���TXTID��ָ������4ȡ�ù�ʻ��ı��ᅣ1�7
    public static String getTxt(String txtId, String lang) {
        String txt = txtId;      
        final DAO dao = DAO.getInstance();                 
        dao.query(Resources.SELECT_TXT_TABLE_SQL);
        dao.setString(1, txtId);
        dao.setString(2, lang);
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                txt = rs.getString("LONG");
            } else {
                dao.query(Resources.SELECT_TXT_TABLE_SQL);
                dao.setString(1, txtId);
                dao.setString(2, "EN");
                rs = dao.executeQuery();
                if (rs.next()) {
                    txt = rs.getString("LONG");
                }
            }
            rs.close();
View Full Code Here

        initSearchField();       
    }
   

  protected void setDefault(int layout) {
      DAO dao = DAO.getInstance();
      dao.update(Resources.UPDATE_CLS_DEFCL_SQL);
      dao.setInt(1,layout);
      dao.setInt(2,getContainer().getCurrentObject().getClsId());
      dao.executeUpdate();
      layoutId=layout;
  }
View Full Code Here

  }

  public void updateReportSelector() {
      reportSelector.removeActionListener(this);
        reportSelector.removeAllItems();
        DAO dao = DAO.getInstance();
        dao.query(Resources.SELECT_CLS_ALL_LAYOUTS_SQL);
        dao.setObject(1, object.getClsId());
        ResultSet rs = dao.executeQuery();
        try {
            Item item = new Item(object.getClsId() + "." + "0", TxtManager.getTxt("VIEW.XTABLE.REPORTSELECTORALL"));
            reportSelector.addItem(item);
            if(layoutId==0) reportSelector.setSelectedItem(item);
            while (rs.next()) {
View Full Code Here

           
        }
               
       
        public static void insertri_balance(Row correspondenceRow, 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);//USE TaxClass
                double lamt = tamt * xr;
                dao.update(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 correspondenceRow, 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);//USE TaxClass
                double lamt = tamt * xr;
                dao.update(Resources.INSERT_RI_VALUE_SQL_CORR);
                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(correspondenceRow, "T", "NS").getColumnValue());
                dao.setObject(11, ObjectUtil.findNewCell(correspondenceRow, "T", "P").getColumnValue());
                dao.setObject(12, ObjectUtil.findNewCell(correspondenceRow, "T", "PA").getColumnValue());
                dao.setObject(13, ObjectUtil.findNewCell(correspondenceRow, "TI", "M").getColumnValue());
                dao.setObject(14, ObjectUtil.findNewCell(correspondenceRow, "TI", "MUOM").getColumnValue());
                dao.setObject(15, ObjectUtil.findNewCell(correspondenceRow, "TI", "MQUAN").getColumnValue());
                dao.setObject(16, ObjectUtil.findNewCell(correspondenceRow, "TI", "MPRICE").getColumnValue());
                dao.setObject(17, ObjectUtil.findNewCell(correspondenceRow, "TI", "IM").getColumnValue());
                dao.setObject(18, ObjectUtil.findNewCell(correspondenceRow, "TI", "IP").getColumnValue());
                dao.setObject(19, ObjectUtil.findNewCell(correspondenceRow, "TI", "IPUOM").getColumnValue());
                dao.setObject(20, ObjectUtil.findNewCell(correspondenceRow, "TI", "IPQUAN").getColumnValue());
                dao.setObject(21, ObjectUtil.findNewCell(correspondenceRow, "TI", "IPPRICE").getColumnValue());
                dao.executeUpdate();           
               
//                System.err.println("ObjectUtil.findNewCell(correspondenceRow, 'TI', 'MPRICE') =  " + ObjectUtil.findNewCell(correspondenceRow, "TI", "MPRICE").getColumnValue());
        }
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.