コード例 #1
0
        public async Task<ActionResult> FindGridView(VMGame filterModel, SxOrder order, int page = 1, int pageSize = 10)
        {
            var defaultOrder = new SxOrder { FieldName = "Title", Direction = SortDirection.Asc };
            var filter = new SxFilter(page, pageSize) { WhereExpressionObject = filterModel, Order = order == null || order.Direction == SortDirection.Unknown ? defaultOrder : order };

            var viewModel = await Repo.ReadAsync(filter);

            ViewBag.Filter = filter;

            return PartialView("_FindGridView", viewModel);
        }
コード例 #2
0
        public async Task<ActionResult> Index(VMGame filterModel, SxOrder order, int page = 1)
        {
            var filter = new SxFilter(page, _pageSize) { Order = order != null && order.Direction != SortDirection.Unknown ? order : null, WhereExpressionObject = filterModel };

            var viewModel = await Repo.ReadAsync(filter);
            if (page > 1 && !viewModel.Any())
                return new HttpNotFoundResult();

            ViewBag.Filter = filter;

            return PartialView("_GridView", viewModel);
        }
コード例 #3
0
 public VMLastMaterialsBlock()
 {
     Materials     = new VMMaterial[0];
     Games         = new VMGame[0];
     GameMaterials = new VMMaterial[0];
 }