// GET: VehicleModels public ActionResult Index(string sortBy, int?filter, int?page) { // Get vehicle makes IEnumerable <VehicleModel> vehicleModels = vehicleModelLogic.GetVehicleModels(filter, page, sortBy); // Put data in ViewBag ViewBag.sortBy = sortBy; ViewBag.filter = filter; ViewBag.Makes = new SelectList(vehicleMakeLogic.GetVehicleMakes(), "Id", "Name"); IEnumerable <VehicleModelViewModel> vehicleModelsVM = Mapper.Map <IEnumerable <VehicleModelViewModel> >(vehicleModels); return(View("~/Views/Admin/VehicleModels/Index.cshtml", vehicleModelsVM)); }
// GET: VehicleMakes public ActionResult Index(string sortBy, int?page, string filter = "") { // Get vehicle makes IPagedList vehicleMakes = vehicleMakeLogic.GetVehicleMakes(page, filter, sortBy); // Put data in view bag ViewBag.sortBy = sortBy; ViewBag.filter = filter; // Map to Vehicle Make View Model IPagedList <VehicleMakeViewModel> vehicleMakesVM = Mapper.Map <IPagedList <VehicleMakeViewModel> >(vehicleMakes); //IPagedList vehicleMakesVM = Mapper.Map<IPagedList<VehicleMakeViewModel>>(vehicleMakes); return(View("~/Views/Admin/VehicleMakes/Index.cshtml", vehicleMakesVM)); }