public void FindSendMar() { string rows = Context.Request.Form["rows"]; string page = Context.Request.Form["page"]; string workOrder = Context.Request.Form["workOrder"]; int count = _bal.FindSendMarCount(workOrder, "1"); IList <MaterialStockHistory> ms = _bal.FindSendMar(rows, page, workOrder, "1"); 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)); }