/// <summary> /// 根据城市编号返回城市名 如果是中国,则返回“省名-城市名”,否则返回国家名 /// </summary> protected string getCityName(object o, object countryId) { string str = string.Empty; int nationId = 0; Int32.TryParse(Convert.ToString(countryId), out nationId); if (nationId != 0) { if (nationId == 224) { if (!string.IsNullOrEmpty(Convert.ToString(o))) { //列表MODEL中没有城市名 EyouSoft.BLL.SystemStructure.SysCity BLL = new EyouSoft.BLL.SystemStructure.SysCity(); EyouSoft.Model.SystemStructure.SysCity Model = BLL.GetSysCityModel(Utils.GetInt(o.ToString())); if (null != Model) { str = string.IsNullOrEmpty(Model.ProvinceName)?"":Model.ProvinceName + "-" + Model.CityName; } } } else { //返回国家名 EyouSoft.BLL.SystemStructure.BSysCountry nationBLL = new EyouSoft.BLL.SystemStructure.BSysCountry(); EyouSoft.Model.SystemStructure.MSysCountry nationModel = nationBLL.GetCountry(nationId); if (null != nationModel) { str = string.Format("{0}({1})", nationModel.CName, nationModel.EnName); } } } return(str); }
protected void InitArea(string AreaID) { EyouSoft.Model.SystemStructure.SysArea AreaModel = new EyouSoft.BLL.SystemStructure.SysArea().GetSysAreaModel(Convert.ToInt32(Utils.GetQueryStringValue("AreaID"))); if (AreaModel != null) { this.txtAreaName.Text = AreaModel.AreaName; if (AreaModel.VisitCity != null && AreaModel.VisitCity.Count > 0) { for (int i = 0; i < AreaModel.VisitCity.Count; i++) { if (AreaModel.VisitCity[i].CountryId == 0) //国内 { if (AreaModel.VisitCity[i].CountyId == 0) //选择城市没有选择县区 { EyouSoft.Model.SystemStructure.SysCity CityModel = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().GetSysCityModel(AreaModel.VisitCity[i].CityId); if (CityModel != null) { strAreaCityHtml += "<input type=\"checkbox\" value=\"" + AreaModel.VisitCity[i].ProvinceId + "," + AreaModel.VisitCity[i].CityId + "\" checked=\"checked\" name=\"cbxCity\"/>" + CityModel.CityName + " "; } this.hidProACityID.Value += AreaModel.VisitCity[i].CityId + ","; } else //选择县区 { EyouSoft.Model.SystemStructure.SysDistrictCounty County = EyouSoft.BLL.SystemStructure.SysDistrictCounty.CreateInstance().GetModel(AreaModel.VisitCity[i].CountyId); if (County != null) { strAreaCityHtml += "<input type=\"checkbox\" checked=\"checked\" value=\"" + AreaModel.VisitCity[i].ProvinceId + "," + AreaModel.VisitCity[i].CityId + "," + AreaModel.VisitCity[i].CountyId + "\" name=\"cbxCounty\"/>" + County.DistrictName + " "; } this.hidProACityACounID.Value += AreaModel.VisitCity[i].CountyId + ","; } } else //国际 { EyouSoft.Model.SystemStructure.MSysCountry CountryModel = EyouSoft.BLL.SystemStructure.BSysCountry.CreateInstance().GetCountry(AreaModel.VisitCity[i].CountryId); if (CountryModel != null) { strAreaCityHtml += "<input type=\"checkbox\" value=\"" + (int)CountryModel.Continent + "," + AreaModel.VisitCity[i].CountryId + "\" checked=\"checked\" name=\"cbxCity\"/>" + CountryModel.CName + " "; } this.hidProACityID.Value += AreaModel.VisitCity[i].CountryId + ","; } } } } }