public ActionResult Index(SliderImageListFiltersModel filters) { int pageTotal; var sliderImages = _sliderImageService.GetAll("CreatedDate", "DESC", filters.Criteria, filters.Page, DefaultPageSize, out pageTotal); var pagedList = new StaticPagedList <SliderImageDto>(sliderImages, filters.Page, DefaultPageSize, pageTotal); var listModel = new SliderImageListModel(pagedList, filters); return(View(listModel)); }
public ActionResult AddSliderImage(SliderImageListFiltersModel filters, int sectionId) { var section = _sectionService.GetById(sectionId); int pageTotal = 0; var images = _sliderImageService.GetAll("CreatedDate", "DESC", filters.Criteria, filters.Page, DefaultPageSize, out pageTotal); var pagedList = new StaticPagedList <SliderImageDto>(images, filters.Page, DefaultPageSize, pageTotal); var listModel = new SliderImageListModel(pagedList, filters); var sectionItems = _sectionItemService.GetBySectionId(sectionId); var addSliderImageModel = new AddSliderImageModel(); addSliderImageModel.SectionName = section.Name; addSliderImageModel.SliderImageListModel = listModel; addSliderImageModel.SelectedSliderImageIds = sectionItems.Where(si => si.SliderImageId.HasValue).Select(si => si.SliderImageId.GetValueOrDefault()).ToList(); addSliderImageModel.SectionId = sectionId; return(View(addSliderImageModel)); }
public PartialViewResult SliderList() { return(PartialView(_sliderImageService.GetAll())); }
public ActionResult SliderList() { List <SliderImage> sliders = _sliderImageService.GetAll() as List <SliderImage>; return(View(sliders)); }