Example #1
0
        public ActionResult VehicleInfoManager(int page = 1, int pageSize = 10)
        {
            List <VehicleinfoViewModel> f = lk.GetAll();

            Session["VehicleInfoAll"] = f;
            List <BrandViewModel> s = br.GetAll();

            Session["brandAll"] = s;
            List <ModelViewModel> o = md.GetAll();

            Session["modelAll"] = o;

            List <VehicleinfoViewModel>      Listvh = new List <VehicleinfoViewModel>();
            PagedList <VehicleinfoViewModel> PageListVH;

            if (Session["VHSearch"] != null)
            {
                Listvh     = (List <VehicleinfoViewModel>)Session["VHSearch"];
                PageListVH = new PagedList <VehicleinfoViewModel>(Listvh, page, pageSize);
            }
            else
            {
                Listvh     = lk.GetAll();
                PageListVH = new PagedList <VehicleinfoViewModel>(Listvh, page, pageSize);
            }

            return(View(PageListVH));
        }
        public ActionResult ModelManager(int page = 1, int pageSize = 10)
        {
            List <ModelViewModel> s = saf.GetAll();

            Session["ListAllModel"] = s;
            List <BrandViewModel> a = brd.GetAll();

            Session["LisBrandAll"] = a;

            List <ModelViewModel>      ListModel = new List <ModelViewModel>();
            PagedList <ModelViewModel> PagedListModel;

            if (Session["SearchModel"] != null)
            {
                ListModel      = (List <ModelViewModel>)Session["SearchModel"];
                PagedListModel = new PagedList <ModelViewModel>(ListModel, page, pageSize);
            }
            else
            {
                ListModel      = saf.GetAll();
                PagedListModel = new PagedList <ModelViewModel>(ListModel, page, pageSize);
            }



            return(View(PagedListModel));
        }