• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CategoryInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.openbravo.pos.ticket.CategoryInfo的典型用法代码示例。如果您正苦于以下问题:Java CategoryInfo类的具体用法?Java CategoryInfo怎么用?Java CategoryInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CategoryInfo类属于com.openbravo.pos.ticket包,在下文中一共展示了CategoryInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
/**
 * This is the action called from the Struts framework.
 * @param mapping The ActionMapping used to select this instance.
 * @param form The optional ActionForm bean for this request.
 * @param request The HTTP Request we are processing.
 * @param response The HTTP Response we are processing.
 * @throws java.lang.Exception
 * @return
 */
public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {

    DynaActionForm inputFormPlace = (DynaActionForm) form;
    RestaurantManager manager = new RestaurantManager();
    List<CategoryInfo> categories = new ArrayList<CategoryInfo>();
    categories = manager.findAllCategories();
    List products = new ArrayList<ProductInfo>();
    products = manager.findProductsByCategory(categories.get(0).getId());
    List taxRates = new ArrayList<String>();
    taxRates = manager.findAllTaxRatesByCategory(products);
    List subcategories = new ArrayList<CategoryInfo>();
    subcategories = manager.findAllSubcategories(categories.get(0).getId());

    request.setAttribute("products", products);
    request.setAttribute("rates", taxRates);
    request.getSession().setAttribute("place", (String) inputFormPlace.get("place"));
    request.setAttribute("placeName", manager.findPlaceNameById((String) inputFormPlace.get("place")));
    request.setAttribute("categories", categories);
    request.setAttribute("subcategories", subcategories);
    request.getSession().setAttribute("floorId", (String) inputFormPlace.get("floorId"));

    return mapping.findForward(SUCCESS);
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:35,代码来源:ProductAction.java


示例2: findAllCategories

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public List<CategoryInfo> findAllCategories() {

        Connection con = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        List<CategoryInfo> vos = null;
        String sqlStr = "select * from CATEGORIES where PARENTID IS NULL order by NAME";

        try {
            //get connection
            con = getConnection();
            //prepare statement
            ps = con.prepareStatement(sqlStr);
            //execute
            rs = ps.executeQuery();
            //transform to VO
            vos = transformSet(rs);
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            try {
                // close the resources 
                if (ps != null) {
                    ps.close();
                }
                if (con != null) {
                    con.close();
                }
            } catch (SQLException sqlee) {
                sqlee.printStackTrace();
            }
        }

        return vos;
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:36,代码来源:CategoryDAO.java


示例3: findAllSubcategories

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public List<CategoryInfo> findAllSubcategories(String id) {
    Connection con = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    List<CategoryInfo> vos = null;
    String sqlStr = "select * from CATEGORIES where PARENTID = ? order by NAME";

    try {
        //get connection
        con = getConnection();
        //prepare statement
        ps = con.prepareStatement(sqlStr);
        ps.setString(1, id);
        //execute
        rs = ps.executeQuery();
        //transform to VO
        vos = transformSet(rs);
    } catch (Exception ex) {
        ex.printStackTrace();
    } finally {
        try {
            // close the resources
            if (ps != null) {
                ps.close();
            }
            if (con != null) {
                con.close();
            }
        } catch (SQLException sqlee) {
            sqlee.printStackTrace();
        }
    }

    return vos;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:36,代码来源:CategoryDAO.java


示例4: findFirstCategory

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public String findFirstCategory() {
    Connection con = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    List<CategoryInfo> vos = null;
    String sqlStr = "select * from CATEGORIES where PARENTID IS NULL order by NAME";

    try {
        //get connection
        con = getConnection();
        //prepare statement
        ps = con.prepareStatement(sqlStr);
        //execute
        rs = ps.executeQuery();
        //transform to VO
        vos = transformSet(rs);
    } catch (Exception ex) {
        ex.printStackTrace();
    } finally {
        try {
            // close the resources
            if (ps != null) {
                ps.close();
            }
            if (con != null) {
                con.close();
            }
        } catch (SQLException sqlee) {
            sqlee.printStackTrace();
        }
    }

    return vos.get(0).getId();
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:35,代码来源:CategoryDAO.java


示例5: map2VO

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
@Override
protected CategoryInfo map2VO(ResultSet rs) throws SQLException {
    CategoryInfo category = new CategoryInfo();
    category.setId(rs.getString("id"));
    category.setParentid(rs.getString("parentid"));
    category.setName(rs.getString("name"));

    return category;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:10,代码来源:CategoryDAO.java


示例6: loadCatalog

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public void loadCatalog() throws BasicException {
    
    // delete all categories panel
    m_jProducts.removeAll();
    
    m_productsset.clear();        
    m_categoriesset.clear();
    
    showingcategory = null;
            
    // Load the taxes logic
    taxeslogic = new TaxesLogic(m_dlSales.getTaxList().list());

    // Load all categories.
    java.util.List<CategoryInfo> categories = m_dlSales.getRootCategories(); 
    
    // Select the first category
    m_jListCategories.setCellRenderer(new SmallCategoryRenderer());
    m_jListCategories.setModel(new CategoriesListModel(categories)); // aCatList
    if (m_jListCategories.getModel().getSize() == 0) {
        m_jscrollcat.setVisible(false);
        jPanel2.setVisible(false);
    } else {
        m_jscrollcat.setVisible(true);
        jPanel2.setVisible(true);
        m_jListCategories.setSelectedIndex(0);
    }
        
    // Display catalog panel
    showRootCategoriesPanel();
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:32,代码来源:JCatalog.java


示例7: selectCategoryPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void selectCategoryPanel(String catid) {

        try {
            // Load categories panel if not exists
            if (!m_categoriesset.contains(catid)) {
                
                JCatalogTab jcurrTab = new JCatalogTab();     
                jcurrTab.applyComponentOrientation(getComponentOrientation());
                m_jProducts.add(jcurrTab, catid);
                m_categoriesset.add(catid);
               
                // Add subcategories
                java.util.List<CategoryInfo> categories = m_dlSales.getSubcategories(catid);
                for (CategoryInfo cat : categories) {

                    jcurrTab.addButton(new ImageIcon(tnbbutton.getThumbNailText(cat.getImage(), cat.getName())), new SelectedCategory(cat));
                }
                
                // Add products
                java.util.List<ProductInfoExt> products = m_dlSales.getProductCatalog(catid);
                for (ProductInfoExt prod : products) {
                    jcurrTab.addButton(new ImageIcon(tnbbutton.getThumbNailText(prod.getImage(), getProductLabel(prod))), new SelectedAction(prod));
                }
            }
            
            // Show categories panel
            CardLayout cl = (CardLayout)(m_jProducts.getLayout());
            cl.show(m_jProducts, catid);  
        } catch (BasicException e) {
            JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notactive"), e));            
        }
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:33,代码来源:JCatalog.java


示例8: showRootCategoriesPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void showRootCategoriesPanel() {
    
    selectIndicatorCategories();
    // Show selected root category
    CategoryInfo cat = (CategoryInfo) m_jListCategories.getSelectedValue();
    
    if (cat != null) {
        selectCategoryPanel(cat.getID());
    }
    showingcategory = null;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:12,代码来源:JCatalog.java


示例9: getListCellRendererComponent

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
    CategoryInfo cat = (CategoryInfo) value;
    setText(cat.getName());
    setIcon(new ImageIcon(tnbcat.getThumbNail(cat.getImage())));
    return this;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:9,代码来源:JCatalog.java


示例10: m_jListCategoriesValueChanged

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void m_jListCategoriesValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_m_jListCategoriesValueChanged

        if (!evt.getValueIsAdjusting()) {
            CategoryInfo cat = (CategoryInfo) m_jListCategories.getSelectedValue();
            if (cat != null) {
                selectCategoryPanel(cat.getID());
            }
        }
        
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:11,代码来源:JCatalog.java


示例11: syncCategory

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public void syncCategory(final CategoryInfo cat) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Category in a transaction
            
            // Try to update
            if (new PreparedSentence(s, 
                        "UPDATE CATEGORIES SET NAME = ?, IMAGE = ? WHERE ID = ?", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                             setString(1, cat.getName());
                             setBytes(2, ImageUtils.writeImage(cat.getImage()));
                             setString(3, cat.getID());                                   
                        }}) == 0) {
                   
                // If not updated, try to insert
                new PreparedSentence(s, 
                    "INSERT INTO CATEGORIES(ID, NAME, IMAGE) VALUES (?, ?, ?)",
                    SerializerWriteParams.INSTANCE
                    ).exec(new DataParams() { public void writeValues() throws BasicException {
                        setString(1, cat.getID());
                        setString(2, cat.getName());
                        setBytes(3, ImageUtils.writeImage(cat.getImage()));
                    }});
            }
            return null;        
        }
    };
    t.execute();        
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:32,代码来源:DataLogicIntegration.java


示例12: loadCatalog

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
/**
 *
 * @throws BasicException
 */
@Override
public void loadCatalog() throws BasicException {
    
    // delete all categories panel
    m_jProducts.removeAll();
    
    m_productsset.clear();        
    m_categoriesset.clear();
    
    showingcategory = null;
            
    // Load the taxes logic
    taxeslogic = new TaxesLogic(m_dlSales.getTaxList().list());

    // Load all categories.
    java.util.List<CategoryInfo> categories = m_dlSales.getRootCategories(); 
    
    // Select the first category
    m_jListCategories.setCellRenderer(new SmallCategoryRenderer());
    m_jListCategories.setModel(new CategoriesListModel(categories)); // aCatList
    if (m_jListCategories.getModel().getSize() == 0) {
        m_jscrollcat.setVisible(false);
        jPanel2.setVisible(false);
    } else {
        m_jscrollcat.setVisible(true);
        jPanel2.setVisible(true);
        m_jListCategories.setSelectedIndex(0);
    }
        
    // Display catalog panel
    showRootCategoriesPanel();
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:37,代码来源:JCatalog.java


示例13: selectCategoryPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void selectCategoryPanel(String catid) {
        try {
            // Load categories panel if not exists
            if (!m_categoriesset.contains(catid)) {
                
                JCatalogTab jcurrTab = new JCatalogTab();     
                jcurrTab.applyComponentOrientation(getComponentOrientation());
                m_jProducts.add(jcurrTab, catid);
                m_categoriesset.add(catid);
               
// Add subcategories
                java.util.List<CategoryInfo> categories = m_dlSales.getSubcategories(catid);
                for (CategoryInfo cat : categories) {
// these the sub categories displayed in the main products Panel    
                   
                   if (cat.getCatShowName()) {
                    jcurrTab.addButton(new ImageIcon(tnbsubcat.getThumbNailText(cat.getImage(), cat.getName())), new SelectedCategory(cat),cat.getTextTip());
                   }else{
                    jcurrTab.addButton(new ImageIcon(tnbsubcat.getThumbNailText(cat.getImage(), "")), new SelectedCategory(cat),cat.getTextTip());
                   }
                }
                
// Add products
                java.util.List<ProductInfoExt> products = m_dlSales.getProductCatalog(catid);
                for (ProductInfoExt prod : products) {
// These are the products selection panel     
                   jcurrTab.addButton( new ImageIcon(tnbbutton.getThumbNailText(prod.getImage(), getProductLabel(prod))), new SelectedAction(prod),prod.getTextTip());
                }
                }
            
            // Show categories panel
            CardLayout cl = (CardLayout)(m_jProducts.getLayout());
            cl.show(m_jProducts, catid);  
        } catch (BasicException e) {
            JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notactive"), e));            
        }
    }
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:38,代码来源:JCatalog.java


示例14: showSubcategoryPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void showSubcategoryPanel(CategoryInfo category) {
// Modified JDL 13.04.13
// this is the new panel that displays when a sub catergory is selected mouse does not work here        
        selectIndicatorPanel(new ImageIcon(tnbsubcat.getThumbNail(category.getImage())),category.getName(), category.getTextTip());
        selectCategoryPanel(category.getID());
        showingcategory = category;
    }
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:8,代码来源:JCatalog.java


示例15: selectCategoryPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void selectCategoryPanel(String catid) {
        try {
            // Load categories panel if not exists
            if (!m_categoriesset.contains(catid)) {
                
                JCatalogTab jcurrTab = new JCatalogTab();     
                jcurrTab.applyComponentOrientation(getComponentOrientation());
                m_jProducts.add(jcurrTab, catid);
                m_categoriesset.add(catid);
               
// Add subcategories
                java.util.List<CategoryInfo> categories = m_dlSales.getSubcategories(catid);
                for (CategoryInfo cat : categories) {
// these the sub categories displayed in the main products Panel    
                   
                   if (cat.getCatShowName()) {
                    jcurrTab.addButton(new ImageIcon(tnbsubcat.getThumbNailText(cat.getImage(), cat.getName())), new SelectedCategory(cat),cat.getTextTip());
                   }else{
                    jcurrTab.addButton(new ImageIcon(tnbsubcat.getThumbNailText(cat.getImage(), "")), new SelectedCategory(cat),cat.getTextTip());
                   }
                }
                
// Add products
                java.util.List<ProductInfoExt> products = m_dlSales.getProductCatalog(catid);
                for (ProductInfoExt prod : products) {
// These are the products selection panel                   
                   jcurrTab.addButton(new ImageIcon(tnbbutton.getThumbNailText(prod.getImage(), getProductLabel(prod))), new SelectedAction(prod),prod.getTextTip());
                }
                }
            
            // Show categories panel
            CardLayout cl = (CardLayout)(m_jProducts.getLayout());
            cl.show(m_jProducts, catid);  
        } catch (BasicException e) {
            JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notactive"), e));            
        }
    }
 
开发者ID:sbandur84,项目名称:micro-Blagajna,代码行数:38,代码来源:JCatalog.java


示例16: findCategory

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public CategoryInfo findCategory(String catid) throws BasicException {
    return (CategoryInfo) new PreparedSentence(s,
            "SELECT ID, NAME, CODE, IMAGE "
            + "FROM CATEGORIES WHERE ID = ?",
            SerializerWriteString.INSTANCE,
            CategoryInfo.getSerializerRead()).find(catid);
}
 
开发者ID:nordpos,项目名称:nordpos,代码行数:8,代码来源:DataLogicSales.java


示例17: getCategoryInfoById

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
public final CategoryInfo getCategoryInfoById(String sID) throws BasicException {
    return (CategoryInfo) new PreparedSentence(s
            , "SELECT ID, NAME, CODE, IMAGE FROM CATEGORIES "
            + "WHERE ID = ?"
            , SerializerWriteString.INSTANCE
            , CategoryInfo.getSerializerRead()).find(sID);
}
 
开发者ID:nordpos,项目名称:nordpos,代码行数:8,代码来源:DataLogicSales.java


示例18: selectCategoryPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void selectCategoryPanel(String catid) {

        try {
            // Load categories panel if not exists
            if (!m_categoriesset.contains(catid)) {

                JCatalogTab jcurrTab = new JCatalogTab();
                jcurrTab.applyComponentOrientation(getComponentOrientation());
                m_jProducts.add(jcurrTab, catid);
                m_categoriesset.add(catid);

                // Add subcategories
                java.util.List<CategoryInfo> categories = new LinkedList<CategoryInfo>();
                if (catid.isEmpty()) {
                    categories = m_dlSales.getRootCategories();
                } else {
                    categories = m_dlSales.getSubcategories(catid);
                }

                for (CategoryInfo cat : categories) {
                    jcurrTab.addButton(new ImageIcon(tnbbutton.getThumbNailText(cat.getImage(), "<p align=\"center\">" + cat.getName() + "</p>")), new SelectedCategory(cat));
                }

                // Add products
                java.util.List<ProductInfoExt> products = m_dlSales.getProductCatalog(catid);
                for (ProductInfoExt prod : products) {
                    jcurrTab.addButton(new ImageIcon(tnbbutton.getThumbNailText(prod.getImage(), getProductLabel(prod))), new SelectedAction(prod));
                }
            }

            // Show categories panel
            CardLayout cl = (CardLayout) (m_jProducts.getLayout());
            cl.show(m_jProducts, catid);
        } catch (BasicException e) {
            JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notactive"), e));
        }
    }
 
开发者ID:nordpos,项目名称:nordpos,代码行数:38,代码来源:JCatalog.java


示例19: showSubcategoryPanel

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void showSubcategoryPanel(CategoryInfo category) {
    if (category != null) {
        selectCategoryPanel(category.getID());
    } else {
        selectCategoryPanel("");
    }
    showingcategory = category;
}
 
开发者ID:nordpos,项目名称:nordpos,代码行数:9,代码来源:JCatalog.java


示例20: jButtonGenBarcodeActionPerformed

import com.openbravo.pos.ticket.CategoryInfo; //导入依赖的package包/类
private void jButtonGenBarcodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGenBarcodeActionPerformed
    
    String sCode = m_jCode.getText();
    if (sCode.length() == 12) {
        m_jCode.setText(sCode.concat(Character.toString(EAN13LogicImpl.calcChecksum(sCode))));
    } else if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.generatebarcode"), AppLocal.getIntString("title.editor"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
        try {
            CategoryInfo mCurrentCategory = (CategoryInfo) m_CategoryModel.getSelectedItem();
            m_jCode.setText(generateBarCode(m_dSales.countPonductsByCategory(mCurrentCategory.getID()), mCurrentCategory.getCode()));
        } catch (BasicException ex) {
            m_jCode.setText(null);
        }
    }
}
 
开发者ID:nordpos,项目名称:nordpos,代码行数:15,代码来源:ProductsEditor.java



注:本文中的com.openbravo.pos.ticket.CategoryInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EventValues类代码示例发布时间:2022-05-22
下一篇:
Java DataNodeFaultInjector类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap