Example #1
0
 public String getDistrictsInfo(int cityId) {
   StringBuffer buf = new StringBuffer();
   List<Area> distList = SimpleDao.getAreaDao(mContext).getChildArea(cityId);
   if (distList != null) {
     for (Area dist : distList) {
       buf.append("\t\t\t\tDIST: ")
           .append(dist.getId() + ", ")
           .append(dist.getName() + ",  ")
           .append(dist.getIdxChar() + ",  ")
           .append(dist.getPid())
           .append("\n");
     }
   }
   return buf.toString();
 }
Example #2
0
 public String getAreaInfo(String proviceName) {
   StringBuffer buf = new StringBuffer();
   Area prov = SimpleDao.getAreaDao(mContext).getProvice(proviceName);
   if (prov == null) return null;
   int proviceId = (int) prov.getId();
   buf.append("PROVICE: " + proviceName + ", Id= " + proviceId).append("\n");
   List<Area> cityList = SimpleDao.getAreaDao(mContext).getChildArea(proviceId);
   if (cityList != null) {
     for (Area area : cityList) {
       buf.append("\n\t\tCITY: ")
           .append(area.getId() + ", ")
           .append(area.getName() + ",  ")
           .append(area.getIdxChar() + ",  ")
           .append(area.getPid())
           .append("\n");
       int cityId = (int) area.getId();
       buf.append(getDistrictsInfo(cityId));
     }
   }
   return buf.toString();
 }