Package framework.beans.address.entities

Examples of framework.beans.address.entities.Address


                    polis1.setInsurer(polis2.getInsurer());
                    polis1.setRegionCode(polis2.getRegionCode());
                    polis1.setTillDate(polis2.getTillDate());
                    polis1.setFromDate(polis2.getFromDate());

                    Address address = polis1.getAddress();
                    polis1.setAddress(polis2.getAddress());
                    manager.remove(address);
                    saveEntity(polis1);
                    auditPolis.check(polis1);
                    target.add(persistAudit(auditPolis));
                } else {
                    System.out.println("          polis1 has more details");
                    Address address = polis2.getAddress();
                    manager.remove(address);
                }

                List<ProfcheckupItem> prchL = findEntityList(ProfcheckupItem.class, "polis.id", polis2.getId());
                for (ProfcheckupItem prch : prchL) {
View Full Code Here


                && src.getPassword() != null && !src.getPassword().isEmpty()) {
            dst.setPassword(src.getPassword());
            System.out.println("          change password");
        }

        Address address1 = dst.getAddress();
        Address address2 = src.getAddress();
        if (address1 == null) {
            if (address2 != null) {
                System.out.println("          cl1 set address2");
                dst.setAddress(address2);
            }
View Full Code Here

     */
    @Override
    public AddressDetails getAddress() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        Client entity = getExistentEntity();
        Address addr = entity.getAddress();
        if (addr == null) {
            addr = new Address();
        }
        return addr.getDetails((RightChecker) this);
    }
View Full Code Here

    @Override
    public ModificationInfo setAddress(AddressDetails details) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_MODIFY);
        Client entity = getExistentEntity();
        AuditDoc<Client> auditDoc = new AuditDoc<Client>(entity, getCollaborator());
        Address addr = entity.getAddress();
        boolean newAddr = false;
        if (addr == null) {
            addr = new Address();
            newAddr = true;
        }

        addr.setBuilding(details.building);
        addr.setFlat(details.flat);
        addr.setAddressObject(findEntity(AddressObject.class, details.objectId));
//        addr.setId(details.id);

        saveEntity(addr);
        if(newAddr) {
            entity.setAddress(addr);
View Full Code Here

        polis.setFromDate(details.fromDate);
        polis.setRegionCode(findEntity(RegionIdCode.class, details.regionCodeId));
        polis.setCollaborator(findEntity(Collaborator.class, getCollaboratorId()));
        polis.setInsurer(findEntity(Insurer.class, details.insurerID));

        Address address = polis.getAddress();
        AddressDetails ad = details.addressDetail;
        if (ad != null && ad.objectId != 0) {
            if (address == null){
                address = new Address();
            }
            address.setAddressObject(findEntity(AddressObject.class, ad.objectId));
            address.setBuilding(ad.building);
            address.setFlat(ad.flat);
            saveEntity(address);
            polis.setAddress(address);
        }else{
            if (address != null) {
                removeEntity(address);
View Full Code Here

            polis.setTrash(true);
            saveEntity(polis);
            auditDoc.check(polis);
            return persistAudit(auditDoc);
        } else {
            Address address = polis.getAddress();
            if (address != null) {
                removeEntity(address);
            }
            removeEntity(polis);
            auditDoc.check(null);
View Full Code Here

        Contract entity = getExistentEntity();

        ArrayList<AuditDoc> auditDocList = new ArrayList<AuditDoc>();
        Polis polis = null;
        AuditDoc<Polis> auditDoc;
        Address a = new Address();
        if (details.id != 0) {
            polis = findEntity(Polis.class, details.id);
            checkTheSame(polis.getContract());
            int count = getEntityCount(ServiceRender.class, new Field[]{new Field("polis", polis)});
            count += getEntityCount(ProfcheckupItem.class, new Field[]{new Field("polis", polis)});
            if (count > 0) {
                //помещение старого в корзину
                auditDoc = new AuditDoc<Polis>(polis, getCollaborator());
                auditDocList.add(auditDoc);
                polis.setTrash(true);
                saveEntity(polis);
                auditDoc.check(polis);
                //создание нового
                auditDoc = new AuditDoc<Polis>(null, getCollaborator());
                auditDocList.add(auditDoc);
                polis = new Polis();
            }
            else {
                auditDoc = new AuditDoc<Polis>(polis, getCollaborator());
                auditDocList.add(auditDoc);
                a = polis.getAddress();
                if (a == null) {
                    a = new Address();
                }
            }
        }
        else {
            auditDoc = new AuditDoc<Polis>(null, getCollaborator());
            auditDocList.add(auditDoc);
            polis = new Polis();
        }
       
        polis.setClient(findEntity(Client.class, details.clientID));
        polis.setContract(entity);
        polis.setCollaborator(findEntity(Collaborator.class, getCollaboratorId()));
        polis.setMember(details.member);
        polis.setSeries(details.series);
        polis.setNumber(details.number);
        polis.setTillDate(details.tillDate);
        polis.setFromDate(details.fromDate);
        polis.setInsurer(details.insurerID != 0 ? findEntity(Insurer.class, details.insurerID) : null);
        polis.setRegionCode(findEntity(RegionIdCode.class, details.regionCodeId));
      
        AddressDetails ad = details.addressDetail;
        if (ad != null) {
            a.setAddressObject(ad.objectId != 0 ? findEntity(AddressObject.class, ad.objectId) : null);
            a.setBuilding(ad.building);
            a.setFlat(ad.flat);
            saveEntity(a);
            polis.setAddress(a);
        }
        int id = saveEntity(polis);
        auditDoc.check(polis);
View Full Code Here

        }
        if (getEntityCount(ProfcheckupItem.class,
            new Field[]{new Field("polis", polis)}, "") > 0) {
            throw new EDataIntegrity("Нельзя удалить данного участника договора так как у него уже есть услуги");
        }
        Address address = polis.getAddress();
        if (address != null) {
            removeEntity(address);
        }
        AuditDoc<Polis> auditDoc = new AuditDoc<Polis>(polis, getCollaborator());
        removeEntity(polis);
View Full Code Here

            p.setTrash(pOld.isTrash());
            p.setCollaborator(pOld.getCollaborator());
            p.setContract(dst);
            if (pOld.getAddress() != null) {
                AddressDetails ad = pOld.getAddress().getDetails(this).clone();
                Address a = new Address();
                a.setBuilding(ad.building);
                a.setFlat(ad.flat);
                a.setAddressObject(ad.objectId != 0 ? findEntity(AddressObject.class, ad.objectId) : null);
                manager.persist(a);
                p.setAddress(a);
            }
            saveEntity(p);
            auditDoc.check(p);
View Full Code Here

                        for (int i = 0; i < profCheckupList.size(); i++) {
                            ProfcheckupItem profcheckupItem = profCheckupList.get(i);
                            profcheckupItem.setPolis(main);
                            saveEntity(profcheckupItem);
                        }
                        Address address = polis.getAddress();
                        if (address != null) {
                            removeEntity(address);
                        }
                        removeEntity(polis);
                    }
View Full Code Here

TOP

Related Classes of framework.beans.address.entities.Address

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.