Package org.hoteia.qalingo.core.web.mvc.viewbean

Examples of org.hoteia.qalingo.core.web.mvc.viewbean.CompanyViewBean


     *
     */
    public CompanyViewBean buildViewBeanCompany(final RequestData requestData, final Company company) throws Exception {
        final Locale locale = requestData.getLocale();
       
        final CompanyViewBean companyViewBean = new CompanyViewBean();
        companyViewBean.setId(company.getId());
        companyViewBean.setCode(company.getCode());
        companyViewBean.setName(company.getName());
        companyViewBean.setDescription(company.getDescription());

        companyViewBean.setAddress1(company.getAddress1());
        companyViewBean.setAddress2(company.getAddress2());
        companyViewBean.setAddressAdditionalInformation(company.getAddressAdditionalInformation());
        companyViewBean.setPostalCode(company.getPostalCode());
        companyViewBean.setCity(company.getCity());
       
        String stateName = referentialDataService.getStateByLocale(company.getStateCode(), locale);
        companyViewBean.setStateCode(company.getStateCode());
        companyViewBean.setStateName(stateName);
       
        String areaName = referentialDataService.getAreaByLocale(company.getAreaCode(), locale);
        companyViewBean.setAreaCode(company.getAreaCode());
        companyViewBean.setAreaName(areaName);
       
        String countryName = referentialDataService.getCountryByLocale(company.getCountryCode(), locale);
        companyViewBean.setCountryCode(company.getCountryCode());
        companyViewBean.setCountryName(countryName);
       
        DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
        if (company.getDateCreate() != null) {
            companyViewBean.setDateCreate(dateFormat.format(company.getDateCreate()));
        } else {
            companyViewBean.setDateCreate(Constants.NOT_AVAILABLE);
        }
        if (company.getDateUpdate() != null) {
            companyViewBean.setDateUpdate(dateFormat.format(company.getDateUpdate()));
        } else {
            companyViewBean.setDateUpdate(Constants.NOT_AVAILABLE);
        }

        companyViewBean.setDetailsUrl(backofficeUrlService.generateUrl(BoUrls.COMPANY_DETAILS, requestData, company));
        companyViewBean.setEditUrl(backofficeUrlService.generateUrl(BoUrls.COMPANY_EDIT, requestData, company));

        return companyViewBean;
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.web.mvc.viewbean.CompanyViewBean

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.