Пример #1
0
        public PartialViewResult BusStationsList(string SearchString, int page = 1)
        {
            var model = _mapper.Map <IEnumerable <BusStationModel> >(_busStationService.GetList(SearchString)).ToPagedList(page, _pageSize);

            ViewBag.SearchString = SearchString;
            return(PartialView(model));
        }
Пример #2
0
        public PartialViewResult ChannelsList(ChannelFilterModel filter, int page = 1)
        {
            var model = _mapper.Map <IEnumerable <ChannelItemModel> >(
                _channelService.GetList(filter.BusStationFrom, filter.BusStationTo)).ToPagedList(page, _pageSize);

            foreach (var item in model)
            {
                var busList = _busStationService.GetList(item.IdBusStationFrom, item.IdBusStationTo);
                if (busList.Any())
                {
                    item.Channel = string.Join(" - ", busList.Select(o => o.Name));
                }
            }

            ViewBag.BusStationFrom = filter.BusStationFrom;
            ViewBag.BusStationTo   = filter.BusStationTo;

            return(PartialView(model));
        }