public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string cJQYBM = context.Request["CJQYBM"].ToString().Trim(); LiuzhuanHelper liuzhuanHelper = new LiuzhuanHelper(); float liuzhuanArea = liuzhuanHelper.GetAreaByCjbm(cJQYBM); CJQYHelper cjqyHelper = new CJQYHelper(); CJQY cjqy = cjqyHelper.GetData(cJQYBM); float cjqyArea = Convert.ToSingle(cjqy.CountArea); float wlzArea = cjqyArea - liuzhuanArea; string json = "[{name:\"已流转面积\",value:" + liuzhuanArea + "},{name:\"未流转面积\",value:" + wlzArea + "}]"; context.Response.Write(json); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string json = ""; if (context.Request["CJQYBM"] != null && context.Request["CJQYBM"] != "") { string cJQYBM = context.Request["CJQYBM"].ToString().Trim(); LiuzhuanHelper liuzhuanHelper = new LiuzhuanHelper(); int liuzhuanCount = liuzhuanHelper.GetCountByCjbm(cJQYBM); CJQYHelper cjqyHelper = new CJQYHelper(); CJQY cjqy = cjqyHelper.GetData(cJQYBM); int cjqyCount = Convert.ToInt32(cjqy.NumFarmer); int wlzCount = cjqyCount - liuzhuanCount; json = "[{name:\"已流转户数\",value:" + liuzhuanCount + "},{name:\"未流转户数\",value:" + wlzCount + "}]"; } context.Response.Write(json); }