public void QueryInMaterial() { string rows = Context.Request.Form["rows"]; string page = Context.Request.Form["page"]; string msn = Context.Request.Form["msn"]; string materialCode = Context.Request.Form["materialCode"]; string batch = Context.Request.Form["batch"]; string custName = Context.Request.Form["custName"]; string startTime = Context.Request.Form["startTime"]; string endTime = Context.Request.Form["endTime"]; PagingResult <MaterialStockHistory> objs = _bal.FindMaterialHistory("", "0", msn, materialCode, batch, custName, startTime, endTime, rows, page); if (objs != null && objs.ResultSet.Count > 0) { for (int i = 0; i < objs.ResultSet.Count; i++) { objs.ResultSet[i].StockHouse = _bal.FindNameBySubCode(objs.ResultSet[i].StockHouse) == null ? objs.ResultSet[i].StockHouse : _bal.FindNameBySubCode(objs.ResultSet[i].StockHouse).SubName; objs.ResultSet[i].CustName = _bal.FindCustNameByCode(objs.ResultSet[i].CustName) == null ? objs.ResultSet[i].CustName : _bal.FindCustNameByCode(objs.ResultSet[i].CustName).NAME; objs.ResultSet[i].UpdatedBy = _bal.FindUserNameByCode(objs.ResultSet[i].UpdatedBy) == null ? objs.ResultSet[i].UpdatedBy : _bal.FindUserNameByCode(objs.ResultSet[i].UpdatedBy).UserName; } } Dictionary <String, Object> map = new Dictionary <String, Object>(); map.Add("total", objs.ResultCount); map.Add("rows", objs.ResultSet); Context.Response.Write(JsonConvert.SerializeObject(map)); }