コード例 #1
0
ファイル: TestData.java プロジェクト: zhanghulk/Daohelper
 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();
 }
コード例 #2
0
ファイル: TestData.java プロジェクト: zhanghulk/Daohelper
 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();
 }