Beispiel #1
0
        internal Stream DownloadToStream(FileDownloadInput input)
        {
            string json   = JsonConvert.SerializeObject(input);
            var    res    = HwApiHelper.HuaweiPostSync(baseUrl, downloadUri, token.Access_token, json, null);
            Stream stream = res.GetResponseStream();

            return(stream);
        }
Beispiel #2
0
        /// <summary>
        /// 产生PO的PDF文件。
        /// 产生的文件保存在出参的流中
        /// </summary>
        /// <param name="input">输入参数</param>
        /// <returns></returns>
        internal GenPoPdfOutParameter GenPoPdfDAL(GenPoPdfInput input)
        {
            string json    = JsonConvert.SerializeObject(input);
            var    res     = HwApiHelper.HuaweiPostSync(baseUrl, genPoPdfUri, token.Access_token, json, null);
            string resJson = HwApiHelper.GetResponseString(res);
            var    output  = JsonConvert.DeserializeObject <GenPoPdfOutParameter>(resJson);

            ErrorMsg = output.HttpCode;
            ErrorMsg = output.Message;
            return(output);
        }
Beispiel #3
0
        /// <summary>
        /// 签返订单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        internal SignBackPoListOutput SignBackPoList(SignBackPoListInput input)
        {
            JsonSerializerSettings settings = new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            };
            string json    = JsonConvert.SerializeObject(input, settings);
            var    res     = HwApiHelper.HuaweiPostSync(baseUrl, signBackUri, token.Access_token, json, null);
            string resJson = HwApiHelper.GetResponseString(res);
            var    output  = JsonConvert.DeserializeObject <SignBackPoListOutput>(resJson);

            ErrorCode = output.Code;
            ErrorMsg  = output.Result;
            return(output);
        }
Beispiel #4
0
        /// <summary>
        /// PO列表查询
        /// </summary>
        /// <param name="inParameter"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        internal PoLineListOutput GetPoLineList(PoLineListInput inParameter, int page, int pageSize)
        {
            JsonSerializerSettings settings = new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore
            };
            string json    = JsonConvert.SerializeObject(inParameter, settings);
            string url     = pageSize == 100 ? findPoLineListUri + page: findPoLineListUri + pageSize + "/" + page;
            var    res     = HwApiHelper.HuaweiPostSync(baseUrl, url, token.Access_token, json, null);
            string resJson = HwApiHelper.GetResponseString(res);
            var    output  = JsonConvert.DeserializeObject <PoLineListOutput>(resJson);

            ErrorMsg  = res.StatusDescription;
            ErrorCode = res.StatusCode.ToString();
            return(output);
        }