Exemplo n.º 1
0
        /// <summary>
        /// 查询案例
        /// </summary>
        /// <param name="fxtCityId"></param>
        /// <param name="projectId"></param>
        /// <param name="buildingTypeCode"></param>
        /// <param name="purposeCode">用途</param>
        /// <param name="buildingAreaCode">面积段code</param>
        /// <param name="startDate">案例时间</param>
        /// <param name="endDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="count"></param>
        /// <param name="isGetCount">是否获取总个数</param>
        /// <returns></returns>
        public static List <FxtApi_DATCase> GetCaseByFxtCityIdAndFxtProjectIdAndBuildingTypeCodeAndPurposeCodeAndAreaTypeAndDate(int fxtCityId, int projectId, string fxtCompanyIds, int?buildingTypeCode, int purposeCode, int?buildingAreaCode, DateTime?startDate, DateTime?endDate, 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 = "GetCaseByCityIdAndProjectIdAndPurposeCodeAndBuildingTypeCodeAndAreaTypeAndDateAndPage";
            var    para = new
            {
                cityId           = fxtCityId,
                projectId        = projectId,
                fxtCompanyIds    = fxtCompanyIds,
                buildingTypeCode = buildingTypeCode,
                purposeCode      = purposeCode,
                buildingAreaCode = buildingAreaCode,
                startDate        = Convert.ToString(startDate),
                endDate          = Convert.ToString(endDate),
                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_DATCase>());
            }
            FxtApi_ResultPageList listObj = FxtApi_ResultPageList.ConvertToObj(jsonStr);

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

            list = list.DecodeField();
            fxtApi.Abort();
            return(list);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据房讯通城市ID and 多个案例ID获取案例信息
        /// </summary>
        /// <param name="fxtCityId"></param>
        /// <param name="fxtIds"></param>
        /// <returns></returns>
        public static List <FxtApi_DATCase> GetCaseByFxtCityIdAndCaseIds(int fxtCityId, int[] fxtCaseIds, FxtAPIClientExtend _fxtApi = null)
        {
            if (fxtCaseIds == null || fxtCaseIds.Length < 1)
            {
                return(new List <FxtApi_DATCase>());
            }
            List <FxtApi_DATCase> list   = new List <FxtApi_DATCase>();
            FxtAPIClientExtend    fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                StringBuilder sb = new StringBuilder("");
                foreach (int id in fxtCaseIds)
                {
                    sb.Append(id).Append(",");
                }
                string str = sb.ToString().TrimEnd(',');

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

                if (string.IsNullOrEmpty(jsonStr))
                {
                    return(new List <FxtApi_DATCase>());
                }
                list = FxtApi_DATCase.ConvertToObjList(jsonStr);
                list = list.DecodeField <FxtApi_DATCase>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                log.Error(string.Format("GetCaseByFxtCityIdAndCaseIds(int fxtCityId:{0}, int[] fxtCaseIds)", fxtCityId), ex);
                fxtApi.Abort();
            }
            return(list);
        }