public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; int corpId = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["cid"])) { if (!int.TryParse(context.Request.QueryString["cid"], out corpId)) corpId = 0; } int allotId = 0; if (string.IsNullOrEmpty(context.Request.QueryString["aid"]) || !int.TryParse(context.Request.QueryString["aid"], out allotId)) allotId = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim()); NFMT.Funds.BLL.ReceivableAllotBLL bll = new NFMT.Funds.BLL.ReceivableAllotBLL(); NFMT.Common.SelectModel select = bll.GetReceCorpAllotSelectModel(pageIndex, pageSize, orderStr, corpId, allotId); NFMT.Common.ResultModel result = bll.Load(user, select); context.Response.ContentType = "application/json; charset=utf-8"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>(); dic.Add("count", result.AffectCount); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic); context.Response.Write(postData); }