Package com.gcrm.domain

Examples of com.gcrm.domain.Contact


        UserUtil.permissionCheck("create_contact");
        if (this.getSeleteIDs() != null) {
            String[] ids = seleteIDs.split(",");
            for (int i = 0; i < ids.length; i++) {
                String copyid = ids[i];
                Contact oriRecord = baseService.getEntityById(Contact.class,
                        Integer.valueOf(copyid));
                Contact targetRecord = oriRecord.clone();
                targetRecord.setId(null);
                this.getbaseService().makePersistent(targetRecord);
            }
        }
        return SUCCESS;
    }
View Full Code Here


            writer.writeHeader(header);
            if (!isTemplate) {
                String[] ids = seleteIDs.split(",");
                for (int i = 0; i < ids.length; i++) {
                    String id = ids[i];
                    Contact contact = baseService.getEntityById(Contact.class,
                            Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], contact.getId());
                    Salutation salutation = contact.getSalutation();
                    if (salutation != null) {
                        data1.put(header[1], salutation.getId());
                    } else {
                        data1.put(header[1], "");
                    }
                    data1.put(header[2], CommonUtil.getOptionLabel(salutation));
                    data1.put(header[3],
                            CommonUtil.fromNullToEmpty(contact.getFirst_name()));
                    data1.put(header[4],
                            CommonUtil.fromNullToEmpty(contact.getLast_name()));
                    data1.put(header[5],
                            CommonUtil.fromNullToEmpty(contact.getEmail()));
                    data1.put(header[6], CommonUtil.fromNullToEmpty(contact
                            .getOffice_phone()));
                    data1.put(header[7],
                            CommonUtil.fromNullToEmpty(contact.getTitle()));
                    data1.put(header[8],
                            CommonUtil.fromNullToEmpty(contact.getMobile()));
                    data1.put(header[9],
                            CommonUtil.fromNullToEmpty(contact.getSkype_id()));
                    data1.put(header[10],
                            CommonUtil.fromNullToEmpty(contact.getDepartment()));
                    data1.put(header[11],
                            CommonUtil.fromNullToEmpty(contact.getFax()));
                    if (contact.getAccount() != null) {
                        data1.put(header[12], contact.getAccount().getId());
                        data1.put(header[13], contact.getAccount().getName());
                    } else {
                        data1.put(header[12], "");
                        data1.put(header[13], "");
                    }
                    data1.put(header[14],
                            CommonUtil.fromNullToEmpty(contact.getWebsite()));
                    data1.put(header[15], CommonUtil.fromNullToEmpty(contact
                            .getPrimary_street()));
                    data1.put(header[16], CommonUtil.fromNullToEmpty(contact
                            .getPrimary_city()));
                    data1.put(header[17], CommonUtil.fromNullToEmpty(contact
                            .getPrimary_state()));
                    data1.put(header[18], CommonUtil.fromNullToEmpty(contact
                            .getPrimary_postal_code()));
                    data1.put(header[19], CommonUtil.fromNullToEmpty(contact
                            .getPrimary_country()));
                    data1.put(header[20], CommonUtil.fromNullToEmpty(contact
                            .getOther_street()));
                    data1.put(header[21],
                            CommonUtil.fromNullToEmpty(contact.getOther_city()));
                    data1.put(header[22], CommonUtil.fromNullToEmpty(contact
                            .getOther_state()));
                    data1.put(header[23], CommonUtil.fromNullToEmpty(contact
                            .getOther_postal_code()));
                    data1.put(header[24], CommonUtil.fromNullToEmpty(contact
                            .getOther_country()));
                    data1.put(header[25],
                            CommonUtil.fromNullToEmpty(contact.getOrigo()));
                    data1.put(header[26], contact.getHeight());
                    data1.put(header[27], contact.getWeight());
                    data1.put(header[28], CommonUtil.fromNullToEmpty(contact
                            .getRelationship()));
                    data1.put(header[29],
                            CommonUtil.fromNullToEmpty(contact.getCharacter()));
                    data1.put(header[30],
                            CommonUtil.fromNullToEmpty(contact.getInterest()));
                    data1.put(header[31],
                            CommonUtil.fromNullToEmpty(contact.getTaboo()));
                    Religious religious = contact.getReligious();
                    if (religious != null) {
                        data1.put(header[32], religious.getId());
                    } else {
                        data1.put(header[32], "");
                    }
                    data1.put(header[33], CommonUtil.getOptionLabel(religious));
                    data1.put(header[34],
                            CommonUtil.fromNullToEmpty(contact.getHabit()));
                    data1.put(header[35],
                            CommonUtil.fromNullToEmpty(contact.getDiet()));
                    data1.put(header[36],
                            CommonUtil.fromNullToEmpty(contact.getNotes()));
                    if (contact.getReport_to() != null) {
                        data1.put(header[37], contact.getReport_to().getId());
                        data1.put(header[38], contact.getReport_to().getName());
                    } else {
                        data1.put(header[37], "");
                        data1.put(header[38], "");
                    }
                    data1.put(header[39], contact.isNot_call());
                    LeadSource leadSource = contact.getLeadSource();
                    if (leadSource != null) {
                        data1.put(header[40], leadSource.getId());
                    } else {
                        data1.put(header[40], "");
                    }
                    data1.put(header[41], CommonUtil.getOptionLabel(leadSource));
                    if (contact.getCampaign() != null) {
                        data1.put(header[42], contact.getCampaign().getId());
                        data1.put(header[43], contact.getCampaign().getName());
                    } else {
                        data1.put(header[42], "");
                        data1.put(header[43], "");
                    }
                    if (contact.getAssigned_to() != null) {
                        data1.put(header[44], contact.getAssigned_to().getId());
                        data1.put(header[45], contact.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[44], "");
                        data1.put(header[45], "");
                    }
View Full Code Here

            createChangeLog(changeLogs, entityName, recordID,
                    "entity.related_record.label", oldRelatedRecord,
                    newRelatedRecord, loginUser);

            String oldContactName = "";
            Contact oldContact = originalTask.getContact();
            if (oldContact != null) {
                oldContactName = CommonUtil.fromNullToEmpty(oldContact
                        .getName());
            }
            String newContactName = "";
            Contact newContact = task.getContact();
            if (newContact != null) {
                newContactName = CommonUtil.fromNullToEmpty(newContact
                        .getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.contact.label", oldContactName, newContactName,
                    loginUser);
View Full Code Here

            }
            TaskPriority priority = task.getPriority();
            if (priority != null) {
                priorityID = priority.getId();
            }
            Contact contact = task.getContact();
            if (contact != null) {
                contactID = contact.getId();
                contactText = contact.getName();
            }
            User assignedTo = task.getAssigned_to();
            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
View Full Code Here

        if (priorityID != null) {
            priority = taskPriorityService.getEntityById(TaskPriority.class,
                    priorityID);
        }
        task.setPriority(priority);
        Contact contact = null;
        if (contactID != null) {
            contact = contactService.getEntityById(Contact.class, contactID);
        }
        task.setContact(contact);
        User assignedTo = null;
View Full Code Here

     * Selects the entities
     *
     * @return the SUCCESS result
     */
    public String select() throws ServiceException {
        Contact contact = null;
        Opportunity opportunity = null;
        TargetList targetList = null;
        Call call = null;
        Meeting meeting = null;
        Set<Lead> leads = null;

        if ("Contact".equals(this.getRelationKey())) {
            contact = contactService.getEntityById(Contact.class,
                    Integer.valueOf(this.getRelationValue()));
            leads = contact.getLeads();
        } else if ("Opportunity".equals(this.getRelationKey())) {
            opportunity = opportunityService.getEntityById(Opportunity.class,
                    Integer.valueOf(this.getRelationValue()));
            leads = opportunity.getLeads();
        } else if ("TargetList".equals(this.getRelationKey())) {
View Full Code Here

     * Unselects the entities
     *
     * @return the SUCCESS result
     */
    public String unselect() throws ServiceException {
        Contact contact = null;
        Opportunity opportunity = null;
        TargetList targetList = null;
        Call call = null;
        Meeting meeting = null;
        Set<Lead> leads = null;
        if ("Contact".equals(this.getRelationKey())) {
            contact = contactService.getEntityById(Contact.class,
                    Integer.valueOf(this.getRelationValue()));
            leads = contact.getLeads();
        } else if ("Opportunity".equals(this.getRelationKey())) {
            opportunity = opportunityService.getEntityById(Opportunity.class,
                    Integer.valueOf(this.getRelationValue()));
            leads = opportunity.getLeads();
        } else if ("TargetList".equals(this.getRelationKey())) {
View Full Code Here

            account.setAssigned_to(lead.getAssigned_to());
            account.setOwner(lead.getOwner());
            this.getAccountService().makePersistent(account);
        }
        if (contactCheck) {
            Contact contact = new Contact();
            contact.setSalutation(lead.getSalutation());
            contact.setFirst_name(lead.getFirst_name());
            contact.setLast_name(lead.getLast_name());
            contact.setOffice_phone(lead.getOffice_phone());
            contact.setTitle(lead.getTitle());
            contact.setMobile(lead.getMobile());
            contact.setDepartment(lead.getDepartment());
            contact.setFax(lead.getFax());
            contact.setAccount(lead.getAccount());
            contact.setPrimary_street(lead.getPrimary_street());
            contact.setPrimary_city(lead.getPrimary_city());
            contact.setPrimary_country(lead.getPrimary_country());
            contact.setPrimary_postal_code(lead.getPrimary_postal_code());
            contact.setPrimary_state(lead.getPrimary_state());
            contact.setOther_street(lead.getOther_street());
            contact.setOther_city(lead.getOther_city());
            contact.setOther_country(lead.getOther_country());
            contact.setOther_postal_code(lead.getOther_postal_code());
            contact.setOther_state(lead.getOther_state());
            contact.setEmail(lead.getEmail());
            contact.setNotes(lead.getNotes());
            contact.setCampaign(lead.getCampaign());
            contact.setNot_call(lead.isNot_call());
            contact.setAssigned_to(lead.getAssigned_to());
            contact.setOwner(lead.getOwner());
            this.getContactService().makePersistent(contact);
        }
        if (opportunityCheck) {
            Opportunity opportunity = new Opportunity();
            String firstName = CommonUtil.fromNullToEmpty(lead.getFirst_name());
View Full Code Here

TOP

Related Classes of com.gcrm.domain.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.