public static List <FxtApi_SYSCode> GetSYSCodeById(int id, FxtAPIClientExtend _fxtApi = null) { List <FxtApi_SYSCode> list = new List <FxtApi_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 <FxtApi_SYSCode>()); } list = FxtApi_SYSCode.ConvertToObjList(jsonStr); list.DecodeField <FxtApi_SYSCode>(); fxtApi.Abort(); } catch (Exception ex) { fxtApi.Abort(); log.Error("GetSYSCodeById(int id,FxtAPIClientExtend _fxtApi = null)", ex); } return(list); }
/// <summary> /// 根据字段code获取code信息 /// </summary> /// <param name="code"></param> /// <param name="_fxtApi"></param> /// <returns></returns> public static FxtApi_SYSCode GetSYSCodeByCode(int code, FxtAPIClientExtend _fxtApi = null) { FxtApi_SYSCode codeObj = null; FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { JObject jObjPara = new JObject(); jObjPara.Add(new JProperty("code", code)); string methodName = "GetSYSCodeByCode"; string jsonStr = Convert.ToString(EntranceApi.Entrance(methodName, jObjPara.ToJSONjss(), _fxtApi: fxtApi)); if (string.IsNullOrEmpty(jsonStr)) { fxtApi.Abort(); return(codeObj); } codeObj = FxtApi_SYSCode.ConvertToObj(jsonStr); codeObj = codeObj.DecodeField(); fxtApi.Abort(); } catch (Exception ex) { fxtApi.Abort(); log.Error(string.Format("GetSYSCodeByCode(int code, FxtAPIClientExtend _fxtApi = null)),code={0}", code), ex); } return(codeObj); }
/// <summary> /// 获取别墅相关的住宅用途 /// </summary> /// <param name="_fxtApi"></param> /// <returns></returns> public static List <FxtApi_SYSCode> GetPurposeTypeCodeVillaType(FxtAPIClientExtend _fxtApi = null) { List <FxtApi_SYSCode> list = new List <FxtApi_SYSCode>(); FxtAPIClientExtend fxtApi = new FxtAPIClientExtend(_fxtApi); try { string name = "GetPurposeTypeCodeVillaType"; string jsonStr = Convert.ToString(EntranceApi.Entrance(name, "", _fxtApi: fxtApi)); if (string.IsNullOrEmpty(jsonStr)) { fxtApi.Abort(); return(new List <FxtApi_SYSCode>()); } list = FxtApi_SYSCode.ConvertToObjList(jsonStr); list.DecodeField <FxtApi_SYSCode>(); fxtApi.Abort(); } catch (Exception ex) { fxtApi.Abort(); log.Error("GetPurposeTypeCodeVillaType()", ex); } return(list); }