Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomAttributeOptionCurrency


    Double minPrice = Double.valueOf(0);
    Double maxPrice = Double.MAX_VALUE;
    for (CustomAttributeOption customAttributeOption : customAttribute.getCustomAttributeOptions()) {
      Float value = Float.valueOf(customAttributeOption.getCustomAttributeOptionCurrency().getCustomAttribValue());
      if (!contentBean.getContentSessionKey().isSiteCurrencyClassDefault()) {
        CustomAttributeOptionCurrency customAttributeOptionCurrency = null;
        for (CustomAttributeOptionCurrency currency : customAttributeOption.getCustomAttributeOptionCurrencies()) {
          if (currency.getSiteCurrencyClass().getSiteCurrencyClassId().equals(contentBean.getContentSessionKey().getSiteCurrencyClassId())) {
            customAttributeOptionCurrency = currency;
          }
        }
        if (customAttributeOptionCurrency != null) {
          value = Float.valueOf(customAttributeOptionCurrency.getCustomAttribValue());
        }
        else {
          value = contentBean.getContentSessionBean().getSiteCurrency().getExchangeRate() * value;
        }
      }
 
View Full Code Here


        em.persist(customAttributeOption);
      }
     
      if (customAttribute.getCustomAttribDataTypeCode() == Constants.CUSTOM_ATTRIBUTE_DATA_TYPE_CURRENCY) {
        exist = true;
        CustomAttributeOptionCurrency customAttribOptionCurrency = customAttributeOption.getCustomAttributeOptionCurrency();
        if (customAttribOptionCurrency == null) {
          customAttribOptionCurrency = new CustomAttributeOptionCurrency();
          exist = false;
          customAttribOptionCurrency.setSiteCurrencyClass(siteCurrencyClass);
          customAttribOptionCurrency.setCustomAttributeOption(customAttributeOption);
          customAttribOptionCurrency.setRecCreateBy(adminBean.getUser().getUserId());
          customAttribOptionCurrency.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          customAttributeOption.setCustomAttributeOptionCurrency(customAttribOptionCurrency);
          customAttributeOption.getCustomAttributeOptionCurrencies().add(customAttribOptionCurrency);
        }
        customAttribOptionCurrency.setCustomAttribValue(optionForm.getCustomAttribValue());
        customAttribOptionCurrency.setRecUpdateBy(adminBean.getUser().getUserId());
        customAttribOptionCurrency.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
        if (!exist) {
          em.persist(customAttribOptionCurrency);
        }
      }
      else {
View Full Code Here

      CustomAttributeOptionDisplayForm optionForm = form.getCustomAttribOptions()[i];
      CustomAttributeOption customAttributeOption = null;
      Long customAttribOptionId = Format.getLong(optionForm.getCustomAttribOptionId());
      customAttributeOption = CustomAttributeOptionDAO.load(adminBean.getSite().getSiteId(), customAttribOptionId);       
      boolean exist = true;
      CustomAttributeOptionCurrency customAttributeOptionCurrency = null;
      for (CustomAttributeOptionCurrency optionCurr : customAttributeOption.getCustomAttributeOptionCurrencies()) {
        if (optionCurr.getSiteCurrencyClass().getSiteCurrencyClassId().equals(siteCurrencyClassId)) {
          customAttributeOptionCurrency = optionCurr;
        }
      }
      if (customAttributeOptionCurrency == null) {
        customAttributeOptionCurrency = new CustomAttributeOptionCurrency();
        exist = false;
        customAttributeOptionCurrency.setRecCreateBy(user.getUserId());
        customAttributeOptionCurrency.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          SiteCurrencyClass siteCurrencyClass = (SiteCurrencyClass) em.find(SiteCurrencyClass.class, siteCurrencyClassId);
          customAttributeOptionCurrency.setSiteCurrencyClass(siteCurrencyClass);
          customAttributeOptionCurrency.setCustomAttributeOption(customAttributeOption);
          customAttributeOption.getCustomAttributeOptionCurrencies().add(customAttributeOptionCurrency);
      }
     
      if (form.isCustomAttribOptionCurrFlag()) {
        customAttributeOptionCurrency.setCustomAttribValue(optionForm.getCustomAttribValueCurr());
      }
      else {
        customAttributeOptionCurrency.setCustomAttribValue(null);
      }
      customAttributeOptionCurrency.setRecUpdateBy(user.getUserId());
      customAttributeOptionCurrency.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      if (!exist) {
        em.persist(customAttributeOptionCurrency);
      }
      optionForm.setCustomAttribValueCurrFlag(form.isCustomAttribOptionCurrFlag());
    }
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.CustomAttributeOptionCurrency

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.