Пример #1
0
 public FindResponse FindFiles(FindRequest request)
 {
     return Execute(_repository, r => r.FindFiles(request));
 }
Пример #2
0
        public ActionResult Index(FileIndexModel model)
        {
            model.InitSortInfo();

            if (string.IsNullOrWhiteSpace(model.SortBy))
            {
                model.SortBy = "Name";
            }

            var filter = new FindRequest
            {
                TextSearch = model.TextSearch,
                SortOption = new SortOption(new[] { new SortItem(model.SortBy, model.SortDirection.Value) }),
                PageOption = new PageOption { PageSize = model.Pagination.PageSize, PageNumber = model.Pagination.CurrentPageIndex }
            };

            var response = ServiceHelper.File.ExecuteDispose(s => s.FindFiles(filter));
            model.Results = response.Results.MapList<FileModel>();
            model.Pagination.TotalRecords = response.TotalRecords;

            return View(model);
        }