Пример #1
0
        public IActionResult SaveSorting(string sorting, string group = null)
        {
            MasterListFilterInput filterInput = GetFilterInSession <MasterListFilterInput>(ConstantConfig.SessionName.MasterListSession);

            filterInput.Sorting = sorting;
            SetFilterToSession(ConstantConfig.SessionName.MasterListSession, filterInput);
            return(RedirectToAction("MainListPartial", new { group = group }));
        }
Пример #2
0
        public IActionResult MainListPartial(string group = null)
        {
            MasterListFilterInput filterInput = GetFilterInSession <MasterListFilterInput>(ConstantConfig.SessionName.MasterListSession);

            filterInput.Group = group;
            ViewData["group"] = group;
            PagingResultDto <MasterListDto> pagingResult = masterListAdminService.GetAllByPaging(filterInput);

            return(PartialView(pagingResult));
        }
Пример #3
0
        public SortingAndPagingResultDto <MasterListDto> GetAllByPaging(MasterListFilterInput masterListFilterInput)
        {
            // neu khong truyen page size thi lay pagesize mac dinh trong bang appparameter
            SetDefaultPageSize(masterListFilterInput);

            if (masterListFilterInput.Sorting == null)
            {
                masterListFilterInput.Sorting = "ModifiedDate desc";
            }

            IQueryable <MasterListDto> query = masterListRepository.GetAll()
                                               .Filter(masterListFilterInput)
                                               .OrderBy(masterListFilterInput.Sorting)
                                               .ProjectTo <MasterListDto>(mapper.ConfigurationProvider);

            return(query.PagedAndSortingQuery(masterListFilterInput));
        }
Пример #4
0
        public IActionResult Index(int page = 0, string group = null)
        {
            MasterListViewModel   viewModel   = new MasterListViewModel();
            MasterListFilterInput filterInput = GetFilterInSession <MasterListFilterInput>(ConstantConfig.SessionName.MasterListSession);

            if (filterInput == null)
            {
                filterInput = new MasterListFilterInput
                {
                    RecordStatus = ConstantConfig.RecordStatusConfig.Active
                };
            }
            filterInput.Group               = group;
            filterInput.PageNumber          = page;
            viewModel.MainListResult        = masterListAdminService.GetAllByPaging(filterInput);
            ViewData["group"]               = group;
            viewModel.MasterListFilterInput = filterInput;
            InitAdminBaseViewModel(viewModel);
            return(View(viewModel));
        }
Пример #5
0
 public IActionResult FilterPartial(MasterListFilterInput filterInput)
 {
     SetFilterToSession(ConstantConfig.SessionName.MasterListSession, filterInput);
     return(RedirectToAction("Index", new { page = 1, group = filterInput.Group }));
 }