Exemplo n.º 1
0
        /// <summary>
        /// 根据城市名称+楼盘名称模糊检索出楼盘信息
        /// </summary>
        /// <param name="projectNameLike"></param>
        /// <param name="cityName"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public static List <FxtApi_DATProject> GetProjectByCityNameAndLikeProjectName(string projectNameLike, string cityName, int count, FxtAPIClientExtend _fxtApi = null)
        {
            if (string.IsNullOrEmpty(projectNameLike) || string.IsNullOrEmpty(cityName))
            {
                return(new List <FxtApi_DATProject>());
            }
            List <FxtApi_DATProject> list   = new List <FxtApi_DATProject>();
            FxtAPIClientExtend       fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name    = "GetProjectByCityNameAndLikePrjName";
                var    para    = new { cityName = cityName, projectName = projectNameLike, length = count };
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));

                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(new List <FxtApi_DATProject>());
                }
                list = FxtApi_DATProject.ConvertToObjList(jsonStr);
                list = list.DecodeField();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("GetProjectByCityNameAndLikeProjectName(string projectNameLike, string cityName, int count)", ex);
            }
            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据城市名称查询楼盘信息
        /// </summary>
        /// <param name="cityName"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <param name="isGetCount">是否获取总数</param>
        /// <returns></returns>
        public static List <FxtApi_DATProject> GetProjectByCityName(string cityName, int pageIndex, int pageSize, out int count, bool isGetCount = true, FxtAPIClientExtend _fxtApi = null)
        {
            count = 0;
            int isgetcount = 1;

            if (!isGetCount)
            {
                isgetcount = 0;
            }
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);


            string name    = "GetProjectByCityNameAndPage";
            var    para    = new { cityName = cityName, pageIndex = pageIndex, pageSize = pageSize, isGetCount = isgetcount };
            string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));

            if (string.IsNullOrEmpty(jsonStr))
            {
                fxtApi.Abort();
                return(new List <FxtApi_DATProject>());
            }
            FxtApi_ResultPageList listObj = FxtApi_ResultPageList.ConvertToObj(jsonStr);

            count = listObj.Count;
            List <FxtApi_DATProject> list = FxtApi_DATProject.ConvertToObjList(listObj.ObjJson);

            list = list.DecodeField();
            fxtApi.Abort();
            return(list);
        }
Exemplo n.º 3
0
        public static List <FxtApi_DATProject> GetProjectByCityIdAndProjectIds(int fxtCityId, int[] projectIds, FxtAPIClientExtend _fxtApi = null)
        {
            string projectIdsStr          = projectIds.ConvertToString();
            List <FxtApi_DATProject> list = new List <FxtApi_DATProject>();

            if (string.IsNullOrEmpty(projectIdsStr))
            {
                return(list);
            }
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                JObject jObjPara = new JObject();
                jObjPara.Add(new JProperty("cityId", fxtCityId));
                jObjPara.Add(new JProperty("projectIds", projectIdsStr));
                string methodName = "GetProjectByCityIdAndProjectIds";
                string jsonStr    = Convert.ToString(EntranceApi.Entrance(methodName, jObjPara.ToJSONjss(), _fxtApi: fxtApi));
                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(new List <FxtApi_DATProject>());
                }
                list = FxtApi_DATProject.ConvertToObjList(jsonStr);
                list = list.DecodeField();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error(string.Format("GetProjectByCityIdAndProjectIds(int fxtCityId, int[] projectIds, FxtAPIClientExtend _fxtApi = null),fxtCity={0}",
                                        fxtCityId), ex);
            }
            return(list);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 根据名称成城市ID,获取楼盘信息(关联网络名查询)
        /// </summary>
        /// <param name="projectName">名字</param>
        /// <param name="fxtCityId">服务端的城市ID</param>
        /// <returns></returns>
        public static List <FxtApi_DATProject> GetProjectJoinProjectMatchByProjectNameCityId(string projectName, int fxtCityId, FxtAPIClientExtend _fxtApi = null)
        {
            if (string.IsNullOrEmpty(projectName))
            {
                return(new List <FxtApi_DATProject>());
            }
            List <FxtApi_DATProject> list   = new List <FxtApi_DATProject>();
            FxtAPIClientExtend       fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name    = "GetProjectJoinProjectMatchByProjectNameCityId";
                var    para    = new { projectName = projectName, cityId = fxtCityId };
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));

                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(new List <FxtApi_DATProject>());
                }
                list = FxtApi_DATProject.ConvertToObjList(jsonStr);
                list = list.DecodeField();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error(string.Format("GetProjectJoinProjectMatchByProjectNameCityId(string projectName:{0}, int fxtCityId:{1})",
                                        projectName == null ? "null" : "", fxtCityId), ex);
            }
            return(list);
        }