Package com.gcrm.domain

Examples of com.gcrm.domain.Account


            document.setFileName(this.uploadFileName);
            attachment.setContent(input);
        }

        if ("Account".equals(this.getRelationKey())) {
            Account account = accountService.getEntityById(Account.class,
                    Integer.valueOf(this.getRelationValue()));
            Set<Account> accounts = document.getAccounts();
            if (accounts == null) {
                accounts = new HashSet<Account>();
            }
View Full Code Here


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

            String oldAccountName = "";
            Account oldAccount = originalOpportunity.getAccount();
            if (oldAccount != null) {
                oldAccountName = CommonUtil.fromNullToEmpty(oldAccount
                        .getName());
            }
            String newAccountName = "";
            Account newAccount = opportunity.getAccount();
            if (newAccount != null) {
                newAccountName = CommonUtil.fromNullToEmpty(newAccount
                        .getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.account.label", oldAccountName, newAccountName,
                    loginUser);
View Full Code Here

    public String get() throws Exception {
        if (this.getId() != null) {
            opportunity = baseService.getEntityById(Opportunity.class,
                    this.getId());

            Account account = opportunity.getAccount();
            if (account != null) {
                accountID = account.getId();
                accountText = account.getName();
            }
            Currency currency = opportunity.getCurrency();
            if (currency != null) {
                currencyID = currency.getId();
            }
View Full Code Here

            opportunity.setDocuments(originalOpportunity.getDocuments());
            opportunity.setCreated_on(originalOpportunity.getCreated_on());
            opportunity.setCreated_by(originalOpportunity.getCreated_by());
        }

        Account account = null;
        if (accountID != null) {
            account = accountService.getEntityById(Account.class, accountID);
        }
        opportunity.setAccount(account);
View Full Code Here

        String stageName = null;
        while (opportunitys.hasNext()) {
            Opportunity instance = opportunitys.next();
            int id = instance.getId();
            String name = CommonUtil.fromNullToEmpty(instance.getName());
            Account account = instance.getAccount();
            if (account != null) {
                accountName = CommonUtil.fromNullToEmpty(account.getName());
            } else {
                accountName = "";
            }
            SalesStage salesStage = instance.getSales_stage();
            stageName = CommonUtil.getOptionLabel(salesStage);
View Full Code Here

                    String accountID = row
                            .get(getText("entity.account_id.label"));
                    if (CommonUtil.isNullOrEmpty(accountID)) {
                        opportunity.setAccount(null);
                    } else {
                        Account account = accountService.getEntityById(
                                Account.class, Integer.parseInt(accountID));
                        opportunity.setAccount(account);
                    }
                    String currencyID = row
                            .get(getText("entity.currency_id.label"));
View Full Code Here

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

                Account account = new Account();
                try {
                    String id = row.get(getText("entity.id.label"));
                    if (!CommonUtil.isNullOrEmpty(id)) {
                        account.setId(Integer.parseInt(id));
                        UserUtil.permissionCheck("update_account");
                    } else {
                        UserUtil.permissionCheck("create_account");
                    }
                    account.setName(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.name.label"))));
                    String typeID = row.get(getText("account.type_id.label"));
                    if (CommonUtil.isNullOrEmpty(typeID)) {
                        account.setAccount_type(null);
                    } else {
                        AccountType accountType = accountTypeService
                                .getEntityById(AccountType.class,
                                        Integer.parseInt(typeID));
                        account.setAccount_type(accountType);
                    }
                    String accountLevelID = row
                            .get(getText("entity.account_level_id.label"));
                    if (CommonUtil.isNullOrEmpty(accountLevelID)) {
                        account.setAccount_type(null);
                    } else {
                        AccountLevel accountLevel = accountLevelService
                                .getEntityById(AccountLevel.class,
                                        Integer.parseInt(accountLevelID));
                        account.setAccount_level(accountLevel);
                    }
                    String currencyID = row
                            .get(getText("entity.currency_id.label"));
                    if (CommonUtil.isNullOrEmpty(currencyID)) {
                        account.setCurrency(null);
                    } else {
                        Currency currency = currencyService.getEntityById(
                                Currency.class, Integer.parseInt(currencyID));
                        account.setCurrency(currency);
                    }
                    String capitalID = row
                            .get(getText("entity.capital_id.label"));
                    if (CommonUtil.isNullOrEmpty(capitalID)) {
                        account.setCapital(null);
                    } else {
                        Capital capital = capitalService.getEntityById(
                                Capital.class, Integer.parseInt(capitalID));
                        account.setCapital(capital);
                    }
                    String annualRevenueID = row
                            .get(getText("entity.annual_revenue_id.label"));
                    if (CommonUtil.isNullOrEmpty(annualRevenueID)) {
                        account.setAnnual_revenue(null);
                    } else {
                        AnnualRevenue annualRevenue = annualRevenueService
                                .getEntityById(AnnualRevenue.class,
                                        Integer.parseInt(annualRevenueID));
                        account.setAnnual_revenue(annualRevenue);
                    }
                    String companySizeID = row
                            .get(getText("entity.company_size_id.label"));
                    if (CommonUtil.isNullOrEmpty(companySizeID)) {
                        account.setCompany_size(null);
                    } else {
                        CompanySize companySize = companySizeService
                                .getEntityById(CompanySize.class,
                                        Integer.parseInt(companySizeID));
                        account.setCompany_size(companySize);
                    }
                    String accountTypeID = row
                            .get(getText("entity.account_type_id.label"));
                    if (CommonUtil.isNullOrEmpty(accountTypeID)) {
                        account.setAccount_type(null);
                    } else {
                        AccountType accountType = accountTypeService
                                .getEntityById(AccountType.class,
                                        Integer.parseInt(accountTypeID));
                        account.setAccount_type(accountType);
                    }
                    String industryID = row
                            .get(getText("entity.industry_id.label"));
                    if (CommonUtil.isNullOrEmpty(industryID)) {
                        account.setIndustry(null);
                    } else {
                        Industry industry = industryService.getEntityById(
                                Industry.class, Integer.parseInt(industryID));
                        account.setIndustry(industry);
                    }
                    account.setEmail(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.email.label"))));
                    account.setOffice_phone(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.office_phone.label"))));
                    account.setWebsite(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.website.label"))));
                    account.setFax(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.fax.label"))));
                    account.setBill_street(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.billing_street.label"))));
                    account.setBill_city(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.billing_city.label"))));
                    account.setBill_state(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.billing_state.label"))));
                    account.setBill_postal_code(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.billing_postal_code.label"))));
                    account.setBill_country(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.billing_country.label"))));
                    account.setShip_street(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.shipping_street.label"))));
                    account.setShip_city(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.shipping_city.label"))));
                    account.setShip_state(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.shipping_state.label"))));
                    account.setShip_postal_code(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.shipping_postal_code.label"))));
                    account.setShip_country(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.shipping_country.label"))));
                    String accountNatureID = row
                            .get(getText("entity.account_nature_id.label"));
                    if (CommonUtil.isNullOrEmpty(accountNatureID)) {
                        account.setAccount_nature(null);
                    } else {
                        AccountNature accountNature = accountNatureService
                                .getEntityById(AccountNature.class,
                                        Integer.parseInt(accountNatureID));
                        account.setAccount_nature(accountNature);
                    }
                    account.setLegal_representative(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.legal_representative.label"))));
                    account.setBusiness_scope(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.business_scope.label"))));
                    SimpleDateFormat dateFormat = new SimpleDateFormat(
                            Constant.DATE_EDIT_FORMAT);
                    String createDateS = row
                            .get(getText("entity.create_date.label"));
                    if (createDateS != null) {
                        Date createDate = dateFormat.parse(createDateS);
                        account.setCreate_date(createDate);
                    } else {
                        account.setCreate_date(null);
                    }
                    account.setCredit(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.credit.label"))));
                    account.setMarket_position(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.market_position.label"))));
                    account.setDevelopment_potential(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.development_potential.label"))));
                    account.setOperational_characteristics(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.operational_characteristics.label"))));
                    account.setOperational_direction(CommonUtil.fromNullToEmpty(row
                            .get(getText("entity.operational_direction.label"))));
                    account.setSic_code(CommonUtil.fromNullToEmpty(row
                            .get(getText("account.sic_code.label"))));
                    account.setTicket_symbol(CommonUtil.fromNullToEmpty(row
                            .get(getText("account.ticket_symbol.label"))));
                    String managerID = row
                            .get(getText("account.manager_id.label"));
                    if (CommonUtil.isNullOrEmpty(managerID)) {
                        account.setManager(null);
                    } else {
                        Account manager = baseService.getEntityById(
                                Account.class, Integer.parseInt(managerID));
                        account.setManager(manager);
                    }
                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
View Full Code Here

     * Saves the entity.
     *
     * @return the SUCCESS result
     */
    public String save() throws Exception {
        final Account originalAccount = saveEntity();

        if ("TargetList".equals(this.getRelationKey())) {
            TargetList targetList = targetListService.getEntityById(
                    TargetList.class, Integer.valueOf(this.getRelationValue()));
            Set<TargetList> targetLists = account.getTargetLists();
View Full Code Here

                    .getEntityById(User.class, loginUser.getId());
            final List<Account> originalAccounts = new ArrayList<Account>();
            final List<Account> currentAccounts = new ArrayList<Account>();
            for (String IDString : selectIDArray) {
                int id = Integer.parseInt(IDString);
                Account accountInstance = this.baseService.getEntityById(
                        Account.class, id);
                Account originalAccount = accountInstance.clone();
                for (String fieldName : fieldNames) {
                    Object value = BeanUtil.getFieldValue(account, fieldName);
                    BeanUtil.setFieldValue(accountInstance, fieldName, value);
                }
                accountInstance.setUpdated_by(user);
View Full Code Here

     */
    private Collection<ChangeLog> genBAChangeLog(
            List<Account> originalAccounts, List<Account> currentAccounts,
            User loginUser) {
        Collection<ChangeLog> allChangeLogs = new ArrayList<ChangeLog>();
        Account originalAccount = null;
        Account currentAccount = null;
        for (int i = 0; i < originalAccounts.size(); i++) {
            originalAccount = originalAccounts.get(i);
            currentAccount = currentAccounts.get(i);
            Collection<ChangeLog> changeLogs = changeLog(originalAccount,
                    currentAccount, loginUser);
View Full Code Here

TOP

Related Classes of com.gcrm.domain.Account

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.