Package com.gcrm.domain

Examples of com.gcrm.domain.User


        Map<String, String> fieldTypeMap = new HashMap<String, String>();
        fieldTypeMap.put("due_date", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("created_on", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("updated_on", Constant.DATA_TYPE_DATETIME);

        User loginUser = UserUtil.getLoginUser();
        SearchCondition searchCondition = getSearchCondition(fieldTypeMap,
                loginUser.getScope_task(), loginUser);
        if (!CommonUtil.isNullOrEmpty(moreFilterKey)) {
            String condition = searchCondition.getCondition();
            condition += " and " + moreFilterKey + "=" + moreFilterValue;
            searchCondition.setCondition(condition);
        }
View Full Code Here


                    Constant.DATE_TIME_FORMAT);
            if (dueDate != null) {
                dueDateS = dateFormat.format(dueDate);
            }

            User user = instance.getAssigned_to();
            if (user != null) {
                assignedTo = 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());
                }
                Date createdOn = instance.getCreated_on();
                String createdOnName = "";
                if (createdOn != null) {
View Full Code Here

                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
                    if (CommonUtil.isNullOrEmpty(assignedToID)) {
                        task.setAssigned_to(null);
                    } else {
                        User assignedTo = userService.getEntityById(User.class,
                                Integer.parseInt(assignedToID));
                        task.setAssigned_to(assignedTo);
                    }
                    baseService.makePersistent(task);
                    successfulNum++;
View Full Code Here

        Map<String, String> fieldTypeMap = new HashMap<String, String>();
        fieldTypeMap.put("created_on", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("updated_on", Constant.DATA_TYPE_DATETIME);

        User loginUser = UserUtil.getLoginUser();
        SearchCondition searchCondition = getSearchCondition(fieldTypeMap,
                loginUser.getScope_opportunity(), loginUser);
        SearchResult<Opportunity> result = baseService.getPaginationObjects(
                CLAZZ, searchCondition);
        Iterator<Opportunity> opportunitys = result.getResult().iterator();
        long totalRecords = result.getTotalRecords();
        getListJson(opportunitys, totalRecords, searchCondition, true);
View Full Code Here

            }
            SalesStage salesStage = instance.getSales_stage();
            stageName = CommonUtil.getOptionLabel(salesStage);
            String amount = CommonUtil.fromNullToEmpty(instance
                    .getOpportunity_amount());
            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 dateFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
View Full Code Here

                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
                    if (CommonUtil.isNullOrEmpty(assignedToID)) {
                        opportunity.setAssigned_to(null);
                    } else {
                        User assignedTo = userService.getEntityById(User.class,
                                Integer.parseInt(assignedToID));
                        opportunity.setAssigned_to(assignedTo);
                    }
                    baseService.makePersistent(opportunity);
                    successfulNum++;
View Full Code Here

        if (originalCampaign != null) {
            ActionContext context = ActionContext.getContext();
            Map<String, Object> session = context.getSession();
            String entityName = Campaign.class.getSimpleName();
            Integer recordID = campaign.getId();
            User loginUser = (User) session
                    .get(AuthenticationSuccessListener.LOGIN_USER);
            changeLogs = new ArrayList<ChangeLog>();

            String oldName = CommonUtil.fromNullToEmpty(originalCampaign
                    .getName());
            String newName = CommonUtil.fromNullToEmpty(campaign.getName());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.name.label", oldName, newName, loginUser);

            String oldStatus = getOptionValue(originalCampaign.getStatus());
            String newStatus = getOptionValue(campaign.getStatus());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.status.label", oldStatus, newStatus, loginUser);

            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_EDIT_FORMAT);
            String oldStartDateValue = "";
            Date oldStartDate = originalCampaign.getStart_date();
            if (oldStartDate != null) {
                oldStartDateValue = dateFormat.format(oldStartDate);
            }
            String newStartDateValue = "";
            Date newStartDate = campaign.getStart_date();
            if (newStartDate != null) {
                newStartDateValue = dateFormat.format(newStartDate);
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.start_date.label", oldStartDateValue,
                    newStartDateValue, loginUser);

            String oldEndDateValue = "";
            Date oldEndDate = originalCampaign.getEnd_date();
            if (oldEndDate != null) {
                oldEndDateValue = dateFormat.format(oldEndDate);
            }
            String newEndDateValue = "";
            Date newEndDate = campaign.getEnd_date();
            if (newEndDate != null) {
                newEndDateValue = dateFormat.format(newEndDate);
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.end_date.label", oldEndDateValue, newEndDateValue,
                    loginUser);

            String oldCampaignType = getOptionValue(originalCampaign.getType());
            String newCampaignType = getOptionValue(campaign.getType());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.type.label", oldCampaignType, newCampaignType,
                    loginUser);

            String oldCurrencyName = "";
            Currency oldCurrency = originalCampaign.getCurrency();
            if (oldCurrency != null) {
                oldCurrencyName = CommonUtil.fromNullToEmpty(oldCurrency
                        .getName());
            }
            String newCurrencyName = "";
            Currency newCurrency = campaign.getCurrency();
            if (newCurrency != null) {
                newCurrencyName = CommonUtil.fromNullToEmpty(newCurrency
                        .getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.currency.label", oldCurrencyName, newCurrencyName,
                    loginUser);

            String oldImpressions = String.valueOf(originalCampaign
                    .getImpressions());
            String newImpressions = String.valueOf(campaign.getImpressions());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.impressions.label", oldImpressions,
                    newImpressions, loginUser);

            String oldBudget = String.valueOf(originalCampaign.getBudget());
            String newBudget = String.valueOf(campaign.getBudget());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.budget.label", oldBudget, newBudget, loginUser);

            String oldExpectedCost = String.valueOf(originalCampaign
                    .getExpected_cost());
            String newExpectedCost = String
                    .valueOf(campaign.getExpected_cost());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.expected_cost.label", oldExpectedCost,
                    newExpectedCost, loginUser);

            String oldActualCost = String.valueOf(originalCampaign
                    .getActual_cost());
            String newActualCost = String.valueOf(campaign.getActual_cost());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.actual_cost.label", oldActualCost, newActualCost,
                    loginUser);

            String oldExpectedRevenue = String.valueOf(originalCampaign
                    .getExpected_revenue());
            String newExpectedRevenue = String.valueOf(campaign
                    .getExpected_revenue());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.expected_revenue.label", oldExpectedRevenue,
                    newExpectedRevenue, loginUser);

            String oldExpectedRespone = String.valueOf(originalCampaign
                    .getExpected_respone());
            String newExpectedRespone = String.valueOf(campaign
                    .getExpected_respone());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.expected_respone.label", oldExpectedRespone,
                    newExpectedRespone, loginUser);

            String oldObjective = CommonUtil.fromNullToEmpty(originalCampaign
                    .getObjective());
            String newObjective = CommonUtil.fromNullToEmpty(campaign
                    .getObjective());
            createChangeLog(changeLogs, entityName, recordID,
                    "campaign.objective.label", oldObjective, newObjective,
                    loginUser);

            String oldNotes = CommonUtil.fromNullToEmpty(originalCampaign
                    .getNotes());
            String newNotes = CommonUtil.fromNullToEmpty(campaign.getNotes());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.notes.label", oldNotes, newNotes, loginUser);

            String oldAssignedToName = "";
            User oldAssignedTo = originalCampaign.getAssigned_to();
            if (oldAssignedTo != null) {
                oldAssignedToName = oldAssignedTo.getName();
            }
            String newAssignedToName = "";
            User newAssignedTo = campaign.getAssigned_to();
            if (newAssignedTo != null) {
                newAssignedToName = newAssignedTo.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.assigned_to.label",
                    CommonUtil.fromNullToEmpty(oldAssignedToName),
                    CommonUtil.fromNullToEmpty(newAssignedToName), loginUser);
View Full Code Here

            endDate = dateFormat.format(end_date);
        }
        this.setId(campaign.getId());
        ActionContext context = ActionContext.getContext();
        Map<String, Object> session = context.getSession();
        User loginUser = (User) session
                .get(AuthenticationSuccessListener.LOGIN_USER);
        from = loginUser.getEmail();
        if (from == null) {
            from = "";
        }
        StringBuilder targetEmails = new StringBuilder("");
        Set<TargetList> targetLists = campaign.getTargetLists();
View Full Code Here

            }
            Currency currency = campaign.getCurrency();
            if (currency != null) {
                currencyID = currency.getId();
            }
            User assignedTo = campaign.getAssigned_to();
            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
            }
            Date start_date = campaign.getStart_date();
            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    Constant.DATE_EDIT_FORMAT);
            if (start_date != null) {
View Full Code Here

        saveEntity();
        String[] fieldNames = this.massUpdate;
        if (fieldNames != null) {
            String[] selectIDArray = this.seleteIDs.split(",");
            Collection<Campaign> campaigns = new ArrayList<Campaign>();
            User loginUser = this.getLoginUser();
            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(
View Full Code Here

TOP

Related Classes of com.gcrm.domain.User

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.