private void setGetBuyofferParams(string bussdata) { AliBuyoffer buyoffer = JsonConvert.DeserializeObject <AliBuyoffer>(bussdata); Secret = buyoffer; UrlParams = new Dictionary <string, string>(); UrlParams.Add("access_token", Secret.TokenKey); UrlParams.Add("buyOfferId", buyoffer.offerid); FunName = "cn.alibaba.open/caigou.api.buyOffer.getBuyOfferById"; }
private void setPostBuyofferParams(string bussdata) { AliBuyoffer buyoffer = JsonConvert.DeserializeObject <AliBuyoffer>(bussdata); Secret = buyoffer; UrlParams = new Dictionary <string, string>(); UrlParams.Add("access_token", Secret.TokenKey); if (buyoffer.items == null) { throw new Exception("缺少询价单明细"); } if (buyoffer.items.Count == 0) { throw new Exception("询价单明细行数为0"); } UrlParams.Add("items", JsonConvert.SerializeObject(buyoffer.items)); UrlParams.Add("prId", buyoffer.ngid); UrlParams.Add("open", buyoffer.open.ToString()); UrlParams.Add("openToPortal", buyoffer.openToPortal.ToString()); UrlParams.Add("allmysupplier", "true"); UrlParams.Add("needSignAgreement", "false"); if (buyoffer.subuserid != "0" && !string.IsNullOrEmpty(buyoffer.subuserid)) { UrlParams.Add("subUserId", buyoffer.subuserid); } UrlParams.Add("gmtQuotationExpire", buyoffer.gmtQuotationExpire.ToString("yyyyMMddHHmmssfffzz00")); UrlParams.Add("subBizType", buyoffer.subBizType); UrlParams.Add("processTemplateCode", buyoffer.processTemplateCode); UrlParams.Add("transToolType", buyoffer.transToolType); UrlParams.Add("invoiceRequirement", buyoffer.invoiceRequirement); UrlParams.Add("visibleAfterEndQuote", buyoffer.visibleAfterEndQuote.ToString()); UrlParams.Add("sourceMethodType", buyoffer.sourceMethodType); if (buyoffer.sourceMethodType == "selectedmysupplier") { if (buyoffer.supplierLoginIds != null) { if (buyoffer.supplierLoginIds.Count > 0) { UrlParams.Add("supplierLoginIds", JsonConvert.SerializeObject(buyoffer.supplierLoginIds)); UrlParams.Add("selectedmysupplier", "true"); } } else if (buyoffer.supplierMemberIds != null) { if (buyoffer.supplierMemberIds.Count > 0) { UrlParams.Add("supplierMemberIds", JsonConvert.SerializeObject(buyoffer.supplierMemberIds)); UrlParams.Add("selectedmysupplier", "true"); } } } UrlParams.Add("includeTax", buyoffer.includeTax.ToString()); UrlParams.Add("quoteHasPostFee", buyoffer.quoteHasPostFee.ToString()); UrlParams.Add("allowPartOffer", buyoffer.allowPartOffer.ToString()); if (buyoffer.certificateIds != null) { if (buyoffer.certificateIds.Count > 0) { UrlParams.Add("certificateIds", JsonConvert.SerializeObject(buyoffer.certificateIds)); } } if (buyoffer.otherCertificateNames != null) { if (buyoffer.otherCertificateNames.Count > 0) { UrlParams.Add("otherCertificateNames", JsonConvert.SerializeObject(buyoffer.otherCertificateNames)); } } UrlParams.Add("description", buyoffer.description); UrlParams.Add("contact", buyoffer.contact); UrlParams.Add("phone", buyoffer.phone); UrlParams.Add("subject", buyoffer.subject); //UrlParams.Add("receiveAddressProvince", "3478"); //UrlParams.Add("receiveAddressCity", "3486"); //UrlParams.Add("receiveAddressCounty", "3487"); if (!string.IsNullOrWhiteSpace(buyoffer.receiveStreetAddress)) { UrlParams.Add("receiveStreetAddress", buyoffer.receiveStreetAddress); } if (!string.IsNullOrWhiteSpace(buyoffer.receiveAddressProvince)) { UrlParams.Add("receiveAddressProvince", buyoffer.receiveAddressProvince); } if (!string.IsNullOrWhiteSpace(buyoffer.receiveAddressCity)) { UrlParams.Add("receiveAddressCity", buyoffer.receiveAddressCity); } FunName = "cn.alibaba.open/caigou.api.buyoffer.postBuyoffer"; }