Package beans.discount.entity

Examples of beans.discount.entity.Discount


        DiscountCardType type = findEntity(DiscountCardType.class, discountCardTypeID);
        Collection<Discount> discounts = findEntityList(Discount.class, "cardType", type);
        List<DiscountDetails> list = new ArrayList<DiscountDetails>();
        Iterator<Discount> i = discounts.iterator();
        while(i.hasNext()) {
            Discount j = (Discount) i.next();
            list.add(j.getDetails((RightChecker) this));
        }
        return list;
    }
View Full Code Here


          new Field("level", level)};
                   
            @SuppressWarnings("unchecked")
            Iterator<Discount> discounts = findEntityList(Discount.class, field).iterator();
            if(discounts.hasNext()) {
                Discount discount = discounts.next();
                discount.setValue(d.value);
                manager.merge(discount);
                // remove extra lines
                while(discounts.hasNext()) {
                    discount = discounts.next();
                    manager.remove(discount);
                }
            } else {
                Discount discount = new Discount();
                discount.setDiscountCardType(type);
                discount.setServiceClass(cls);
                discount.setLevel(level);
                discount.setValue(d.value);
                manager.persist(discount);
            }
        }
    }
View Full Code Here

    protected void onRemove(DiscountLevel entity) throws ClipsServerException {
        super.onRemove(entity);
       
        Iterator list  = findEntityList(Discount.class, "level", entity).iterator();
        while(list.hasNext()) {
            Discount d = (Discount) list.next();
            manager.remove(d);
        }       
    }
View Full Code Here

            discountCard.setType((DiscountCardType) entityWith);
            manager.merge(discountCard);
        }
        List entityList1 = findEntityList(Discount.class, "cardType", entityWhat);
        for (int i = 0; i < entityList1.size(); i++) {
            Discount discount = (Discount) entityList1.get(i);
            discount.setDiscountCardType((DiscountCardType) entityWith);
            manager.merge(discount);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

    private void replaceServiceClass(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Discount, Service
        List entityList = findEntityList(Discount.class, "serviceClass", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Discount d = (Discount)entityList.get(i);
            d.setServiceClass((ServiceClass) entityWith);
            manager.merge(d);
        }
        List entityList1 = findEntityList(Service.class, "serviceClass", entityWhat);
        for (int i = 0; i < entityList1.size(); i++) {
            Service s = (Service) entityList1.get(i);
View Full Code Here

TOP

Related Classes of beans.discount.entity.Discount

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.