예제 #1
0
        public IActionResult MainListPartial()
        {
            AdminMenuFilterInput           filterInput  = GetFilterInSession <AdminMenuFilterInput>(ConstantConfig.SessionName.AdminMenuSession);
            PagingResultDto <AdminMenuDto> pagingResult = adminMenuAdminService.GetAllByPaging(filterInput);

            ViewBag.AdminMenuCombobox = adminMenuAdminService.GetAdminMenusCombobox();
            return(PartialView(pagingResult));
        }
예제 #2
0
        public PagingResultDto <AdminMenuDto> GetAllByPaging(AdminMenuFilterInput adminMenuFilterInput)
        {
            // neu khong truyen page size thi lay pagesize mac dinh trong bang appparameter
            SetDefaultPageSize(adminMenuFilterInput);

            IQueryable <AdminMenuDto> query = adminMenuRepository.GetAll()
                                              .Filter(adminMenuFilterInput)
                                              .OrderBy(x => x.OrderNo)
                                              .ProjectTo <AdminMenuDto>(mapper.ConfigurationProvider);

            return(query.PagedQuery(adminMenuFilterInput));
        }
예제 #3
0
        public IActionResult Index(int page = 0)
        {
            AdminMenuViewModel   viewModel   = new AdminMenuViewModel();
            AdminMenuFilterInput filterInput = GetFilterInSession <AdminMenuFilterInput>(ConstantConfig.SessionName.AdminMenuSession);

            if (filterInput == null)
            {
                filterInput = new AdminMenuFilterInput
                {
                    RecordStatus = ConstantConfig.RecordStatusConfig.Active
                };
            }
            filterInput.PageNumber         = page;
            viewModel.PagingResult         = adminMenuAdminService.GetAllByPaging(filterInput);
            viewModel.AdminMenuFilterInput = filterInput;
            ViewBag.AdminMenuCombobox      = adminMenuAdminService.GetAdminMenusCombobox();

            InitAdminBaseViewModel(viewModel);
            return(View(viewModel));
        }
예제 #4
0
 public IActionResult FilterPartial(AdminMenuFilterInput filterInput)
 {
     SetFilterToSession(ConstantConfig.SessionName.AdminMenuSession, filterInput);
     return(RedirectToAction("Index", new { page = 1 }));
 }