/// <summary> /// 获取对应的数据 /// </summary> /// <param name="Id"></param> /// <returns></returns> public string GetProvinceCityModel(object Id) { ProvinceCity bll = new ProvinceCity(); ProvinceCityInfo model = bll.GetModel(Id); if (model == null) { return("[]"); } return(JsonConvert.SerializeObject(model)); }
public string GetProvinceCityModel(Guid Id) { StringBuilder sb = new StringBuilder(); ProvinceCity bll = new ProvinceCity(); ProvinceCityInfo model = bll.GetModel(Id); if (model == null) { return("[]"); } return(sb.ToString()); }
/// <summary> /// 获取所有省份列表 /// </summary> /// <returns></returns> public string GetProvince() { ProvinceCity bll = new ProvinceCity(); ProvinceCityInfo parentModel = bll.GetModel("中国"); if (parentModel == null) { return("[]"); } SqlParameter parm = new SqlParameter("@ParentId", SqlDbType.UniqueIdentifier); parm.Value = parentModel.Id; List <ProvinceCityInfo> list = bll.GetList("and ParentId = @ParentId", parm); if (list == null || list.Count == 0) { return("[]"); } return(JsonConvert.SerializeObject(list)); }
public string GetProvince() { StringBuilder sb = new StringBuilder(); ProvinceCity bll = new ProvinceCity(); ProvinceCityInfo parentModel = bll.GetModel("中国"); if (parentModel == null) { return("[]"); } SqlParameter parm = new SqlParameter("@ParentId", SqlDbType.UniqueIdentifier); parm.Value = parentModel.Id; List <ProvinceCityInfo> list = bll.GetList("and ParentId = @ParentId", parm); if (list == null || list.Count == 0) { return("[]"); } return(sb.ToString()); }