public string DownloadQRCode(string pRequest) { //try //{ var rd = new RetailTraderItemQRCodeRD(); var rsp = new SuccessResponse <IAPIResponseData>(rd); string path = ""; var rp = pRequest.DeserializeJSONTo <APIRequest <RetailTraderItemQRCode> >(); if (string.IsNullOrEmpty(rp.Parameters.RetailTraderId)) { throw new APIException("请输入RetailTraderId参数") { ErrorCode = 000 } } ; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; var bll = new RetailTraderBLL(loggingSessionInfo); HttpContext context = System.Web.HttpContext.Current; var entityRetailTrader = bll.GetByID(rp.Parameters.RetailTraderId); DataSet ds = bll.RetailTraderItemQRCode(rp.Parameters.RetailTraderId); try { if (ds != null && ds.Tables[0].Rows.Count > 0) { List <GetRetailTraderItemQRCode> list = DataTableToObject.ConvertToList <GetRetailTraderItemQRCode>(ds.Tables[0]).ToList(); path = CreateZipAndResponse(list, context.Response, entityRetailTrader.RetailTraderName); if (!string.IsNullOrEmpty(path)) { rd.FilePath = path; } } else { throw new Exception("未绑定商品!"); //context.Response.Write("<script languge='javascript'>alert('No Data'); window.location.href='index.aspx'</script>"); } } catch (Exception ex) { throw ex; } return(rsp.ToJSON()); }