예제 #1
0
        public JsonResult UsuariosPaginados(int? page)
        {
            using (var bll = new UsuarioSapiensBLL())
            {

                var vm = bll.ListarTodos().AsQueryable();

                var ajaxGridFactory = new Grid.Mvc.Ajax.GridExtensions.AjaxGridFactory();
                var grid = ajaxGridFactory.CreateAjaxGrid(vm, page.HasValue? page.Value: 1 , false);

                return Json(new { Html = grid.ToJson("_GridUsuarios", this), grid.HasItems }, JsonRequestBehavior.AllowGet);
            }
        }
예제 #2
0
        //
        // GET: /Usuario/
        public ActionResult Index()
        {
            //Autentica
            if (Session["ConexaoSapiens"] == null)
            {
                return RedirectToAction("Login", "Home");
            }
            //Autoriza
            if (!AutorizaUsuario(ControlAccessConfig.Usuario))
            {
                return View("Erro", null, "Módulo não autorizado para este usuário. ");
            }

            using (var bll = new UsuarioSapiensBLL())
            {
                var model = bll.ListarTodos().OrderBy(u => u.Nomusu).AsQueryable();
                var ajaxGridFactory = new Grid.Mvc.Ajax.GridExtensions.AjaxGridFactory();
                var grid = ajaxGridFactory.CreateAjaxGrid(model, 1, false);

                return View(grid);
            }
        }