public void ProcessRequest(HttpContext context) { context.Response.ContentEncoding = Encoding.UTF8; context.Response.ContentType = "application/json"; string idCode = context.Request.QueryString["IDCode"]; StockBLL bll = BLLFactory.CreateBLL <StockBLL>(); WHMatAmount mat = null; if (string.IsNullOrEmpty(idCode) == false) { //根据识别码 mat = bll.GetStockByBarCode(idCode); if (mat == null || mat.ProductAmount == 0) { mat = new WHMatAmount(); mat.MatCode = "none"; mat.MatBarCode = "none"; } } context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(mat)); }