Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.TaxRegion


       JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
     
        Long taxRegionId = Format.getLong(form.getTaxRegionId());
        String taxRegionZipIds[] = form.getTaxRegionZipIds();
        TaxRegion taxRegion = (TaxRegion) em.find(TaxRegion.class, taxRegionId);
        if (taxRegionZipIds != null) {
          for (int i = 0; i < taxRegionZipIds.length; i++) {
            Long taxRegionZipId = Format.getLong(taxRegionZipIds[i]);
              TaxRegionZip taxRegionZip = (TaxRegionZip) em.find(TaxRegionZip.class, taxRegionZipId);
              taxRegion.getZipCodes().remove(taxRegionZip);
              em.remove(taxRegionZip);
          }
        }
    String result = getJSONZipCodeList(taxRegion);
    streamWebService(response, result);
View Full Code Here


          query.setParameter("published", form.getSrPublished());
        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<TaxRegionDisplayForm> vector = new Vector<TaxRegionDisplayForm>();
        while (iterator.hasNext()) {
          TaxRegion taxRegion = (TaxRegion) iterator.next();
        TaxRegionDisplayForm taxRegionDisplay = new TaxRegionDisplayForm();
        taxRegionDisplay.setTaxRegionId(Format.getLong(taxRegion.getTaxRegionId()));
        taxRegionDisplay.setTaxRegionDesc(taxRegion.getTaxRegionDesc());
        taxRegionDisplay.setPublished(String.valueOf(taxRegion.getPublished()));
        vector.add(taxRegionDisplay);
        }
        form.setTaxRegions(vector);
       
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

        TaxRegionListingActionForm form = (TaxRegionListingActionForm) actionForm;
        String taxRegionIds[] = form.getTaxRegionIds();
       
        if (taxRegionIds != null) {
          for (int i = 0; i < taxRegionIds.length; i++) {
              TaxRegion taxRegion = new TaxRegion();
              taxRegion = TaxRegionDAO.load(site.getSiteId(), Format.getLong(taxRegionIds[i]));
              em.remove(taxRegion);
          }
        }
View Full Code Here

public class TaxRegionDAO extends Tax {
  private static final long serialVersionUID = 4555920843332071425L;

  public static TaxRegion load(String siteId, Long taxRegionId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      TaxRegion taxRegion = (TaxRegion) em.find(TaxRegion.class, taxRegionId);
    if (!taxRegion.getSite().getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return taxRegion;
  }
View Full Code Here

           "left     join taxRegion.site site " +
           "where    site.siteId = :siteId";
    Query query = em.createQuery(sql);
    query.setParameter("siteId", contentBean.getSiteDomain().getSite().getSiteId());
    boolean found = false;
    TaxRegion tr = null;
    Vector<TaxRegion> vector = new Vector<TaxRegion>();
    Iterator<?> iterator = query.getResultList().iterator();
    while (iterator.hasNext()) {
      tr = (TaxRegion) iterator.next();
      if (tr.getPublished() != Constants.VALUE_YES) {
        continue;
      }
          Iterator<?> iteratorCountry = null;
          iteratorCountry = tr.getCountries().iterator();
          while (iteratorCountry.hasNext()) {
            Country country = (Country) iteratorCountry.next();
            if (country.getCountryId().equals(shippingAddress.getCountry().getCountryId())) {
              vector.add(tr);
              break;
            }
          }
         
          if (!found) {
            if (shippingAddress.getState() != null) {
              Iterator<?> iteratorState = null;
              iteratorState = tr.getStates().iterator();
              while (iteratorState.hasNext()) {
                State state = (State) iteratorState.next();
                if (state.getStateId().equals(shippingAddress.getState().getStateId())) {
                  vector.add(tr);
                  break;
                }
              }
            }
          }
          String zipCode = shippingAddress.getCustZipCode();
          if (!found && !Format.isNullOrEmpty(zipCode)) {
            Iterator<?> iteratorZipCode = tr.getZipCodes().iterator();
            while (iteratorZipCode.hasNext()) {
              TaxRegionZip trZip = (TaxRegionZip) iteratorZipCode.next();
              if (zipCode.compareTo(trZip.getZipCodeStart()) >= 0 &&
                zipCode.compareTo(trZip.getZipCodeEnd()) <= 0) {
                vector.add(tr);
View Full Code Here

    for (TaxRegion taxRegion : taxRegionList) {
      ProductClass shippingProductClass = taxRegion.getShippingProductClass();
      if (shippingProductClass == null) {
        continue;
      }
      TaxRegion list[] = {taxRegion};
      ItemTax taxes[] = calcTaxes(shippingProductClass.getProductClassId(), list, shippingAmount);
      for (ItemTax itemTax : taxes) {
        Enumeration<ItemTax> enumeration = vector.elements();
        boolean found = false;
        while (enumeration.hasMoreElements()) {
View Full Code Here

TOP

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

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.