예제 #1
0
        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);
        }
예제 #2
0
 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);
     }
 }