Пример #1
0
        /// <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));
        }
Пример #2
0
        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());
        }
Пример #3
0
        /// <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));
        }
Пример #4
0
        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());
        }