public ActionResult GetListArtice(ArticeIndexModel model) { PopulateIndexModel(model); return JsonObject(true, string.Empty, new { html = PartialViewToString("_list", model) }); }
public ActionResult Index(ArticeIndexModel model) { PopulateIndexModel(model); return View(model); }
private void PopulateIndexModel(ArticeIndexModel 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.Artice.ExecuteDispose(s => s.FindArtices(filter)); model.Results = response.Results.MapList<ArticeModel>(); model.Pagination.TotalRecords = response.TotalRecords; }