Beispiel #1
0
        public RoomsVm RetreiveList(RoomFilterVm filterVm)
        {
            var filter = filterVm.Map();

            _repoUnit.Room.OnBeforePaging += roomList =>
            {
                filterVm.TotalPages = PageCounter.GetTotalPages(roomList.Count(), filter.PageSize);
                filterVm.Page = PageCounter.GetRangedPage(filterVm.Page, filterVm.TotalPages);
            };

            return new RoomsVm
                       {
                           Rooms = _repoUnit.Room.Load(filter),
                           Filter = filterVm
                       };
        }
Beispiel #2
0
 public ActionResult List(RoomFilterVm filter)
 {
     return PartialView(_service.RetreiveList(filter));
 }