Package org.jabusuite.address

Examples of org.jabusuite.address.Contact


        return this.findDataset(id,true);
    }
   
    public Contact findDataset(long id, boolean withAdditionalData) {
        logger.debug("Searching for contact "+id);
        Contact contact = manager.find(Contact.class, id);
        return contact;
    }
View Full Code Here


        super();
    }

    @Override
    protected void assignToParent(JbsBaseObject newObject) {
        Contact contact = (Contact)newObject;
        Address address = (Address)this.getParentObject();
        contact.setAddress(address);
        contact.copyPermissionsFrom(address);
    }
View Full Code Here

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals(JbsDialogWindowOKCancel.ACTION_OK)) {
                    if (fmSelectContact.getSelectedJbsObject() != null) {
                        Contact contact = (Contact)fmSelectContact.getSelectedJbsObject();
                        addContact(contact);
                    }
                }
            }
        });
View Full Code Here

            logger.debug("Creatign letters.");
            ((MassLetterWizard)this.getWizard()).getCreatedLetters().clear();
            LettersRemote letterManagement = (LettersRemote) ClientTools.getRemoteBean(LettersRemote.class);
            Iterator it = ((MassLetterWizard) this.getWizard()).getContacts().iterator();
            while (it.hasNext()) {
                Contact contact = (Contact) it.next();
                logger.debug("Creating letter for "+contact.getName1());
                Letter letter = (Letter) ((MassLetterWizard)this.getWizard()).getLetterTemplate().getCopy();
                letter.setContact(contact);
                letterManagement.createDataset(letter, ClientGlobals.getUser(), ClientGlobals.getCompany());
                ((MassLetterWizard)this.getWizard()).getCreatedLetters().add(letter);
            }
View Full Code Here

        }

        public Object getValueAt(int column, int row) {
            if ((getJbsObjects().size() > 0) && (row < getJbsObjects().size())) {
                try {
                    Contact contact = (Contact) this.getJbsObjects().get(row);
                    switch (column) {
                        case 0:
                            String name = "";
                            if (contact.getName2() != null) {
                                name = contact.getName2();
                            }
                            if (contact.getName1() != null) {
                                if (!name.equals(""))
                                    name+=" ";
                                name += contact.getName1();
                            }
                            if ((contact.getFirstName() != null) && (!contact.getFirstName().trim().equals(""))) {
                                name = name + ", " + contact.getFirstName();
                            }
                            if (name.equals(""))
                                name="test";
                            return name;
                        case 1:
                            String sType = JbsL10N.getString("ContactType.CT_CONTACT");
                            if (contact instanceof HierarchyCustomer)
                                sType = JbsL10N.getString("ContactType.CT_CUSTOMER");
                            else if (contact instanceof Customer)
                                sType = JbsL10N.getString("ContactType.CT_CUSTOMER");
                            else if (contact instanceof Employee)
                                sType = JbsL10N.getString("ContactType.CT_EMPLOYEE");
                            return sType;
                        case 2:
                            if ((contact.getAddress()!=null) && (contact.getAddress().getStreet()!=null))
                                return contact.getAddress().getStreet();
                            else if ((contact instanceof Address) && (((Address)contact).getStreet()!=null))
                                return ((Address)contact).getStreet();
                            else
                                return "";
                        case 3:
                            String zip = "";
                           
                            Address address = null;
                            if (contact instanceof Address)
                                address = (Address)contact;
                            else
                                address = contact.getAddress();
                           
                            String city = "";
                            if (address!=null) {
                                if (address.getZip() != null) {
                                    zip = address.getZip();
View Full Code Here

            }
        }
       
        public Object getValueAt(int column, int row) {
            if (row<this.getJbsBaseObjects().size()) {
                Contact contact = (Contact)this.getJbsBaseObjects().get(row);
                switch (column) {
                    case 0 :
                        String sName = contact.getName1();
                        if ((contact.getFirstName()!=null) && (!contact.getFirstName().trim().equals("")))
                            sName+=", "+contact.getFirstName();
                        return sName;
                    case 1 :
                        String sPhone = contact.getPhone();
                        if (sPhone!=null)
                            return sPhone;
                        else
                            return null;
                    case 2 :
                        String sMobilePhone = contact.getMobilePhone();
                        if (sMobilePhone!=null)
                            return sMobilePhone;
                        else
                            return null;
                    case 3 :
                        String sEmail = contact.getEmail();
                        if (sEmail!=null)
                            return sEmail;
                        else
                            return null;
                    default :
View Full Code Here

        this.setPnEditJbsObject(new PnContactEdit(this.getState(), this.getContact()));
    }

    @Override
    public void createJbsBaseObject() {
        this.setJbsBaseObject(new Contact());
    }
View Full Code Here


    public PnContactEdit() {
        super(DlgState.dsInsert);
        this.setSaveDirectly(true);
        this.setContact(new Contact());
    }
View Full Code Here

    protected JRDataSource createDataSource() throws Exception {
        return new JREmptyDataSource();
    }
   
    protected Address getAddress() {
        Contact contact = this.getContact();
        if (contact==null)
            contact = this.getAddressLetter().getContact();
       
        if (contact instanceof Address)
            return (Address)contact;
        else
            return contact.getAddress();
    }
View Full Code Here

TOP

Related Classes of org.jabusuite.address.Contact

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.