Пример #1
0
        public static bool InsertProjectApi(string projectName, int cityId, int areaId, int purposeCode, string address, out string message, FxtAPIClientExtend _fxtApi = null)
        {
            bool r = true;

            message = "";
            FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi);

            try
            {
                string        name    = "InsertProject";
                var           para    = new { projectName = projectName, cityId = cityId, areaId = areaId, purposeCode = purposeCode, address = address };
                string        jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi));
                FxtApi_Result result  = FxtApi_Result.ConvertToObj(jsonStr);
                if (result == null)
                {
                    fxtApi.Abort();
                    return(false);
                }
                r       = result.Result == 0 ? false : true;
                message = JsonHelp.DecodeField(result.Message);
                fxtApi.Abort();
            }
            catch (Exception ex)
            {
                fxtApi.Abort();
                log.Error("InsertProjectApi(string projectName,int cityId,int areaId,int purposeCode,string address,out string message)", ex);
                return(false);
            }
            return(r);
        }
Пример #2
0
        /// <summary>
        /// 根据城市名称获取fxtapi中的行政区
        /// </summary>
        /// <param name="cityName"></param>
        /// <returns></returns>
        public ActionResult GetFxtSysAreaByCityName_Api(string cityName)
        {
            cityName = JsonHelp.DecodeField(cityName);
            List <FxtApi_SYSArea> list = AreaApiManager.GetAreaByCityName(cityName);

            list = list.EncodeField <FxtApi_SYSArea>();
            string jsonStr = list.ToJSONjss().MvcResponseJson(1, "", "");

            Response.Write(jsonStr);
            Response.End();
            return(null);
        }
Пример #3
0
        public ActionResult AddProject_Fancybox(string projectName, string cityName, string areaName, long?caseId)
        {
            projectName = JsonHelp.DecodeField(projectName);
            cityName    = JsonHelp.DecodeField(cityName);
            areaName    = JsonHelp.DecodeField(areaName);
            int                       nowProvinceId   = 0;
            int                       nowCityId       = 0;
            int                       nowAreaId       = 0;
            FxtApi_SYSCity            city            = CityApi.GetCityByCityName(cityName);
            List <FxtApi_SYSProvince> provinceList    = ProvinceApi.GetAllProvince();
            List <FxtApi_SYSCode>     purposeCodeList = SysCodeApi.GetAllProjectPurposeCode();
            List <FxtApi_SYSCity>     cityList        = new List <FxtApi_SYSCity>();
            List <FxtApi_SYSArea>     areaList        = new List <FxtApi_SYSArea>();

            if (city != null)
            {
                nowProvinceId = city.ProvinceId;
                nowCityId     = city.CityId;
                cityList      = CityApi.GetCityByProvinceId(nowProvinceId);
                areaList      = AreaApi.GetAreaByCityId(nowCityId);
                if (areaList != null)
                {
                    FxtApi_SYSArea area = areaList.Where(p => !string.IsNullOrEmpty(areaName) && (p.AreaName.Contains(areaName) || areaName.Contains(p.AreaName))).FirstOrDefault();
                    if (area != null)
                    {
                        nowAreaId = area.AreaId;
                    }
                }
            }
            ViewBag.Address         = "";
            ViewBag.nowProvinceId   = nowProvinceId;
            ViewBag.nowCityId       = nowCityId;
            ViewBag.nowAreaId       = nowAreaId;
            ViewBag.projectName     = projectName;
            ViewBag.provinceList    = provinceList;
            ViewBag.purposeCodeList = purposeCodeList;
            ViewBag.cityList        = cityList;
            ViewBag.areaList        = areaList;
            if (caseId != null)
            {
                案例信息 caseObj = CaseManager.GetCaseById(Convert.ToInt64(caseId));
                if (caseObj != null && caseObj.地址 != null)
                {
                    ViewBag.Address = caseObj.地址;
                }
            }

            return(View());
        }