public ActionResult GetStocks(int companyId, int warehouseId, int commodityId, int commodityTypeId, int brandId, int start, int length) { int currentUserId = Convert.ToInt32(Session["CurrentUserId"].ToString()); var StockSvc = new StockService(); int from = start; int to = from + length - 1; var data = StockSvc.GetStockByRange(companyId, warehouseId, commodityId, commodityTypeId, brandId, from, to, currentUserId); var allCount = StockSvc.GetStockCount(companyId, warehouseId, commodityId, commodityTypeId, brandId, currentUserId); var result = new Dictionary<string, object> { {"aaData", data}, {"iTotalRecords", data.Count}, {"iTotalDisplayRecords", allCount} }; return Json(result); }