Esempio n. 1
0
        public IActionResult Index(string searchString, int?page = 1)
        {
            HttpContext.Session.SetString("urlPhongban", UriHelper.GetDisplayUrl(Request));
            searchString = String.IsNullOrEmpty(searchString) ? "" : searchString;
            if (!_phongbanRepository.Any())
            {
                return(View("Empty"));
            }
            var pb = _phongbanRepository.ListPhongban(searchString, page);

            ViewBag.phongban          = pb;
            ViewData["CurrentFilter"] = searchString;
            return(View(pb));
        }
Esempio n. 2
0
        public void listPhong(string select)
        {
            List <Phongban> phongban = _phongbanRepository.ListPhongban().ToList();

            ViewBag.phongban = new SelectList(phongban, "maphong", "tenphong", select);
        }