Example #1
0
  public String getCities() {
    List<Class<?>> list;
    if (_stateId != null) {
      list =
          CommonController.getAllObjects(
              City.class, "Status = 1 and StateId = " + Integer.parseInt(_stateId));
    } else {
      list = CommonController.getAllObjects(City.class, "Status = 1");
    }

    for (int i = 0; i < list.size(); i++) {
      City city = City.class.cast(list.get(i));
      _cityMap.put(city.getCityId(), city.getCityName());
    }
    return "success";
  }
Example #2
0
  public String getStates() {
    List<Class<?>> list;
    if (_countryId != null) {
      list =
          CommonController.getAllObjects(
              StateTB.class, "Status = 1 and CountryId = " + Integer.parseInt(_countryId));
    } else {
      list = CommonController.getAllObjects(StateTB.class, "Status = 1");
    }

    for (int i = 0; i < list.size(); i++) {
      StateTB state = StateTB.class.cast(list.get(i));
      _stateMap.put(state.getStateid(), state.getStateName());
    }
    return "success";
  }