Exemplo n.º 1
0
        /// <summary>
        /// 获取数据列表
        /// </summary>
        /// <returns></returns>
        public string GetProvinceCityList()
        {
            ProvinceCity            bll  = new ProvinceCity();
            List <ProvinceCityInfo> list = bll.GetList();

            if (list == null || list.Count == 0)
            {
                return("[]");
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取数据分页列表,并返回所有记录数
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecords"></param>
        /// <param name="sqlWhere"></param>
        /// <param name="cmdParms"></param>
        /// <returns></returns>
        public string GetProvinceCityList(int pageIndex, int pageSize, out int totalRecords, string sqlWhere, params SqlParameter[] cmdParms)
        {
            ProvinceCity            bll  = new ProvinceCity();
            List <ProvinceCityInfo> list = bll.GetList(pageIndex, pageSize, out totalRecords, sqlWhere, cmdParms);

            if (list == null || list.Count == 0)
            {
                return("[]");
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取满足当前条件的数据列表
        /// </summary>
        /// <param name="sqlWhere"></param>
        /// <param name="cmdParms"></param>
        /// <returns></returns>
        public string GetProvinceCityList(string sqlWhere, params SqlParameter[] cmdParms)
        {
            ProvinceCity            bll  = new ProvinceCity();
            List <ProvinceCityInfo> list = bll.GetList(sqlWhere, cmdParms);

            if (list == null || list.Count == 0)
            {
                return("[]");
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取当前市的区列表
        /// </summary>
        /// <returns></returns>
        public string GetDistrict(object cityId)
        {
            ProvinceCity bll  = new ProvinceCity();
            SqlParameter parm = new SqlParameter("@ParentId", SqlDbType.UniqueIdentifier);

            parm.Value = Guid.Parse(cityId.ToString());
            List <ProvinceCityInfo> list = bll.GetList("and ParentId = @ParentId", parm);

            if (list == null || list.Count == 0)
            {
                return("[]");
            }
            return(JsonConvert.SerializeObject(list));
        }
Exemplo n.º 5
0
        public string GetDistrict(Guid cityId)
        {
            StringBuilder sb   = new StringBuilder();
            ProvinceCity  bll  = new ProvinceCity();
            SqlParameter  parm = new SqlParameter("@ParentId", SqlDbType.UniqueIdentifier);

            parm.Value = Guid.Parse(cityId.ToString());
            List <ProvinceCityInfo> list = bll.GetList("and ParentId = @ParentId", parm);

            if (list == null || list.Count == 0)
            {
                return("[]");
            }
            return(sb.ToString());
        }
Exemplo n.º 6
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));
        }
Exemplo n.º 7
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());
        }