Package com.gcrm.domain

Examples of com.gcrm.domain.Campaign


            createChangeLog(changeLogs, entityName, recordID,
                    "opportunity.probability.label", oldProbability,
                    newProbability, loginUser);

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


            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
            }

            Campaign campaign = opportunity.getCampaign();
            if (campaign != null) {
                campaignID = campaign.getId();
                campaignText = campaign.getName();
            }

            Date expect_close_date = opportunity.getExpect_close_date();
            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_EDIT_FORMAT);
View Full Code Here

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

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

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

     * Saves the entity.
     *
     * @return the SUCCESS result
     */
    public String save() throws Exception {
        Campaign originalCampaign = saveEntity();
        final Collection<ChangeLog> changeLogs = changeLog(originalCampaign,
                campaign);
        campaign = getbaseService().makePersistent(campaign);
        this.setId(campaign.getId());
        this.setSaveFlag("true");
View Full Code Here

            User user = userService
                    .getEntityById(User.class, loginUser.getId());
            Collection<ChangeLog> allChangeLogs = new ArrayList<ChangeLog>();
            for (String IDString : selectIDArray) {
                int id = Integer.parseInt(IDString);
                Campaign campaignInstance = this.baseService.getEntityById(
                        Campaign.class, id);
                Campaign originalCampaign = campaignInstance.clone();
                for (String fieldName : fieldNames) {
                    Object value = BeanUtil.getFieldValue(campaign, fieldName);
                    BeanUtil.setFieldValue(campaignInstance, fieldName, value);
                }
                campaignInstance.setUpdated_by(user);
View Full Code Here

     *
     * @return original campaign record
     * @throws ParseException
     */
    private Campaign saveEntity() throws Exception {
        Campaign originalCampaign = null;
        if (campaign.getId() == null) {
            UserUtil.permissionCheck("create_campaign");
        } else {
            UserUtil.permissionCheck("update_campaign");
            originalCampaign = baseService.getEntityById(Campaign.class,
                    campaign.getId());
            campaign.setTargetLists(originalCampaign.getTargetLists());
            campaign.setCreated_on(originalCampaign.getCreated_on());
            campaign.setCreated_by(originalCampaign.getCreated_by());
        }
        CampaignStatus status = null;
        if (statusID != null) {
            status = campaignStatusService.getEntityById(CampaignStatus.class,
                    statusID);
View Full Code Here

        String statusName = null;
        String typeName = null;
        String assignedTo = null;
        while (campaigns.hasNext()) {
            Campaign instance = campaigns.next();
            int id = instance.getId();
            String name = CommonUtil.fromNullToEmpty(instance.getName());
            CampaignStatus status = instance.getStatus();
            statusName = CommonUtil.getOptionLabel(status);
            CampaignType type = instance.getType();
            typeName = CommonUtil.getOptionLabel(type);

            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_FORMAT);
            String startDateString = "";
            Date startDate = instance.getStart_date();
            if (startDate != null) {
                startDateString = dateFormat.format(startDate);
            }
            String endDateString = "";
            Date endDate = instance.getEnd_date();
            if (endDate != null) {
                endDateString = dateFormat.format(endDate);
            }
            User user = instance.getAssigned_to();
            if (user != null) {
                assignedTo = CommonUtil.fromNullToEmpty(user.getName());
            } else {
                assignedTo = "";
            }
            if (isList) {
                User createdBy = instance.getCreated_by();
                String createdByName = "";
                if (createdBy != null) {
                    createdByName = CommonUtil.fromNullToEmpty(createdBy
                            .getName());
                }
                User updatedBy = instance.getUpdated_by();
                String updatedByName = "";
                if (updatedBy != null) {
                    updatedByName = CommonUtil.fromNullToEmpty(updatedBy
                            .getName());
                }
                SimpleDateFormat dateTimeFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
                String createdOnString = "";
                if (createdOn != null) {
                    createdOnString = dateTimeFormat.format(createdOn);
                }
                Date updatedOn = instance.getUpdated_on();
                String updatedOnString = "";
                if (updatedOn != null) {
                    updatedOnString = dateTimeFormat.format(updatedOn);
                }
View Full Code Here

        UserUtil.permissionCheck("create_campaign");
        if (this.getSeleteIDs() != null) {
            String[] ids = seleteIDs.split(",");
            for (int i = 0; i < ids.length; i++) {
                String copyid = ids[i];
                Campaign oriRecord = baseService.getEntityById(Campaign.class,
                        Integer.valueOf(copyid));
                Campaign 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];
                    Campaign campaign = baseService.getEntityById(
                            Campaign.class, Integer.parseInt(id));
                    final HashMap<String, ? super Object> data1 = new HashMap<String, Object>();
                    data1.put(header[0], campaign.getId());
                    data1.put(header[1],
                            CommonUtil.fromNullToEmpty(campaign.getName()));
                    CampaignStatus campaignStatus = campaign.getStatus();
                    if (campaignStatus != null) {
                        data1.put(header[2], campaignStatus.getId());
                    } else {
                        data1.put(header[2], "");
                    }
                    data1.put(header[3],
                            CommonUtil.getOptionLabel(campaignStatus));
                    CampaignType campaignType = campaign.getType();
                    if (campaignType != null) {
                        data1.put(header[4], campaignType.getId());
                    } else {
                        data1.put(header[4], "");
                    }
                    data1.put(header[5],
                            CommonUtil.getOptionLabel(campaignType));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_EDIT_FORMAT);
                    Date startDate = campaign.getStart_date();
                    if (startDate != null) {
                        data1.put(header[6], dateFormat.format(startDate));
                    } else {
                        data1.put(header[6], "");
                    }
                    Date endDate = campaign.getEnd_date();
                    if (endDate != null) {
                        data1.put(header[7], dateFormat.format(endDate));
                    } else {
                        data1.put(header[7], "");
                    }
                    if (campaign.getCurrency() != null) {
                        data1.put(header[8], campaign.getCurrency().getId());
                        data1.put(header[9], campaign.getCurrency().getName());
                    } else {
                        data1.put(header[8], "");
                        data1.put(header[9], "");
                    }
                    data1.put(header[10], campaign.getImpressions());
                    data1.put(header[11], campaign.getBudget());
                    data1.put(header[12], campaign.getExpected_cost());
                    data1.put(header[13], campaign.getActual_cost());
                    data1.put(header[14], campaign.getExpected_revenue());
                    data1.put(header[15], campaign.getExpected_respone());
                    data1.put(header[16],
                            CommonUtil.fromNullToEmpty(campaign.getObjective()));
                    data1.put(header[17],
                            CommonUtil.fromNullToEmpty(campaign.getNotes()));
                    if (campaign.getAssigned_to() != null) {
                        data1.put(header[18], campaign.getAssigned_to().getId());
                        data1.put(header[19], campaign.getAssigned_to()
                                .getName());
                    } else {
                        data1.put(header[18], "");
                        data1.put(header[19], "");
                    }
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.