Package com.gcrm.domain

Examples of com.gcrm.domain.Campaign


                Map<String, String> row = new HashMap<String, String>();
                for (int i = 0; i < line.size(); i++) {
                    row.put(header[i], line.get(i));
                }

                Campaign campaign = new Campaign();
                try {
                    String id = row.get(getText("entity.id.label"));
                    if (!CommonUtil.isNullOrEmpty(id)) {
                        campaign.setId(Integer.parseInt(id));
                        UserUtil.permissionCheck("update_campaign");
                    } else {
                        UserUtil.permissionCheck("create_campaign");
                    }
                    campaign.setName(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.name.label"))));
                    String statusID = row
                            .get(getText("entity.status_id.label"));
                    if (CommonUtil.isNullOrEmpty(statusID)) {
                        campaign.setStatus(null);
                    } else {
                        CampaignStatus status = campaignStatusService
                                .getEntityById(CampaignStatus.class,
                                        Integer.parseInt(statusID));
                        campaign.setStatus(status);
                    }
                    String typeID = row.get(getText("entity.type_id.label"));
                    if (CommonUtil.isNullOrEmpty(typeID)) {
                        campaign.setType(null);
                    } else {
                        CampaignType type = campaignTypeService.getEntityById(
                                CampaignType.class, Integer.parseInt(typeID));
                        campaign.setType(type);
                    }
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_EDIT_FORMAT);
                    String startDateS = row
                            .get(getText("entity.start_date.label"));
                    if (startDateS != null) {
                        Date startDate = dateFormat.parse(startDateS);
                        campaign.setStart_date(startDate);
                    } else {
                        campaign.setStart_date(null);
                    }
                    String endDateS = row.get(getText("entity.end_date.label"));
                    if (startDateS != null) {
                        Date endDate = dateFormat.parse(endDateS);
                        campaign.setEnd_date(endDate);
                    } else {
                        campaign.setEnd_date(null);
                    }
                    String currencyID = row
                            .get(getText("entity.currency_id.label"));
                    if (CommonUtil.isNullOrEmpty(currencyID)) {
                        campaign.setCurrency(null);
                    } else {
                        Currency currency = currencyService.getEntityById(
                                Currency.class, Integer.parseInt(currencyID));
                        campaign.setCurrency(currency);
                    }
                    String impressions = row
                            .get(getText("campaign.impressions.label"));
                    if (CommonUtil.isNullOrEmpty(impressions)) {
                        campaign.setImpressions(0);
                    } else {
                        campaign.setImpressions(Double.parseDouble(impressions));
                    }
                    String budget = row.get(getText("campaign.budget.label"));
                    if (CommonUtil.isNullOrEmpty(budget)) {
                        campaign.setBudget(0);
                    } else {
                        campaign.setBudget(Double.parseDouble(budget));
                    }
                    String expectedCost = row
                            .get(getText("campaign.expected_cost.label"));
                    if (CommonUtil.isNullOrEmpty(expectedCost)) {
                        campaign.setExpected_cost(0);
                    } else {
                        campaign.setExpected_cost(Double
                                .parseDouble(expectedCost));
                    }
                    String actualCost = row
                            .get(getText("campaign.actual_cost.label "));
                    if (CommonUtil.isNullOrEmpty(actualCost)) {
                        campaign.setActual_cost(0);
                    } else {
                        campaign.setActual_cost(Double.parseDouble(actualCost));
                    }
                    String expectedRevenue = row
                            .get(getText("campaign.expected_revenue.label"));
                    if (CommonUtil.isNullOrEmpty(expectedRevenue)) {
                        campaign.setExpected_revenue(0);
                    } else {
                        campaign.setExpected_revenue(Double
                                .parseDouble(expectedRevenue));
                    }
                    String expectedRespone = row
                            .get(getText("campaign.expected_respone.label"));
                    if (CommonUtil.isNullOrEmpty(expectedRespone)) {
                        campaign.setExpected_respone(0);
                    } else {
                        campaign.setExpected_respone(Double
                                .parseDouble(expectedRespone));
                    }

                    campaign.setObjective(CommonUtil.fromNullToEmpty(row
                            .get(getText("campaign.objective.label"))));
                    campaign.setNotes(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.notes.label"))));
                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
                    if (CommonUtil.isNullOrEmpty(assignedToID)) {
                        campaign.setAssigned_to(null);
                    } else {
                        User assignedTo = userService.getEntityById(User.class,
                                Integer.parseInt(assignedToID));
                        campaign.setAssigned_to(assignedTo);
                    }
                    baseService.makePersistent(campaign);
                    successfulNum++;
                } catch (Exception e) {
                    failedNum++;
                    failedMsg.put(campaign.getName(), e.getMessage());
                }

            }

            this.setFailedMsg(failedMsg);
View Full Code Here


    public String save() throws Exception {
        TargetList originalTargetList = saveEntity();
        final Collection<ChangeLog> changeLogs = changeLog(originalTargetList,
                targetList);
        if ("Campaign".equals(this.getRelationKey())) {
            Campaign campaign = campaignService.getEntityById(Campaign.class,
                    Integer.valueOf(this.getRelationValue()));
            Set<Campaign> campaigns = targetList.getCampaigns();
            if (campaigns == null) {
                campaigns = new HashSet<Campaign>();
            }
View Full Code Here

            Salutation salutation = contact.getSalutation();
            if (salutation != null) {
                salutationID = salutation.getId();
            }

            Campaign campaign = contact.getCampaign();
            if (campaign != null) {
                campaignID = campaign.getId();
                campaignText = campaign.getName();
            }
            User assignedTo = contact.getAssigned_to();
            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
View Full Code Here

        if (this.getOwnerID() != null) {
            owner = userService.getEntityById(User.class, this.getOwnerID());
        }
        contact.setOwner(owner);

        Campaign campaign = null;
        if (campaignID != null) {
            campaign = campaignService
                    .getEntityById(Campaign.class, campaignID);
        }
        contact.setCampaign(campaign);
View Full Code Here

            createChangeLog(changeLogs, entityName, recordID,
                    "menu.leadSource.title", oldLeadSource, newLeadSource,
                    loginUser);

            String oldCampaignName = "";
            Campaign oldCampaign = originalContact.getCampaign();
            if (oldCampaign != null) {
                oldCampaignName = oldCampaign.getName();
            }
            String newCampaignName = "";
            Campaign newCampaign = contact.getCampaign();
            if (newCampaign != null) {
                newCampaignName = newCampaign.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.campaign.label",
                    CommonUtil.fromNullToEmpty(oldCampaignName),
                    CommonUtil.fromNullToEmpty(newCampaignName), loginUser);
View Full Code Here

            Salutation salutation = lead.getSalutation();
            if (salutation != null) {
                salutationID = salutation.getId();
            }

            Campaign campaign = lead.getCampaign();
            if (campaign != null) {
                campaignID = campaign.getId();
                campaignText = campaign.getName();
            }
            User assignedTo = lead.getAssigned_to();
            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
View Full Code Here

        if (this.getOwnerID() != null) {
            owner = userService.getEntityById(User.class, this.getOwnerID());
        }
        lead.setOwner(owner);

        Campaign campaign = null;
        if (campaignID != null) {
            campaign = campaignService
                    .getEntityById(Campaign.class, campaignID);
        }
        lead.setCampaign(campaign);
View Full Code Here

            createChangeLog(changeLogs, entityName, recordID,
                    "entity.not_call.label", String.valueOf(oldNotCall),
                    String.valueOf(newNotCall), loginUser);

            String oldCampaignName = "";
            Campaign oldCampaign = originalLead.getCampaign();
            if (oldCampaign != null) {
                oldCampaignName = oldCampaign.getName();
            }
            String newCampaignName = "";
            Campaign newCampaign = lead.getCampaign();
            if (newCampaign != null) {
                newCampaignName = newCampaign.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.campaign.label",
                    CommonUtil.fromNullToEmpty(oldCampaignName),
                    CommonUtil.fromNullToEmpty(newCampaignName), loginUser);
View Full Code Here

                    String campaignID = row
                            .get(getText("entity.campaign_id.label"));
                    if (CommonUtil.isNullOrEmpty(campaignID)) {
                        contact.setCampaign(null);
                    } else {
                        Campaign campaign = campaignService.getEntityById(
                                Campaign.class, Integer.parseInt(campaignID));
                        contact.setCampaign(campaign);
                    }
                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
View Full Code Here

                    String campaignID = row
                            .get(getText("entity.campaign_id.label"));
                    if (CommonUtil.isNullOrEmpty(campaignID)) {
                        lead.setCampaign(null);
                    } else {
                        Campaign campaign = campaignService.getEntityById(
                                Campaign.class, Integer.parseInt(campaignID));
                        lead.setCampaign(campaign);
                    }
                    String doNotCall = row
                            .get(getText("entity.not_call.label"));
View Full Code Here

TOP

Related Classes of com.gcrm.domain.Campaign

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.