コード例 #1
0
ファイル: SYSProvinceApi.cs プロジェクト: kingshhh/fxtcode
        public static List <FxtApi_SYSProvince> GetAllProvince(FxtAPIClientExtend _fxtApi = null)
        {
            List <FxtApi_SYSProvince> list   = new List <FxtApi_SYSProvince>();
            FxtAPIClientExtend        fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name    = "GetProvince";
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, "", _fxtApi: fxtApi));

                FxtApi_PublicResult result = jsonStr.ParseJSONjss <FxtApi_PublicResult>();
                if (result == null || string.IsNullOrEmpty(Convert.ToString(result.data)))
                {
                    fxtApi.Abort();
                    return(new List <FxtApi_SYSProvince>());
                }
                list = Convert.ToString(result.data).ParseJSONList <FxtApi_SYSProvince>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("GetAllProvince()", ex);
            }
            return(list);
        }
コード例 #2
0
        /// <summary>
        /// 根据城市名称获取城市信息
        /// </summary>
        /// <param name="cityName"></param>
        /// <returns></returns>
        public static FxtApi_SYSCity GetCityByCityName(string cityName, FxtAPIClientExtend _fxtApi = null)
        {
            FxtApi_SYSCity     city   = null;
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name    = "GetCityByCityName";
                var    para    = new { cityName = cityName };
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));
                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(null);
                }
                city = jsonStr.ParseJSONjss <FxtApi_SYSCity>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error(string.Format("GetCityByCityName(string cityName:{0})", cityName == null ? "null" : ""), ex);
            }
            return(city);
        }
コード例 #3
0
ファイル: DATBuildingApi.cs プロジェクト: kingshhh/fxtcode
        /// <summary>
        /// 根据楼栋ID获取楼栋详细信息,(根据查勘权限和字表)
        /// </summary>
        /// <param name="buildingId"></param>
        /// <param name="cityId"></param>
        /// <param name="companyId"></param>
        /// <param name="_fxtApi"></param>
        /// <returns></returns>
        public static DATBuilding GetBuildingDetailByBuildingIdAndCityIdAndCompanyId(int buildingId, int cityId, int companyId, FxtAPIClientExtend _fxtApi = null)
        {
            DATBuilding        obj    = null;
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name = "GetBuildingDetailByBuildingIdAndCityIdAndCompanyId";

                var    para    = new { buildingId = buildingId, cityId = cityId, companyId = companyId };
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));

                FxtApi_PublicResult result = jsonStr.ParseJSONjss <FxtApi_PublicResult>();
                if (result == null || string.IsNullOrEmpty(Convert.ToString(result.data)))
                {
                    fxtApi.Abort();
                    return(obj);
                }
                obj = Convert.ToString(result.data).ParseJSONjss <DATBuilding>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("GetBuildingDetailByBuildingIdAndCityIdAndCompanyId()", ex);
            }
            return(obj);
        }
コード例 #4
0
        public static List <SYSCode> GetSYSCodeById(int id, FxtAPIClientExtend _fxtApi = null)
        {
            List <SYSCode>     list   = new List <SYSCode>();
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

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

                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(new List <SYSCode>());
                }
                list = JsonHelp.ParseJSONList <SYSCode>(jsonStr);
                list.DecodeField <SYSCode>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("GetSYSCodeById(int id,FxtAPIClientExtend _fxtApi = null)", ex);
            }
            return(list);
        }
コード例 #5
0
ファイル: SYSAreaApi.cs プロジェクト: kingshhh/fxtcode
        /// <summary>
        /// 根据行政区ID获取行政区信息
        /// </summary>
        /// <param name="areaId"></param>
        /// <param name="_fxtApi"></param>
        /// <returns></returns>
        public static FxtApi_SYSArea GetAreaByAreaId(int areaId, FxtAPIClientExtend _fxtApi = null)
        {
            FxtApi_SYSArea     obj    = new FxtApi_SYSArea();
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                var    jObjPara   = new { areaId = areaId };
                string methodName = "GetAreaByAreaId";
                string jsonStr    = Convert.ToString(EntranceApi.Entrance(methodName, jObjPara.ToJSONjss(), _fxtApi: fxtApi));
                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(null);
                }
                obj = jsonStr.ParseJSONjss <FxtApi_SYSArea>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error(string.Format("GetAreaByAreaId(),areaId={0}",
                                        areaId), ex);
            }
            return(obj);
        }
コード例 #6
0
ファイル: SYSAreaApi.cs プロジェクト: kingshhh/fxtcode
        /// <summary>
        /// 根据多个行政区ID获取多个行政区信息
        /// </summary>
        /// <param name="areaIds"></param>
        /// <param name="_fxtApi"></param>
        /// <returns></returns>
        public static List <FxtApi_SYSArea> GetAreaByAreaIds(int[] areaIds, FxtAPIClientExtend _fxtApi = null)
        {
            string areaIdsStr          = areaIds.ConvertToString();
            List <FxtApi_SYSArea> list = new List <FxtApi_SYSArea>();

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

            try
            {
                var    jObjPara   = new { areaIds = areaIdsStr };
                string methodName = "GetSYSAreaByAreaIds";
                string jsonStr    = Convert.ToString(EntranceApi.Entrance(methodName, jObjPara.ToJSONjss(), _fxtApi: fxtApi));
                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(new List <FxtApi_SYSArea>());
                }
                list = jsonStr.ParseJSONList <FxtApi_SYSArea>();;
                list = list.DecodeField();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error(string.Format("GetAreaByAreaIds(int[] areaIds, FxtAPIClientExtend _fxtApi = null),areaIds={0}",
                                        areaIdsStr == null ? "null" : areaIdsStr), ex);
            }
            return(list);
        }
コード例 #7
0
ファイル: SYSAreaApi.cs プロジェクト: kingshhh/fxtcode
        /// <summary>
        /// 根据城市id获取行政区列表
        /// </summary>
        /// <param name="fxtCityId"></param>
        /// <returns></returns>
        public static List <FxtApi_SYSArea> GetAreaByCityId(int fxtCityId, FxtAPIClientExtend _fxtApi = null)
        {
            FxtAPIClientExtend    fxtApi = new FxtAPIClientExtend(_fxtApi);
            List <FxtApi_SYSArea> list   = new List <FxtApi_SYSArea>();

            try
            {
                string name                = "GetArea";
                var    para                = new { cityId = fxtCityId };
                string jsonStr             = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));
                FxtApi_PublicResult result = jsonStr.ParseJSONjss <FxtApi_PublicResult>();
                if (result == null || string.IsNullOrEmpty(Convert.ToString(result.data)))
                {
                    fxtApi.Abort();
                    return(new List <FxtApi_SYSArea>());
                }
                list = Convert.ToString(result.data).ParseJSONList <FxtApi_SYSArea>();
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error(string.Format("GetAreaByCityId(cityName:{0})", fxtCityId), ex);
            }
            return(list);
        }
コード例 #8
0
        /// <summary>
        /// 根据楼盘ID获取楼盘详细信息,(根据查勘权限和字表)
        /// </summary>
        /// <param name="projectId"></param>
        /// <param name="cityId"></param>
        /// <param name="companyId"></param>
        /// <param name="_lnkpaList"></param>
        /// <param name="_lnkpcList"></param>
        /// <param name="phCount"></param>
        /// <param name="_fxtApi"></param>
        /// <returns></returns>
        public static DATProject GetProjectDetailByProjectIdAndCityIdAndCompanyId(int projectId, int cityId, int companyId,
                                                                                  out IList <LNKPAppendage> _lnkpaList, out IList <LNKPCompany> _lnkpcList, out int phCount, FxtAPIClientExtend _fxtApi = null)
        {
            _lnkpaList = new List <LNKPAppendage>();
            _lnkpcList = new List <LNKPCompany>();
            phCount    = 0;
            DATProject         proj   = null;
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name = "GetProjectDetailByProjectIdAndCityIdAndCompanyId";

                var    para    = new { projectId = projectId, cityId = cityId, companyId = companyId };
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));
                //log.Info(string.Format("获取正式库楼盘信息(wcf):fxtcompanyid:{0},fxtprojectid:{1},cityid:{2},jsonstri:{3}", companyId, projectId, cityId,jsonStr));
                FxtApi_PublicResult result = jsonStr.ParseJSONjss <FxtApi_PublicResult>();
                if (result == null || string.IsNullOrEmpty(Convert.ToString(result.data)))
                {
                    fxtApi.Abort();
                    return(proj);
                }
                JObject jobj = JObject.Parse(Convert.ToString(result.data));
                proj       = jobj.Value <string>("project").ParseJSONjss <DATProject>();
                _lnkpaList = jobj.Value <string>("appendage").ParseJSONList <LNKPAppendage>();
                phCount    = jobj.Value <int>("phcount");
                _lnkpcList = jobj.Value <string>("pcompany").ParseJSONList <LNKPCompany>();

                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("GetProjectDetailByProjectIdAndCityIdAndCompanyId()", ex);
            }
            return(proj);
        }
コード例 #9
0
        /// <summary>
        /// 获取所有城市
        /// </summary>
        /// <param name="_fxtApi"></param>
        /// <returns></returns>
        public static List <FxtApi_SYSCity> GetAllCity(FxtAPIClientExtend _fxtApi = null)
        {
            List <FxtApi_SYSCity> list   = new List <FxtApi_SYSCity>();
            FxtAPIClientExtend    fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string name    = "GetAllCity";
                string jsonStr = Convert.ToString(EntranceApi.Entrance(name, "", _fxtApi: fxtApi));
                if (string.IsNullOrEmpty(jsonStr))
                {
                    fxtApi.Abort();
                    return(null);
                }
                list = JsonHelp.ParseJSONList <FxtApi_SYSCity>(jsonStr);
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("GetAllCity()", ex);
            }
            return(list);
        }