Package beans.discount.entity

Examples of beans.discount.entity.DiscountCard


        List cards = findEntityList(DiscountCard.class, "client", entity);
        List<DiscountCardDetails> res = new ArrayList<DiscountCardDetails>();

        Iterator i = cards.iterator();
        while (i.hasNext()) {
            DiscountCard j = (DiscountCard) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here


    @Override
    public DiscountCardDetails getDiscountCard() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        ServiceRender entity = getExistentEntity();
       
        DiscountCard dc = entity.getDiscountCard();
        if (dc == null) {
            return null;
        }
        return dc.getDetails((RightChecker) this);
    }
View Full Code Here

    @Override
    public int getCalculatedDiscount() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        ServiceRender entity = getExistentEntity();

        DiscountCard discountCard = entity.getDiscountCard();
        PacketService packetService = entity.getPacketService();
        if (discountCard != null || packetService != null) {
            //по дисконтной карте или по пакету услуг
            int cardID = discountCard == null ? 0 : discountCard.getId();
            int packetID = packetService == null ? 0 : packetService.getPacketTemplate().getId();
            return CalcDiscount.calculateDiscount(manager, cardID, entity.getService().getId(), packetID);
        } else {
            return entity.getDiscount();
        }
View Full Code Here

    private void replaceDiscountCardType(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //DiscountCard, Discount
        List entityList = findEntityList(DiscountCard.class, "type", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            DiscountCard discountCard = (DiscountCard)entityList.get(i);
            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);
View Full Code Here

        try {
            DiscountCardBeanRemote cardBeanRemote = getBean(DiscountCardBean.class);
            List list = findEntityList(checked, f);
            for (int i = 0; i < list.size(); i++) {
                DiscountCard discountCard = (DiscountCard) list.get(i);
                cardBeanRemote.initByID(discountCard.getId(), getSessionId());
                DiscountCardDetails details = (DiscountCardDetails) cardBeanRemote.getDetails();
                details.collaboratorBlockerID = getCollaboratorId();
                cardBeanRemote.update(details);
            }
        } catch (ClipsServerException ex) {
View Full Code Here

     */
    @Override
    public ModificationInfo createNewServices(NewServicesChunk chunk) throws ClipsServerException {
        ArrayList<AuditDetails> auditDetList = new ArrayList<AuditDetails>();
        checkCommandAccessibility(COMMAND_CREATE);
        DiscountCard card = null;
        Disease disease = (chunk.diseaseID == 0) ? null : findEntity(Disease.class, chunk.diseaseID);
        //Сооздаем полис если его нет
        Pair<Polis, AuditDetails> pair = getPolis(chunk.polisDetails);
        Polis polis = pair.first;
        if (pair.second != null) {
View Full Code Here

TOP

Related Classes of beans.discount.entity.DiscountCard

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.