public JsonResult GetAllRegions() { var academyTeams = _balRegions.GetAllRegions(); var gridModel = new DataSourceResult { Data = academyTeams, Total = academyTeams.Count }; var jsonResult = Json(gridModel, JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return(jsonResult); }
public JsonResult GetAllRegions() { if (Session["RegionId"] != null) { int regionId = Convert.ToInt32(Session["RegionId"]); var academyTeams = _balRegions.GetAllRegions().Where(r => r.Id == regionId); var gridModel = academyTeams; var jsonResult = Json(gridModel, JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return(jsonResult); } else { var academyTeams = _balRegions.GetAllRegions(); var gridModel = new DataSourceResult { Data = academyTeams, Total = academyTeams.Count }; var jsonResult = Json(gridModel, JsonRequestBehavior.AllowGet); jsonResult.MaxJsonLength = int.MaxValue; return(jsonResult); } }