public ActionResult Province() { //三方登录Key YSWL.MALL.BLL.Ms.Regions regionBll = new Regions(); List <YSWL.MALL.Model.Ms.Regions> regionList = regionBll.GetProvinceList(); return(PartialView("_Province", regionList)); }
/// <summary> /// 省列表 /// </summary> /// <returns></returns> public ActionResult ProvinceList() { List <RegionInfo> regionList = Regions.GetProvinceList(); StringBuilder sb = new StringBuilder(); sb.Append("["); foreach (RegionInfo info in regionList) { sb.AppendFormat("{0}\"id\":\"{1}\",\"name\":\"{2}\"{3},", "{", info.RegionId, info.Name, "}"); } if (regionList.Count > 0) { sb.Remove(sb.Length - 1, 1); } sb.Append("]"); return(Content(sb.ToString())); }
/// <summary> /// 省列表 /// </summary> /// <returns></returns> public ActionResult ProvinceList() { List <ha_regions> regionList = Regions.GetProvinceList(); StringBuilder sb = new StringBuilder(); sb.Append("["); foreach (ha_regions info in regionList) { sb.AppendFormat("{0}\"id\":\"{1}\",\"name\":\"{2}\"{3},", "{", info.regionid, info.name, "}"); } if (regionList.Count > 0) { sb.Remove(sb.Length - 1, 1); } sb.Append("]"); return(AjaxResult("success", sb.ToString(), true)); }