Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.State


      StateDisplayForm stateForm = states[i];
      if (stateForm.getRemove() == null) {
        continue;
      }
      if (stateForm.getRemove().equals(String.valueOf(Constants.VALUE_YES))) {
        State state = StateDAO.load(site.getSiteId(), Format.getLong(stateForm.getStateId()));
        country.getStates().remove(state);
        em.remove(state);
      }
    }
   
View Full Code Here


        HttpServletResponse response)
    throws Throwable {
   
        String stateId = (String) request.getParameter("stateId");
         
        State state = StateDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(stateId));
      JSONEscapeObject jsonResult = new JSONEscapeObject();
      jsonResult.put("stateId", state.getStateId());
      jsonResult.put("stateCode", state.getStateCode());
      jsonResult.put("stateName", state.getStateName());
        String jsonString = jsonResult.toHtmlString();
    streamWebService(response, jsonString);
        return null;
  }
View Full Code Here

 
  public void createAdditionalInfo(CountryMaintActionForm form, Country country) {
    Vector<StateDisplayForm> vector = new Vector<StateDisplayForm>();
    Iterator<?> iterator = country.getStates().iterator();
    while (iterator.hasNext()) {
      State state = (State) iterator.next();
      StateDisplayForm stateForm = new StateDisplayForm();
      stateForm.setStateId(Format.getLong(state.getStateId()));
      stateForm.setStateCode(state.getStateCode());
      stateForm.setStateName(state.getStateName());
      vector.add(stateForm);
    }
    StateDisplayForm states[] = new StateDisplayForm[vector.size()];
    vector.copyInto(states);
    form.setStates(states);
View Full Code Here

          }
    }
    jsonResult.put("messages", vector);
    if (!error) {
      boolean exist = false;
      State state = null;
      if (!Format.isNullOrEmpty(stateId)) {
        state = StateDAO.load( site.getSiteId(), Format.getLong(stateId));
        exist = true;
      }
      else {
        state = new State();
        state.setRecCreateBy(adminBean.getUser().getUserId());
        state.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      }
      state.setStateCode(stateCode);
      state.setStateName(stateName);
     
      Country country = CountryDAO.load( site.getSiteId(), Format.getLong(countryId));
      state.setCountry(country);
      state.setRecUpdateBy(adminBean.getUser().getUserId());
      state.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      if (!exist) {
        em.persist(state);
      }
      jsonResult.put("status", Constants.WEBSERVICE_STATUS_SUCCESS);
    }
View Full Code Here

      }
      jsonResult.put("countries", countries);
      Iterator<State> iterator1 = shippingRegion.getStates().iterator();
      Vector<JSONEscapeObject> states = new Vector<JSONEscapeObject>();
      while (iterator1.hasNext()) {
        State state = (State) iterator1.next();
        JSONEscapeObject object = new JSONEscapeObject();
        object.put("stateId", state.getStateId());
        object.put("stateCode", state.getStateCode());
        object.put("stateName", state.getStateName());
        states.add(object);
      }
      jsonResult.put("states", states);
      result = jsonResult.toHtmlString();
      return result;
View Full Code Here

   
      String stateIds[] = form.getStateIds();
      if (stateIds != null) {
        for (int i = 0; i < stateIds.length; i++) {
          Long stateId = Format.getLong(stateIds[i]);
              State state = (State) em.find(State.class, stateId);
              Iterator<?> states = shippingRegion.getStates().iterator();
              boolean found = false;
              while (states.hasNext()) {
                State s = (State) states.next();
                if (s.getStateId().equals(stateId)) {
                  found = true;
                  break;
                }
              }
              if (!found) {
View Full Code Here

      if (stateIds != null) {
        for (int i = 0; i < stateIds.length; i++) {
          Long stateId = Format.getLong(stateIds[i]);
              Iterator<?> states = shippingRegion.getStates().iterator();
              while (states.hasNext()) {
                State s = (State) states.next();
                if (s.getStateId().equals(stateId)) {
                  states.remove();
                  modified = true;
                  break;
                }
              }
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 = shippingRegion.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

      jsonCountry.put("countryCode", country.getCountryCode());
      jsonCountry.put("countryName", country.getCountryName());
      Iterator<?> iterator1 = country.getStates().iterator();
      Vector<JSONEscapeObject> states = new Vector<JSONEscapeObject>();
      while (iterator1.hasNext()) {
        State state = (State) iterator1.next();
        JSONEscapeObject jsonState = new JSONEscapeObject();
        jsonState.put("stateId", state.getStateId());
        jsonState.put("stateCode", state.getStateCode());
        jsonState.put("stateName", state.getStateName());
        states.add(jsonState);
      }
      jsonCountry.put("states", states);
      countries.add(jsonCountry);
    }
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.