private PartialViewResult getResult(int testId)
        {
            var defaultOrder = new SX.WebCore.SxOrderItem {
                FieldName = "dstq.Title", Direction = SortDirection.Asc
            };
            var filter = new SxFilter(1, _pageSize)
            {
                Order = defaultOrder, AddintionalInfo = new object[] { testId }
            };
            var viewModel = _repo.Read(filter);

            ViewBag.Filter = filter;
            return(PartialView("_GridView", viewModel));
        }
        public async Task <ActionResult> Index(int testId, VMSiteTestSubject filterModel, SX.WebCore.SxOrderItem order, int page = 1)
        {
            var defaultOrder = new SX.WebCore.SxOrderItem {
                FieldName = "dstq.Title", Direction = SortDirection.Asc
            };
            var filter = new SxFilter(page, _pageSize)
            {
                Order = order == null || order.Direction == SortDirection.Unknown ? defaultOrder : order, WhereExpressionObject = filterModel, AddintionalInfo = new object[] { testId }
            };

            var viewModel = await _repo.ReadAsync(filter);

            if (page > 1 && !viewModel.Any())
            {
                return(new HttpNotFoundResult());
            }

            ViewBag.Filter = filter;

            return(PartialView("_GridView", viewModel));
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Index(string curCat, VMAphorism filterModel, SX.WebCore.SxOrderItem order, int page = 1)
        {
            filterModel.CategoryId = curCat;
            ViewBag.CategoryId     = curCat;

            var filter = new SxFilter(page, _pageSize)
            {
                Order = order, WhereExpressionObject = filterModel
            };
            var viewModel = await Repo.ReadAsync(filter);

            if (page > 1 && !viewModel.Any())
            {
                return(new HttpNotFoundResult());
            }

            ViewBag.Filter = filter;

            return(PartialView("_GridView", viewModel));
        }
Exemplo n.º 4
0
 public override Task <ActionResult> Index(VMAphorism filterModel, SX.WebCore.SxOrderItem order, int page = 1)
 {
     return(base.Index(filterModel, order, page));
 }