Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.State


        }

        String removeStates[] = form.getRemoveStates();
        if (removeStates != null) {
          for (int i = 0; i < removeStates.length; i++) {
              State state = StateDAO.load(site.getSiteId(), Format.getLong(removeStates[i]));
            tax.getStates().remove(state);
          }
        }
        em.flush();
       
View Full Code Here


      bean.setParentValue(prefix);
      vector.add(bean);
     
      Iterator<?> stateIterator = country.getStates().iterator();
      while (stateIterator.hasNext()) {
        State state = (State) stateIterator.next();
        bean = new CountryStateTableBean();
        bean.setType("S");
        bean.setLabel(state.getStateName());
        bean.setValue(state.getStateId().toString());
        bean.setParentValue(country.getCountryId().toString());
        vector.add(bean);
      }
    }
    CountryStateTableBean countryStateTable[] = new CountryStateTableBean[vector.size()];
View Full Code Here

        }
        iterator = tax.getStates().iterator();
        while (iterator.hasNext()) {
          State state = (State) iterator.next();
          CountryStateTableBean bean = new CountryStateTableBean();
          bean.setType("S");
          bean.setLabel(state.getCountry().getCountryName() + " - " + state.getStateName());
          bean.setValue(state.getStateId().toString());
          vector.add(bean);
        }
       
        CountryStateTableBean regionCountryStateTable[] = new CountryStateTableBean[vector.size()];
        vector.copyInto(regionCountryStateTable);
View Full Code Here

      query.setParameter("siteId", siteId);
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       vector.add(new LabelValueBean("", ""));
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
View Full Code Here

       query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
View Full Code Here

      custAddress.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      custAddress.setRecUpdateDatetime(new Date());
      Country country = CountryDAO.loadByCountryCode(siteId, adddress.getCustCountryCode());
      custAddress.setCountry(country);
      if (adddress.getCustStateCode() != null) {
        State state = StateDAO.loadByStateCode(siteId, adddress.getCustStateCode());
        custAddress.setState(state);
      }
      em.persist(custAddress);
      orderHeader.setCustAddress(custAddress);
    }
   
    CustomerAddress billingAddress = shoppingCart.getBillingAddress();
    if (billingAddress != null) {
      OrderAddress address = null;
      if (orderHeader.getBillingAddress() != null) {
        address = orderHeader.getBillingAddress();
      }
      else {
        address = new OrderAddress();
        address.setRecCreateBy(Constants.USERNAME_SYSTEM);
        address.setRecCreateDatetime(new Date());
      }
      address.setCustUseAddress(billingAddress.getCustUseAddress());
      address.setCustPrefix(billingAddress.getCustPrefix());
      address.setCustFirstName(billingAddress.getCustFirstName());
      address.setCustMiddleName(billingAddress.getCustMiddleName());
      address.setCustLastName(billingAddress.getCustLastName());
      address.setCustSuffix(billingAddress.getCustSuffix());
      address.setCustAddressLine1(billingAddress.getCustAddressLine1());
      address.setCustAddressLine2(billingAddress.getCustAddressLine2());
      address.setCustCityName(billingAddress.getCustCityName());
      address.setCustStateName(billingAddress.getCustStateName());
      address.setCustStateCode(billingAddress.getCustStateCode());
      address.setCustCountryName(billingAddress.getCustCountryName());
      address.setCustCountryCode(billingAddress.getCustCountryCode());
      address.setCustStateName(billingAddress.getCustStateName());
      address.setCustZipCode(billingAddress.getCustZipCode());
      address.setCustPhoneNum(billingAddress.getCustPhoneNum());
      address.setCustFaxNum(billingAddress.getCustFaxNum());
      address.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      address.setRecUpdateDatetime(new Date());
      Country country = CountryDAO.loadByCountryCode(siteId, billingAddress.getCustCountryCode());
      address.setCountry(country);
      if (billingAddress.getCustStateCode() != null) {
        State state = StateDAO.loadByStateCode(siteId, billingAddress.getCustStateCode());
        address.setState(state);
      }
      em.persist(address);
      orderHeader.setBillingAddress(address);
    }
    CustomerAddress shippingAddress = shoppingCart.getShippingAddress();
    if (shippingAddress != null) {
      OrderAddress address = null;
      if (orderHeader.getShippingAddress() != null) {
        address = orderHeader.getShippingAddress();
      }
      else {
        address = new OrderAddress();
        address.setRecCreateBy(Constants.USERNAME_SYSTEM);
        address.setRecCreateDatetime(new Date());
      }
      address.setCustUseAddress(shippingAddress.getCustUseAddress());
      address.setCustPrefix(shippingAddress.getCustPrefix());
      address.setCustFirstName(shippingAddress.getCustFirstName());
      address.setCustMiddleName(shippingAddress.getCustMiddleName());
      address.setCustLastName(shippingAddress.getCustLastName());
      address.setCustSuffix(shippingAddress.getCustSuffix());
      address.setCustAddressLine1(shippingAddress.getCustAddressLine1());
      address.setCustAddressLine2(shippingAddress.getCustAddressLine2());
      address.setCustCityName(shippingAddress.getCustCityName());
      address.setCustStateName(shippingAddress.getCustStateName());
      address.setCustStateCode(shippingAddress.getCustStateCode());
      address.setCustCountryName(shippingAddress.getCustCountryName());
      address.setCustCountryCode(shippingAddress.getCustCountryCode());
      address.setCustStateName(shippingAddress.getCustStateName());
      address.setCustZipCode(shippingAddress.getCustZipCode());
      address.setCustPhoneNum(shippingAddress.getCustPhoneNum());
      address.setCustFaxNum(shippingAddress.getCustFaxNum());
      address.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      address.setRecUpdateDatetime(new Date());
      Country country = CountryDAO.loadByCountryCode(siteId, shippingAddress.getCustCountryCode());
      address.setCountry(country);
      if (shippingAddress.getCustStateCode() != null) {
        State state = StateDAO.loadByStateCode(siteId, shippingAddress.getCustStateCode());
        address.setState(state);
      }
      em.persist(address);
      orderHeader.setShippingAddress(address);
    }
View Full Code Here

          }
        }
        if (!isFound) {
            Iterator<?> states = shippingRegion.getStates().iterator();
            while (states.hasNext()) {
              State state = (State) states.next();
              if (state.getStateId().equals(stateId)) {
                isFound = true;
              }
            }
        }
          String zipCode = address.getCustZipCode();
View Full Code Here

          }
        }
        if (!found) {
            Iterator<?> states = smRegion.getShippingRegion().getStates().iterator();
            while (states.hasNext()) {
              State state = (State) states.next();
              if (state.getStateId().equals(address.getState().getStateId())) {
                shippingMethodRegion = smRegion;
                found = true;
                break;
              }
            }
View Full Code Here

          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;
                }
              }
            }
View Full Code Here

TOP

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

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.