Пример #1
0
        public IActionResult Grid()
        {
            string             gridName    = HttpContext.Request.Query["Name"];
            IMVCGridDefinition grid        = MVCGridDefinitionTable.GetDefinitionInterface(gridName);
            QueryOptions       options     = QueryStringParser.ParseOptions(grid, HttpHelper.HttpContext.Request.ToNameValueCollection());
            GridContext        gridContext = GridContextUtility.Create(/*context, */ gridName, grid, options);

            GridEngine engine = new GridEngine();

            if (!engine.CheckAuthorization(gridContext))
            {
                return(new StatusCodeResult(403));
            }

            var renderingModel = engine.GenerateModel(gridContext);

            return(PartialView(grid.ViewPath, renderingModel));
        }
Пример #2
0
        public ActionResult Grid()
        {
            HttpContext        context     = System.Web.HttpContext.Current;
            string             gridName    = context.Request.QueryString["Name"];
            IMVCGridDefinition grid        = MVCGridDefinitionTable.GetDefinitionInterface(gridName);
            QueryOptions       options     = QueryStringParser.ParseOptions(grid, context.Request.QueryString);
            GridContext        gridContext = GridContextUtility.Create(/*context, */ gridName, grid, options);

            GridEngine engine = new GridEngine();

            if (!engine.CheckAuthorization(gridContext, context.User.Identity.IsAuthenticated))
            {
                return(new HttpStatusCodeResult(403, "Access denied"));
            }

            var renderingModel = engine.GenerateModel(gridContext);

            return(PartialView(grid.ViewPath, renderingModel));
        }
Пример #3
0
        public ActionResult Grid()
        {
            var context = System.Web.HttpContext.Current;

            string gridName = context.Request["Name"];

            var grid = MVCGridDefinitionTable.GetDefinitionInterface(gridName);

            var options = GridOptionParser.ParseOptions(grid, gridName, context.Request);

            var gridContext = GridContextUtility.Create(context, gridName, grid, options);

            GridEngine engine = new GridEngine();

            if (!engine.CheckAuthorization(gridContext))
            {
                return(new HttpStatusCodeResult(403, "Access denied"));
            }

            var renderingModel = engine.GenerateModel(gridContext);

            return(PartialView(grid.ViewPath, renderingModel));
        }