/// <summary> /// 删除案例 /// </summary> /// <param name="cityName">城市名称</param> /// <param name="caseIds"></param> /// <param name="message"></param> /// <returns></returns> public static bool DeleteCaseByCityNameAndCaseIds(string cityName, int[] caseIds, out string message, FxtAPIClientExtend _fxtApi = null) { message = ""; if (caseIds == null || caseIds.Length < 1) { return(true); } FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { string name = "DeleteCaseByCityNameAndCaseIds"; var para = new { cityName = cityName, caseIds = caseIds.ConvertToString() }; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi)); FxtApi_Result result = FxtApi_Result.ConvertToObj(jsonStr); bool _re = true; if (result.Result == 0) { message = result.Message.DecodeField(); _re = false; } fxtApi.Abort(); return(_re); } catch (Exception ex) { message = "系统异常"; log.Error("DeleteCaseByCityIdAndCaseIds(string cityName, int[] caseIds,out string message)", ex); fxtApi.Abort(); return(false); } return(true); }
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); }
public static bool UpdateCase(int fxtCityId, FxtApi_DATCase caseObj, out string message, FxtAPIClientExtend _fxtApi = null) { message = ""; if (caseObj == null) { return(true); } FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { string caseJson = caseObj.EncodeField().ToJSONjss(); string name = "UpdateCase"; var para = new { cityId = fxtCityId, caseJson = caseJson }; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi)); FxtApi_Result result = FxtApi_Result.ConvertToObj(jsonStr); if (result.Result == 0) { message = result.Message.DecodeField(); fxtApi.Abort(); return(false); } fxtApi.Abort(); caseObj.DecodeField(); } catch (Exception ex) { message = "系统异常"; log.Error("UpdateCase(int fxtCityId, FxtApi_DATCase caseObj, out string message)", ex); fxtApi.Abort(); return(false); } return(true); }
public static bool InsertProjectMatch(List <FxtApi_SYSProjectMatch> list, out string message, FxtAPIClientExtend _fxtApi = null) { message = ""; if (list == null || list.Count < 1) { return(true); } FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { list = list.EncodeField(); string json = list.ToJSONjss(); string name = "InsertSYSProjectMatchList"; var para = new { jsonData = json }; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi)); FxtApi_Result result = FxtApi_Result.ConvertToObj(jsonStr); if (result.Result == 0) { message = result.Message.DecodeField(); fxtApi.Abort(); return(false); } fxtApi.Abort(); } catch (Exception ex) { fxtApi.Abort(); log.Error("InsertProjectMatch(List<FxtApi_SYSProjectMatch> list,out string message)", ex); return(false); } return(true); }
/// <summary> /// 新增案例 /// </summary> /// <param name="caseId"></param> /// <param name="fxtCityId"></param> /// <param name="projectId"></param> /// <param name="buildingId"></param> /// <param name="houseNo"></param> /// <param name="caseDate"></param> /// <param name="purposeCode"></param> /// <param name="buildingArea"></param> /// <param name="unitPrice"></param> /// <param name="totalPrice"></param> /// <param name="caseTypeCode"></param> /// <param name="structureCode"></param> /// <param name="buildingTypeCode"></param> /// <param name="floorNumber"></param> /// <param name="totalFloor"></param> /// <param name="houseTypeCode"></param> /// <param name="frontCode"></param> /// <param name="moneyUnitCode"></param> /// <param name="remark"></param> /// <param name="areaId"></param> /// <param name="buildingDate"></param> /// <param name="fitmentCode"></param> /// <param name="subHouse"></param> /// <param name="peiTao"></param> /// <param name="createUser"></param> /// <param name="sourceName"></param> /// <param name="sourceLink"></param> /// <param name="sourcePhone"></param> /// <param name="message"></param> /// <param name="_fxtApi"></param> /// <returns></returns> public static FxtApi_DATCase InsertCase(int fxtCityId, int projectId, int?buildingId, string houseNo, DateTime caseDate, int?purposeCode, decimal?buildingArea, decimal?unitPrice, decimal?totalPrice, int?caseTypeCode, int?structureCode, int?buildingTypeCode, int?floorNumber, int?totalFloor, int?houseTypeCode, int?frontCode, int?moneyUnitCode, string remark, int?areaId, string buildingDate, int?fitmentCode, string subHouse, string peiTao, string createUser, string sourceName, string sourceLink, string sourcePhone, out string message, FxtAPIClientExtend _fxtApi = null) { message = ""; FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); FxtApi_DATCase caseObj = null; try { string name = "InsertCase"; var para = new { cityId = fxtCityId, projectId = projectId, buildingId = buildingId, houseNo = houseNo, caseDate = caseDate, purposeCode = purposeCode, buildingArea = buildingArea, unitPrice = unitPrice, totalPrice = totalPrice, caseTypeCode = caseTypeCode, structureCode = structureCode, buildingTypeCode = buildingTypeCode, floorNumber = floorNumber, totalFloor = totalFloor, houseTypeCode = houseTypeCode, frontCode = frontCode, moneyUnitCode = moneyUnitCode, remark = remark, areaId = areaId, buildingDate = buildingDate, fitmentCode = fitmentCode, subHouse = subHouse, peiTao = peiTao, createUser = createUser, sourceName = sourceName, sourceLink = sourceLink, sourcePhone = sourcePhone }; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, para.ToJSONjss(), _fxtApi: fxtApi)); FxtApi_Result result = FxtApi_Result.ConvertToObj(jsonStr); if (result.Result == 0) { message = result.Message.DecodeField(); fxtApi.Abort(); return(null); } caseObj = FxtApi_DATCase.ConvertToObj(result.Detail).DecodeField(); fxtApi.Abort(); } catch (Exception ex) { message = "系统异常"; log.Error("InsertCase(int caseId, int fxtCityId, int projectId,....)", ex); fxtApi.Abort(); return(null); } return(caseObj); }