public void FindReceiveMar() { string rows = Context.Request.Form["rows"]; string page = Context.Request.Form["page"]; string materialCode = Context.Request.Form["materialCode"]; int count = _bal.FindReceiveMarCount(materialCode); IList <MaterialStock> ms = _bal.FindReceiveMar(rows, page, materialCode); if (ms != null && ms.Count > 0) { for (int i = 0; i < ms.Count; i++) { ms[i].StockHouse = _bal.FindNameBySubCode(ms[i].StockHouse) == null ? ms[i].StockHouse : _bal.FindNameBySubCode(ms[i].StockHouse).SubName; ms[i].CustName = _bal.FindCustNameByCode(ms[i].CustName) == null ? ms[i].CustName : _bal.FindCustNameByCode(ms[i].CustName).NAME; ms[i].UpdatedBy = _bal.FindUserNameByCode(ms[i].UpdatedBy) == null ? ms[i].UpdatedBy : _bal.FindUserNameByCode(ms[i].UpdatedBy).UserName; } } Dictionary <String, Object> map = new Dictionary <String, Object>(); map.Add("total", count); map.Add("rows", ms); Context.Response.Write(JsonConvert.SerializeObject(map)); }