public ActionResult Index() { var model = new FileIndexModel(); model.Files = TSFiles.LoadStubs(); model.Permissions = Permissions.Load(User); string userID = User.GetUserID(); model.Files.MineFilter = UserPreferences.Get <bool>(userID, "PageIndexMine"); return(View(model)); }
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); }