Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ShippingRegionZip


      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
      Iterator<ShippingRegionZip> iterator = shippingRegion.getZipCodes().iterator();
      Vector<JSONEscapeObject> zipCodes = new Vector<JSONEscapeObject>();
      while (iterator.hasNext()) {
        ShippingRegionZip shippingRegionZip = (ShippingRegionZip) iterator.next();
        JSONEscapeObject object = new JSONEscapeObject();
        object.put("shippingRegionZipId", shippingRegionZip.getShippingRegionZipId());
        object.put("zipCodeExpression", String.valueOf(shippingRegionZip.getZipCodeExpression()));
        object.put("zipCodeStart", shippingRegionZip.getZipCodeStart());
        object.put("zipCodeEnd", shippingRegionZip.getZipCodeEnd());
        zipCodes.add(object);
      }
      jsonResult.put("zipCodes", zipCodes);
      result = jsonResult.toHtmlString();
      return result;
View Full Code Here


    jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
   
    Long shippingRegionId = Format.getLong(form.getShippingRegionId());
    ShippingRegion shippingRegion = (ShippingRegion) em.find(ShippingRegion.class, shippingRegionId);
     
    ShippingRegionZip shippingRegionZip = new ShippingRegionZip();
    shippingRegionZip.setZipCodeStart(form.getZipCodeStart());
    shippingRegionZip.setZipCodeEnd(form.getZipCodeEnd());
    if (form.getZipCodeExpression().equalsIgnoreCase(String.valueOf(Constants.VALUE_YES))) {
      shippingRegionZip.setZipCodeExpression(Constants.VALUE_YES);
    }
    else {
      shippingRegionZip.setZipCodeExpression(Constants.VALUE_NO);
    }
   
    shippingRegionZip.setRecUpdateBy(adminBean.getUser().getUserId());
    shippingRegionZip.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    shippingRegionZip.setRecCreateBy(adminBean.getUser().getUserId());
    shippingRegionZip.setRecCreateDatetime(new Date(System.currentTimeMillis()));
    shippingRegionZip.setShippingRegion(shippingRegion);
   
    em.persist(shippingRegionZip);
   
    String result = getJSONZipCodeList(shippingRegion);
    this.streamWebService(response, result);
View Full Code Here

    String shippingRegionZipIds[] = form.getShippingRegionZipIds();
    ShippingRegion shippingRegion = (ShippingRegion) em.find(ShippingRegion.class, shippingRegionId);
    if (shippingRegionZipIds != null) {
      for (int i = 0; i < shippingRegionZipIds.length; i++) {
            Long shippingRegionZipId = Format.getLong(shippingRegionZipIds[i]);
              ShippingRegionZip shippingRegionZip = (ShippingRegionZip) em.find(ShippingRegionZip.class, shippingRegionZipId);
              shippingRegion.getZipCodes().remove(shippingRegionZip);
              em.remove(shippingRegionZip);
          }
    }
    String result = getJSONZipCodeList(shippingRegion);
View Full Code Here

TOP

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

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.