Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Country


      shippingRegion.setShippingMethodRegionTypes(null);
          Iterator<?> it = null;
          if (master.getCountries() != null) {
            it = master.getCountries().iterator();
            while (it.hasNext()) {
              Country mc = (Country) it.next();
              Country country = CountryDAO.loadByCountryName(site.getSiteId(), mc.getCountryName());
              shippingRegion.getCountries().add(country);
            }
          }
          if (master.getStates() != null) {
            it = master.getStates().iterator();
View Full Code Here


      Query query = em.createQuery(sql);
      query.setParameter("siteId", site.getSiteId());
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
View Full Code Here

        Tax tax = TaxDAO.load(site.getSiteId(), taxId);

        String countries[] = form.getCountries();
        if (countries != null) {
          for (int i = 0; i < countries.length; i++) {
              Country country = CountryDAO.load(site.getSiteId(), Format.getLong(countries[i]));
            tax.getCountries().add(country);
          }
        }

        String states[] = form.getStates();
View Full Code Here

        Tax tax = TaxDAO.load(site.getSiteId(), taxId);

        String removeCountries[] = form.getRemoveCountries();
        if (removeCountries != null) {
          for (int i = 0; i < removeCountries.length; i++) {
              Country country = CountryDAO.load(site.getSiteId(), Format.getLong(removeCountries[i]));
            tax.getCountries().remove(country);
          }
        }

        String removeStates[] = form.getRemoveStates();
View Full Code Here

        Query query = em.createQuery("from Country country where siteId = :siteId order by countryName");
    query.setParameter("siteId", adminBean.getSite().getSiteId());
    Iterator<?> iterator = query.getResultList().iterator();
    Vector<CountryStateTableBean> vector = new Vector<CountryStateTableBean>();
    while (iterator.hasNext()) {
      Country country = (Country) iterator.next();
      String prefix = "";
      if (country.getCountryName().length() > 0) {
        prefix = country.getCountryName().substring(0,1).toUpperCase();
      }
      if (!isRootExist(vector, prefix)) {
        CountryStateTableBean bean = new CountryStateTableBean();
        bean.setType("R");
        bean.setLabel(prefix);
        bean.setValue(prefix);
        bean.setParentValue("root");
        vector.add(bean);
      }
     
      CountryStateTableBean bean = new CountryStateTableBean();
      bean.setType("C");
      bean.setLabel(country.getCountryName());
      bean.setValue(country.getCountryId().toString());
      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()];
        vector.copyInto(countryStateTable);
View Full Code Here

      form.setRemoveStates(null);
     
        Iterator<?> iterator = tax.getCountries().iterator();
        Vector<CountryStateTableBean> vector = new Vector<CountryStateTableBean>();
        while (iterator.hasNext()) {
          Country country = (Country) iterator.next();
          CountryStateTableBean bean = new CountryStateTableBean();
          bean.setType("C");
          bean.setLabel(country.getCountryName());
          bean.setValue(country.getCountryId().toString());
           vector.add(bean);

        }
        iterator = tax.getStates().iterator();
View Full Code Here

    addressForm.setCustLastName(custAddress.getCustLastName());
    addressForm.setCustSuffix(custAddress.getCustSuffix());
    addressForm.setCustAddressLine1(custAddress.getCustAddressLine1());
    addressForm.setCustAddressLine2(custAddress.getCustAddressLine2());
    addressForm.setCustCityName(custAddress.getCustCityName());
    Country country = custAddress.getCountry();
    State state = custAddress.getState();
    if (state != null) {
      addressForm.setCustStateName(state.getStateName());
      addressForm.setCustStateCode(state.getStateCode());
    }
    addressForm.setCustCountryName(country.getCountryName());
    addressForm.setCustCountryCode(country.getCountryCode());
    addressForm.setCustZipCode(custAddress.getCustZipCode());
    addressForm.setCustPhoneNum(custAddress.getCustPhoneNum());
    addressForm.setCustFaxNum(custAddress.getCustFaxNum());
    form.setCustAddress(addressForm);
   
    OrderAddress billingAddress = orderHeader.getBillingAddress();
    addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(billingAddress.getCustUseAddress());
    if (billingAddress.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      addressForm.setOrderAddressId(billingAddress.getOrderAddressId().toString());
      addressForm.setCustPrefix(billingAddress.getCustPrefix());
      addressForm.setCustFirstName(billingAddress.getCustFirstName());
      addressForm.setCustMiddleName(billingAddress.getCustMiddleName());
      addressForm.setCustLastName(billingAddress.getCustLastName());
      addressForm.setCustSuffix(billingAddress.getCustSuffix());
      addressForm.setCustAddressLine1(billingAddress.getCustAddressLine1());
      addressForm.setCustAddressLine2(billingAddress.getCustAddressLine2());
      country = billingAddress.getCountry();
      state = billingAddress.getState();
      addressForm.setCustCityName(billingAddress.getCustCityName());
      if (state != null) {
        addressForm.setCustStateName(state.getStateName());
        addressForm.setCustStateCode(state.getStateCode());
      }
      addressForm.setCustCountryName(country.getCountryName());
      addressForm.setCustCountryCode(country.getCountryCode());
      addressForm.setCustZipCode(billingAddress.getCustZipCode());
      addressForm.setCustPhoneNum(billingAddress.getCustPhoneNum());
      addressForm.setCustFaxNum(billingAddress.getCustFaxNum());
    }
    form.setBillingAddress(addressForm);
   
    OrderAddress shippingAddress = orderHeader.getShippingAddress();
    addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(shippingAddress.getCustUseAddress());
    if (shippingAddress.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      addressForm.setOrderAddressId(shippingAddress.getOrderAddressId().toString());
      addressForm.setCustPrefix(shippingAddress.getCustPrefix());
      addressForm.setCustFirstName(shippingAddress.getCustFirstName());
      addressForm.setCustMiddleName(shippingAddress.getCustMiddleName());
      addressForm.setCustLastName(shippingAddress.getCustLastName());
      addressForm.setCustSuffix(shippingAddress.getCustSuffix());
      addressForm.setCustAddressLine1(shippingAddress.getCustAddressLine1());
      addressForm.setCustAddressLine2(shippingAddress.getCustAddressLine2());
      addressForm.setCustCityName(shippingAddress.getCustCityName());
      country = shippingAddress.getCountry();
      state = shippingAddress.getState();
      if (state != null) {
        addressForm.setCustStateName(state.getStateName());
        addressForm.setCustStateCode(state.getStateCode());
      }
      addressForm.setCustCountryName(country.getCountryName());
      addressForm.setCustCountryCode(country.getCountryCode());
      addressForm.setCustZipCode(shippingAddress.getCustZipCode());
      addressForm.setCustPhoneNum(shippingAddress.getCustPhoneNum());
      addressForm.setCustFaxNum(shippingAddress.getCustFaxNum());
    }
    form.setShippingAddress(addressForm);
View Full Code Here

      Query query = em.createQuery("from country in class Country where country.siteId = :siteId order by countryName");
      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
View Full Code Here

      Query query = em.createQuery("from country in class Country where country.siteId = :siteId");
      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
View Full Code Here

      Query query = em.createQuery("from country in class Country where country.siteId = :siteId order by country.countryName");
      query.setParameter("siteId", siteId);
       Iterator<?> iterator = query.getResultList().iterator();
       Vector<LabelValueBean> vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         Country country = (Country) iterator.next();
         LabelValueBean bean = new LabelValueBean(country.getCountryName(), country.getCountryCode());
         vector.add(bean);
       }
       LabelValueBean countries[] = new LabelValueBean[vector.size()];
       vector.copyInto(countries);
       form.setCountries(countries);
      
      String sql = "from CreditCard credit_card where siteId = :siteId order by seqNum";
       query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         CreditCard creditCard = (CreditCard) iterator.next();
         LabelValueBean bean = new LabelValueBean(creditCard.getCreditCardDesc(), creditCard.getCreditCardId().toString());
         vector.add(bean);
       }
       LabelValueBean creditCards[] = new LabelValueBean[vector.size()];
       vector.copyInto(creditCards);
       form.setCreditCards(creditCards);
  
      LabelValueBean expiryMonths[] = {new LabelValueBean("01", "01"),
         new LabelValueBean("02", "02"),
         new LabelValueBean("03", "03"),
         new LabelValueBean("04", "04"),
         new LabelValueBean("05", "05"),
         new LabelValueBean("06", "06"),
         new LabelValueBean("07", "07"),
         new LabelValueBean("08", "08"),
         new LabelValueBean("09", "09"),
         new LabelValueBean("10", "10"),
         new LabelValueBean("11", "11"),
         new LabelValueBean("12", "12")};
    LabelValueBean expiryYears[] = {new LabelValueBean("2011", "2011"),
              new LabelValueBean("2012", "2012"),
              new LabelValueBean("2013", "2013"),
              new LabelValueBean("2014", "2014"),
              new LabelValueBean("2015", "2015"),
              new LabelValueBean("2016", "2016"),
              new LabelValueBean("2017", "2017"),
              new LabelValueBean("2018", "2018"),
              new LabelValueBean("2019", "2019"),
              new LabelValueBean("2020", "2020"),
              new LabelValueBean("2021", "2021"),
              new LabelValueBean("2022", "2022"),
              new LabelValueBean("2023", "2023"),
              new LabelValueBean("2024", "2024"),
              new LabelValueBean("2025", "2025"),
              new LabelValueBean("2026", "2026"),
              new LabelValueBean("2027", "2027"),
              new LabelValueBean("2028", "2028"),
              new LabelValueBean("2029", "2029"),
              };
    form.setExpiryMonths(expiryMonths);
    form.setExpiryYears(expiryYears);
   
    Country estimateCountry = CountryDAO.loadByCountryCode(siteId, form.getEstimateCountryCode());
    Vector<LabelValueBean> estimateStateVector = new Vector<LabelValueBean>();
    if (estimateCountry != null) {
      for (State state : estimateCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        estimateStateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[estimateStateVector.size()];
      estimateStateVector.copyInto(states);
         form.setEstimateStates(states);
    }
    else {
      LabelValueBean states[] = {};
         form.setEstimateStates(states);
    }
   
    Country custCountry = CountryDAO.loadByCountryCode(siteId, form.getCustCountryCode());
    Vector<LabelValueBean> stateVector = new Vector<LabelValueBean>();
    if (custCountry != null) {
      for (State state : custCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        stateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[stateVector.size()];
      stateVector.copyInto(states);
         form.setCustStates(states);
    }
    else {
      LabelValueBean states[] = {};
         form.setCustStates(states);
    }
   
    custCountry = CountryDAO.loadByCountryCode(siteId, form.getBillingCustCountryCode());
    stateVector = new Vector<LabelValueBean>();
    if (custCountry != null) {
      for (State state : custCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        stateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[stateVector.size()];
      stateVector.copyInto(states);
         form.setBillingCustStates(states);
    }
    else {
      LabelValueBean states[] = {};
         form.setBillingCustStates(states);
    }
   
    custCountry = CountryDAO.loadByCountryCode(siteId, form.getShippingCustCountryCode());
    stateVector = new Vector<LabelValueBean>();
    if (custCountry != null) {
      for (State state : custCountry.getStates()) {
        LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
        stateVector.add(bean);
      }
      LabelValueBean states[] = new LabelValueBean[stateVector.size()];
      stateVector.copyInto(states);
View Full Code Here

TOP

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

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.