Ejemplo n.º 1
0
 public static EventUserSearchDto ToDto(this EventUserSearchViewModel source)
 {
     return(new EventUserSearchDto
     {
         PageNumber = source.PageNumber,
         PageSize = source.PageSize,
         Title = source.Title
     });
 }
Ejemplo n.º 2
0
        public IActionResult Index(EventUserSearchViewModel searchModel)
        {
            var data = _userService.GetEvents(searchModel.ToDto());

            List <SelectListItem> pageSizeSelector = new List <SelectListItem>();

            pageSizeSelector.Add(new SelectListItem("12", "12", searchModel.PageSize == 12));
            pageSizeSelector.Add(new SelectListItem("24", "24", searchModel.PageSize == 24));
            pageSizeSelector.Add(new SelectListItem("36", "36", searchModel.PageSize == 36));
            pageSizeSelector.Add(new SelectListItem("48", "48", searchModel.PageSize == 48));
            pageSizeSelector.Add(new SelectListItem("60", "60", searchModel.PageSize == 60));

            ViewBag.PageSizeSelector = pageSizeSelector;

            return(View(new SearchModel <EventUserSearchViewModel, PaginationViewModel <EventViewModel> >(searchModel, data.ToVewModel())));
        }