Пример #1
0
 public static Dictionary <int, string> GetStreets(int countryId, bool containDel = true)
 {
     Hidistro.Entities.Store.RegionInfo region = RegionHelper.GetRegion(countryId, true);
     if (region != null)
     {
         Dictionary <int, string> childList = RegionHelper.GetChildList(countryId, containDel);
         if (childList == null || childList.Count == 0)
         {
             IList <Hidistro.Entities.Store.RegionInfo> streetsOfCity = new RegionDao().GetStreetsOfCity(region.ParentRegionId, containDel);
             if (streetsOfCity == null || streetsOfCity.Count == 0)
             {
                 return(new Dictionary <int, string>());
             }
             IList <Hidistro.Entities.Store.RegionInfo> allRegions = RegionHelper.GetAllRegions();
             allRegions = allRegions.Concat(streetsOfCity).ToList();
             HiCache.Remove("FileCache-Regions");
             HiCache.Insert("FileCache-Regions", allRegions);
             streetsOfCity = ((!containDel) ? (from r in streetsOfCity
                                               where r.ParentRegionId == countryId && !r.IsDel
                                               select r).ToList() : (from r in streetsOfCity
                                                                     where r.ParentRegionId == countryId
                                                                     select r).ToList());
             childList = new Dictionary <int, string>();
             foreach (Hidistro.Entities.Store.RegionInfo item in streetsOfCity)
             {
                 childList.Add(item.RegionId, item.RegionName);
             }
             return(childList);
         }
         return(childList);
     }
     return(null);
 }
Пример #2
0
 public static Dictionary <int, string> GetCountys(int cityId, bool containDel = true)
 {
     return(RegionHelper.GetChildList(cityId, containDel));
 }
Пример #3
0
 public static Dictionary <int, string> GetCitys(int provinceId, bool containDel = true)
 {
     return(RegionHelper.GetChildList(provinceId, containDel));
 }