public ActionResult Index(TimCuTruViewModel viewModel)
        {
            int?   page            = null;
            byte?  LoaiTimKiemId   = viewModel.LoaiTimKiemId;
            byte?  LoaiCuTruId     = viewModel.LoaiCuTruId;
            byte?  LoaiTrangThaiId = viewModel.LoaiTrangThaiId;
            byte?  LoaiHanId       = viewModel.LoaiHanId;
            string TimKiem         = viewModel.TimKiem;

            viewModel.CuTrus = SearchCuTru(LoaiTimKiemId,
                                           LoaiCuTruId,
                                           LoaiTrangThaiId,
                                           LoaiHanId,
                                           TimKiem).OrderBy(c => c.Id).ToPagedList(page ?? 1, pageNumber);

            return(View(viewModel));
        }
        public ActionResult Index(byte?LoaiTimKiemId, byte?LoaiCuTruId, byte?LoaiTrangThaiId, byte?LoaiHanId, string TimKiem, int?page)
        {
            // Get CuTru list
            IEnumerable <CuTru> cuTrus = SearchCuTru(LoaiTimKiemId,
                                                     LoaiCuTruId,
                                                     LoaiTrangThaiId,
                                                     LoaiHanId,
                                                     TimKiem);

            // Create TimCuTruViewModel based on params data
            var viewModel = new TimCuTruViewModel
            {
                CuTrus          = cuTrus.OrderBy(c => c.Id).ToPagedList(page ?? 1, pageNumber),
                TimKiem         = TimKiem,
                LoaiTimKiemId   = LoaiTimKiemId,
                LoaiCuTruId     = LoaiCuTruId,
                LoaiHanId       = LoaiHanId,
                LoaiTrangThaiId = LoaiTrangThaiId
            };

            return(View(viewModel));
        }