Beispiel #1
0
        /// <summary>
        /// 查询往来单位
        /// </summary>
        /// <param name="partnerCode"></param>
        /// <returns></returns>
        public string QueryPartner(string partnerCode)
        {
            var request  = new QueryPartnerRequest();
            var parmsDic = new Dictionary <string, object>();
            var parms    = new QueryPartnerDto {
                param = new QueryPartnerParam {
                    Code = partnerCode
                }
            };

            parmsDic.Add("_args", JsonConvert.SerializeObject(parms));
            request.SetPostParameters(parmsDic);
            var result    = _Client.Excute <JArray>(request);
            var resultStr = "";

            if (result != null)
            {
                var resultMsg = JsonConvert.DeserializeObject <List <QueryPartnerResult> >(result.ToString());
                if (resultMsg != null && resultMsg.Count > 0)
                {
                    resultStr = resultMsg.FirstOrDefault().Code;
                }
            }
            return(resultStr);
        }
Beispiel #2
0
        public List <CommonQueryResult> QueryPartnerList()
        {
            var request  = new QueryPartnerRequest();
            var parmsDic = new Dictionary <string, object>();
            var parms    = new QueryPartnerDto {
                param = new QueryPartnerParam {
                }
            };

            parmsDic.Add("_args", JsonConvert.SerializeObject(parms));
            request.SetPostParameters(parmsDic);
            var result    = _Client.Excute <JArray>(request);
            var resultStr = new List <CommonQueryResult>();

            if (result != null)
            {
                var resultMsg = JsonConvert.DeserializeObject <List <CommonQueryResult> >(result.ToString());
                if (resultMsg != null && resultMsg.Count > 0)
                {
                    resultStr = resultMsg;
                }
            }
            return(resultStr);
        }