public ActionResult AdminPanel() { if (!User.IsAdmin) { return(Redirect("/")); } var result = BloodSearchModelsRemoteProvider.GetOffers(new GetOffersByFiltersParameters { Filter = new SearchFilter { Sort = SearchFilter.SortEnum.Default, Type = OfferTypeEnum.Any, Statuses = new List <OfferStateEnum> { OfferStateEnum.New } }, PagingFilter = new PagingFilter { PageNumber = 1, PageSize = 100 } }); var model = new AdminPanelResponse { Items = result.Offers, TotalCount = result.TotalCount }; return(View(model)); }
public ActionResult Index(QueryParameters parameters) { var model = new SearchItemsIndexResponse(System.Web.HttpContext.Current) { QueryParameters = parameters }; var filters = OffersQueryParamsUtils.ParseFilterFromQueryParameters(parameters); model.Filter = filters.Filter; model.PagingFilter = filters.PagingFilter; var result = BloodSearchModelsRemoteProvider.GetOffers(new GetOffersByFiltersParameters { Filter = filters.Filter, PagingFilter = filters.PagingFilter }); model.Items = result.Offers; model.TotalCount = result.TotalCount; return(View(model)); }