/// <summary> /// 获取地区列表(列表框使用) /// </summary> /// <returns></returns> private Dictionary <string, string> GetAreaDict() { if (areaDict == null) { AreaType = string.IsNullOrEmpty(Request["rdAreaType"]) ? 1 : Convert.ToInt32(Request["rdAreaType"]); if (AreaType > 3 || AreaType < 1) { AreaType = 1; } List <B_AreaEntity> areaList; switch (AreaType) { case 1: areaList = B_BaseToolService.Instance.GetCountriesCache(); break; case 2: areaList = B_BaseToolService.Instance.GetProvincesCache(); break; default: //3 areaList = B_BaseToolService.Instance.GetCitiesCache(); break; } DefaultArea = areaList[0]; areaDict = new Dictionary <string, string>(); foreach (B_AreaEntity area in areaList) { areaDict.Add(area.EnShortName, area.Name); } } return(areaDict); }
/// <summary> /// 获取地区列表(列表框使用) /// </summary> /// <returns></returns> private Dictionary <string, string> GetAreaDict() { if (areaDict == null) { AreaType = 1; List <B_AreaEntity> areaList; switch (AreaType) { case 1: areaList = B_BaseToolService.Instance.GetCountriesCache(); break; case 2: areaList = B_BaseToolService.Instance.GetProvincesCache(); break; default: //3 areaList = B_BaseToolService.Instance.GetCitiesCache(); break; } DefaultArea = areaList[0]; areaDict = new Dictionary <string, string>(); foreach (B_AreaEntity area in areaList) { areaDict[area.EnShortName] = area.Name; } } return(areaDict); }
/// <summary> /// 获取地区列表(列表框使用) /// </summary> /// <returns></returns> private Dictionary <string, string> GetAreaDict() { if (areaDict == null) { List <B_AreaEntity> areaList = B_BaseToolService.Instance.GetCountriesCache(); DefaultArea = areaList[0]; areaDict = new Dictionary <string, string>(); foreach (B_AreaEntity area in areaList) { areaDict[area.EnShortName] = area.Name; } } return(areaDict); }
/// <summary> /// 获取地区列表(列表框使用) /// </summary> /// <returns></returns> private Dictionary <string, string> GetAreaDict() { if (areaDict == null) { AreaType = 1; List <B_AreaEntity> areaList = B_BaseToolService.Instance.GetCountriesCache(); DefaultArea = areaList[0]; areaDict = new Dictionary <string, string>(); foreach (B_AreaEntity area in areaList) { areaDict.Add(area.ID.ToString(), area.Name); } } return(areaDict); }
public B_AreaEntity GetAreabyid(int areaid) { if (areaid == -1) { return(new B_AreaEntity() { EnShortName = "-1" }); } string sql = "select ID,Name,ParentID,EnShortName from Cfg_Areas where id=" + areaid; B_AreaEntity entity = null; using (var reader = MySqlHelper.ExecuteReader(Mysql_Statdb_Connstring, sql)) { if (reader.Read()) { entity = new B_AreaEntity(reader); } } return(entity); }